:root {
  --blue: #0046ff;
  --blue-soft: #ebf0ff;
  --ink: #f4f6fb;
  --ink-2: #b8c0d4;
  --ink-3: #7b8499;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(6, 9, 20, 0.86);
  --gold: #ffc94d;
  --font: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --board-w: clamp(250px, 23vw, 430px);
  --banner-h: clamp(64px, 8.6vh, 96px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #05070f;
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  color: inherit;
  white-space: nowrap;
}

.cap {
  font-size: clamp(11px, 1.05vw, 15px);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 700;
}

.primary {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  border-radius: 14px;
  padding: 0.85em 1.6em;
  font-size: clamp(16px, 1.6vw, 22px);
  box-shadow: 0 10px 30px rgba(0, 70, 255, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.primary:active {
  transform: scale(0.97);
}
.primary.big {
  font-size: clamp(20px, 2.2vw, 30px);
  padding: 0.75em 1.4em;
  width: 100%;
}

.ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-weight: 700;
  border-radius: 12px;
  padding: 0.7em 1.1em;
  font-size: clamp(13px, 1.15vw, 17px);
  border: 1px solid var(--line);
}
.ghost:active {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------------------------------------------------------------- screens */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
}

#setup {
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(0, 70, 255, 0.28), transparent 60%),
    radial-gradient(90% 70% at -10% 110%, rgba(0, 70, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #05070f, #0a1024);
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.4vh, 30px) clamp(16px, 2.6vw, 44px);
  gap: clamp(10px, 1.8vh, 22px);
  overflow-y: auto;
}

.setup-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.brand h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 68px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #c9d6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p {
  margin: 0.45em 0 0;
  color: var(--ink-2);
  font-size: clamp(14px, 1.35vw, 19px);
  font-weight: 500;
}
.top-actions {
  display: flex;
  gap: 8px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(14px, 2.4vw, 40px);
  flex: 1;
  min-height: 0;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.sec-head h2 {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper button {
  width: clamp(40px, 3.6vw, 54px);
  height: clamp(40px, 3.6vw, 54px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
}
.stepper output {
  min-width: 2.2em;
  text-align: center;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.free {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  font-size: clamp(14px, 1.3vw, 18px);
  padding: 0.85em 1em;
  outline: none;
}
.free:focus {
  border-color: var(--blue);
  background: rgba(0, 70, 255, 0.08);
}

.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  overflow-y: auto;
  min-height: 0;
}
.prow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 2px;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}
.prow:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.prow.off {
  opacity: 0.35;
}
.prow input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(15px, 1.35vw, 19px);
  font-weight: 600;
  padding: 6px 2px;
  outline: none;
}
.prow input:focus {
  border-bottom-color: var(--blue);
}
.prow input::placeholder {
  color: var(--ink-3);
  font-weight: 500;
}
.prow .gbtn {
  min-width: 3.4em;
  min-height: 44px;
  padding: 0.45em 0.7em;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 16px);
  color: var(--ink-2);
}
.prow .gbtn.m,
.prow .gbtn.f {
  background: rgba(0, 70, 255, 0.22);
  color: #fff;
}

.ball {
  --c: #ff5a5f;
  --k: #fff;
  width: clamp(34px, 3vw, 46px);
  height: clamp(34px, 3vw, 46px);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 30%, white) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 62%, black) 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.4);
  color: var(--k);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(15px, 1.4vw, 21px);
  font-variant-numeric: tabular-nums;
  flex: none;
  cursor: pointer;
}

.stake-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.stake-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.75em 0.4em;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 600;
  color: var(--ink-2);
}
.stake-item .mark {
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  border: 2px solid var(--ink-3);
  flex: none;
}
.stake-item.on {
  color: #fff;
  font-weight: 800;
  background: rgba(0, 70, 255, 0.18);
}
.stake-item.on .mark {
  border-color: var(--blue);
  background: radial-gradient(circle, #fff 0 32%, var(--blue) 36%);
}

.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(13px, 1.2vw, 17px);
  color: var(--ink-2);
  font-weight: 600;
}
.opt:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 14px;
}
.opt:nth-child(even) {
  padding-left: 14px;
}
.opt input[type='text'] {
  width: 8em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.5em 0.7em;
  outline: none;
  text-align: right;
}
.opt input[type='range'] {
  width: 9em;
  accent-color: var(--blue);
}
.seg {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  padding: 0.45em 0.7em;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-weight: 700;
  font-size: clamp(12px, 1.05vw, 15px);
}
.seg button.on {
  background: var(--blue);
  color: #fff;
}
.switch {
  width: 3.2em;
  height: 1.8em;
  border-radius: 1em;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 0.2em;
  left: 0.2em;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.switch.on {
  background: var(--blue);
}
.switch.on::after {
  transform: translateX(1.4em);
}

#startBtn {
  margin-top: auto;
}

/* ---------------------------------------------------------------- HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
#banner {
  position: absolute;
  left: 0;
  right: var(--board-w);
  top: 0;
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 1.8vw, 30px);
  background: linear-gradient(180deg, rgba(4, 6, 14, 0.95), rgba(4, 6, 14, 0.7) 75%, rgba(4, 6, 14, 0));
  gap: 18px;
}
.stake {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
}
.stake strong {
  font-size: clamp(18px, 2.2vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi {
  position: absolute;
  right: -1.6em;
  top: 0.15em;
  font-size: clamp(20px, 2.4vw, 36px);
  font-weight: 900;
  color: var(--gold);
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.live {
  display: flex;
  gap: clamp(10px, 1.6vw, 26px);
  flex: none;
}
.live-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.live-cell b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(16px, 1.8vw, 28px);
  font-weight: 800;
  white-space: nowrap;
}
.live-cell.last b {
  color: #fff;
}
.chip-ball {
  --c: #fff;
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 35%, white), var(--c) 50%, color-mix(in srgb, var(--c) 60%, black));
  flex: none;
}

#board {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--board-w);
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--banner-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: clamp(16px, 1.6vw, 24px);
}
.board-head .ghost {
  padding: 0.45em 0.8em;
  font-size: clamp(12px, 1vw, 14px);
}
#rows {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  flex: 1;
  overflow: hidden;
}
.row {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 2.1em auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s;
  font-size: var(--row-font, 18px);
}
.row .st {
  font-size: 0.8em !important;
}
.row .rk {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  text-align: right;
}
.row .nm {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .st {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
}
.row .ball {
  width: 1.65em;
  height: 1.65em;
  font-size: 0.8em;
  cursor: default;
}
.row.done .rk {
  color: #fff;
}
.row.win {
  background: rgba(255, 201, 77, 0.16);
}
.row.win .rk,
.row.win .st {
  color: var(--gold);
}
.row.lose {
  background: rgba(0, 70, 255, 0.34);
}
.row.lose .st {
  color: #fff;
}
.row.danger .nm {
  font-weight: 900;
}

#ticker {
  position: absolute;
  left: 0;
  right: var(--board-w);
  bottom: clamp(18px, 4vh, 44px);
  display: flex;
  justify-content: center;
}
#ticker.top {
  bottom: auto;
  top: calc(var(--banner-h) + 12px);
}
.tick {
  background: rgba(4, 6, 14, 0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.45em 1em;
  font-size: clamp(18px, 2.3vw, 38px);
  font-weight: 900;
  letter-spacing: -0.02em;
  animation: tickIn 0.32s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
}
.tick.big {
  font-size: clamp(22px, 3vw, 48px);
  border-color: rgba(255, 201, 77, 0.6);
}
.tick.out {
  animation: tickOut 0.3s ease forwards;
}
#lower {
  position: absolute;
  left: clamp(80px, 7vw, 120px);
  top: calc(var(--banner-h) + 10px);
  font-size: clamp(14px, 1.4vw, 21px);
  font-weight: 700;
  color: var(--ink-2);
  transition: opacity 0.4s;
}
#lower b {
  color: #fff;
  font-weight: 900;
}

@keyframes tickIn {
  from {
    transform: translateY(18px) scale(0.92);
    opacity: 0;
  }
}
@keyframes tickOut {
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- intro */
#intro {
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding-bottom: 7vh;
}
.intro-card {
  background: rgba(4, 6, 14, 0.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 3.5vh, 40px) clamp(24px, 4vw, 64px);
  max-width: min(92vw, 1200px);
  text-align: center;
  animation: tickIn 0.5s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.intro-stake {
  margin-top: 0;
  font-size: clamp(34px, 5vw, 80px);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.intro-rule {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 32px);
  line-height: 1.45;
  font-weight: 600;
}
.lineup {
  margin-top: clamp(14px, 2.6vh, 28px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1vw, 16px) clamp(10px, 1.4vw, 22px);
}
.lu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 700;
  color: var(--ink-2);
  min-width: 3.4em;
}
.count {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(120px, 26vh, 300px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 60px rgba(0, 70, 255, 0.9);
  pointer-events: none;
}
.count span {
  animation: countPop 0.9s ease forwards;
}
@keyframes countPop {
  0% {
    transform: scale(1.8);
    opacity: 0;
  }
  20% {
    transform: scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- results */
#result {
  background: radial-gradient(80% 70% at 50% 40%, rgba(5, 8, 20, 0.86), rgba(3, 4, 10, 0.97));
  display: grid;
  place-items: center;
  overflow-y: auto;
}
.result-wrap {
  width: min(94vw, 1500px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vh, 26px);
  padding: clamp(16px, 3vh, 36px) 0;
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  align-items: center;
  gap: clamp(12px, 2vw, 36px);
}
.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.pod b {
  font-size: clamp(22px, 2.6vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.pod .cap {
  font-size: clamp(16px, 1.7vw, 26px);
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.pod.first .cap {
  color: var(--gold);
}
.pod-ball {
  width: clamp(90px, 11vw, 180px);
  height: clamp(90px, 11vw, 180px);
  font-size: clamp(40px, 5vw, 84px);
  cursor: default;
}
.pod.first .pod-ball {
  box-shadow: 0 0 0 4px rgba(255, 201, 77, 0.85), 0 0 60px rgba(255, 201, 77, 0.45), inset 0 -6px 12px rgba(0, 0, 0, 0.35);
}
.pod.last .pod-ball {
  box-shadow: 0 0 0 4px rgba(90, 140, 255, 0.85), 0 0 60px rgba(0, 70, 255, 0.5), inset 0 -6px 12px rgba(0, 0, 0, 0.35);
}
.settle {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(14px, 2.4vh, 26px) clamp(14px, 2vw, 30px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.settle-head {
  font-size: clamp(26px, 3.4vw, 56px);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.settle-detail {
  font-size: clamp(20px, 2.4vw, 38px);
  font-weight: 800;
  color: var(--gold);
}
.settle-note {
  font-size: clamp(14px, 1.4vw, 20px);
  color: var(--ink-2);
  font-weight: 600;
  min-height: 1em;
}
.couple {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: 4px;
  align-items: center;
  padding: clamp(12px, 2vh, 22px) clamp(16px, 2vw, 30px);
  background: rgba(255, 107, 193, 0.1);
  border-radius: 18px;
}
.couple .cap {
  grid-column: 1 / 3;
  color: #ff9ad5;
}
.couple-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 900;
  grid-row: 2 / 4;
}
.couple-pair .heart {
  color: #ff6bc1;
}
.couple-ask {
  font-size: clamp(20px, 2.3vw, 36px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.couple-alt {
  font-size: clamp(13px, 1.3vw, 19px);
  color: var(--ink-2);
  font-weight: 600;
}
.order-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 0.8vw, 12px);
}
.os {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: clamp(11px, 1vw, 15px);
  color: var(--ink-3);
  font-weight: 700;
}
.os .ball {
  width: clamp(30px, 2.6vw, 42px);
  height: clamp(30px, 2.6vw, 42px);
  font-size: clamp(13px, 1.2vw, 18px);
  cursor: default;
}
.talk {
  text-align: center;
  color: var(--ink-2);
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 600;
  min-height: 1.2em;
}
.result-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.sub-actions {
  grid-column: 1 / 3;
  display: flex;
  justify-content: center;
  gap: 28px;
}
.text-btn {
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
  font-size: clamp(14px, 1.3vw, 19px);
  padding: 0.5em 0.4em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}
.couple.late {
  animation: lateIn 0.6s 1.6s cubic-bezier(0.2, 1, 0.3, 1) both;
}
@keyframes lateIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}
.duel-title {
  position: absolute;
  left: 0;
  right: var(--board-w);
  top: calc(var(--banner-h) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.duel-title .cap {
  font-size: clamp(18px, 2.2vw, 34px);
  color: var(--gold);
  letter-spacing: 0.04em;
}
.duel-names {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(26px, 3.2vw, 52px);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: rgba(4, 6, 14, 0.78);
  padding: 8px 22px;
  border-radius: 16px;
}
.duel-names em {
  font-style: normal;
  font-size: 0.6em;
  color: var(--ink-3);
  margin: 0 6px;
}
.duel-names .ball {
  width: 1.15em;
  height: 1.15em;
  font-size: 0.62em;
  cursor: default;
}
.result-actions .primary.big {
  width: auto;
}

/* ---------------------------------------------------------------- mission */
#mission {
  background: rgba(3, 4, 10, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  perspective: 1400px;
}
.card-flip {
  width: min(70vw, 760px);
  height: min(58vh, 460px);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.3, 1.3, 0.5, 1);
  cursor: pointer;
}
.card-flip.flipped {
  transform: rotateY(180deg);
}
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px;
  text-align: center;
}
.card-face.front {
  background: linear-gradient(140deg, #0046ff, #0a1a5c);
  font-size: clamp(32px, 4vw, 60px);
  font-weight: 900;
  box-shadow: 0 30px 80px rgba(0, 70, 255, 0.4);
}
.card-face.back {
  background: linear-gradient(160deg, #f6f8ff, #dfe6ff);
  color: #0a0f1e;
  transform: rotateY(180deg);
}
.card-face.back .cap {
  color: #445;
}
.mission-ask {
  font-size: clamp(28px, 3.6vw, 56px);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.mission-alt {
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 700;
  color: #3b4460;
}

/* ---------------------------------------------------------------- history / pause */
#history {
  background: rgba(3, 4, 10, 0.94);
  display: grid;
  place-items: center;
}
.history-wrap {
  width: min(92vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.history-table {
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.hrow {
  display: grid;
  grid-template-columns: auto 1fr repeat(3, 5.5em);
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 600;
}
.hrow.head {
  color: var(--ink-3);
  font-size: clamp(12px, 1.1vw, 15px);
}
.hrow .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
#pause {
  background: rgba(3, 4, 10, 0.8);
  display: grid;
  place-items: center;
}
.pause-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(80vw, 420px);
  text-align: center;
}
.pause-box h2 {
  font-size: clamp(28px, 3vw, 44px);
  margin: 0 0 10px;
}
.replay-badge {
  position: fixed;
  top: calc(var(--banner-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(255, 255, 255, 0.92);
  color: #0a0f1e;
  font-weight: 900;
  font-size: clamp(16px, 1.8vw, 26px);
  padding: 0.35em 1em;
  border-radius: 10px;
  pointer-events: none;
}

/* portrait fallback: board at the bottom */
@media (max-aspect-ratio: 1/1) {
  :root {
    --board-w: 0px;
  }
  #board {
    top: auto;
    width: 100%;
    height: 26vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  #banner {
    right: 0;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .podium {
    grid-template-columns: 1fr 1fr;
  }
  .settle {
    grid-column: 1 / 3;
    grid-row: 2;
  }
  .result-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.attract {
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 28px;
  border-radius: 18px;
  background: rgba(4, 6, 14, 0.82);
  border: 1px solid var(--line);
  pointer-events: none;
  animation: breathe 2.8s ease-in-out infinite;
}
.attract strong {
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.attract span {
  font-size: clamp(15px, 1.6vw, 24px);
  font-weight: 700;
  color: var(--ink-2);
}
@keyframes breathe {
  50% {
    opacity: 0.72;
  }
}
.lineup:empty {
  display: none;
}
