:root {
  --bg: #071018;
  --panel: rgba(15, 25, 36, 0.95);
  --panel-strong: rgba(20, 32, 45, 0.98);
  --ink: #f3ecdf;
  --muted: #9daaba;
  --accent: #d9a85b;
  --accent-strong: #f0c276;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(217, 168, 91, 0.16), transparent 30%),
    linear-gradient(180deg, #08121b 0%, #04090e 100%);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  -webkit-text-size-adjust: 100%;
}

.shell {
  width: min(1180px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 14px 0 32px;
}

.hero,
.card,
.board-panel {
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
}

.hero-copy {
  min-width: 0;
}

.hero-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.difficulty-picker {
  display: grid;
  gap: 8px;
  width: min(100%, 220px);
}

.difficulty-select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.difficulty-select:focus {
  outline: 2px solid rgba(240, 194, 118, 0.35);
  outline-offset: 2px;
}

.difficulty-select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.eyebrow,
.label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  color: var(--muted);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 0.98;
}

.lede {
  margin-top: 8px;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease, color 140ms ease;
}

.audio-toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.audio-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.audio-toggle[data-muted='true'] {
  color: var(--muted);
}

.audio-toggle-glyph {
  width: 22px;
  height: 22px;
  display: block;
}

.audio-toggle-speaker {
  fill: currentColor;
}

.audio-toggle-wave {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  transition: opacity 140ms ease, transform 140ms ease;
}

.audio-toggle-wave-one {
}

.audio-toggle-wave-two {
  opacity: 0.82;
}

.audio-toggle-slash {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
  transform-origin: center;
  transform: scale(0.72);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
}

.audio-toggle[data-muted='true'] .audio-toggle-wave {
  opacity: 0;
  transform: scale(0.7);
}

.audio-toggle[data-muted='true'] .audio-toggle-slash {
  opacity: 1;
  transform: scale(1);
}

.hero-actions button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.hero-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.hero-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1f1406;
}

.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--border);
}

.danger {
  border-color: rgba(213, 101, 101, 0.32);
  background: rgba(213, 101, 101, 0.12);
  color: #ffd5d5;
}

.layout {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.board-panel {
  border-radius: var(--radius);
  padding: 18px;
}

.board-panel.panel-flash-win {
  animation: panelFlashWin 720ms ease;
}

.board-panel.panel-flash-loss {
  animation: panelFlashLoss 720ms ease;
}

.board-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: min(100%, 760px);
  margin: 0 auto -4px;
}

.board-header .hud-chip-lives {
  min-height: 38px;
  padding: 8px 12px;
  flex-shrink: 0;
}

.clock-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

#clock {
  display: block;
  position: relative;
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.clock-box[data-state='warning'] {
  border-color: rgba(255, 111, 111, 0.34);
  background: linear-gradient(135deg, rgba(128, 24, 30, 0.28), rgba(255, 111, 111, 0.12));
  box-shadow:
    0 0 0 1px rgba(255, 111, 111, 0.08),
    0 0 26px rgba(255, 90, 90, 0.18);
}

.clock-box[data-state='warning'] .label {
  color: rgba(255, 215, 215, 0.82);
}

.clock-box[data-state='warning'] #clock {
  color: #ff7575;
  text-shadow: 0 0 20px rgba(255, 92, 92, 0.34);
  animation: clockDangerPulse 920ms ease-in-out infinite, clockDangerJolt 460ms ease-in-out infinite;
}

.clock-box[data-state='expired'] {
  border-color: rgba(255, 90, 90, 0.38);
  background: linear-gradient(135deg, rgba(118, 18, 24, 0.3), rgba(255, 90, 90, 0.14));
  box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.1), 0 0 24px rgba(255, 90, 90, 0.14);
}

.clock-box[data-state='expired'] #clock {
  color: #ff6666;
  text-shadow: 0 0 18px rgba(255, 92, 92, 0.28);
}

.board-shell {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 12px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #0e1721;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.32);
}

.board {
  width: 100%;
  aspect-ratio: 1;
}

.promotion-picker {
  position: absolute;
  inset: 0;
  z-index: 24;
}

.promotion-picker[hidden] {
  display: none;
}

.promotion-picker-tray {
  --promotion-square-size: 72px;
  position: absolute;
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 22px;
  border: 1px solid rgba(240, 194, 118, 0.22);
  background: linear-gradient(180deg, rgba(18, 28, 39, 0.98), rgba(10, 17, 26, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.promotion-picker-button {
  width: var(--promotion-square-size);
  height: var(--promotion-square-size);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.promotion-picker-button:hover,
.promotion-picker-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(240, 194, 118, 0.46);
  outline: none;
}

.promotion-picker-button[data-default='true'] {
  border-color: rgba(240, 194, 118, 0.62);
  box-shadow: inset 0 0 0 1px rgba(240, 194, 118, 0.2);
}

.promotion-picker-glyph {
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1;
}

.board-status {
  margin-top: 14px;
  width: min(100%, 760px);
  margin-inline: auto;
  color: var(--muted);
  line-height: 1.45;
}

.feedback-banner {
  width: min(100%, 760px);
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.feedback-banner[data-tone='win'] {
  color: #dff8d3;
  border-color: rgba(121, 191, 109, 0.28);
  background: rgba(121, 191, 109, 0.14);
}

.feedback-banner[data-tone='loss'] {
  color: #ffd7d7;
  border-color: rgba(213, 101, 101, 0.28);
  background: rgba(213, 101, 101, 0.14);
}

.feedback-banner.feedback-banner-pop {
  animation: feedbackBannerPop 680ms cubic-bezier(0.2, 0.85, 0.2, 1);
}

.confirm-dialog {
  width: min(calc(100vw - 24px), 420px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
}

.confirm-dialog::backdrop {
  background: rgba(2, 6, 10, 0.74);
  backdrop-filter: blur(8px);
}

.confirm-dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(25, 35, 47, 0.98), rgba(12, 19, 28, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.confirm-dialog-title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  line-height: 1;
}

.confirm-dialog-copy {
  color: var(--muted);
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.confirm-dialog-actions button {
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
}

@keyframes feedbackBannerPop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelFlashWin {
  0% {
    box-shadow: var(--shadow);
  }

  35% {
    box-shadow: 0 0 0 1px rgba(121, 191, 109, 0.34), 0 0 40px rgba(121, 191, 109, 0.18), var(--shadow);
  }

  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes panelFlashLoss {
  0% {
    box-shadow: var(--shadow);
  }

  35% {
    box-shadow: 0 0 0 1px rgba(213, 101, 101, 0.34), 0 0 40px rgba(213, 101, 101, 0.18), var(--shadow);
  }

  100% {
    box-shadow: var(--shadow);
  }
}

.challenge-subtitle {
  margin-top: 8px;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.96rem;
}

.takeover-dialog {
  width: min(calc(100vw - 24px), 560px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  color: var(--ink);
}

.takeover-dialog::backdrop {
  background: rgba(2, 6, 10, 0.78);
  backdrop-filter: blur(8px);
}

.takeover-dialog-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(240, 194, 118, 0.24);
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(38, 25, 18, 0.72), rgba(17, 27, 39, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 28px 90px rgba(0, 0, 0, 0.5);
  animation: takeoverBriefingReveal 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.takeover-dialog-copy {
  min-width: 0;
}

.takeover-dialog-rail {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.takeover-dialog-badge {
  margin: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.takeover-dialog-badge-primary {
  border-color: rgba(240, 194, 118, 0.26);
  background: rgba(240, 194, 118, 0.16);
  color: #fff1cf;
}

.takeover-dialog-badge:empty {
  display: none;
}

.takeover-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.takeover-player-badge {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.takeover-player-badge-hero {
  border-color: rgba(240, 194, 118, 0.24);
  background: linear-gradient(135deg, rgba(240, 194, 118, 0.1), rgba(255, 255, 255, 0.04));
}

.takeover-player-badge-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.takeover-player-badge-swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.takeover-player-badge-swatch[data-side='w'] {
  background: #f5eddc;
}

.takeover-player-badge-swatch[data-side='b'] {
  background: #0d1420;
  border-color: rgba(240, 194, 118, 0.32);
}

.takeover-player-badge-name {
  font-size: clamp(1rem, 3vw, 1.28rem);
  line-height: 1.05;
  word-break: break-word;
}

.takeover-player-row-versus {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 194, 118, 0.18);
  background: rgba(240, 194, 118, 0.08);
  color: #fff1cf;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.takeover-eval {
  margin-top: 12px;
}

.takeover-eval-bar {
  position: relative;
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.takeover-eval-segment {
  height: 100%;
  transition: width 180ms ease;
}

.takeover-eval-segment[data-side='w'] {
  background: linear-gradient(180deg, #f4efdf, #d7cdb7);
}

.takeover-eval-segment[data-side='b'] {
  background: linear-gradient(180deg, #1e2632, #0d131d);
}

.takeover-eval-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 244, 224, 0.94);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.takeover-dialog-title {
  margin-top: 10px;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  line-height: 0.98;
}

.takeover-dialog-title:empty {
  display: none;
}

.takeover-dialog-body {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
  max-width: 28rem;
}

.takeover-dialog-body:empty {
  display: none;
}

.takeover-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.takeover-dialog-secondary,
.takeover-dialog-dismiss {
  white-space: nowrap;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.sidebar {
  display: grid;
  gap: 12px;
}

.tower-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(240, 194, 118, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(19, 30, 43, 0.98), rgba(10, 17, 26, 0.98));
}

.tower-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 34%);
  pointer-events: none;
}

.tower-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.tower-caption {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.tower-summary {
  display: grid;
  gap: 4px;
  text-align: right;
}

.tower-progress-label {
  font-size: 1.1rem;
  color: var(--ink);
}

.tower-progress-meta {
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.tower-frame {
  position: relative;
  margin-top: 16px;
}

.tower-overflow {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.04em;
}

.tower-overflow[hidden] {
  display: none;
}

.tower-overflow:last-child {
  margin-top: 8px;
}

.tower-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 10px 0 10px 32px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.tower-list::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 194, 118, 0.08), rgba(240, 194, 118, 0.65), rgba(240, 194, 118, 0.08));
}

.tower-step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.tower-step[data-bucket-tier='elite'] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(240, 194, 118, 0.08),
    0 18px 38px rgba(240, 194, 118, 0.06);
}

.tower-step[data-bucket-tier='high'] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(214, 149, 86, 0.06);
}

.tower-step[data-bucket-tier='mate'] {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(213, 101, 101, 0.08),
    0 14px 28px rgba(213, 101, 101, 0.06);
}

.tower-step::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translateY(-50%);
  border: 2px solid rgba(240, 194, 118, 0.35);
  background: #08121b;
  box-shadow: 0 0 0 6px rgba(8, 18, 27, 0.94);
}

.tower-step-index {
  min-width: 2.8ch;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

.tower-step-body {
  min-width: 0;
}

.tower-step-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tower-step-title {
  font-size: 0.98rem;
  line-height: 1.2;
}

.tower-step-bucket {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(243, 236, 223, 0.86);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tower-step-bucket[data-bucket-tier='elite'] {
  border-color: rgba(240, 194, 118, 0.34);
  background: linear-gradient(135deg, rgba(240, 194, 118, 0.22), rgba(177, 110, 36, 0.14));
  color: #fff3d3;
  box-shadow: 0 0 0 1px rgba(240, 194, 118, 0.08), 0 0 18px rgba(240, 194, 118, 0.1);
}

.tower-step-bucket[data-bucket-tier='high'] {
  border-color: rgba(214, 149, 86, 0.26);
  background: linear-gradient(135deg, rgba(214, 149, 86, 0.18), rgba(214, 149, 86, 0.08));
  color: #ffe4be;
}

.tower-step-bucket[data-bucket-tier='mid'] {
  border-color: rgba(108, 154, 219, 0.24);
  background: linear-gradient(135deg, rgba(108, 154, 219, 0.16), rgba(108, 154, 219, 0.08));
  color: #dbeafe;
}

.tower-step-bucket[data-bucket-tier='low'] {
  border-color: rgba(173, 181, 198, 0.18);
  background: rgba(173, 181, 198, 0.08);
  color: rgba(243, 236, 223, 0.8);
}

.tower-step-bucket[data-bucket-tier='mate'] {
  border-color: rgba(213, 101, 101, 0.28);
  background: linear-gradient(135deg, rgba(213, 101, 101, 0.16), rgba(240, 194, 118, 0.08));
  color: #ffe0dd;
}

.tower-step-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.tower-step-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tower-step-lives {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tower-step-life {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
}

.tower-step-life[data-state='alive'] {
  background: linear-gradient(180deg, rgba(76, 196, 120, 0.95), rgba(28, 137, 76, 0.95));
  border-color: rgba(113, 228, 154, 0.42);
  box-shadow: 0 0 0 2px rgba(76, 196, 120, 0.1);
}

.tower-step-life[data-state='lost'] {
  background: linear-gradient(180deg, rgba(133, 32, 40, 0.9), rgba(92, 16, 24, 0.92));
  border-color: rgba(240, 109, 121, 0.34);
}

.tower-step-lives-label {
  color: rgba(243, 236, 223, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tower-step-stamp {
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  white-space: nowrap;
}

.tower-step[data-state='preview-current'],
.tower-step[data-state='current'] {
  border-color: rgba(240, 194, 118, 0.44);
  background: linear-gradient(135deg, rgba(240, 194, 118, 0.14), rgba(255, 255, 255, 0.04));
}

.tower-step[data-state='current'] {
  animation: towerCurrentPulse 1.8s ease-in-out infinite;
}

.tower-step[data-state='preview-current']::before,
.tower-step[data-state='current']::before,
.tower-step[data-state='next']::before,
.tower-step[data-state='champion']::before {
  background: var(--accent-strong);
  border-color: rgba(240, 194, 118, 0.95);
}

.tower-step[data-state='preview-current'] .tower-step-stamp,
.tower-step[data-state='current'] .tower-step-stamp,
.tower-step[data-state='next'] .tower-step-stamp,
.tower-step[data-state='champion'] .tower-step-stamp {
  border-color: rgba(240, 194, 118, 0.28);
  background: rgba(240, 194, 118, 0.14);
  color: #fff1cf;
}

.tower-step[data-state='preview-current'] .tower-step-bucket,
.tower-step[data-state='current'] .tower-step-bucket,
.tower-step[data-state='next'] .tower-step-bucket,
.tower-step[data-state='champion'] .tower-step-bucket {
  border-color: rgba(240, 194, 118, 0.28);
  background: rgba(240, 194, 118, 0.16);
  color: #fff1cf;
}

.tower-step[data-state='next'] {
  border-color: rgba(240, 194, 118, 0.24);
  background: rgba(240, 194, 118, 0.08);
}

.tower-step[data-state='cleared'],
.tower-step[data-state='champion'] {
  border-color: rgba(121, 191, 109, 0.18);
  background: rgba(121, 191, 109, 0.08);
}

.tower-step[data-state='cleared'] .tower-step-title,
.tower-step[data-state='cleared'] .tower-step-caption,
.tower-step[data-state='champion'] .tower-step-title,
.tower-step[data-state='champion'] .tower-step-caption {
  text-decoration: line-through;
  text-decoration-color: rgba(240, 194, 118, 0.42);
  text-decoration-thickness: 1.8px;
}

.tower-step[data-state='cleared'] .tower-step-stamp,
.tower-step[data-state='champion'] .tower-step-stamp {
  border-color: rgba(121, 191, 109, 0.22);
  background: rgba(121, 191, 109, 0.14);
  color: #d8f6d1;
}

.tower-step[data-state='cleared'] .tower-step-bucket,
.tower-step[data-state='champion'] .tower-step-bucket {
  border-color: rgba(121, 191, 109, 0.24);
  background: rgba(121, 191, 109, 0.14);
  color: #d8f6d1;
}

.tower-step[data-state='cleared']::before,
.tower-step[data-state='champion']::before {
  border-color: rgba(121, 191, 109, 0.56);
  background: rgba(121, 191, 109, 0.94);
}

.tower-step[data-state='retry'],
.tower-step[data-state='fallen'] {
  border-color: rgba(213, 101, 101, 0.24);
  background: rgba(213, 101, 101, 0.08);
}

.tower-step[data-state='retry']::before,
.tower-step[data-state='fallen']::before {
  border-color: rgba(213, 101, 101, 0.72);
  background: rgba(213, 101, 101, 0.88);
}

.tower-step[data-state='retry'] .tower-step-stamp,
.tower-step[data-state='fallen'] .tower-step-stamp {
  border-color: rgba(213, 101, 101, 0.24);
  background: rgba(213, 101, 101, 0.14);
  color: #ffdada;
}

.tower-step[data-state='retry'] .tower-step-bucket,
.tower-step[data-state='fallen'] .tower-step-bucket {
  border-color: rgba(213, 101, 101, 0.24);
  background: rgba(213, 101, 101, 0.16);
  color: #ffdada;
}

.tower-step[data-state='preview'],
.tower-step[data-state='upcoming'] {
  opacity: 0.9;
}

@keyframes towerCurrentPulse {
  0%,
  100% {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(240, 194, 118, 0.22), 0 0 34px rgba(240, 194, 118, 0.12), 0 18px 34px rgba(0, 0, 0, 0.16);
  }
}

@keyframes takeoverBriefingReveal {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  min-width: 0;
  border-radius: 20px;
  padding: 16px;
}

.mobile-disclosure {
  overflow: hidden;
}

.mobile-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.mobile-disclosure-summary::-webkit-details-marker {
  display: none;
}

.mobile-disclosure-body {
  margin-top: 12px;
}

.mobile-disclosure-body .mobile-disclosure-stackless {
  margin-top: 0;
}

.mobile-disclosure-chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(240, 194, 118, 0.74);
  border-bottom: 2px solid rgba(240, 194, 118, 0.74);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.mobile-disclosure[open] .mobile-disclosure-chevron {
  transform: rotate(225deg);
}

.pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(240, 191, 109, 0.14);
  color: var(--accent-strong);
}

.difficulty-meta {
  margin-top: 8px;
  color: var(--muted);
}

.premove-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.premove-clear {
  padding: 7px 12px;
  font-size: 0.86rem;
}

.premove-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink);
}

.premove-list:empty {
  display: none;
}

.premove-hint {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.position-context {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.context-headline {
  font-size: 1rem;
  line-height: 1.35;
}

.context-meta,
.context-players,
.context-opening {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.context-players:empty,
.context-opening:empty {
  display: none;
}

.move-log {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.cm-chessboard {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.cm-chessboard > * {
  max-width: 100%;
}

.cm-chessboard svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.cm-chessboard .board {
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.26));
}

.cm-chessboard .pieces-layer .piece {
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
}

.cm-chessboard-draggable-piece {
  z-index: 48;
  overflow: visible;
}

.cm-chessboard.chess-club .coordinates .coordinate {
  font-size: 7.8px;
  font-weight: 700;
}

.cm-chessboard .markers .marker.marker-frame-primary {
  stroke: rgba(255, 227, 145, 0.95);
  stroke-width: 3.4px;
  opacity: 0.95;
}

.cm-chessboard .markers .marker.marker-frame {
  stroke: rgba(240, 194, 118, 0.9);
  stroke-width: 3px;
  opacity: 0.78;
}

.cm-chessboard .markers .marker.marker-dot {
  fill: rgba(20, 27, 36, 0.28);
  opacity: 0.95;
}

.cm-chessboard .markers .marker.marker-bevel {
  stroke: rgba(210, 101, 101, 0.72);
  stroke-width: 3px;
  opacity: 0.85;
}

@media (max-width: 899px) {
  .layout {
    gap: 14px;
  }

  .board-panel,
  .card {
    padding: 14px;
  }

  .hero {
    align-items: start;
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    justify-content: flex-start;
  }

  .hero-side {
    width: 100%;
    justify-items: start;
  }

  .difficulty-picker {
    width: 100%;
  }

  .board-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .clock-box {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    text-align: right;
  }

  #level-title {
    font-size: clamp(1.6rem, 4vw, 2rem);
    line-height: 1.02;
  }

  .challenge-subtitle,
  .board-status,
  .context-meta,
  .context-players,
  .context-opening,
  .tower-caption,
  .premove-hint {
    font-size: 0.92rem;
  }

  .board-shell {
    padding: 8px;
    border-radius: 20px;
  }

  .board-status,
  .feedback-banner {
    width: 100%;
  }

  .takeover-dialog-card {
    padding: 20px;
    border-radius: 24px;
  }

  .sidebar {
    gap: 10px;
  }

  .tower-head {
    grid-template-columns: 1fr;
  }

  .tower-summary {
    text-align: left;
  }

  .takeover-player-row {
    grid-template-columns: 1fr;
  }

  .takeover-player-row-versus {
    justify-self: start;
  }

  .takeover-dialog-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 699px) {
  body {
    padding-bottom: calc(102px + env(safe-area-inset-bottom));
  }

  .shell {
    width: min(100vw - 12px, 1000px);
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .hero,
  .board-panel,
  .card {
    border-radius: 20px;
  }

  .hero {
    gap: 14px;
  }

  body[data-run-active='true'] .hero {
    padding-block: 12px;
  }

  body[data-run-active='true'] .hero-copy h1 {
    font-size: clamp(1.2rem, 5.2vw, 1.45rem);
  }

  body[data-run-active='true'] .hero-copy .lede {
    display: none;
  }

  body[data-run-active='true'] .hero-copy {
    display: grid;
    gap: 4px;
  }

  .hero-side,
  .difficulty-picker {
    width: 100%;
  }

  .hero-actions {
    position: fixed;
    left: 50%;
    bottom: calc(8px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 32;
    width: min(calc(100vw - 12px), 520px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 12, 18, 0.92);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.44);
    backdrop-filter: blur(14px);
  }

  .hero-actions button {
    width: 100%;
    min-height: 48px;
  }

  .audio-toggle {
    width: 42px;
    height: 42px;
  }

  #clock {
    font-size: clamp(1.7rem, 8.2vw, 2.1rem);
  }

  .board-shell {
    padding: 6px;
    border-radius: 18px;
  }

  .lede {
    font-size: 0.92rem;
  }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card-mobile-full {
    grid-column: 1 / -1;
  }

  .mobile-disclosure {
    padding: 14px;
  }

  .mobile-disclosure:not([open]) {
    padding-bottom: 14px;
  }

  .mobile-disclosure-summary {
    min-height: 28px;
  }

  .mobile-disclosure-body {
    margin-top: 10px;
  }

  .tower-list {
    padding-left: 26px;
  }

  .tower-step {
    grid-template-columns: auto 1fr;
  }

  .tower-step-stamp {
    grid-column: 2;
    justify-self: start;
  }

  .pill {
    max-width: 100%;
  }

  .move-log,
  .premove-list {
    max-height: min(32vh, 240px);
    overflow: auto;
    padding-right: 4px;
  }

  .position-context {
    gap: 6px;
  }

  .takeover-dialog {
    width: min(calc(100vw - 12px), 560px);
  }

  .takeover-dialog-card {
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
  }

  .takeover-dialog-rail {
    gap: 8px;
  }

  .takeover-lives-indicator {
    margin-left: auto;
  }

  .takeover-life {
    width: 14px;
    height: 14px;
    font-size: 0.56rem;
  }

  .takeover-player-badge {
    padding: 12px 14px;
  }

  .takeover-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .takeover-dialog-secondary,
  .takeover-dialog-dismiss {
    width: 100%;
    text-align: center;
  }

  .promotion-picker-tray {
    --promotion-square-size: 60px;
  }
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 286px;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tower-step,
  .tower-step[data-state='current'],
  .takeover-dialog-card {
    animation: none;
    transition: none;
  }
}

:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --bg-deep: #04080d;
  --bg-high: #08131c;
  --panel-glass: rgba(9, 15, 22, 0.78);
  --panel-ink: rgba(255, 255, 255, 0.07);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --chip-border: rgba(255, 255, 255, 0.08);
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 12% 0%, rgba(240, 194, 118, 0.18), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(92, 138, 255, 0.12), transparent 22%),
    linear-gradient(180deg, var(--bg-high) 0%, var(--bg-deep) 100%);
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  left: -12vw;
  top: 22vh;
  width: 34vw;
  height: 34vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(240, 194, 118, 0.08), transparent 68%);
  filter: blur(16px);
}

body::after {
  right: -10vw;
  bottom: 12vh;
  width: 28vw;
  height: 28vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(121, 191, 109, 0.07), transparent 70%);
  filter: blur(18px);
}

h1,
h2,
.battle-stat-value,
.tower-step-title,
.takeover-player-badge-name,
.takeover-dialog-title,
.tower-scene-title,
.run-summary-status {
  font-family: var(--font-display);
}

button,
select,
input,
summary,
.audio-toggle,
.hud-chip,
.label,
.eyebrow,
.board-status,
.takeover-player-badge-side,
.takeover-dialog-badge,
.tower-step-stamp,
.run-summary-message {
  font-family: var(--font-ui);
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: min(1180px, calc(100vw - 20px));
  padding: 18px 0 32px;
}

.lobby-screen {
  display: block;
}

body[data-screen='game'] .lobby-screen {
  display: none;
}

.lobby-scene,
.match-hud,
.battle-menu,
.board-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(13, 21, 31, 0.94), rgba(6, 11, 16, 0.94));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

.lobby-scene {
  display: grid;
  gap: 24px;
  padding: 28px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(15, 25, 36, 0.96), rgba(7, 12, 18, 0.96));
}

.lobby-scene::before,
.match-hud::before,
.board-panel::before,
.battle-menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 34%);
  pointer-events: none;
}

.lobby-utility-row,
.lobby-preview-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lobby-badge {
  margin: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 194, 118, 0.22);
  background: rgba(240, 194, 118, 0.12);
  color: #fff1cf;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.lobby-copy {
  display: grid;
  gap: 12px;
  max-width: 44rem;
}

.lobby-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.9rem, 8vw, 5.4rem);
  line-height: 0.9;
}

.lobby-copy .lede {
  max-width: 34rem;
  color: rgba(243, 236, 223, 0.8);
  font-size: 1.03rem;
  line-height: 1.45;
}

.lobby-controls {
  display: grid;
  grid-template-columns: minmax(0, 260px) auto;
  gap: 12px;
  align-items: end;
}

.lobby-start-button {
  min-height: 58px;
  padding-inline: 22px;
  font-size: 1.02rem;
}

.lobby-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.lobby-preview-line {
  color: var(--muted);
}

.lobby-tower-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.lobby-preview-step {
  min-width: 0;
  min-height: 84px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 12px 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
}

.lobby-preview-step[data-bucket-tier='elite'] {
  border-color: rgba(240, 194, 118, 0.22);
  background:
    radial-gradient(circle at top, rgba(240, 194, 118, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
  box-shadow: 0 18px 38px rgba(240, 194, 118, 0.08);
}

.lobby-preview-step[data-bucket-tier='high'] {
  border-color: rgba(214, 149, 86, 0.16);
  background:
    radial-gradient(circle at top, rgba(214, 149, 86, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
}

.lobby-preview-step[data-bucket-tier='mid'] {
  border-color: rgba(108, 154, 219, 0.14);
  background:
    radial-gradient(circle at top, rgba(108, 154, 219, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
}

.lobby-preview-step[data-bucket-tier='mate'] {
  border-color: rgba(213, 101, 101, 0.16);
  background:
    radial-gradient(circle at top, rgba(213, 101, 101, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
}

.lobby-preview-step::before {
  content: '';
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.lobby-preview-step[data-state='preview-current'] {
  border-color: rgba(240, 194, 118, 0.28);
  background: linear-gradient(180deg, rgba(240, 194, 118, 0.14), rgba(255, 255, 255, 0.05));
}

.lobby-preview-step[data-state='preview-current']::before {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.lobby-preview-step-number {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.lobby-preview-step-bucket {
  color: #fff4dd;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

.lobby-preview-step-note {
  color: rgba(243, 236, 223, 0.56);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .lobby-tower-preview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .lobby-tower-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .lobby-tower-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.game-stage {
  display: grid;
  gap: 16px;
}

body[data-screen='lobby'] .game-stage {
  opacity: 0.38;
  filter: saturate(0.65);
  pointer-events: none;
  transform: scale(0.985);
  transform-origin: top center;
}

body[data-screen='lobby'] .match-hud,
body[data-screen='lobby'] .game-action-dock,
body[data-screen='lobby'] .battle-menu,
body[data-screen='lobby'] .feedback-banner,
body[data-screen='lobby'] .board-status,
body[data-screen='lobby'] .run-summary {
  display: none;
}

body[data-screen='lobby'] .board-panel {
  max-width: min(92vw, 560px);
  margin-inline: auto;
}

.match-hud {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(13, 21, 31, 0.96), rgba(7, 12, 18, 0.96));
}

.match-hud-main {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.match-hud-sidecar {
  display: flex;
  align-items: start;
  gap: 12px;
  margin-left: auto;
}

.match-copy {
  min-width: 0;
}

.match-copy h2 {
  margin-top: 6px;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 0.96;
}

.challenge-subtitle {
  margin-top: 8px;
  max-width: 30rem;
  color: rgba(243, 236, 223, 0.72);
  font-size: 0.98rem;
  line-height: 1.35;
}

.match-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: rgba(243, 236, 223, 0.88);
  font-size: 0.86rem;
  line-height: 1;
}

.hud-chip-strong {
  border-color: rgba(240, 194, 118, 0.28);
  background: linear-gradient(135deg, rgba(240, 194, 118, 0.22), rgba(240, 194, 118, 0.1));
  color: #fff5df;
}

.hud-chip-bucket {
  color: #ffe7ad;
}

.hud-chip-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud-chip-lives strong {
  font-size: 1.08rem;
}

.hud-lives-track {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-life {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hud-life[data-state='alive'] {
  background: linear-gradient(180deg, rgba(76, 196, 120, 0.95), rgba(28, 137, 76, 0.95));
  border-color: rgba(113, 228, 154, 0.46);
  box-shadow: 0 0 0 3px rgba(76, 196, 120, 0.12);
}

.hud-life[data-state='lost'] {
  background: linear-gradient(180deg, rgba(133, 32, 40, 0.9), rgba(92, 16, 24, 0.92));
  border-color: rgba(240, 109, 121, 0.36);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tower-hud-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tower-hud-step {
  position: relative;
  min-width: 38px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.tower-hud-step[data-state='cleared'],
.tower-hud-step[data-state='champion'] {
  background: rgba(121, 191, 109, 0.34);
  border-color: rgba(121, 191, 109, 0.34);
}

.tower-hud-step[data-state='current'],
.tower-hud-step[data-state='preview-current'] {
  min-width: 56px;
  background: linear-gradient(135deg, rgba(240, 194, 118, 0.78), rgba(240, 194, 118, 0.28));
  border-color: rgba(240, 194, 118, 0.5);
}

.tower-hud-step[data-state='next'] {
  min-width: 48px;
  background: rgba(240, 194, 118, 0.18);
  border-color: rgba(240, 194, 118, 0.28);
}

.tower-hud-step[data-state='retry'],
.tower-hud-step[data-state='fallen'] {
  min-width: 48px;
  background: rgba(213, 101, 101, 0.24);
  border-color: rgba(213, 101, 101, 0.34);
}

.board-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top, rgba(240, 194, 118, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(13, 21, 31, 0.96), rgba(7, 12, 18, 0.98));
}

.board-panel.panel-flash-win {
  animation: arenaFlashWin 760ms ease;
}

.board-panel.panel-flash-loss {
  animation: arenaFlashLoss 760ms ease;
}

.board-shell {
  width: min(100%, 760px);
  padding: 12px;
  max-width: 100%;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #0b121a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

#board {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#board > div {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 1;
}

.board-status {
  width: min(100%, 760px);
  margin-inline: auto;
  text-align: center;
  color: rgba(243, 236, 223, 0.58);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.feedback-banner {
  width: min(100%, 760px);
}

.run-summary {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 12px;
  width: min(calc(100% - 48px), 560px);
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(240, 194, 118, 0.2);
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(15, 24, 34, 0.96), rgba(7, 11, 16, 0.96));
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.run-summary[hidden] {
  display: none;
}

.run-summary-status {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 0.94;
}

.run-summary-message {
  color: rgba(243, 236, 223, 0.76);
  line-height: 1.45;
}

.run-summary button {
  justify-self: start;
}

.run-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.run-summary-stat {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.run-summary-stat-label,
.battle-menu-note {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-summary-stat strong {
  font-size: 1rem;
  color: #fff4dd;
}

body[data-run-status='won'] .run-summary {
  border-color: rgba(121, 191, 109, 0.26);
  background:
    radial-gradient(circle at top right, rgba(121, 191, 109, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(15, 24, 34, 0.96), rgba(7, 11, 16, 0.96));
}

body[data-run-status='lost'] .run-summary {
  border-color: rgba(213, 101, 101, 0.26);
  background:
    radial-gradient(circle at top right, rgba(213, 101, 101, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(15, 24, 34, 0.96), rgba(7, 11, 16, 0.96));
}

.game-action-dock {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.game-action-dock button {
  min-height: 48px;
  padding-inline: 18px;
}

.game-action-dock button[hidden] {
  display: none;
}

.battle-menu {
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(12, 18, 26, 0.96), rgba(7, 12, 17, 0.96));
}

.battle-menu[hidden] {
  display: none;
}

.battle-menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
}

.battle-menu-summary span:first-child {
  font-weight: 600;
}

.battle-menu-note {
  margin-left: auto;
}

body[data-run-status='awaiting_continue'] .board-shell {
  filter: saturate(0.88) brightness(0.92);
}

body[data-run-status='awaiting_continue'] .game-action-dock .primary {
  box-shadow: 0 0 0 1px rgba(240, 194, 118, 0.18), 0 0 22px rgba(240, 194, 118, 0.14);
}

body[data-run-status='lost'] .board-shell {
  filter: saturate(0.72) brightness(0.88);
}

body[data-run-status='won'] .board-shell {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(121, 191, 109, 0.14),
    0 0 34px rgba(121, 191, 109, 0.08);
}

.battle-menu-summary::-webkit-details-marker {
  display: none;
}

.battle-menu-body {
  padding: 0 18px 18px;
}

.battle-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.battle-card {
  grid-column: span 12;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.battle-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.battle-stat-value {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1;
}

.position-context {
  margin-top: 0;
  gap: 10px;
}

.context-meta,
.context-players,
.context-opening,
.difficulty-meta,
.premove-hint,
.tower-caption {
  color: var(--muted);
}

.move-log,
.premove-list {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.tower-scene {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 11, 0.72);
  backdrop-filter: blur(12px);
}

.tower-scene[hidden] {
  display: none;
}

.tower-scene-card {
  width: min(100%, 560px);
  padding: 24px;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(240, 194, 118, 0.22);
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(17, 26, 37, 0.98), rgba(7, 11, 17, 0.98));
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.52);
  animation: towerSceneReveal 520ms cubic-bezier(0.2, 0.85, 0.2, 1);
}

.tower-scene-title {
  margin-top: 8px;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 0.94;
}

.tower-scene-note {
  margin-top: 10px;
  color: rgba(243, 236, 223, 0.72);
  line-height: 1.45;
}

.tower-scene-viewport {
  position: relative;
  height: clamp(340px, 58vh, 452px);
  margin-top: 18px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.94) 14%, rgba(0, 0, 0, 0.94) 86%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.94) 14%, rgba(0, 0, 0, 0.94) 86%, transparent);
}

.tower-scene-viewport::before,
.tower-scene-viewport::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 2;
  pointer-events: none;
}

.tower-scene-viewport::before {
  top: 0;
  background: linear-gradient(180deg, rgba(7, 11, 17, 0.98), rgba(7, 11, 17, 0));
}

.tower-scene-viewport::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(7, 11, 17, 0.98), rgba(7, 11, 17, 0));
}

.tower-scene-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 28px 32px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  position: relative;
  transform: translateY(0);
  will-change: transform;
}

.tower-scene-list::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 42px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 194, 118, 0.08), rgba(240, 194, 118, 0.65), rgba(240, 194, 118, 0.08));
}

.tower-scene .tower-step {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  animation: towerSceneStepReveal 520ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
  min-height: 50px;
  gap: 10px;
  padding: 9px 11px;
}

.tower-scene .tower-step::before {
  left: -24px;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 5px rgba(8, 18, 27, 0.94);
}

.tower-scene .tower-step-index {
  min-width: 2.5ch;
  font-size: 0.76rem;
}

.tower-scene .tower-step-heading {
  gap: 6px;
}

.tower-scene .tower-step-title {
  font-size: 0.9rem;
}

.tower-scene .tower-step-bucket {
  min-height: 21px;
  padding: 3px 7px;
  font-size: 0.63rem;
}

.tower-scene .tower-step-caption {
  margin-top: 2px;
  font-size: 0.76rem;
  line-height: 1.25;
}

.tower-scene .tower-step-meta {
  margin-top: 5px;
  gap: 6px;
}

.tower-scene .tower-step-lives {
  gap: 4px;
}

.tower-scene .tower-step-life {
  width: 7px;
  height: 7px;
}

.tower-scene .tower-step-lives-label {
  font-size: 0.64rem;
}

.tower-scene .tower-step-stamp {
  padding: 5px 7px;
  font-size: 0.6rem;
}

.tower-scene .tower-step:nth-child(1) {
  animation-delay: 80ms;
}

.tower-scene .tower-step:nth-child(2) {
  animation-delay: 140ms;
}

.tower-scene .tower-step:nth-child(3) {
  animation-delay: 200ms;
}

.tower-scene .tower-step:nth-child(4) {
  animation-delay: 260ms;
}

.tower-scene .tower-step:nth-child(5) {
  animation-delay: 320ms;
}

.tower-scene .tower-step:nth-child(6) {
  animation-delay: 380ms;
}

.tower-scene .tower-step:nth-child(7) {
  animation-delay: 440ms;
}

.tower-scene .tower-step:nth-child(8) {
  animation-delay: 500ms;
}

.tower-scene[data-camera-phase='origin'] .tower-step[data-scene-focus='origin'] {
  border-color: rgba(240, 194, 118, 0.3);
  box-shadow:
    0 26px 50px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(240, 194, 118, 0.14),
    0 0 28px rgba(240, 194, 118, 0.12);
}

.tower-scene[data-camera-phase='origin'] .tower-step[data-scene-focus='target'] {
  opacity: 0.72;
  filter: saturate(0.78);
}

.tower-scene[data-camera-phase='advance'] .tower-step[data-scene-focus='origin'] {
  opacity: 0.68;
  filter: saturate(0.76);
}

.tower-scene[data-camera-phase='advance'] .tower-step[data-scene-focus='target'] {
  border-color: rgba(240, 194, 118, 0.3);
  box-shadow:
    0 26px 50px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(240, 194, 118, 0.14),
    0 0 28px rgba(240, 194, 118, 0.12);
}

.tower-scene[data-tone='loss'] .tower-step[data-state='retry'],
.tower-scene[data-tone='loss'] .tower-step[data-state='fallen'] {
  animation:
    towerSceneStepReveal 520ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards,
    towerSceneShake 480ms ease 620ms 1;
}

.tower-scene[data-tone='win'] .tower-step[data-state='cleared'] {
  box-shadow: 0 18px 34px rgba(121, 191, 109, 0.08);
}

.tower-scene[data-tone='win'] .tower-step[data-crossed='true'] {
  border-color: rgba(240, 194, 118, 0.28);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(240, 194, 118, 0.12);
}

.tower-scene[data-tone='win'] .tower-step[data-crossed='true']::after {
  content: '';
  position: absolute;
  left: 52px;
  right: 18px;
  top: 50%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(240, 194, 118, 0.2), rgba(240, 194, 118, 0.95), rgba(240, 194, 118, 0.2));
  box-shadow: 0 0 0 1px rgba(240, 194, 118, 0.08), 0 0 22px rgba(240, 194, 118, 0.18);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: towerCrossOff 760ms cubic-bezier(0.2, 0.85, 0.2, 1) 860ms forwards;
}

.tower-scene[data-tone='win'] .tower-step[data-crossed='true'] .tower-step-title,
.tower-scene[data-tone='win'] .tower-step[data-crossed='true'] .tower-step-caption {
  text-decoration-color: rgba(240, 194, 118, 0.72);
  text-decoration-thickness: 2.4px;
}

.tower-scene[data-tone='win'] .tower-step[data-crossed='true'] .tower-step-stamp {
  border-color: rgba(240, 194, 118, 0.24);
  background: rgba(240, 194, 118, 0.14);
  color: #fff1cf;
}

.tower-scene[data-tone='win'] .tower-step[data-state='next'],
.tower-scene[data-tone='intro'] .tower-step[data-state='current'] {
  animation:
    towerSceneStepReveal 520ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards,
    towerCurrentPulse 1.6s ease-in-out 760ms 2 both;
}

.takeover-dialog {
  width: min(calc(100vw - 20px), 640px);
}
  background:
    radial-gradient(circle at top right, rgba(240, 194, 118, 0.18), transparent 26%),
    linear-gradient(135deg, rgba(42, 28, 20, 0.82), rgba(15, 23, 34, 0.98));
}

.takeover-dialog-copy {
  display: grid;
  gap: 18px;
}

.takeover-dialog-title {
  margin-top: 4px;
  font-size: clamp(1.95rem, 6vw, 3rem);
}

.takeover-dialog-body {
  margin-top: 0;
  max-width: 32ch;
  color: rgba(243, 236, 223, 0.76);
}

.takeover-dialog-dismiss {
  min-height: 50px;
  padding-inline: 20px;
}

@keyframes arenaFlashWin {
  0% {
    box-shadow: var(--shadow);
  }

  35% {
    box-shadow: 0 0 0 1px rgba(121, 191, 109, 0.38), 0 0 54px rgba(121, 191, 109, 0.16), var(--shadow);
  }

  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes arenaFlashLoss {
  0% {
    box-shadow: var(--shadow);
  }

  35% {
    box-shadow: 0 0 0 1px rgba(213, 101, 101, 0.4), 0 0 54px rgba(213, 101, 101, 0.16), var(--shadow);
  }

  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes towerSceneReveal {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes towerSceneStepReveal {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes towerCrossOff {
  0% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes towerSceneShake {
  0%,
  100% {
    transform: translateX(0);
  }

  30% {
    transform: translateX(-6px);
  }

  60% {
    transform: translateX(6px);
  }
}

@media (min-width: 960px) {
  .battle-card.tower-card {
    grid-column: span 5;
  }

  .battle-card.takeover-dossier {
    grid-column: span 7;
  }

  .battle-card.battle-stat {
    grid-column: span 3;
  }

  .battle-card.battle-log-card,
  .battle-card.battle-premove-card {
    grid-column: span 4;
  }

  .game-action-dock {
    justify-content: flex-end;
  }
}

@media (max-width: 899px) {
  .shell {
    gap: 16px;
  }

  .lobby-controls {
    grid-template-columns: 1fr;
  }

  .match-hud-main {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .match-hud-sidecar {
    justify-content: flex-end;
    align-items: center;
    margin-left: 0;
  }

  .clock-box {
    display: flex;
    align-items: end;
    justify-content: space-between;
    text-align: left;
  }

  .board-panel {
    padding: 18px;
  }
}

@media (max-width: 699px) {
  body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .shell {
    width: min(100vw - 12px, 1000px);
    padding: 8px 0 18px;
    gap: 14px;
  }

  .lobby-scene {
    min-height: calc(100svh - 16px - env(safe-area-inset-bottom));
    align-content: space-between;
    padding: 20px;
    border-radius: 26px;
  }

  .lobby-copy h1 {
    font-size: clamp(2.4rem, 13vw, 3.8rem);
  }

  .lobby-preview {
    padding: 14px;
  }

  .lobby-tower-preview {
    gap: 8px;
  }

  .lobby-preview-step {
    min-height: 92px;
    padding: 11px 11px 12px;
  }

  .lobby-preview-step-bucket {
    font-size: 0.82rem;
  }

  .lobby-preview-step-number {
    font-size: 0.68rem;
  }

  .lobby-preview-step-note {
    font-size: 0.62rem;
  }

  .match-hud {
    display: contents;
  }

  .match-hud-main {
    order: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 2px 4px 0;
  }

  .match-copy h2 {
    margin-top: 2px;
    font-size: clamp(2rem, 8.4vw, 2.7rem);
  }

  .challenge-subtitle {
    margin-top: 6px;
    font-size: 0.88rem;
    line-height: 1.28;
  }

  .match-hud-sidecar {
    align-items: start;
  }

  .match-chip-row {
    order: 3;
    padding: 2px 4px 0;
  }

  .tower-hud-list {
    order: 4;
    padding: 0 4px;
  }

  .board-header {
    gap: 10px;
    margin-bottom: -2px;
  }

  .board-header .hud-chip-lives {
    min-height: 34px;
    padding: 7px 11px;
  }

  .clock-box {
    min-height: 40px;
    padding: 3px 10px;
    border-radius: 12px;
  }

  #clock {
    font-size: clamp(1.82rem, 6.5vw, 2.18rem);
    line-height: 0.92;
  }

  .hud-chip {
    min-height: 36px;
    padding: 8px 12px;
  }

  .board-panel {
    order: 2;
    padding: 14px;
    border-radius: 24px;
  }

  .board-shell {
    padding: 8px;
    border-radius: 20px;
  }

  .run-summary {
    position: static;
    width: 100%;
  }

  .run-summary-stats {
    grid-template-columns: 1fr;
  }

  .game-action-dock {
    order: 5;
    position: static;
    width: 100%;
    max-width: 560px;
    margin: 14px auto 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 10, 16, 0.92);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
  }

  .game-action-dock button {
    width: 100%;
  }

  .battle-menu {
    order: 6;
    border-radius: 22px;
  }

  .battle-menu-summary {
    padding: 14px 16px;
  }

  .battle-menu-note {
    display: none;
  }

  .battle-menu-body {
    padding: 0 14px 14px;
  }

  .battle-card {
    padding: 14px;
    border-radius: 18px;
  }

  .move-log,
  .premove-list {
    max-height: min(24vh, 180px);
  }

  .tower-scene {
    padding: 12px;
  }

  .tower-scene-card {
    padding: 20px;
    border-radius: 24px;
  }

  .tower-scene-viewport {
    height: clamp(284px, 48vh, 340px);
  }

  .takeover-dialog {
    width: min(calc(100vw - 10px), 640px);
  }

  .takeover-dialog-card {
    min-height: auto;
    max-height: calc(100svh - 16px);
    padding: 16px 18px 18px;
    border-radius: 24px;
    align-content: start;
    overflow: auto;
  }

  .takeover-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .takeover-dialog-dismiss {
    width: 100%;
  }
}

@keyframes clockDangerPulse {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 12px rgba(255, 92, 92, 0.2);
  }

  45% {
    transform: scale(1.06);
    text-shadow: 0 0 24px rgba(255, 92, 92, 0.42);
  }
}

@keyframes clockDangerJolt {
  0%,
  100% {
    left: 0;
  }

  25% {
    left: -2px;
  }

  75% {
    left: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-panel,
  .tower-scene-card,
  .tower-scene .tower-step,
  .tower-hud-step,
  .clock-box,
  .clock-box #clock {
    animation: none;
    transition: none;
  }
}
