@font-face {
  font-family: Silkscreen;
  src: url('/assets/fonts/Silkscreen-Regular.ttf') format('truetype');
  font-display: swap;
}
:root {
  color-scheme: dark;
  scrollbar-gutter: stable;
  --back: #170f1c;
  --ink: #f6ead9;
  --muted: #c4aec7;
  --muted-strong: #d7c3d7;
  --line: #55405b;
  --panel: #26192b;
  --gold: #f5c773;
  --coral: #ff918f;
  --mint: #a6e4ca;
  font-family: system-ui, sans-serif;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--back); }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--back); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
a { color: var(--gold); text-underline-offset: .2em; }
button, a.button {
  appearance: none;
  min-height: 2.75rem;
  padding: .62rem .9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 650;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
button:hover, a.button:hover { border-color: var(--gold); }
button:disabled { cursor: default; opacity: .62; }
.primary, a.primary { background: var(--gold); color: #26172b; border-color: var(--gold); }
.primary:hover:not(:disabled), a.primary:hover { background: #ffe0a4; }
.host-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .8rem max(1rem, calc((100% - 98rem) / 2));
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--ink); font: 1.05rem Silkscreen, monospace; text-decoration: none;
}
.logo-mark {
  width: 1.25rem; height: 1.2rem; position: relative; background: var(--coral);
  clip-path: polygon(0 0,100% 0,100% 72%,72% 72%,72% 100%,28% 100%,28% 72%,0 72%);
}
.logo-mark::after {
  content: ''; position: absolute; width: .25rem; height: .33rem; top: .25rem; left: .23rem;
  background: var(--back); box-shadow: .54rem 0 var(--back);
}
#channel-status { color: var(--mint); font-size: .875rem; }
.host-room { width: min(calc(100% - 2rem), 98rem); margin: 1rem auto 2rem; }
.host-room p { line-height: 1.5; }
.host-room #error { color: var(--coral); }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
#setup { width: min(100%, 77rem); margin: 0 auto; padding-inline: clamp(0rem, 2vw, 1.5rem); }
.landing-hero, .landing-play {
  display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: clamp(1.8rem, 4.7vw, 4.6rem); align-items: center;
}
.landing-hero { padding-block: clamp(2.8rem, 5.5vw, 5.25rem) clamp(2.5rem, 5vw, 4.5rem); }
.landing-intro h1 {
  color: var(--ink); font: 400 clamp(2.5rem, 5.25vw, 5.25rem)/.94 Silkscreen, monospace;
  letter-spacing: -.07em; margin: 0 0 1.35rem;
}
.landing-intro h1 span { display: block; }
.landing-lead { max-width: 24ch; margin: 0; font-size: clamp(1.18rem, 2vw, 1.6rem); font-weight: 650; }
.landing-rules { max-width: 38ch; color: var(--muted-strong); margin: .8rem 0 0; }
.landing-timing { color: var(--gold); margin: .75rem 0 1.4rem; font-size: .95rem; }
.landing-intro .primary {
  min-height: 3rem; padding-inline: 1.2rem; background: var(--mint); border-color: var(--mint);
}
.landing-intro .primary:hover:not(:disabled) { background: #c4f2df; border-color: #c4f2df; }
#setup-help { color: var(--muted-strong); margin: .65rem 0 0; font-size: .86rem; }
.landing-preview { min-width: 0; margin: 0; }
.landing-screen {
  display: grid; position: relative; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-top: 3px solid var(--gold); background: #25263d;
}
.landing-screen video { display: block; width: 100%; height: 100%; min-height: 0; }
.landing-screen button {
  position: absolute; inset: 0; display: grid; place-items: end start; border: 0;
  border-radius: 0; background: transparent; padding: clamp(.5rem, 1.15vw, 1rem);
}
.play-label {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  white-space: nowrap; font-size: .9rem; background: var(--back); border: 1px solid var(--gold);
  min-height: 2.75rem; padding-inline: .75rem; border-radius: 4px;
}
.landing-screen button:hover { color: var(--gold); }
.play-icon {
  width: 0; height: 0; border-block: .4rem solid transparent; border-left: .64rem solid var(--gold);
}
.landing-preview figcaption { margin-top: .65rem; color: var(--muted); font-size: .82rem; }
.landing-play {
  border-top: 1px solid var(--line); grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  padding-block: clamp(2.2rem, 5vw, 4rem);
}
.landing-play h2 {
  margin: 0; max-width: 18ch; color: var(--ink);
  font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; letter-spacing: -.025em;
}
.landing-play p { max-width: 46ch; margin: .85rem 0 0; color: var(--muted-strong); }
.landing-play p strong { color: var(--ink); }
.landing-play .landing-stream { margin-top: 1.25rem; }
.landing-podium { width: 100%; height: auto; border-bottom: 2px solid var(--gold); display: block; }
.ending-actions { display: grid; gap: .55rem; text-align: center; }
.game-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: .6rem; margin-bottom: .75rem;
}
.game-toolbar h2 { margin: 0; font: bold clamp(1.35rem, 3vw, 1.8rem) Georgia, serif; letter-spacing: -.035em; }
.game-toolbar button { font-size: .85rem; }
#stage-view { min-width: 10rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 1.15rem; align-items: start; }
#game:focus { outline: none; }
.stage-only .game-toolbar h2 { visibility: hidden; }
#host-controls { padding: .9rem 0 0 1rem; border-left: 1px solid var(--line); }
#host-controls h3 { margin: 0; font-size: 1.05rem; }
.round-header { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
#host-clock { color: var(--gold); font-weight: 650; font-variant-numeric: tabular-nums; }
#host-clock.urgent { color: var(--coral); }
#instruction { min-height: 3em; margin: .65rem 0 1rem; }
.letters { display: grid; gap: .45rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.letters:empty, #vote-status:empty { display: none; }
.letters button { padding-inline: 0; }
.option-text { display: none; }
#vote-status { color: var(--muted-strong); font-size: .875rem; font-variant-numeric: tabular-nums; }
.shortcuts { color: var(--muted); font-size: .8rem; margin: 1.15rem 0 0; }
kbd { color: var(--ink); font-size: .85rem; }

.unity-frame {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9;
  width: min(100%, max(36rem, calc((100dvh - 9rem) * 16 / 9)));
  overflow: hidden; background: #25263d;
}
#unity-canvas { display: block; width: 100%; height: 100%; }
#unity-loading {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; justify-items: center;
  gap: .75rem; padding: 1rem; text-align: center;
  background: inherit;
}
#unity-loading p { margin: 0; }
#unity-loading progress { accent-color: var(--gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 46rem) {
  .landing-hero, .landing-play { grid-template-columns: minmax(0, 1fr); }
  .landing-intro h1 { font-size: clamp(2.5rem, 9.5vw, 4.5rem); }
  .landing-hero { padding-top: clamp(2.1rem, 6vw, 3rem); }
}
@media (max-width: 56rem) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  #host-controls { padding: 1rem 0 0; border: 0; border-top: 1px solid var(--line); }
  #instruction { min-height: 0; }
}
@media (max-width: 30rem) {
  .play-detail { display: none; }
  #answer-shortcut { display: none; }
  .host-bar { align-items: center; }
  #channel-status { text-align: right; }
  .game-toolbar { align-items: flex-start; }
  #prompt { position: static; width: auto; height: auto; margin: .65rem 0 0; clip-path: none; white-space: normal; font-weight: 650; }
  #options { grid-template-columns: 1fr; }
  #options button { display: flex; align-items: baseline; gap: .7rem; padding-inline: .8rem; text-align: left; }
  .option-text { display: inline; font-weight: 450; }
}
