:root {
  --bg: #080c13;
  --bg-elevated: #0d1420;
  --panel: #101824;
  --panel-soft: #0c131d;
  --panel-bright: #151f2e;
  --line: rgba(229, 239, 255, 0.09);
  --line-strong: rgba(229, 239, 255, 0.16);
  --text: #f3f6fb;
  --text-soft: #b2bdcf;
  --muted: #8492a8;
  --muted-dim: #5f6c80;
  --accent: #eaff63;
  --accent-deep: #c7e62e;
  --danger: #ff4b6e;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --font-body: "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI Semibold", "Arial Narrow", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-swift: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-panel: 0 30px 80px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 56% -10%, rgba(69, 102, 156, 0.13), transparent 38%),
    linear-gradient(180deg, #080c13 0%, #080c13 55%, #070b11 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: #0b0f15;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  width: 52vw;
  height: 52vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
}

.ambient-blob--one {
  top: -25vw;
  right: -14vw;
  background: #2f63c8;
}

.ambient-blob--two {
  bottom: -34vw;
  left: -18vw;
  background: #8d3152;
  opacity: 0.12;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 72%);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 19, 0.76);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
}

.brand-mark i:nth-child(1) {
  background: #ff5c73;
}

.brand-mark i:nth-child(2) {
  background: #4f8eff;
}

.brand-mark i:nth-child(3) {
  background: #ffc145;
}

.brand-mark i:nth-child(4) {
  background: #35d17c;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-copy small {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-tag {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: color 180ms ease;
}

.text-button:hover {
  color: var(--text);
}

.text-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.text-button svg .fill-dot {
  fill: currentColor;
  stroke: none;
}

.app-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 48px) clamp(16px, 3vw, 42px) 58px;
}

.screen {
  width: 100%;
}

.screen:not([hidden]) {
  animation: screenIn 520ms var(--ease-out) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(234, 255, 99, 0.65);
  animation: livePulse 2.4s ease-in-out infinite;
}

/* ---------- Setup ---------- */

.setup-screen {
  display: flex;
  min-height: calc(100vh - 178px);
  align-items: center;
}

.setup-grid {
  display: grid;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  grid-template-areas:
    "copy card"
    "details card";
  grid-template-columns: minmax(0, 1fr) minmax(390px, 448px);
  column-gap: clamp(42px, 7vw, 110px);
  row-gap: 0;
  align-items: center;
}

.setup-copy {
  max-width: 670px;
  align-self: end;
  grid-area: copy;
}

.setup-details {
  max-width: 670px;
  align-self: start;
  grid-area: details;
}

.setup-card {
  grid-area: card;
  align-self: center;
}

.display-title {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: clamp(68px, 8.4vw, 120px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: uppercase;
}

.display-title > span {
  display: block;
}

.display-accent {
  padding-left: 0.035em;
  color: var(--accent);
  text-shadow: 0 0 80px rgba(234, 255, 99, 0.12);
}

.setup-lead {
  max-width: 570px;
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.75;
}

.feature-list {
  display: flex;
  max-width: 595px;
  flex-direction: column;
  margin-top: 36px;
  border-top: 1px solid var(--line);
}

.feature {
  display: grid;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}

.feature-index {
  padding-top: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.feature h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.feature p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.setup-foot {
  margin: 22px 0 0;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.055em;
  line-height: 1.8;
  text-transform: uppercase;
}

.setup-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.055), transparent 32%),
    linear-gradient(180deg, #111a27 0%, #0c131d 100%);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.setup-card::before {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 255, 99, 0.8), transparent);
  content: "";
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 3px 13px;
}

.preview-caption {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.preview-frame {
  position: relative;
  display: grid;
  overflow: hidden;
  width: 100%;
  height: clamp(235px, 23vw, 286px);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 40%, rgba(86, 115, 167, 0.13), transparent 60%),
    #080d14;
}

.preview-frame::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 25px 25px;
  content: "";
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at center, #000, transparent 78%);
}

.mini-board {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(80%, 254px);
  aspect-ratio: 1;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: #06090e;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  grid-template-columns: repeat(10, 1fr);
  gap: 1.5px;
}

.mini-cell {
  min-width: 0;
  border-radius: 1.5px;
  background: var(--cell-color);
  animation: miniCellIn 420ms var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}

.preview-scanline {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234, 255, 99, 0.65), transparent);
  opacity: 0.42;
  animation: scanline 7s linear infinite;
}

.preview-note {
  position: absolute;
  z-index: 2;
  right: 13px;
  bottom: 11px;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.setup-config {
  padding: 18px 3px 0;
}

.config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.config-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.config-head strong {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stepper {
  display: flex;
  overflow: hidden;
  height: 43px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
}

.stepper button {
  display: grid;
  width: 40px;
  height: 100%;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.stepper button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.stepper button:disabled {
  color: var(--muted-dim);
  cursor: not-allowed;
}

.stepper span {
  min-width: 34px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  text-align: center;
}

.range {
  width: 100%;
  height: 5px;
  margin: 21px 0 11px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 25%), rgba(255, 255, 255, 0.1) var(--fill, 25%), rgba(255, 255, 255, 0.1) 100%);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.range::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  border: 4px solid #111927;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(234, 255, 99, 0.55), 0 0 18px rgba(234, 255, 99, 0.3);
  cursor: grab;
  appearance: none;
  -webkit-appearance: none;
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 4px solid #111927;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(234, 255, 99, 0.55), 0 0 18px rgba(234, 255, 99, 0.3);
  cursor: grab;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1;
}

.range-ticks span.is-current {
  color: var(--accent);
}

.palette-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 47px;
  margin-top: 18px;
  align-content: flex-start;
}

.palette-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 9.5px;
  line-height: 1;
}

.palette-chip i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow: 0 0 7px color-mix(in srgb, var(--chip-color) 60%, transparent);
}

.mode-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mode-grid .quick-toggle {
  margin-top: 0;
  padding: 8px;
  align-items: flex-start;
}

.quick-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  user-select: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.quick-toggle:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.quick-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quick-toggle-track {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.quick-toggle-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c5cfdd;
  transition: transform 180ms var(--ease-swift), background-color 180ms ease;
}

.quick-toggle input:checked + .quick-toggle-track {
  border-color: var(--accent);
  background: var(--accent);
}

.quick-toggle input:checked + .quick-toggle-track i {
  background: #0b121a;
  transform: translateX(14px);
}

.quick-toggle input:focus-visible + .quick-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.quick-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quick-toggle-copy strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.quick-toggle-copy small {
  color: var(--muted-dim);
  font-size: 8.5px;
  line-height: 1.35;
}

.mode-grid .quick-toggle-copy strong {
  font-size: 9.5px;
}

.mode-grid .quick-toggle-copy small {
  font-size: 8px;
}

@media (max-width: 720px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }
}

.zombie-chance {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(118, 255, 122, 0.22);
  border-radius: 10px;
  background: rgba(118, 255, 122, 0.045);
}

.zombie-chance[hidden] {
  display: none;
}

.zombie-chance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 9px;
}

.zombie-chance-head strong {
  color: #9dff9f;
  font-family: var(--font-mono);
  font-size: 10px;
}

.zombie-chance small {
  display: block;
  margin-top: 5px;
  color: var(--muted-dim);
  font-size: 7.5px;
}

.lang-button span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.music-button.is-muted {
  color: var(--muted-dim);
  opacity: 0.72;
}

.music-button.is-muted .music-wave {
  display: none;
}

.quick-badge.quick-badge--danger {
  border-color: rgba(255, 92, 115, 0.42);
  background: rgba(255, 92, 115, 0.14);
  color: #ffb4be;
}

.quick-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.quick-badge[hidden] {
  display: none;
}

.setup-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 3px 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.setup-card-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.primary {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 22px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #0b0f14;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms var(--ease-swift), box-shadow 180ms ease, background 180ms ease;
}

.primary::after {
  position: absolute;
  top: -80%;
  left: -45%;
  width: 35%;
  height: 250%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  content: "";
  transform: rotate(24deg);
  transition: left 500ms var(--ease-out);
}

.primary:hover:not(:disabled) {
  background: #f0ff83;
  box-shadow: 0 12px 35px rgba(234, 255, 99, 0.16);
  transform: translateY(-2px);
}

.primary:hover:not(:disabled)::after {
  left: 115%;
}

.primary:active:not(:disabled) {
  transform: translateY(0);
}

.primary:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.primary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary--wide {
  width: 100%;
  margin-top: 20px;
}

.ghost-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 170ms ease, border-color 170ms ease, background 170ms ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(229, 239, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.ghost-button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.ghost-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* ---------- Game ---------- */

.game-screen {
  max-width: 1290px;
  margin: 0 auto;
}

.game-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 24px;
}

.game-title {
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat {
  display: flex;
  min-width: 62px;
  flex-direction: column;
  gap: 1px;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.stat span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.game-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 382px;
  gap: 22px;
}

.board-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 27%),
    rgba(15, 23, 35, 0.68);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.board-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 1px 2px 16px;
}

.board-panel-head h2,
.generator-head h2,
.log-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.connected-badge svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.board-wrap {
  display: flex;
  justify-content: center;
}

.board-shell {
  --board-pad: 9px;
  position: relative;
  width: 100%;
  max-width: min(680px, calc(100vh - 226px));
  aspect-ratio: 1;
  padding: var(--board-pad);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 22%),
    #05080d;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.48),
    0 0 0 5px rgba(255, 255, 255, 0.018),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.board {
  position: absolute;
  z-index: 1;
  inset: var(--board-pad);
  display: grid;
  overflow: hidden;
  border-radius: 12px;
  background: #06090e;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
}

.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background-color: var(--cell-color, #1a2432);
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 44%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.1), transparent 48%);
  box-shadow:
    inset 0 0 0 0.8px rgba(255, 255, 255, 0.16),
    0 0 0 0.65px var(--cell-color, #06090e);
  cursor: crosshair;
  transition: background-color 240ms var(--ease-swift), filter 160ms ease;
  animation: cellIn 520ms var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}

.cell::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.35) 28%, transparent 66%);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.cell:hover {
  filter: brightness(1.14) saturate(1.04);
}

.cell.is-wasteland {
  background-color: #040608;
  background-image:
    radial-gradient(circle at 50% 50%, #20262b 0 7%, #0a0e12 27%, #040608 64%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 45%);
  cursor: not-allowed;
}

.cell.is-neutral {
  background-color: #c8c8c8;
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 11px);
  cursor: crosshair;
}

.cell.is-zombie {
  background-color: #4f8f35;
  background-image:
    repeating-linear-gradient(45deg, rgba(24, 63, 20, 0.24) 0 2px, transparent 2px 9px),
    radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.2) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 66%, rgba(4, 30, 8, 0.3) 0 2px, transparent 3px),
    linear-gradient(145deg, #9bd76f, #3d7d2d);
  cursor: not-allowed;
}

.cell.is-zombie:hover {
  filter: none;
}

.cell.is-zombie::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 48%, rgba(232, 255, 205, 0.28), transparent 62%);
  content: "";
  opacity: 1;
  pointer-events: none;
}

.zombie-icon {
  position: absolute;
  z-index: 3;
  inset: 19%;
  display: block;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAZDklEQVR4nO1dC7Rd1VVd976XDzSQFCEECoQQQLBAqQgEkK+C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Cj7HjUUiIr8yRVn1rPnrV467X9jLea48/W2r49GpRfLbQT+Gg+mKV3fJjGnh7NXjdifhktflj/NAcHE3mmfEE8uqPcKeJZMFsJFSchbSllU44vfbSMSmRdqx891gpldfr4Zhaa7GDvIVbQNP+BY+ynQseXujOTuL1PUnu6Er4vYzVuq/t0xibN41sj1qF3vAscg5fhsMyiqIPMzB9mY+DFRhwIrR6XHihUGgar0Gu33PyWwt7Ii6QbGJuOeuWR8wc8ib5VfTap+UI21UIKk0HD7dEIupOcjCHCW/DLqq/dieA1L3H8C1QwWyLahfUzrUueaKIKR0twdT7nvgEzu0hDCX8+xg5hKIMy8OhIU9Wc+zyfLxcrGrfrEmolh9iZtc7ItbI2ThJV68CV2arwH6GYpCanh2zJk2Xjn4mrIRXqLJwTOMF+aXvXefOaOqHaOx64EuyHwKH5XVHSFnCJjP1LB7926MQog4pecbJIfn3JmiDpV5VGWLn/5ShFPr76+DhwQ6/vs5D8AiGKcvfoG6vZxZ7FZWCDhgZSwHz4rzdJ2XyWo7DEH7PVT8rOpY3nCIED/xItM1dRjGFaBWgQ2n2yvAAeKZT66JnHuQmtCoYEoL4rT1wiNNhSKTU41C7gTaOW/sxduHciYMX1EySwd1AI1K0YgvUBPgAvPq5PZ4KatiG9jCCOrdIlFPH+UqcvDocCI6tvvLHbOTx7QRN3wae70wwlGf9sdb9G6ht8wzG9UdwPYVn9Hvce9+t4JOCMqrQVLC5oOP9qMc7D6eibAT8p4llWIM5/LPwL56Ew/kotmwrsA5BpTUE6vQgWa6UpV6ShDMd5puBkTVSxDqpF9A0egFVAQ0Z4tLw2QB31jpuwZsfybA2OkxWDuM5hSAjiUMebdd3/Dg8HtBwFxUwCx+dceR9pxLoizmkg6zqWoMAjQlAwyS8E+D/AdQqtvy0RNlKAAAAAElFTkSuQmCC");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.94;
  filter: drop-shadow(0 1px 2px rgba(8, 34, 8, 0.45));
  pointer-events: none;
  animation: zombieThreat 2400ms ease-in-out infinite;
}

.cell.is-neutral:hover {
  filter: brightness(1.12) saturate(0.8);
}

.cell.is-revived {
  z-index: 5;
  animation: revivedCell 820ms var(--ease-out) both;
}

.cell.is-wasteland:hover {
  filter: none;
}

.cell.is-wasteland::before {
  position: absolute;
  z-index: 2;
  inset: 27%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.8);
  content: "";
  opacity: 0.85;
  pointer-events: none;
}

.cell.is-cratered::before {
  animation: craterPulse 760ms var(--ease-out) both;
}

.cell.is-zombified {
  z-index: 5;
  animation: zombifyCell 900ms var(--ease-out) both;
}

.cell.is-desant-target {
  z-index: 4;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.92),
    inset 0 0 26px rgba(87, 200, 255, 0.7);
  animation: desantTarget 900ms ease-in-out infinite;
}

.cell.is-landed {
  z-index: 5;
  animation: landedCell 620ms var(--ease-out) both;
}

.cell.is-flash::after {
  animation: captureFlash 430ms ease-out both;
}

.cell.is-captured {
  z-index: 3;
  animation: capturedCell 520ms var(--ease-out) both;
}

.cell.is-dead {
  filter: grayscale(1) brightness(0.42);
}

.board-overlay {
  position: absolute;
  z-index: 2;
  inset: var(--board-pad);
  width: calc(100% - var(--board-pad) * 2);
  height: calc(100% - var(--board-pad) * 2);
  overflow: visible;
  pointer-events: none;
}

.grid-lines {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-linecap: square;
  stroke-width: 0.22;
}

.active-outline,
.target-outline {
  fill: none;
  transition: opacity 220ms ease;
}

.active-outline {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.6;
  filter: drop-shadow(0 0 1.3px rgba(234, 255, 99, 0.9)) drop-shadow(0 0 4px rgba(234, 255, 99, 0.35));
  animation: outlinePulse 2.2s ease-in-out infinite;
}

.target-outline {
  stroke: #ffffff;
  stroke-dasharray: 1.5 1.2;
  stroke-linecap: round;
  stroke-width: 0.55;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55));
  animation: targetMarch 900ms linear infinite;
}

.board-vignette {
  position: absolute;
  z-index: 3;
  inset: var(--board-pad);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 8%),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.22) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.missile-layer {
  position: absolute;
  z-index: 6;
  inset: var(--board-pad);
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
}

.missile {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  color: #fff4d6;
  filter: drop-shadow(0 0 8px rgba(255, 214, 118, 0.95));
  will-change: transform, opacity;
}

.missile svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  transform: rotate(-133deg);
}

.missile--mega {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  color: #fff0c8;
  filter: drop-shadow(0 0 15px rgba(255, 111, 55, 0.98));
}

.impact-flash {
  position: absolute;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 217, 112, 0.9) 8%, rgba(255, 93, 58, 0.42) 28%, transparent 65%);
  animation: impactFlash 560ms ease-out both;
  pointer-events: none;
}

.impact-flash--mega {
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  background: radial-gradient(circle, #fff 0%, #ffe0a0 6%, rgba(255, 94, 36, 0.78) 18%, rgba(255, 46, 20, 0.32) 42%, transparent 70%);
  animation-duration: 900ms;
}

.uprising-flash {
  position: absolute;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border: 1px solid rgba(75, 227, 160, 0.62);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 255, 240, 0.9) 0%, rgba(75, 227, 160, 0.7) 12%, rgba(75, 227, 160, 0.2) 36%, transparent 67%);
  animation: uprisingFlash 900ms ease-out both;
  pointer-events: none;
}

.paratrooper {
  position: absolute;
  z-index: 7;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  color: #d9f7ff;
  filter: drop-shadow(0 0 9px rgba(87, 200, 255, 0.9));
  will-change: transform, opacity;
}

.paratrooper svg {
  width: 100%;
  height: 100%;
}

.landing-flash {
  position: absolute;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  background: radial-gradient(circle, #f4fdff 0%, rgba(87, 200, 255, 0.8) 13%, rgba(87, 200, 255, 0.2) 36%, transparent 66%);
  animation: landingFlash 620ms ease-out both;
  pointer-events: none;
}

.board-shell.is-impact {
  animation: boardImpact 360ms ease-out;
}

.board-panel-foot {
  padding: 15px 2px 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legend-chip {
  display: inline-flex;
  min-width: 96px;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 9.5px;
  line-height: 1;
  transition: border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.legend-chip i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--chip-color);
}

.legend-chip span {
  overflow: hidden;
  max-width: 78px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-chip b {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
}

.legend-chip.is-active {
  border-color: rgba(234, 255, 99, 0.58);
  background: rgba(234, 255, 99, 0.055);
  color: var(--text);
}

.legend-chip.is-active b {
  color: var(--accent);
}

.legend-chip.is-dead {
  opacity: 0.38;
}

.legend-chip.is-dead span {
  text-decoration: line-through;
}

.legend-chip--zombie i {
  background: #2d6d38;
  box-shadow: 0 0 8px rgba(118, 255, 122, 0.55);
}

.legend-chip--zombie b {
  color: #9dff9f;
}

.legend-chip--neutral i {
  background: #c8c8c8;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.legend-chip--neutral b {
  color: #d2d2d2;
}

.legend-chip--wasteland i {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: #040608;
  box-shadow: inset 0 0 5px #000;
}

.legend-chip--wasteland b {
  color: var(--text-soft);
}

.board-hint {
  min-height: 13px;
  margin-top: 10px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

/* ---------- Control column ---------- */

.control-column {
  position: sticky;
  top: 96px;
  display: flex;
  max-height: calc(100vh - 116px);
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  scrollbar-width: thin;
}

.control-column::-webkit-scrollbar {
  width: 5px;
}

.control-column::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
}

.generator-card,
.log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.045), transparent 30%),
    linear-gradient(180deg, #111a27 0%, #0c131d 100%);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.generator-card {
  padding: 18px;
}

.generator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.turn-stamp {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(234, 255, 99, 0.28);
  border-radius: 10px;
  background: rgba(234, 255, 99, 0.045);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.active-strip {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--actor-color, #ffffff) 15%, var(--line));
  border-radius: 13px;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--actor-color, #ffffff) 4%, transparent), transparent 65%),
    rgba(5, 9, 15, 0.38);
  transition: border-color 240ms ease, background 240ms ease;
}

.active-strip::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.025));
  content: "";
  pointer-events: none;
}

.active-swatch {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--swatch-color, #263241);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 5px 16px rgba(0, 0, 0, 0.22);
  color: rgba(8, 12, 19, 0.72);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  transition: background 240ms ease;
}

.active-swatch.is-random {
  background: conic-gradient(from 210deg, #ff5c73, #ffc145, #35d17c, #4f8eff, #a77bff, #ff5c73);
}

.active-swatch.is-random span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 6px;
  background: rgba(8, 12, 19, 0.9);
  color: var(--accent);
  font-size: 14px;
}

.active-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.active-copy span {
  overflow: hidden;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.active-copy strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-area {
  display: flex;
  margin-left: auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.active-area strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}

.active-area span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wheel-zone {
  position: relative;
  display: grid;
  padding: 16px 0 4px;
  place-items: center;
}

.wheel-shell {
  --tone: var(--accent);
  position: relative;
  width: min(236px, 76%);
  aspect-ratio: 1;
  border: 5px solid #1a2432;
  border-radius: 50%;
  background: #080d14;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 0 2px rgba(0, 0, 0, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.55);
  transition: box-shadow 400ms ease;
}

.wheel-shell.has-result {
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.13),
    0 0 34px color-mix(in srgb, var(--tone) 19%, transparent),
    inset 0 0 0 2px rgba(0, 0, 0, 0.45),
    inset 0 0 28px rgba(0, 0, 0, 0.55);
}

.wheel-rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  will-change: transform;
  transform-origin: 50% 50%;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wheel-wedge {
  stroke: #0a0f17;
  stroke-width: 2;
}

.wheel-marker {
  transition: opacity 180ms ease;
}

.wheel-shell.is-spinning .wheel-marker {
  opacity: 0;
  transition-duration: 100ms;
}

.wheel-label {
  fill: rgba(7, 11, 16, 0.82);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-anchor: middle;
}

.wheel-pct {
  fill: rgba(7, 11, 16, 0.56);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  text-anchor: middle;
}

.wheel-pct--light {
  fill: rgba(255, 255, 255, 0.72);
}

.wheel-icon {
  fill: none;
  stroke: rgba(7, 11, 16, 0.72);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.wheel-icon--light {
  stroke: rgba(255, 255, 255, 0.74);
}

.wheel-icon--fill {
  fill: rgba(7, 11, 16, 0.72);
  stroke: none;
}

.wheel-rim {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
}

.wheel-notch {
  fill: rgba(255, 255, 255, 0.32);
}

.wheel-pointer {
  position: absolute;
  z-index: 7;
  top: 9px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 18px solid var(--accent);
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  filter: drop-shadow(0 0 7px rgba(234, 255, 99, 0.55));
  transform: translateX(-50%);
}

.wheel-pointer::after {
  position: absolute;
  top: -25px;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(234, 255, 99, 0.8);
  content: "";
}

.wheel-hub {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: flex;
  width: 82px;
  height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 50%),
    #0a111b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -50%);
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.wheel-shell.has-result .wheel-hub {
  border-color: color-mix(in srgb, var(--tone) 58%, transparent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45), 0 0 22px color-mix(in srgb, var(--tone) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hub-icon {
  display: grid;
  width: 30px;
  height: 28px;
  place-items: center;
  color: var(--tone, var(--accent));
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.hub-icon svg {
  width: 25px;
  height: 25px;
}

.wheel-hub small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wheel-shell.is-spinning .wheel-hub {
  animation: hubPulse 420ms ease-in-out infinite alternate;
}

.odds {
  display: grid;
  margin-top: 12px;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.odd,
.rule-row {
  --tone: #8b97aa;
}

.odd[hidden] {
  display: none;
}

.odd[data-action="war"],
.rule-row[data-action="war"],
.outcome[data-tone="war"] {
  --tone: #ff7847;
}

.odd[data-action="rocket"],
.rule-row[data-action="rocket"],
.outcome[data-tone="rocket"] {
  --tone: #ff4368;
}

.odd[data-action="mega"],
.rule-row[data-action="mega"],
.outcome[data-tone="mega"] {
  --tone: #ff0000;
}

.odd[data-action="bio"],
.rule-row[data-action="bio"],
.outcome[data-tone="bio"] {
  --tone: #ffe45c;
}

.odd[data-action="zombie"],
.rule-row[data-action="zombie"],
.outcome[data-tone="zombie"] {
  --tone: #76ff7a;
}

.odd[data-action="vaccine"],
.rule-row[data-action="vaccine"],
.outcome[data-tone="vaccine"] {
  --tone: #d7fffa;
}

.quick-toggle.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.odd[data-action="rebellion"],
.rule-row[data-action="rebellion"],
.outcome[data-tone="rebellion"] {
  --tone: #4be3a0;
}

.odd[data-action="split"],
.rule-row[data-action="split"],
.outcome[data-tone="split"] {
  --tone: #aa82ff;
}

.odd[data-action="desant"],
.rule-row[data-action="desant"],
.outcome[data-tone="desant"] {
  --tone: #57c8ff;
}

.odd[data-action="revival"],
.rule-row[data-action="revival"],
.outcome[data-tone="revival"] {
  --tone: #b8f36b;
}

.odd[data-action="war"] {
  grid-column: 1 / -1;
}

.odd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--text-soft);
  font-size: 9.5px;
  line-height: 1;
}

.odd i {
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 8px color-mix(in srgb, var(--tone) 55%, transparent);
}

.odd span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.odd b {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
}

.outcome {
  --tone: #8a96a8;
  position: relative;
  display: flex;
  min-height: 94px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--tone) 6%, transparent), transparent 58%),
    rgba(5, 9, 15, 0.36);
  transition: border-color 260ms ease, background 260ms ease;
}

.outcome::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--tone);
  content: "";
  opacity: 0.8;
}

.outcome.is-updating .outcome-copy {
  animation: outcomeTick 320ms var(--ease-out);
}

.outcome-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 8%, transparent);
  color: var(--tone);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

.outcome-icon svg {
  width: 22px;
  height: 22px;
}

.outcome-icon .icon-dot {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: var(--tone);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tone) 45%, transparent);
}

.outcome-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.outcome-kicker {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.8px;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.outcome-copy > strong {
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outcome-copy > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.42;
}

.target-pill {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1;
  text-transform: uppercase;
}

.target-pill i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--target-color, #fff);
}

.target-pill strong {
  overflow: hidden;
  max-width: 100px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.target-pill b {
  color: var(--text-soft);
  font-weight: 500;
}

.dice {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dice-bonus {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 2px;
}

.dice-bonus[hidden] {
  display: none;
}

.bonus-die {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bonus-die .die-face {
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 5px;
  gap: 1px;
}

.bonus-die > span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 5.5px;
  letter-spacing: 0.04em;
}

.dice-power {
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.dice-power[hidden] {
  display: none;
}

.dice.is-multi > .die-face,
.dice.is-multi > #diceLabel {
  display: none;
}

.dice.is-multi .dice-bonus {
  gap: 7px;
  margin-top: 0;
}

.dice.is-multi .bonus-die .die-face {
  width: 34px;
  height: 34px;
  padding: 5px;
  border-radius: 7px;
  gap: 2px;
}

.dice.is-multi .bonus-die > span {
  font-size: 6.5px;
}

.dice.is-multi.is-rolling .dice-bonus {
  animation: diceThrow 360ms var(--ease-out);
}

@keyframes diceThrow {
  0% {
    opacity: 0.25;
    transform: translateY(-10px) rotate(-4deg);
  }
  65% {
    opacity: 1;
    transform: translateY(1px) rotate(1deg);
  }
  100% {
    transform: translateY(0) rotate(0);
  }
}

.dice > span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}

.die-face {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 5px;
  border-radius: 8px;
  background: #f1f4fa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.14);
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.die-face i {
  display: block;
  border-radius: 50%;
  background: transparent;
}

.die-face i.is-on {
  background: #111722;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.dice.is-rolling .die-face {
  animation: diceShake 160ms linear infinite;
}

.dice.is-rolling .die-face i.is-on {
  background: #263042;
}

.dice.is-settled .die-face {
  animation: diceSettle 420ms var(--ease-out);
}

.die-face.is-d10 {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f2fff9, #bde9d3);
  color: #0a2419;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.turn-actions {
  display: grid;
  margin-top: 14px;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  align-items: stretch;
}

.generate-button {
  width: 100%;
  min-height: 54px;
  margin-top: 0;
}

.generate-button.is-busy {
  background: linear-gradient(100deg, #dceb63, #f4ff9b, #dceb63);
  background-size: 220% 100%;
  animation: buttonBusy 1.2s linear infinite;
  opacity: 1;
}

.auto-button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  cursor: pointer;
  grid-template-columns: 17px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  text-align: left;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 170ms ease, color 170ms ease;
}

.auto-button:hover:not(:disabled) {
  border-color: rgba(229, 239, 255, 0.27);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.auto-button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.auto-icon {
  width: 15px;
  height: 15px;
  grid-row: 1 / 3;
  fill: currentColor;
  color: var(--muted);
  transition: color 170ms ease;
}

.auto-icon--stop {
  display: none;
}

.auto-label {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.065em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.auto-timer {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.auto-button.is-active {
  border-color: rgba(75, 227, 160, 0.48);
  background:
    linear-gradient(145deg, rgba(75, 227, 160, 0.16), rgba(75, 227, 160, 0.025)),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 1px rgba(75, 227, 160, 0.08), 0 0 22px rgba(75, 227, 160, 0.08);
  color: #e8fff6;
}

.auto-button.is-active .auto-icon {
  color: #4be3a0;
}

.auto-button.is-active .auto-icon--play {
  display: none;
}

.auto-button.is-active .auto-icon--stop {
  display: block;
}

.auto-button.is-active .auto-timer {
  color: #78f0bc;
}

.auto-button.is-paused .auto-timer {
  color: var(--accent);
}

/* ---------- Log ---------- */

.log-card {
  padding: 17px 17px 13px;
}

.log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 11px;
}

.log-count {
  display: grid;
  min-width: 31px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.log-list {
  max-height: 244px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: rgba(255, 255, 255, 0.13) transparent;
  scrollbar-width: thin;
}

.log-list::-webkit-scrollbar {
  width: 4px;
}

.log-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.log-entry {
  display: grid;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 9px;
}

.log-entry:first-child {
  animation: logIn 400ms var(--ease-out) both;
}

.log-marker {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--dot, var(--muted));
  box-shadow: 0 0 8px color-mix(in srgb, var(--dot, var(--muted)) 45%, transparent);
}

.log-body {
  min-width: 0;
}

.log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.log-meta b {
  color: var(--text-soft);
  font-weight: 500;
}

.log-title {
  display: block;
  margin: 3px 0 2px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.log-text {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.log-empty {
  padding: 20px 2px 8px;
  color: var(--muted-dim);
  font-size: 10.5px;
  line-height: 1.5;
}

/* ---------- Victory ---------- */

.victory-overlay {
  position: absolute;
  z-index: 10;
  inset: var(--board-pad);
  display: grid;
  overflow: hidden;
  padding: 20px;
  place-items: center;
  border-radius: 12px;
  background: rgba(4, 7, 12, 0.6);
  backdrop-filter: blur(9px) saturate(0.75);
  -webkit-backdrop-filter: blur(9px) saturate(0.75);
  animation: fadeIn 320ms ease both;
}

.victory-card {
  position: relative;
  z-index: 2;
  width: min(350px, 100%);
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 33%),
    linear-gradient(180deg, #131d2b, #0b111a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  text-align: center;
  animation: victoryIn 650ms var(--ease-out) both;
}

.victory-card .eyebrow {
  justify-content: center;
}

.victory-swatch {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 17px auto 12px;
  place-items: center;
  border-radius: 19px;
  background: var(--winner, var(--accent));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 12px 30px color-mix(in srgb, var(--winner, var(--accent)) 30%, transparent);
  color: rgba(8, 12, 19, 0.72);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.victory-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.victory-card > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.victory-stats {
  display: grid;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.victory-stats div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--line);
}

.victory-stats div:first-child {
  border-left: 0;
}

.victory-stats strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.victory-stats span {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.victory-actions {
  display: grid;
  margin-top: 17px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.victory-actions .primary,
.victory-actions .ghost-button {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  font-size: 8.5px;
}

.confetti {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  left: var(--left);
  width: 7px;
  height: 12px;
  border-radius: 1px;
  background: var(--piece-color);
  opacity: 0;
  animation: confettiFall var(--duration) var(--delay) cubic-bezier(0.15, 0.66, 0.36, 1) forwards;
}

/* ---------- Rules dialog ---------- */

.rules-dialog {
  width: min(720px, calc(100vw - 30px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 25px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06), transparent 26%),
    linear-gradient(180deg, #111a27, #0a1019);
  color: var(--text);
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.75);
  scrollbar-width: thin;
}

.rules-dialog::backdrop {
  background: rgba(2, 5, 9, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rules-dialog[open] {
  animation: dialogIn 320ms var(--ease-out) both;
}

.rules-dialog > * {
  margin-right: 28px;
  margin-left: 28px;
}

.rules-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
}

.rules-top h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.rules-flow {
  display: grid;
  margin-top: 22px;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rules-step {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.024);
}

.rules-step > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.rules-step strong {
  display: block;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rules-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.rules-table {
  margin-top: 19px;
  border-top: 1px solid var(--line);
}

.rule-row {
  display: grid;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
}

.rule-row .rule-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--tone);
  box-shadow: 0 0 9px color-mix(in srgb, var(--tone) 45%, transparent);
}

.rule-row > strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rule-row > b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
}

.rule-row > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  grid-column: 2 / -1;
}

.rules-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(234, 255, 99, 0.04);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.rules-dialog .primary--wide {
  margin-top: 20px;
  margin-bottom: 26px;
}

/* ---------- Animations ---------- */

.reveal {
  animation: revealUp 720ms var(--ease-out) both;
}

.reveal--1 {
  animation-delay: 30ms;
}

.reveal--2 {
  animation-delay: 90ms;
}

.reveal--3 {
  animation-delay: 160ms;
}

.reveal--4 {
  animation-delay: 240ms;
}

.reveal--5 {
  animation-delay: 330ms;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 0.65;
    box-shadow: 0 0 8px rgba(234, 255, 99, 0.4);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 16px rgba(234, 255, 99, 0.85);
  }
}

@keyframes cellIn {
  from {
    opacity: 0;
    transform: scale(0.62);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes miniCellIn {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scanline {
  0% {
    top: 0;
    opacity: 0;
  }
  8% {
    opacity: 0.46;
  }
  88% {
    opacity: 0.36;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes captureFlash {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes craterPulse {
  0% {
    opacity: 0;
    transform: scale(0.35);
    border-color: rgba(255, 181, 93, 0.9);
    box-shadow: 0 0 28px rgba(255, 123, 48, 0.6);
  }
  42% {
    opacity: 1;
  }
  100% {
    opacity: 0.85;
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow:
      inset 0 0 10px rgba(0, 0, 0, 0.9),
      0 0 8px rgba(0, 0, 0, 0.8);
  }
}

@keyframes capturedCell {
  0% {
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.82),
      inset 0 0 22px rgba(255, 255, 255, 0.42);
  }
  100% {
    box-shadow:
      inset 0 0 0 0 rgba(255, 255, 255, 0),
      inset 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes outlinePulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes targetMarch {
  to {
    stroke-dashoffset: -5.4;
  }
}

@keyframes hubPulse {
  from {
    transform: translate(-50%, -50%) scale(0.97);
  }
  to {
    transform: translate(-50%, -50%) scale(1.03);
  }
}

@keyframes outcomeTick {
  0% {
    opacity: 0.3;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes diceShake {
  0% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(4deg) translateY(-1px);
  }
  100% {
    transform: rotate(-3deg) translateY(0);
  }
}

@keyframes diceSettle {
  0% {
    transform: scale(1.16);
  }
  55% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes buttonBusy {
  to {
    background-position: -220% 0;
  }
}

@keyframes logIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boardImpact {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-5px, 3px);
  }
  40% {
    transform: translate(4px, -3px);
  }
  60% {
    transform: translate(-3px, -2px);
  }
  80% {
    transform: translate(2px, 2px);
  }
}

@keyframes impactFlash {
  0% {
    opacity: 0;
    transform: scale(0.15);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes uprisingFlash {
  0% {
    opacity: 0;
    transform: scale(0.22);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes zombieThreat {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes zombifyCell {
  0% {
    box-shadow: inset 0 0 0 4px rgba(118, 255, 122, 0.95), inset 0 0 34px rgba(58, 180, 70, 0.9);
    filter: brightness(1.8);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(118, 255, 122, 0), inset 0 0 0 rgba(58, 180, 70, 0);
    filter: brightness(1);
  }
}

@keyframes revivedCell {
  0% {
    box-shadow: inset 0 0 0 4px rgba(231, 255, 196, 0.95), inset 0 0 34px rgba(184, 243, 107, 0.85);
    filter: brightness(1.7);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(231, 255, 196, 0), inset 0 0 0 rgba(184, 243, 107, 0);
    filter: brightness(1);
  }
}

@keyframes landingFlash {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes desantTarget {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, 0.92),
      inset 0 0 22px rgba(87, 200, 255, 0.48);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(255, 255, 255, 0.65),
      inset 0 0 32px rgba(87, 200, 255, 0.9);
  }
}

@keyframes landedCell {
  0% {
    box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.95), inset 0 0 35px rgba(87, 200, 255, 0.8);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0), inset 0 0 0 rgba(87, 200, 255, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes victoryIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 520px, 0) rotate(var(--rotate));
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Large desktop: board + generator + journal in one row ---------- */

@media (min-width: 1360px) {
  .game-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px) minmax(238px, 286px);
    gap: 16px;
  }

  .control-column {
    display: contents;
  }

  .generator-card {
    display: flex;
    align-self: stretch;
    flex-direction: column;
  }

  .generator-card .turn-actions {
    margin-top: auto;
  }

  .board-panel {
    padding: 18px;
  }

  .log-card {
    display: flex;
    min-height: 0;
    max-height: 100%;
    align-self: stretch;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 15px 13px;
  }

  .log-card .log-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
    overflow-y: auto;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .setup-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 46px;
  }

  .display-title {
    font-size: clamp(62px, 8vw, 96px);
  }

  .game-grid {
    grid-template-columns: minmax(0, 1fr) 354px;
    gap: 18px;
  }

  .generator-card {
    padding: 16px;
  }

  .wheel-shell {
    width: min(222px, 78%);
  }
}

@media (max-width: 980px) {
  .setup-screen {
    min-height: auto;
  }

  .setup-grid {
    max-width: 690px;
    grid-template-areas:
      "copy"
      "card"
      "details";
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .setup-copy,
  .setup-details {
    max-width: 100%;
  }

  .display-title {
    font-size: clamp(64px, 12.5vw, 104px);
  }

  .feature-list {
    max-width: 100%;
  }

  .setup-details .feature-list {
    margin-top: 0;
  }

  .setup-card {
    max-width: 470px;
    margin: 0 auto;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .board-panel {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
  }

  .board-shell {
    max-width: 680px;
  }

  .control-column {
    position: static;
    max-height: none;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    overflow: visible;
  }

  .wheel-shell {
    width: min(235px, 60%);
  }

  .log-list {
    max-height: 230px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-tag {
    display: none;
  }

  .app-main {
    padding: 22px 13px 42px;
  }

  .display-title {
    font-size: clamp(50px, 15.2vw, 82px);
    margin-top: 15px;
  }

  .setup-lead {
    margin-top: 22px;
    font-size: 13.5px;
  }

  .feature-list {
    margin-top: 27px;
  }

  .feature {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 14px 0;
  }

  .feature p {
    font-size: 11.5px;
  }

  .setup-card {
    padding: 14px;
    border-radius: 22px;
  }

  .preview-frame {
    height: 230px;
  }

  .mini-board {
    width: min(82%, 220px);
  }

  .setup-config {
    padding-top: 15px;
  }

  .config-head strong {
    font-size: 20px;
  }

  .game-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 17px;
  }

  .game-title {
    font-size: 32px;
  }

  .game-stats {
    width: 100%;
  }

  .stat {
    padding: 0 10px;
  }

  .stat:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .game-stats .ghost-button {
    margin-left: auto;
  }

  .board-panel {
    padding: 12px;
    border-radius: 21px;
  }

  .board-panel-head {
    padding: 2px 2px 12px;
  }

  .connected-badge {
    display: none;
  }

  .board-shell {
    --board-pad: 6px;
    border-radius: 15px;
  }

  .board {
    border-radius: 9px;
  }

  .board-overlay,
  .board-vignette,
  .victory-overlay {
    border-radius: 9px;
  }

  .board-panel-foot {
    padding-top: 12px;
  }

  .legend-chip {
    min-width: 0;
    flex: 1 1 calc(33.333% - 6px);
    max-width: none;
    padding: 6px 7px;
    font-size: 9px;
  }

  .legend-chip span {
    max-width: none;
  }

  .board-hint {
    margin-top: 8px;
    font-size: 6.8px;
  }

  .generator-card,
  .log-card {
    border-radius: 18px;
  }

  .generator-card {
    padding: 15px;
  }

  .wheel-shell {
    width: min(230px, 70%);
  }

  .wheel-zone {
    padding-top: 14px;
  }

  .outcome {
    min-height: 88px;
  }

  .rules-dialog > * {
    margin-right: 18px;
    margin-left: 18px;
  }

  .rules-top {
    margin-top: 20px;
  }

  .rules-flow {
    grid-template-columns: 1fr;
  }

  .rules-dialog .primary--wide {
    margin-bottom: 20px;
  }

  .victory-card {
    padding: 20px;
  }

  .victory-card h2 {
    font-size: 25px;
  }
}

@media (max-width: 480px) {
  .brand-copy strong {
    font-size: 10.5px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .text-button span {
    display: none;
  }

  .text-button {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
  }

  .setup-lead {
    line-height: 1.65;
  }

  .preview-frame {
    height: 208px;
  }

  .mini-board {
    width: min(82%, 194px);
  }

  .stepper button {
    width: 38px;
  }

  .primary {
    font-size: 10px;
  }

  .stat {
    min-width: 50px;
  }

  .stat strong {
    font-size: 20px;
  }

  .game-stats {
    gap: 6px;
  }

  .game-stats .ghost-button {
    width: 42px;
    padding: 0;
    flex: 0 0 42px;
  }

  .game-stats .ghost-button span {
    display: none;
  }

  .legend-chip {
    flex-basis: calc(50% - 6px);
  }

  .odd {
    padding: 6px 7px;
    font-size: 9px;
  }

  .outcome {
    gap: 9px;
    padding: 11px;
  }

  .outcome-icon {
    width: 38px;
    height: 38px;
  }

  .outcome-copy > strong {
    font-size: 12.5px;
  }

  .outcome-copy > p {
    font-size: 9.5px;
  }

  .dice {
    align-self: flex-start;
    margin-top: 1px;
  }

  .die-face {
    width: 31px;
    height: 31px;
    padding: 4px;
  }

  .victory-overlay {
    padding: 10px;
  }

  .victory-card {
    padding: 17px;
  }

  .victory-swatch {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    font-size: 13px;
  }

  .victory-actions {
    grid-template-columns: 1fr;
  }

  .victory-actions .primary,
  .victory-actions .ghost-button {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .confetti {
    display: none;
  }

  .wheel-rotor {
    transition: none !important;
  }
}

