/* =========================================================
   Real Or Fake — shared UI
   ========================================================= */

:root {
  --bg: #070708;
  --bg-soft: #0b0b0d;
  --panel: #101013;
  --panel-2: #151519;
  --panel-3: #1b1b20;
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f2efe6;
  --dim: #a39e95;
  --faint: #706c65;
  --accent: #e3ff4d;
  --accent-soft: rgba(227, 255, 77, 0.12);
  --gold: #ffcf6d;
  --ai: #c8a7ff;
  --real: #74e6c7;
  --bad: #ff7670;
  --good: #a8ee6a;
  --radius: 18px;
  --header-h: 68px;
  --video-maxh: min(60vh, 620px);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI Emoji",
    "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "JetBrains Mono",
    ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 720px at 10% -8%, rgba(227, 255, 77, 0.065), transparent 60%),
    radial-gradient(900px 600px at 102% 2%, rgba(200, 167, 255, 0.055), transparent 55%),
    radial-gradient(900px 680px at 50% 112%, rgba(116, 230, 199, 0.035), transparent 60%),
    var(--bg);
}

body[data-mode="screen"] {
  height: 100vh;
  overflow: hidden;
  --header-h: 76px;
  --video-maxh: min(72vh, 840px);
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
video {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #09090a;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
}

.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;
}

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.4;
  color: var(--faint);
  text-transform: uppercase;
}

.micro {
  margin: 0;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

/* ---------------- atmosphere ---------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 48%, rgba(0, 0, 0, 0.42) 100%);
}

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(16px, 3.2vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.8);
  backdrop-filter: blur(18px) saturate(1.15);
}

body.is-gate .topbar,
body.is-gate .progress-track {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--text);
  opacity: 0.92;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-copy b {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-copy small {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.2em;
  color: var(--faint);
  white-space: nowrap;
}

.top-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.015);
}

.phase-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

body[data-phase="question"] .phase-chip i {
  background: var(--bad);
  box-shadow: 0 0 0 0 rgba(255, 118, 112, 0.55);
  animation: pulse 1.7s infinite;
}

body[data-phase="question"] .phase-chip {
  color: var(--text);
  border-color: rgba(255, 118, 112, 0.3);
}

body[data-phase="revealed"] .phase-chip i {
  background: var(--accent);
}

body[data-phase="revealed"] .phase-chip {
  color: var(--accent);
  border-color: rgba(227, 255, 77, 0.25);
}

body[data-phase="finished"] .phase-chip i {
  background: var(--text);
}

.people-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
}

.people-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.people-chip b {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--dim);
}

.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(227, 255, 77, 0.25);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  white-space: nowrap;
}

.score-chip b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.clock {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--line-2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

body[data-mode="player"] [data-fullscreen],
body[data-mode="player"] [data-clock] {
  display: none;
}

.progress-track {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 39;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------------- main / views ---------------- */

.main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: clamp(20px, 3.2vh, 38px) clamp(16px, 3.2vw, 44px) 48px;
}

.view {
  animation: viewIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.is-gate .main {
  max-width: none;
  padding: 0;
}

/* =========================================================
   GATE
   ========================================================= */

.gate-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
  padding: clamp(28px, 6vh, 64px) clamp(22px, 6vw, 88px);
}

.gate-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(255, 255, 255, 0.035) 50%, transparent 50.1%);
  opacity: 0.6;
}

.gate-art {
  justify-self: end;
  width: 100%;
  max-width: 660px;
}

.film-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 62vh;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 26% 16%, rgba(255, 255, 255, 0.07), transparent 62%),
    radial-gradient(60% 90% at 84% 100%, rgba(227, 255, 77, 0.045), transparent 60%),
    #0a0a0c;
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.55), inset 0 0 80px rgba(0, 0, 0, 0.45);
}

.film-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  pointer-events: none;
}

.film-hud {
  position: absolute;
  top: 26px;
  left: 30px;
  right: 30px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.42);
}

.hud-rec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.62);
}

.hud-rec i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 12px rgba(255, 118, 112, 0.7);
  animation: pulse 2s infinite;
}

.film-q {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 34px;
  font-family: Georgia, "Songti SC", "Times New Roman", serif;
  font-size: clamp(160px, 22vw, 300px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 90px rgba(227, 255, 77, 0.06);
  user-select: none;
}

.film-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 255, 77, 0.5), transparent);
  opacity: 0.55;
  animation: scan 8s ease-in-out infinite alternate;
}

.film-bottom {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  color: rgba(255, 255, 255, 0.32);
}

.film-bottom i {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.film-perf {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(255, 255, 255, 0.018);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Crect x='7' y='10' width='16' height='10' rx='2.5' fill='%23ffffff' fill-opacity='.13'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.32);
  border-style: solid;
  border-width: 0;
}

.corner.tl {
  top: 16px;
  left: 16px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.corner.tr {
  top: 16px;
  right: 16px;
  border-top-width: 1px;
  border-right-width: 1px;
}

.corner.bl {
  bottom: 16px;
  left: 16px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.corner.br {
  bottom: 16px;
  right: 16px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

.gate-art-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 4px 0;
}

.gate-art-caption p {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
}

.gate-card {
  position: relative;
  justify-self: start;
  width: 100%;
  max-width: 490px;
  padding: clamp(24px, 3.6vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012) 58%),
    rgba(12, 12, 14, 0.72);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px);
}

.gate-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 42px;
  width: 64px;
  height: 1px;
  background: var(--accent);
  opacity: 0.75;
}

.gate-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gate-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.gate-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bad);
  animation: pulse 1.8s infinite;
}

.gate-card h1 {
  margin: 20px 0 0;
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.gate-card h1 em {
  font-style: normal;
  color: var(--accent);
}

.gate-lead {
  margin: 16px 0 0;
  max-width: 36em;
  font-size: 13px;
  line-height: 1.75;
  color: var(--dim);
}

.join-form {
  margin-top: clamp(24px, 3.4vh, 36px);
}

.join-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.join-row input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 15px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.join-row input::placeholder {
  color: #5c5852;
}

.join-row input:focus {
  border-color: rgba(227, 255, 77, 0.55);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(227, 255, 77, 0.08);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #0a0a0b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.18s, transform 0.18s, background 0.18s, border-color 0.18s;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.primary:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.primary:disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--faint);
  cursor: not-allowed;
}

.join-btn {
  height: 52px;
  min-width: 134px;
  padding: 0 18px;
  white-space: nowrap;
}

.join-btn .icon {
  width: 16px;
  height: 16px;
}

.form-note {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--faint);
}

.form-error {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--bad);
}

.gate-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(22px, 3vh, 32px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--faint);
}

.gate-meta b {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.gate-brand .brand-mark {
  width: 26px;
  height: 26px;
}

.gate-brand .brand-copy b {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gate-brand .brand-copy small {
  display: block;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: var(--faint);
  white-space: nowrap;
}

/* =========================================================
   LOBBY
   ========================================================= */

.lobby-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  min-height: calc(100vh - var(--header-h) - 120px);
  padding: clamp(10px, 4vh, 50px) 0;
}

.lobby-copy h1 {
  margin: 18px 0 0;
  font-size: clamp(40px, 4.6vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: pre-line;
}

.lobby-sub {
  margin: 18px 0 0;
  max-width: 34em;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--dim);
}

.lobby-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.018);
}

.pill b {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.pill.accent {
  border-color: rgba(227, 255, 77, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.lobby-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.lobby-rule b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.lobby-rule span:first-child {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.lobby-feed {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.feed-label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

.feed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.feed-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.02);
  animation: chipIn 0.35s ease both;
}

.feed-empty {
  font-size: 11px;
  color: var(--faint);
}

.lobby-qr {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.qr-card {
  position: relative;
  width: clamp(280px, 25vw, 400px);
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}

.qr-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.qr-tag {
  position: absolute;
  top: -10px;
  left: 22px;
  height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: var(--accent);
  color: #0a0a0b;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.qr-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #0a0a0b;
  border-style: solid;
  border-width: 0;
}

.qr-corner.tl {
  top: 7px;
  left: 7px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.qr-corner.tr {
  top: 7px;
  right: 7px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.qr-corner.bl {
  bottom: 7px;
  left: 7px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.qr-corner.br {
  bottom: 7px;
  right: 7px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.qr-info {
  text-align: center;
  max-width: 380px;
}

.qr-info h2 {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.qr-info p {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
}

.qr-info code {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  word-break: break-all;
}

.qr-warn {
  margin-top: 12px !important;
  padding: 8px 10px;
  border: 1px solid rgba(255, 118, 112, 0.25);
  border-radius: 8px;
  background: rgba(255, 118, 112, 0.06);
  color: #ff9b96 !important;
  font-size: 10.5px !important;
}

body[data-mode="player"] .lobby-shell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

body[data-mode="player"] .lobby-qr {
  display: none;
}

body[data-mode="player"] .lobby-sub {
  margin-left: auto;
  margin-right: auto;
}

body[data-mode="player"] .lobby-pills,
body[data-mode="player"] .lobby-rule {
  justify-content: center;
}

body[data-mode="player"] .lobby-feed {
  width: 100%;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

body[data-mode="player"] .feed-chips {
  justify-content: center;
}

/* =========================================================
   ROUND
   ========================================================= */

.round {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 386px);
  align-items: center;
  gap: clamp(28px, 4vw, 60px);
}

.media-col {
  min-width: 0;
}

.media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.media-case {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.case-title {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elapsed {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

body[data-phase="question"] .live-dot {
  background: var(--bad);
  animation: pulse 1.6s infinite;
}

body[data-phase="revealed"] .live-dot {
  background: var(--accent);
}

.screen-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(12px, 2.2vh, 22px) 0 clamp(10px, 1.8vh, 18px);
}

.ambient {
  position: absolute;
  inset: 10% 9%;
  z-index: 0;
  border-radius: 42px;
  background-size: cover;
  background-position: center;
  filter: blur(46px) saturate(1.35);
  opacity: 0.34;
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 1;
  width: min(100%, calc(var(--video-maxh) * var(--ar, 1.7778)));
  aspect-ratio: var(--ar, 1.7778);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.58);
}

.screen.is-revealed {
  border-color: rgba(227, 255, 77, 0.22);
}

.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
  cursor: pointer;
}

.video-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.38) 100%);
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 0;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.play-overlay:hover .play-disc {
  transform: scale(1.05);
  border-color: rgba(227, 255, 77, 0.5);
}

.screen.is-playing .play-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-disc {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(9, 9, 11, 0.62);
  backdrop-filter: blur(12px);
  transition: transform 0.22s ease, border-color 0.22s;
}

.play-disc .icon {
  width: 27px;
  height: 27px;
  color: var(--accent);
  margin-left: 3px;
}

.play-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.video-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.video-loader i {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.video-error {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(7, 7, 8, 0.9);
  text-align: center;
  padding: 24px;
}

.video-error b {
  font-size: 14px;
}

.video-error span {
  font-size: 11px;
  color: var(--faint);
}

.player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px 11px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screen:hover .player-bar,
.screen:focus-within .player-bar,
.screen.is-paused .player-bar,
.screen.is-ended .player-bar {
  opacity: 1;
}

@media (hover: none) {
  .player-bar {
    opacity: 1;
  }
}

.pbtn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: background 0.16s;
}

.pbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pbtn .icon {
  width: 17px;
  height: 17px;
}

.ptime {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.66);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.ptime i {
  font-style: normal;
  opacity: 0.35;
  margin: 0 2px;
}

.pseek {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 20px;
  display: flex;
  align-items: center;
}

.pseek-track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.pseek-buffer,
.pseek-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
}

.pseek-buffer {
  background: rgba(255, 255, 255, 0.26);
}

.pseek-fill {
  background: var(--accent);
}

.pseek-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pseek:focus-within .pseek-track {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.screen-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 5;
  border-color: rgba(255, 255, 255, 0.22);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}

.screen-corner.tl {
  top: 13px;
  left: 13px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.screen-corner.tr {
  top: 13px;
  right: 13px;
  border-top-width: 1px;
  border-right-width: 1px;
}

.screen-corner.bl {
  bottom: 13px;
  left: 13px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.screen-corner.br {
  bottom: 13px;
  right: 13px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

.media-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 18px;
}

.media-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.media-status i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}

.screen.is-playing ~ .media-status i,
.media-status.is-playing i {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(227, 255, 77, 0.5);
}

.keys {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: #5e5a54;
  white-space: nowrap;
}

.keys span {
  margin: 0 2px;
  opacity: 0.5;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
}

/* ---------------- rail ---------------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.rail-top {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rail-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rail-state {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--faint);
  white-space: nowrap;
}

body[data-phase="question"] .rail-state {
  border-color: rgba(255, 118, 112, 0.24);
  color: #ff9b96;
}

body[data-phase="revealed"] .rail-state {
  border-color: rgba(227, 255, 77, 0.24);
  color: var(--accent);
}

.question {
  margin: 0;
  font-size: clamp(25px, 2.25vw, 34px);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.025em;
}

.round-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.round-title::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.round-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--faint);
}

.round-hint::before {
  content: "提示 · ";
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.75;
}

.panel {
  animation: panelIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ask {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 82px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.choice:hover:not(:disabled) {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.04);
}

.choice:active:not(:disabled) {
  transform: scale(0.994);
}

.choice:disabled {
  cursor: default;
}

.choice.is-selected {
  border-color: rgba(227, 255, 77, 0.62);
  background: rgba(227, 255, 77, 0.055);
  box-shadow: inset 0 0 0 1px rgba(227, 255, 77, 0.1);
}

.choice-absolute {
  border-color: rgba(255, 193, 99, 0.24);
  background:
    linear-gradient(160deg, rgba(255, 193, 99, 0.055), rgba(255, 193, 99, 0.012)),
    rgba(255, 255, 255, 0.012);
}

.choice-absolute.is-selected {
  border-color: rgba(227, 255, 77, 0.68);
  background: rgba(227, 255, 77, 0.06);
}

.choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.choice-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
  white-space: nowrap;
}

.choice-tag.absolute {
  border-color: rgba(255, 193, 99, 0.34);
  background: rgba(255, 193, 99, 0.07);
  color: var(--gold);
}

.choice-copy {
  display: block;
  min-width: 0;
}

.choice-copy b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.choice-tick {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.choice-tick .icon {
  width: 11px;
  height: 11px;
}

.choice.is-selected .choice-tick {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0a0b;
}

.submit {
  width: 100%;
  min-height: 48px;
  margin-top: 1px;
}

.keycap {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.55;
}

.ask .micro {
  margin-top: -2px;
}

.screen-hint {
  display: none;
  margin: 2px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--faint);
}

.screen-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.meter {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.meter-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 10.5px;
  color: var(--faint);
}

.meter-copy b {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--text);
}

.meter-copy span:nth-child(2) {
  opacity: 0.45;
}

.submitted {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(227, 255, 77, 0.28);
  border-radius: 13px;
  background: rgba(227, 255, 77, 0.045);
}

.submitted-check {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0b;
}

.submitted-check .icon {
  width: 18px;
  height: 18px;
}

.submitted-copy b {
  font-size: 13px;
}

.submitted-copy p {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: var(--dim);
}

.submitted-count {
  text-align: right;
}

.submitted-count b {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.1;
  color: var(--accent);
}

.submitted-count span {
  font-size: 9px;
  color: var(--faint);
}

.submitted-wait {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(227, 255, 77, 0.14);
  font-size: 10px;
  color: var(--faint);
}

/* ---------------- result ---------------- */

.result {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.result-head {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.answer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.answer-stamp {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 7px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.15;
  transform: rotate(-2deg);
  animation: stampIn 0.5s cubic-bezier(0.2, 1.3, 0.35, 1) both;
}

.answer-stamp.is-ai {
  color: var(--ai);
  border-color: rgba(200, 167, 255, 0.55);
  background: rgba(200, 167, 255, 0.08);
}

.answer-stamp.is-real {
  color: var(--real);
  border-color: rgba(116, 230, 199, 0.55);
  background: rgba(116, 230, 199, 0.08);
}

.verdict {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  white-space: nowrap;
}

.verdict.is-ok {
  border-color: rgba(227, 255, 77, 0.35);
  background: rgba(227, 255, 77, 0.06);
  color: var(--accent);
}

.verdict.is-bad {
  border-color: rgba(255, 118, 112, 0.35);
  background: rgba(255, 118, 112, 0.06);
  color: #ff9b96;
}

.verdict.is-none {
  color: var(--faint);
}

.points-gain {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.points-gain.is-zero {
  color: var(--faint);
}

.your-choice {
  margin: 0;
  font-size: 10.5px;
  color: var(--faint);
}

.answer-note {
  margin: 0;
  padding-left: 11px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
}

.answer-source {
  margin: -4px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: #5f5b55;
  word-break: break-word;
}

.answer-source:empty {
  display: none;
}

.stats-card {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.donut-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut circle {
  fill: none;
  stroke-width: 11;
}

.donut-track {
  stroke: rgba(255, 255, 255, 0.13);
}

.donut-fill {
  stroke: var(--accent);
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.donut-wrap.is-empty .donut-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}

.donut-center b {
  font-family: var(--mono);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  font-size: 7.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
}

.stats-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
}

.stat-chips b {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.stat-chips .ok b {
  color: var(--accent);
}

.stat-chips .bad b {
  color: #ff9b96;
}

.abstain {
  margin: -2px 0 0;
  font-size: 9px;
  color: #5f5b55;
}

.split {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.split-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.split-bar {
  display: flex;
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.split-bar i {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.seg-ai {
  background: var(--ai);
}

.seg-real {
  background: var(--real);
}

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 9px;
  color: var(--faint);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}

.legend.ai i {
  background: var(--ai);
}

.legend.real i {
  background: var(--real);
}

.legend b {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.legend.is-answer {
  color: var(--text);
}

.legend.is-answer b {
  color: var(--accent);
}

.waiting-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 2px;
  font-size: 10px;
  color: var(--faint);
}

.waiting-line i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s infinite;
}

.rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--faint);
}

.you-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.you-score b {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.you-score b[data-you-rank] {
  color: var(--text);
}

.you-score .dot {
  opacity: 0.4;
  margin: 0 2px;
}

.rail-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #5f5b55;
}

.rail-sync i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s infinite;
}

.screen-join {
  display: none;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-qr {
  width: 84px;
  height: 84px;
  padding: 5px;
  border-radius: 9px;
  background: #fff;
  flex: none;
}

.mini-qr img {
  display: block;
  width: 100%;
  height: 100%;
}

.screen-join b {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.screen-join span {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  word-break: break-all;
}

/* =========================================================
   FINISH
   ========================================================= */

.finish-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(4px, 2vh, 20px) 0 18px;
}

.finish-head {
  text-align: center;
}

.finish-head h1 {
  margin: 12px 0 0;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.finish-head p {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--faint);
}

.finish-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: clamp(26px, 4vh, 42px);
}

.personal-card,
.event-stats,
.board {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}

.personal-card {
  padding: 26px 24px;
}

.big-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.big-score > b {
  font-family: var(--mono);
  font-size: clamp(54px, 6vw, 76px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.big-score span {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
}

.big-score span b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--faint);
}

.personal-line {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--dim);
}

.personal-line b {
  color: var(--text);
}

.personal-rank {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--dim);
}

.personal-rank b {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--accent);
}

.dot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
  min-height: 12px;
}

.result-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.result-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(227, 255, 77, 0.25);
}

.result-dot.bad {
  background: var(--bad);
}

.result-dot.miss {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.personal-nick {
  margin: 20px 0 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.board {
  padding: 24px 24px 14px;
  min-width: 0;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.board-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.board-head span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--faint);
}

.lb-labels,
.leaderboard li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 66px 62px 62px;
  align-items: center;
  gap: 8px;
}

.lb-labels {
  margin-top: 18px;
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #5f5b55;
}

.lb-labels span:nth-child(n + 3) {
  text-align: right;
}

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard li {
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 12px;
}

.leaderboard li:last-child {
  border-bottom: 0;
}

.leaderboard li.is-me {
  background: rgba(227, 255, 77, 0.055);
  box-shadow: inset 2px 0 0 var(--accent);
}

.lb-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.leaderboard li:nth-child(-n + 3) .lb-rank {
  color: var(--accent);
}

.lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-points {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lb-correct,
.lb-acc {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lb-empty {
  margin: 18px 0;
  padding: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
}

.finish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.finish-qr {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finish-qr img {
  width: 74px;
  height: 74px;
  padding: 5px;
  border-radius: 9px;
  background: #fff;
}

.finish-qr b {
  display: block;
  font-size: 11px;
}

.finish-qr span {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--faint);
}

.finish-note {
  margin: 0;
  font-size: 10px;
  color: var(--faint);
}

body[data-mode="player"] .finish-qr {
  display: none;
}

body[data-mode="player"] .finish-foot {
  justify-content: center;
}

.event-stats {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 24px;
}

.event-stat b {
  display: block;
  font-family: var(--mono);
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.event-stat span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: var(--faint);
}

/* ---------------- awards ---------------- */

.finish-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.awards {
  padding: 22px 22px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}

.awards-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.awards-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.award {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.award:first-of-type {
  border-top: 0;
}

.award-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
}

.award-icon .icon {
  width: 16px;
  height: 16px;
}

.award-points .award-icon {
  color: var(--accent);
  border-color: rgba(227, 255, 77, 0.24);
}

.award-confident .award-icon {
  color: var(--gold);
  border-color: rgba(255, 193, 99, 0.28);
}

.award-sharp .award-icon {
  color: var(--real);
  border-color: rgba(116, 230, 199, 0.28);
}

.award-copy {
  min-width: 0;
}

.award-title {
  display: block;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.award-copy b {
  display: block;
  margin-top: 1px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.award-meta {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.awards-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.awards-step {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--faint);
  white-space: nowrap;
}

.award.is-pending {
  opacity: 0.5;
}

.award.is-pending .award-copy b {
  color: var(--faint);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.award.is-pending .award-icon {
  filter: grayscale(1);
  opacity: 0.55;
}

.award.is-cue {
  padding-left: 10px;
  border-radius: 10px;
  background: rgba(255, 193, 99, 0.045);
  box-shadow: inset 2px 0 0 rgba(255, 193, 99, 0.55);
}

.award:not(.is-pending) {
  animation: awardReveal 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes awardReveal {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- ceremony stage ---------------- */

.ceremony {
  margin-top: 16px;
  padding: 16px 20px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ceremony-title {
  margin: 5px 0 0;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.ceremony-line {
  margin: 7px 0 0;
  font-size: 10.5px;
  color: var(--faint);
}

.ceremony-winner {
  margin-top: 5px;
}

.ceremony-winner b {
  display: block;
  font-size: clamp(26px, 4.2vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ceremony-winner span {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--faint);
}

.ceremony.is-suspense {
  border-color: rgba(255, 193, 99, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 193, 99, 0.06),
    0 0 46px rgba(255, 193, 99, 0.07) inset;
}

.ceremony.is-suspense .ceremony-line {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  animation: suspensePulse 1.3s ease-in-out infinite;
}

.ceremony.is-revealed .ceremony-winner {
  animation: winnerPop 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes suspensePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

@keyframes winnerPop {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- locked final board ---------------- */

.board.is-locked .lb-labels,
.board.is-locked .leaderboard,
.board.is-locked .lb-empty {
  display: none;
}

.board-locked {
  margin: 20px 0 6px;
  padding: 26px 18px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.015);
}

/* ---------------- emoji fireworks ---------------- */

.fx-layer {
  position: fixed;
  inset: 64px 0 0;
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
}

.fx-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 193, 99, 0.16), transparent 55%);
  animation: fxFlash 0.9s ease-out forwards;
}

.fx-emoji {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: var(--size);
  line-height: 1;
  opacity: 0;
  will-change: transform, opacity;
  animation: fxBurst 2.2s cubic-bezier(0.16, 0.7, 0.3, 1) var(--delay) forwards;
}

@keyframes fxFlash {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}

@keyframes fxBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--scale))
      rotate(var(--rot));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-layer {
    display: none;
  }
}

body[data-mode="screen"] .ceremony {
  margin-top: 14px;
  padding: 20px 24px;
}

body[data-mode="screen"] .ceremony-title {
  font-size: 13px;
}

body[data-mode="screen"] .ceremony-winner b {
  font-size: clamp(34px, 4vw, 56px);
}

.personal-hidden {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--gold);
}

/* =========================================================
   EMPTY / BOOT / TOAST
   ========================================================= */

.empty-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58vh;
  text-align: center;
}

.empty-shell h1 {
  margin: 6px 0 0;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.03em;
}

.empty-shell p {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  width: 46px;
  height: 46px;
  color: var(--text);
  opacity: 0.9;
}

.boot-mark svg {
  width: 100%;
  height: 100%;
}

.boot-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--faint);
}

.boot-track {
  width: 150px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.boot-track i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: bootSweep 1.3s ease-in-out infinite;
}

.boot-retry {
  border: 1px solid rgba(255, 118, 112, 0.35);
  border-radius: 8px;
  background: rgba(255, 118, 112, 0.06);
  color: #ff9b96;
  padding: 8px 14px;
  font-size: 11px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  transform: translate(-50%, 12px);
  max-width: min(90vw, 460px);
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(18, 18, 21, 0.94);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
}

.toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.is-bad {
  border-color: rgba(255, 118, 112, 0.35);
  color: #ffb0ac;
}

.reconnect {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 193, 99, 0.3);
  border-radius: 999px;
  background: rgba(30, 24, 14, 0.92);
  font-size: 10px;
  color: #ffcf8a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.reconnect i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffcf8a;
  animation: pulse 1.4s infinite;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.shake {
  animation: shake 0.35s ease;
}

/* =========================================================
   SCREEN MODE
   ========================================================= */

body[data-mode="screen"] .main {
  max-width: 1760px;
  height: calc(100vh - var(--header-h));
  display: flex;
  padding: clamp(18px, 3vh, 34px) clamp(26px, 3.2vw, 56px);
}

body[data-mode="screen"] .view {
  width: 100%;
}

body[data-mode="screen"] .round {
  grid-template-columns: minmax(0, 1fr) clamp(400px, 27vw, 520px);
  align-items: center;
  gap: clamp(34px, 3.6vw, 64px);
  height: 100%;
}

body[data-mode="screen"] .media-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

body[data-mode="screen"] .media-head {
  margin-bottom: 4px;
}

body[data-mode="screen"] .case-title {
  font-size: 13px;
}

body[data-mode="screen"] .kicker {
  font-size: 10.5px;
  letter-spacing: 0.24em;
}

body[data-mode="screen"] .screen {
  border-radius: 22px;
}

body[data-mode="screen"] .play-disc {
  width: 92px;
  height: 92px;
}

body[data-mode="screen"] .play-disc .icon {
  width: 32px;
  height: 32px;
}

body[data-mode="screen"] .play-label {
  font-size: 9.5px;
}

body[data-mode="screen"] .rail {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  gap: 20px;
}

body[data-mode="screen"] .rail::-webkit-scrollbar {
  display: none;
}

body[data-mode="screen"] .question {
  font-size: clamp(32px, 2.55vw, 48px);
  line-height: 1.2;
}

body[data-mode="screen"] .round-title {
  font-size: 14px;
}

body[data-mode="screen"] .round-hint {
  font-size: 13px;
}

body[data-mode="screen"] .round-hint::before {
  font-size: 9.5px;
}

body[data-mode="screen"] .choice {
  min-height: 82px;
  padding: 14px 16px;
  cursor: default;
}

body[data-mode="screen"] .choice:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.018);
}

body[data-mode="screen"] .choice-copy b {
  font-size: 18px;
}

body[data-mode="screen"] .choice-copy small {
  font-size: 11px;
}

body[data-mode="screen"] .choice-glyph {
  width: 44px;
  height: 44px;
}

body[data-mode="screen"] .choice-glyph .icon {
  width: 23px;
  height: 23px;
}

body[data-mode="screen"] .submit,
body[data-mode="screen"] .micro {
  display: none;
}

body[data-mode="screen"] .screen-hint {
  display: block;
  font-size: 11px;
}

body[data-mode="screen"] .screen-progress {
  display: flex;
}

body[data-mode="screen"] .meter {
  height: 6px;
}

body[data-mode="screen"] .meter-copy {
  font-size: 11.5px;
}

body[data-mode="screen"] .meter-copy b {
  font-size: 21px;
}

body[data-mode="screen"] .answer-stamp {
  font-size: 30px;
  padding: 8px 18px;
}

body[data-mode="screen"] .verdict,
body[data-mode="screen"] .points-gain,
body[data-mode="screen"] .your-choice,
body[data-mode="screen"] .you-score {
  display: none !important;
}

body[data-mode="screen"] .answer-note {
  font-size: 14.5px;
  line-height: 1.72;
}

body[data-mode="screen"] .answer-source {
  font-size: 10px;
}

body[data-mode="screen"] .stats-card {
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  padding: 17px;
}

body[data-mode="screen"] .donut-center b {
  font-size: 30px;
}

body[data-mode="screen"] .donut-center span {
  font-size: 9px;
}

body[data-mode="screen"] .stat-chips {
  font-size: 10.5px;
  gap: 12px;
}

body[data-mode="screen"] .stat-chips b {
  font-size: 13px;
}

body[data-mode="screen"] .abstain {
  font-size: 10px;
}

body[data-mode="screen"] .split-head {
  font-size: 10px;
}

body[data-mode="screen"] .split-legend {
  font-size: 10px;
}

body[data-mode="screen"] .legend b {
  font-size: 11px;
}

body[data-mode="screen"] .waiting-line {
  font-size: 11px;
}

body[data-mode="screen"] .screen-join {
  display: flex;
  margin-top: auto;
}

body[data-mode="screen"] .rail-foot {
  padding-top: 9px;
}

body[data-mode="screen"] .score-chip {
  display: none !important;
}

body[data-mode="screen"] .lobby-shell {
  min-height: 100%;
  height: 100%;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.9fr);
  gap: clamp(40px, 6vw, 110px);
  padding: 0;
}

body[data-mode="screen"] .lobby-copy h1 {
  font-size: clamp(54px, 5vw, 84px);
}

body[data-mode="screen"] .lobby-sub {
  font-size: 15px;
}

body[data-mode="screen"] .lobby-feed {
  max-width: 780px;
}

body[data-mode="screen"] .feed-chip {
  font-size: 11.5px;
  height: 28px;
}

body[data-mode="screen"] .qr-card {
  width: clamp(300px, 25vw, 410px);
}

body[data-mode="screen"] .finish-shell {
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
  padding-bottom: 0;
}

body[data-mode="screen"] .finish-shell::-webkit-scrollbar {
  display: none;
}

body[data-mode="screen"] .finish-head h1 {
  font-size: clamp(46px, 4vw, 68px);
}

body[data-mode="screen"] .finish-grid {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 26px;
  margin-top: clamp(18px, 3vh, 32px);
}

body[data-mode="screen"] .board {
  padding: 20px 22px 10px;
}

body[data-mode="screen"] .leaderboard li {
  min-height: clamp(36px, 4.1vh, 48px);
  font-size: 14px;
}

body[data-mode="screen"] .lb-labels {
  margin-top: 12px;
}

body[data-mode="screen"] .lb-points {
  font-size: 17px;
}

body[data-mode="screen"] .lb-correct,
body[data-mode="screen"] .lb-acc {
  font-size: 11px;
}

body[data-mode="screen"] .event-stats {
  padding: 24px;
}

body[data-mode="screen"] .finish-foot {
  margin-top: 16px;
}

body[data-mode="screen"] .awards {
  padding: 18px 18px 8px;
}

body[data-mode="screen"] .awards-head h2 {
  font-size: 20px;
}

body[data-mode="screen"] .award {
  padding: 9px 0;
}

body[data-mode="screen"] .award-copy b {
  font-size: 17px;
}

body[data-mode="screen"] .finish-qr img {
  width: 84px;
  height: 84px;
}

body[data-mode="screen"] .toast {
  display: none;
}

/* ---------------- screen readability ---------------- */

body[data-mode="screen"] .brand-mark {
  width: 34px;
  height: 34px;
}

body[data-mode="screen"] .brand-copy b {
  font-size: 18px;
}

body[data-mode="screen"] .brand-copy small {
  font-size: 8.5px;
}

body[data-mode="screen"] .phase-chip {
  height: 32px;
  padding: 0 13px;
  font-size: 12px;
}

body[data-mode="screen"] .people-chip {
  font-size: 12px;
  gap: 8px;
}

body[data-mode="screen"] .people-chip .icon {
  width: 16px;
  height: 16px;
}

body[data-mode="screen"] .people-chip b {
  font-size: 14px;
}

body[data-mode="screen"] .clock {
  font-size: 14px;
}

body[data-mode="screen"] .keys {
  display: none;
}

body[data-mode="screen"] .media-status {
  font-size: 11px;
}

body[data-mode="screen"] .case-title {
  font-size: 15px;
}

body[data-mode="screen"] .elapsed {
  font-size: 12px;
}

body[data-mode="screen"] .rail-kicker .kicker {
  font-size: 11.5px;
}

body[data-mode="screen"] .rail-state {
  font-size: 11px;
  padding: 5px 10px;
}

body[data-mode="screen"] .round-title {
  font-size: 15px;
}

body[data-mode="screen"] .screen-hint {
  font-size: 13px;
}

body[data-mode="screen"] .meter-copy {
  font-size: 13px;
}

body[data-mode="screen"] .meter-copy b {
  font-size: 24px;
}

body[data-mode="screen"] .answer-stamp {
  font-size: 34px;
}

body[data-mode="screen"] .answer-note {
  font-size: 16px;
}

body[data-mode="screen"] .answer-source {
  font-size: 11px;
}

body[data-mode="screen"] .stats-card {
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

body[data-mode="screen"] .stat-chips {
  font-size: 13px;
  gap: 14px;
}

body[data-mode="screen"] .stat-chips b {
  font-size: 16px;
}

body[data-mode="screen"] .abstain {
  font-size: 11.5px;
}

body[data-mode="screen"] .split-head {
  font-size: 11.5px;
}

body[data-mode="screen"] .split-legend {
  font-size: 11.5px;
}

body[data-mode="screen"] .legend b {
  font-size: 13px;
}

body[data-mode="screen"] .waiting-line {
  font-size: 13px;
}

body[data-mode="screen"] .rail-foot {
  font-size: 10.5px;
}

body[data-mode="screen"] .screen-join .mini-qr {
  width: 110px;
  height: 110px;
  padding: 7px;
}

body[data-mode="screen"] .screen-join b {
  font-size: 14px;
}

body[data-mode="screen"] .screen-join span {
  font-size: 10.5px;
}

body[data-mode="screen"] .finish-qr img {
  width: 104px;
  height: 104px;
  padding: 6px;
}

body[data-mode="screen"] .finish-qr b {
  font-size: 13px;
}

body[data-mode="screen"] .finish-qr span {
  font-size: 11px;
}

body[data-mode="screen"] .finish-note {
  font-size: 12px;
}

body[data-mode="screen"] .board-head h2 {
  font-size: 22px;
}

body[data-mode="screen"] .board-head span {
  font-size: 10px;
}

body[data-mode="screen"] .lb-labels {
  font-size: 10px;
}

body[data-mode="screen"] .leaderboard li {
  font-size: 15px;
}

body[data-mode="screen"] .lb-points {
  font-size: 19px;
}

body[data-mode="screen"] .lb-correct,
body[data-mode="screen"] .lb-acc {
  font-size: 12.5px;
}

body[data-mode="screen"] .finish-head p {
  font-size: 14px;
}

body[data-mode="screen"] .finish-shell {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body[data-mode="screen"] .event-stat b {
  font-size: 48px;
}

body[data-mode="screen"] .event-stat span {
  font-size: 11.5px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1120px) {
  .round {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 32px;
  }

  .gate-shell {
    gap: 40px;
    padding-left: 40px;
    padding-right: 40px;
  }

  .gate-card h1 {
    font-size: 38px;
  }
}

@media (max-width: 960px) {
  .gate-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 28px;
    padding: 40px 22px;
  }

  .gate-shell::before {
    display: none;
  }

  .gate-art {
    display: none;
  }

  .gate-card {
    max-width: 520px;
  }

  .lobby-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 30px;
  }

  body[data-mode="screen"] .lobby-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 10px;
    padding-bottom: 20px;
  }

  body[data-mode="screen"] .lobby-qr {
    flex-direction: row;
    align-items: center;
  }

  .round {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }

  .media-col {
    width: 100%;
  }

  .rail {
    padding-bottom: 14px;
  }

  .finish-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .personal-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 24px;
  }

  .personal-card > .kicker {
    grid-column: 1 / -1;
  }

  .big-score {
    grid-row: span 2;
  }

  .dot-row,
  .personal-nick {
    grid-column: 1 / -1;
  }

  body[data-mode="screen"] .round {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    gap: 20px;
  }

  body[data-mode="screen"] .main {
    height: auto;
    min-height: calc(100vh - var(--header-h));
    overflow: auto;
  }

  body[data-mode="screen"] {
    height: auto;
    overflow: auto;
  }

  body[data-mode="screen"] .media-col {
    height: auto;
  }

  body[data-mode="screen"] .question {
    font-size: clamp(28px, 4vw, 38px);
  }

  body[data-mode="screen"] .finish-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --video-maxh: 52vh;
  }

  body {
    font-size: 14px;
  }

  .topbar {
    padding: 0 14px;
    gap: 10px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand {
    gap: 8px;
  }

  .brand-copy b {
    font-size: 13px;
  }

  .brand-copy small {
    display: none;
  }

  .top-center {
    gap: 7px;
  }

  .phase-chip {
    height: 25px;
    padding: 0 9px;
    font-size: 9.5px;
  }

  .people-chip {
    display: none;
  }

  .score-chip {
    height: 25px;
    padding: 0 8px;
  }

  .score-chip b {
    font-size: 13px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
  }

  .main {
    padding: 14px 14px 30px;
  }

  .gate-shell {
    padding: 26px 18px 34px;
  }

  .gate-card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .gate-card h1 {
    font-size: 33px;
  }

  .gate-lead {
    font-size: 12px;
  }

  .join-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .join-btn {
    width: 100%;
    height: 48px;
  }

  .join-row input {
    height: 48px;
  }

  .lobby-copy h1 {
    font-size: 36px;
  }

  .lobby-sub {
    font-size: 12px;
  }

  .lobby-shell {
    gap: 24px;
  }

  .lobby-rule {
    font-size: 9.5px;
  }

  .lobby-feed {
    margin-top: 24px;
  }

  .question {
    font-size: 22px;
  }

  .round {
    gap: 20px;
  }

  .case-title {
    font-size: 10px;
  }

  .elapsed {
    font-size: 9.5px;
  }

  .choices {
    gap: 7px;
  }

  .choice {
    min-height: 74px;
    padding: 9px 10px;
    gap: 6px;
  }

  .choice-copy b {
    font-size: 13.5px;
  }

  .choice-tag {
    height: 16px;
    padding: 0 5px;
    font-size: 6.8px;
  }

  .choice-tick {
    width: 16px;
    height: 16px;
  }

  .submit {
    min-height: 46px;
  }

  .keys {
    display: none;
  }

  .media-foot {
    justify-content: flex-start;
  }

  .answer-stamp {
    font-size: 22px;
    padding: 6px 11px;
  }

  .stats-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
  }

  .donut-center b {
    font-size: 18px;
  }

  .donut-center span {
    font-size: 6.5px;
  }

  .stat-chips {
    gap: 7px;
    font-size: 9px;
  }

  .stat-chips b {
    font-size: 10px;
  }

  .split-legend {
    gap: 4px 9px;
  }

  .ptime {
    display: none;
  }

  .player-bar {
    gap: 5px;
    padding: 10px 9px 9px;
  }

  .pbtn {
    width: 30px;
    height: 30px;
  }

  .screen {
    border-radius: 14px;
  }

  .play-disc {
    width: 64px;
    height: 64px;
  }

  .play-label {
    font-size: 8px;
  }

  .finish-head h1 {
    font-size: 38px;
  }

  .finish-grid {
    margin-top: 22px;
    gap: 14px;
  }

  .personal-card {
    display: block;
    padding: 20px;
  }

  .big-score b {
    font-size: 52px;
  }

  .board {
    padding: 18px 14px 8px;
  }

  .board-head h2 {
    font-size: 17px;
  }

  .board-head span {
    font-size: 7.5px;
    text-align: right;
  }

  .lb-labels,
  .leaderboard li {
    grid-template-columns: 34px minmax(0, 1fr) 52px 48px;
    gap: 6px;
  }

  .lb-labels span:last-child,
  .leaderboard li .lb-acc {
    display: none;
  }

  .leaderboard li {
    padding: 0 6px;
  }

  .lb-labels {
    padding-left: 6px;
    padding-right: 6px;
  }

  .toast {
    bottom: 16px;
    font-size: 11px;
  }

  .screen-join {
    gap: 10px;
  }
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stampIn {
  from {
    opacity: 0;
    transform: rotate(-7deg) scale(1.18);
  }
  to {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 118, 112, 0.4);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 0 4px rgba(255, 118, 112, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  from {
    top: 12%;
    opacity: 0.15;
  }
  to {
    top: 88%;
    opacity: 0.55;
  }
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootSweep {
  0% {
    transform: translateX(-110%);
  }
  55% {
    transform: translateX(160%);
  }
  100% {
    transform: translateX(300%);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.screen:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.screen:fullscreen video {
  object-fit: contain;
}

@media (max-height: 860px) {
  body[data-mode="screen"] .question {
    font-size: clamp(26px, 2.2vw, 34px);
  }

  body[data-mode="screen"] .round-hint {
    font-size: 12px;
  }

  body[data-mode="screen"] .round-title {
    font-size: 13px;
  }

  body[data-mode="screen"] .choices {
    gap: 7px;
  }

  body[data-mode="screen"] .choice {
    min-height: 76px;
    padding: 9px 11px;
    gap: 6px;
  }

  body[data-mode="screen"] .choice-copy b {
    font-size: 15px;
  }

  body[data-mode="screen"] .choice-tag {
    height: 16px;
    font-size: 7px;
  }

  body[data-mode="screen"] .screen-join .mini-qr {
    width: 88px;
    height: 88px;
    padding: 5px;
  }

  body[data-mode="screen"] .screen-join b {
    font-size: 12px;
  }

  body[data-mode="screen"] .screen-join span {
    font-size: 9px;
  }

  body[data-mode="screen"] .stats-card {
    grid-template-columns: 118px minmax(0, 1fr);
    padding: 13px;
    gap: 14px;
  }

  body[data-mode="screen"] .answer-note {
    font-size: 13.5px;
  }

  body[data-mode="screen"] .waiting-line {
    font-size: 11.5px;
  }

  body[data-mode="screen"] .event-stats {
    display: none;
  }

  body[data-mode="screen"] .screen {
    border-radius: 18px;
  }
}

@media (max-height: 860px) and (min-width: 961px) {
  body[data-mode="screen"][data-phase="revealed"] .rail-top .question,
  body[data-mode="screen"][data-phase="revealed"] .rail-top .round-hint {
    display: none;
  }

  body[data-mode="screen"][data-phase="revealed"] .rail {
    gap: 12px;
  }

  body[data-mode="screen"][data-phase="revealed"] .result {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* screen finish: keep the ceremony and board inside one projector frame */
body[data-mode="screen"] .finish-shell {
  justify-content: safe center;
}

body[data-mode="screen"] .finish-head h1 {
  margin-top: 8px;
  font-size: clamp(40px, 3.4vw, 56px);
}

body[data-mode="screen"] .finish-head p {
  margin-top: 8px;
  font-size: 13px;
}

body[data-mode="screen"] .finish-grid {
  margin-top: 16px;
}

body[data-mode="screen"] .ceremony {
  margin-top: 10px;
  padding: 14px 22px 12px;
}

body[data-mode="screen"] .ceremony-title {
  margin-top: 4px;
  font-size: 20px;
}

body[data-mode="screen"] .ceremony-line {
  margin-top: 5px;
  font-size: 15px;
}

body[data-mode="screen"] .ceremony-winner {
  margin-top: 2px;
}

body[data-mode="screen"] .ceremony-winner b {
  font-size: clamp(34px, 3.4vw, 50px);
}

body[data-mode="screen"] .fx-layer {
  top: 108px;
}

body[data-mode="screen"] .awards {
  padding: 14px 16px 6px;
}

body[data-mode="screen"] .awards-head h2 {
  font-size: 18px;
}

body[data-mode="screen"] .award {
  padding: 7px 0;
}

body[data-mode="screen"] .event-stats {
  display: none;
}

body[data-mode="screen"] .finish-foot {
  margin-top: 10px;
}

body[data-mode="screen"] .finish-qr img {
  width: 68px;
  height: 68px;
}

body[data-mode="screen"] .finish-note {
  font-size: 11px;
}

/* short projectors: keep the ceremony and board on one frame */
@media (max-height: 820px) {
  body[data-mode="screen"] .finish-foot {
    display: none;
  }

  body[data-mode="screen"] .finish-head h1 {
    font-size: clamp(34px, 3vw, 46px);
  }

  body[data-mode="screen"] .ceremony {
    margin-top: 6px;
    padding: 10px 18px 9px;
  }

  body[data-mode="screen"] .ceremony-winner b {
    font-size: clamp(28px, 3vw, 40px);
  }

  body[data-mode="screen"] .finish-grid {
    margin-top: 10px;
  }

  body[data-mode="screen"] .awards {
    padding: 10px 14px 4px;
  }

  body[data-mode="screen"] .award {
    padding: 5px 0;
  }
}
