@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 700; font-display: swap; font-style: normal;
}

:root {
  /* Two faces doing two jobs: Space Grotesk has the character for display
   * sizes and distinctive numerals; Inter is what stays legible at 13px. */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;

  /* Type scale */
  --t-hero: clamp(2.9rem, 15vw, 4rem);
  --t-xl: 2rem;
  --t-lg: 1.3rem;
  --t-md: 1rem;
  --t-sm: 0.875rem;
  --t-xs: 0.78rem;
  --t-label: 0.68rem;

  --bg: #06070c;
  --ink: #f3f6fd;
  --muted: #959eb5;
  --faint: #626b80;

  --accent: #5b8cff;
  --accent-2: #a56bff;
  --danger: #ff4d6d;
  --good: #2fe08a;
  --warn: #ffc14d;

  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-bright: rgba(255, 255, 255, 0.17);
  --veil: rgba(10, 12, 20, 0.74);

  --radius: 18px;
  --radius-sm: 13px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 1px var(--hair), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* The UA rule for [hidden] is display:none at the lowest specificity, so any
 * class here that sets display would quietly beat it - leaving, in one case,
 * a full-screen overlay that ate every click. */
[hidden] { display: none !important; }

/* The page colour lives on html alone. Put it on body too and body's own
 * background paints over its negative-z-index pseudo-elements, hiding the
 * backdrop - and clearing it on both leaves the canvas white. */
html { background: var(--bg); }
body { background-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

/* Keeps the sprite out of layout while leaving its gradients resolvable -
 * display:none would stop some browsers finding them. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- the room behind the glass ---------------------------------------- */

body::before, body::after {
  content: ""; position: fixed; z-index: -2;
  width: 115vmax; height: 115vmax; border-radius: 50%;
  filter: blur(70px); opacity: 0.5; pointer-events: none;
}
body::before {
  top: -55vmax; left: -40vmax;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.5), transparent 62%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
body::after {
  bottom: -62vmax; right: -45vmax;
  background: radial-gradient(circle, rgba(165, 107, 255, 0.42), transparent 62%);
  animation: drift-b 31s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.14); } }
@keyframes drift-b { to { transform: translate3d(-12vmax, -9vmax, 0) scale(1.1); } }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.4; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.view { max-width: 30rem; margin: 0 auto; padding-bottom: 76px; position: relative; }

/* ---- icons ------------------------------------------------------------- */

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; stroke-width: 1.9; }

.iconbtn {
  display: grid; place-items: center;
  width: 42px; height: 42px; padding: 0;
  color: var(--muted);
  background: var(--glass); border: 1px solid var(--hair);
  border-radius: 12px; cursor: pointer;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: color 0.18s, border-color 0.18s, transform 0.12s var(--ease);
}
.iconbtn:hover { color: var(--ink); border-color: var(--hair-bright); }
.iconbtn:active { transform: scale(0.94); }

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

/* ---- layout ------------------------------------------------------------ */

.pane { display: flex; flex-direction: column; gap: 15px; }
.pane-centred { min-height: 78vh; justify-content: center; text-align: center; }

.pane > * { animation: rise 0.42s var(--ease) both; }
.pane > *:nth-child(1) { animation-delay: 0.02s; }
.pane > *:nth-child(2) { animation-delay: 0.06s; }
.pane > *:nth-child(3) { animation-delay: 0.1s; }
.pane > *:nth-child(4) { animation-delay: 0.14s; }
.pane > *:nth-child(5) { animation-delay: 0.18s; }
.pane > *:nth-child(6) { animation-delay: 0.22s; }
.pane > *:nth-child(n+7) { animation-delay: 0.26s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }

.sectionhead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 4px;
}

/* ---- type -------------------------------------------------------------- */

.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-mark {
  width: 84px; height: 84px;
  fill: none; stroke: url(#g-brand); stroke-width: 1.15;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 8px 26px rgba(123, 110, 255, 0.45));
  animation: hover-mark 5.5s ease-in-out infinite;
}
.hero-mark-danger { stroke: var(--danger); width: 64px; height: 64px; }
@keyframes hover-mark { 50% { transform: translateY(-6px); } }

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-hero); font-weight: 700;
  letter-spacing: -0.045em; line-height: 0.95;
  background: linear-gradient(104deg, #fff 10%, var(--accent) 50%, var(--accent-2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 0; color: var(--muted); font-size: var(--t-md); line-height: 1.45; }

.h2 {
  margin: 0; display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.022em;
}
.h3 {
  margin: 12px 0 -2px; display: flex; align-items: center; gap: 7px;
  font-size: var(--t-xs); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.label {
  font-size: var(--t-label); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
}
.panel-title {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: var(--t-md); font-weight: 700; letter-spacing: -0.015em;
}
.muted { color: var(--muted); }
.hint { margin: 0; color: var(--muted); font-size: var(--t-sm); min-height: 1.3em; }
.hint-centred { text-align: center; }
.footnote {
  margin: 2px 0 0; display: flex; align-items: center; justify-content: center;
  gap: 7px; color: var(--faint); font-size: var(--t-xs);
}

/* ---- glass surfaces ---------------------------------------------------- */

.hostbox, .players li, .roster li, .clues li, .votegrid button, .verdict,
.timer, .sheet-card, .joinpanel, .turnbar, input, select {
  background: var(--glass);
  border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

/* ---- controls ---------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; text-align: left; flex: 1; }
.field > span {
  font-size: var(--t-label); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}
.field-row { display: flex; gap: 11px; }

input, select {
  width: 100%; padding: 14px 15px;
  font-family: var(--font-ui);
  font-size: 16px; /* anything smaller and iOS zooms the viewport on focus */
  font-weight: 500; color: var(--ink);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.16);
}

/* Four boxes, one character each, focus hopping as you type - the pattern
 * everyone already knows from one-time codes. */
.code-entry { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.code-slot {
  padding: 0; height: 64px; text-align: center;
  font-family: var(--font-display);
  font-size: 1.85rem; font-weight: 700; text-transform: uppercase;
  caret-color: var(--accent);
}
.code-slot:not(:placeholder-shown) { border-color: var(--hair-bright); }

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-weight: 650; font-size: var(--t-md); letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  cursor: pointer; touch-action: manipulation;
  transition: transform 0.12s var(--ease), box-shadow 0.2s, filter 0.2s;
}
.btn-lg { padding: 17px 20px; font-size: 1.02rem; }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn:disabled:active { transform: none; }

.btn-primary {
  color: #060913; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(91, 140, 255, 0.32);
}
.btn-primary:not(:disabled):hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--hair); backdrop-filter: none; }
.btn-small { padding: 10px 14px; font-size: var(--t-sm); border-radius: 11px; }
.btn-leave { align-self: center; color: var(--faint); margin-top: 4px; }

.check { display: flex; align-items: center; gap: 11px; text-align: left; }
.check input { width: 21px; height: 21px; flex: none; accent-color: var(--accent); }

.rule {
  display: flex; align-items: center; gap: 14px;
  color: var(--faint); font-size: var(--t-xs);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.rule::before, .rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hair), transparent);
}

/* ---- the room code ----------------------------------------------------- */

.roomhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.headright { display: flex; align-items: center; gap: 9px; }

.code-display { display: flex; gap: 7px; margin-top: 6px; }
.code-display b {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.7rem;
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  border-radius: 11px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--hair-bright);
  animation: pop-in 0.4s var(--ease) both;
}
.code-display b:nth-child(2) { animation-delay: 0.05s; }
.code-display b:nth-child(3) { animation-delay: 0.1s; }
.code-display b:nth-child(4) { animation-delay: 0.15s; }

/* QR and its explanation are one object, not two stacked blocks. */
.joinpanel {
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  gap: 15px; padding: 14px; border-radius: var(--radius);
  box-shadow: var(--ring);
}
.joinpanel canvas {
  width: 124px; height: 124px; image-rendering: pixelated;
  border-radius: 12px; background: #fff; padding: 8px;
  box-shadow: 0 0 36px rgba(91, 140, 255, 0.24);
}
.joinpanel-say { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.joinpanel-say b { color: var(--ink); font-weight: 600; word-break: break-all; }

/* ---- the roster -------------------------------------------------------- */

.roster {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
}
.roster li {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  box-shadow: var(--ring); min-width: 0;
  animation: pop-in 0.34s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.roster .who {
  flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: var(--t-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.roster li.gone { opacity: 0.42; }
.roster .mark { flex: none; display: grid; place-items: center; }
.roster .mark-host { color: var(--warn); }
.roster .mark-done { color: var(--good); }
.roster .mark-you { color: var(--accent); }
.roster .kick {
  flex: none; background: none; border: 0; color: var(--faint);
  display: grid; place-items: center; cursor: pointer; padding: 2px;
}
.roster .kick:hover { color: var(--danger); }

/* A colour and an initial per player - far faster to read than names. */
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 0.9rem; font-weight: 700; color: #07080d;
  background: linear-gradient(145deg, hsl(var(--h) 90% 72%), hsl(var(--h2) 85% 58%));
  box-shadow: 0 4px 14px hsl(var(--h) 80% 50% / 0.3);
}
.avatar-lg { width: 46px; height: 46px; border-radius: 14px; font-size: 1.2rem; }

.tag {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; color: var(--faint);
  border: 1px solid var(--hair); padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.tag-host { color: var(--warn); border-color: rgba(255, 193, 77, 0.4); }
.tag-imposter {
  color: var(--danger); border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.1);
}
.tag-you { color: var(--accent); border-color: rgba(91, 140, 255, 0.45); }
.tag-done { color: var(--good); border-color: rgba(47, 224, 138, 0.42); }

/* ---- host settings, folded away until wanted --------------------------- */

.hostbox { border-radius: var(--radius); box-shadow: var(--ring); overflow: hidden; }
.hostbox summary {
  /* Title and summary stack in one column so neither has to truncate. */
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "ico title chev" "ico sum chev";
  align-items: center; column-gap: 11px;
  padding: 13px 15px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: var(--t-sm);
}
.hostbox summary > .icon:first-of-type { grid-area: ico; }
.hostbox summary > span { grid-area: title; }
.hostbox summary > .chevron { grid-area: chev; }
.hostbox summary::-webkit-details-marker { display: none; }
.hostbox summary em {
  grid-area: sum; font-style: normal;
  color: var(--faint); font-size: var(--t-xs); font-weight: 450;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hostbox summary .chevron { transition: transform 0.22s var(--ease); color: var(--faint); }
.hostbox[open] summary .chevron { transform: rotate(90deg); }
.hostbox-body {
  display: flex; flex-direction: column; gap: 14px;
  padding: 2px 15px 16px;
  border-top: 1px solid var(--hair);
  margin-top: -1px; padding-top: 15px;
}

/* ---- waiting ----------------------------------------------------------- */

.waiting {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 0;
}
.waiting-masks { display: flex; gap: 14px; color: var(--faint); }
.waiting-masks .icon { width: 28px; height: 28px; animation: breathe 1.8s ease-in-out infinite; }
.waiting-masks .icon:nth-child(2) { animation-delay: 0.22s; }
.waiting-masks .icon:nth-child(3) { animation-delay: 0.44s; }
@keyframes breathe {
  50% { opacity: 0.35; transform: translateY(-4px); }
}

/* ---- the card ---------------------------------------------------------- */

.card {
  display: block; width: 100%; padding: 0;
  background: none; border: 0; backdrop-filter: none;
  perspective: 1200px; cursor: pointer; font: inherit; color: inherit;
}
.card-inner {
  position: relative; display: block; width: 100%; height: 14rem;
  transform-style: preserve-3d;
  transition: transform 0.72s var(--ease);
}
.card:not(.card-hidden) .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: 22px; text-align: center;
  border-radius: 22px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--glass); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.card-back {
  color: var(--faint);
  background:
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, 0.035) 0 11px, transparent 11px 22px),
    var(--glass);
}
.card-glyph {
  width: 54px; height: 54px;
  fill: none; stroke: url(#g-brand); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.85;
}
.card-tap {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--t-sm); color: var(--faint);
}
.card-front { transform: rotateY(180deg); }

.card-role {
  font-size: var(--t-label); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); font-weight: 700;
}
.card-word {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.05;
}
.card-category { color: var(--muted); font-size: var(--t-sm); }

.card.is-imposter .card-front {
  border-color: rgba(255, 77, 109, 0.55);
  background:
    radial-gradient(130% 90% at 50% 0%, rgba(255, 77, 109, 0.22), transparent 68%),
    var(--glass);
  box-shadow: var(--shadow), 0 0 54px rgba(255, 77, 109, 0.3);
  animation: menace 2.6s ease-in-out infinite;
}
.card.is-imposter .card-role { color: var(--danger); }
.card.is-imposter .card-word {
  background: linear-gradient(100deg, #fff, var(--danger));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes menace { 50% { box-shadow: var(--shadow), 0 0 74px rgba(255, 77, 109, 0.46); } }

/* ---- the table --------------------------------------------------------- */

.turnbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--veil); box-shadow: var(--ring);
}
.turnbar-who { min-width: 0; }

.clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.clues li {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  box-shadow: var(--ring);
  animation: pop-in 0.34s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.clues .who {
  color: var(--faint); font-size: var(--t-xs); min-width: 4.2rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clues .said {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em;
}
.clues-compact li { padding: 7px 11px; }
.clues-compact .avatar { width: 25px; height: 25px; border-radius: 8px; font-size: 0.72rem; }
.clues li.pending { opacity: 0.45; }
.clues li.pending .said { font-style: italic; font-weight: 500; }

.composer {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; gap: 9px; padding: 12px 0 4px;
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.composer input { flex: 1; }
.composer .btn { padding-inline: 18px; }

.timer {
  position: relative; width: 44px; height: 44px; flex: none;
  border-radius: 50%; padding: 0; display: grid; place-items: center;
  box-shadow: var(--ring);
}
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 3; stroke-linecap: round; }
.timer .track { stroke: rgba(255, 255, 255, 0.1); }
.timer .lead { stroke: var(--accent); transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.timer span {
  font-family: var(--font-display);
  font-size: 0.84rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer.urgent .lead { stroke: var(--danger); }
.timer.urgent span { color: var(--danger); }
.timer.urgent { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---- voting ------------------------------------------------------------ */

.votegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.votegrid button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 12px;
  font-family: var(--font-ui); font-weight: 650; color: var(--ink);
  border-radius: var(--radius); cursor: pointer;
  box-shadow: var(--ring);
  transition: transform 0.14s var(--ease), border-color 0.2s, box-shadow 0.2s;
  animation: pop-in 0.34s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.votegrid button:active { transform: scale(0.96); }
.votegrid button.picked {
  border-color: rgba(91, 140, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.5), 0 10px 32px rgba(91, 140, 255, 0.28);
}
.votegrid button.picked::after {
  content: "\2713"; position: absolute; top: 8px; right: 11px;
  font-size: 0.82rem; color: var(--accent);
}
.votegrid button:disabled { opacity: 0.4; }
.votegrid .sub {
  font-weight: 450; font-size: var(--t-xs); color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- results ----------------------------------------------------------- */

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.players li {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 10px 13px; border-radius: var(--radius-sm);
  box-shadow: var(--ring);
  animation: pop-in 0.34s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.players .who { flex: 1 1 7rem; font-weight: 600; font-size: var(--t-sm); }
.players .score {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem;
}
.scoreboard li:first-child {
  border-color: rgba(255, 193, 77, 0.38);
  background:
    linear-gradient(100deg, rgba(255, 193, 77, 0.12), transparent 60%), var(--glass);
}
.scoreboard .rank {
  flex: none; width: 1.3rem; text-align: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-sm); color: var(--faint);
}

.verdict {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 22px 18px; border-radius: var(--radius); text-align: center;
  font-family: var(--font-display);
  font-size: 1.42rem; font-weight: 700; letter-spacing: -0.03em;
  box-shadow: var(--ring);
  animation: slam 0.6s var(--ease) both;
}
.verdict-icon { width: 30px; height: 30px; stroke-width: 1.6; }
.verdict.crew {
  color: var(--good); border-color: rgba(47, 224, 138, 0.42);
  background: radial-gradient(110% 130% at 50% 0%, rgba(47, 224, 138, 0.2), transparent 70%), var(--glass);
  box-shadow: var(--ring), 0 0 56px rgba(47, 224, 138, 0.22);
}
.verdict.imposter {
  color: var(--danger); border-color: rgba(255, 77, 109, 0.45);
  background: radial-gradient(110% 130% at 50% 0%, rgba(255, 77, 109, 0.22), transparent 70%), var(--glass);
  box-shadow: var(--ring), 0 0 56px rgba(255, 77, 109, 0.24);
}
@keyframes slam {
  0% { opacity: 0; transform: scale(1.16); filter: blur(7px); }
  100% { opacity: 1; transform: none; filter: none; }
}

.reveal-word { margin: 0; text-align: center; font-size: var(--t-sm); color: var(--muted); }
.reveal-word strong {
  display: block; font-family: var(--font-display);
  font-size: var(--t-xl); font-weight: 700;
  letter-spacing: -0.035em; color: var(--ink); margin-top: 2px;
}

.guessbox { display: flex; flex-direction: column; gap: 14px; }

#confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

/* ---- chrome ------------------------------------------------------------ */

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

.banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: max(12px, env(safe-area-inset-top));
  z-index: 50; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #ff4d6d, #ff7a4d);
  color: #1b0509; font-weight: 650; font-size: var(--t-sm);
  box-shadow: 0 12px 34px rgba(255, 77, 109, 0.4);
  animation: pop-in 0.26s var(--ease) both;
}
.banner.info {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #060913; box-shadow: 0 12px 34px rgba(91, 140, 255, 0.4);
}

.conn {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 25; padding: 9px 17px; border-radius: 999px;
  background: var(--veil); border: 1px solid var(--hair);
  color: var(--muted); font-size: var(--t-xs); font-weight: 600;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.conn::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  margin-right: 8px; border-radius: 50%; background: var(--warn);
  animation: pulse 1.1s ease-in-out infinite;
}

.soundbtn {
  position: fixed; z-index: 24;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  border-radius: 50%; opacity: 0.55;
}
.soundbtn:hover { opacity: 1; }

.sheet {
  position: fixed; inset: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center;
  padding: 26px; background: rgba(4, 5, 9, 0.78);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  animation: fade 0.22s ease both;
}
.sheet-card {
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  padding: 30px 34px; text-align: center;
  border-radius: 22px; box-shadow: var(--shadow);
  animation: pop-in 0.3s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- a little more room ------------------------------------------------ */

@media (min-width: 430px) {
  .joinpanel canvas { width: 148px; height: 148px; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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

/* Your own tile in the roster, picked out without spending a chip on it. */
.roster li.is-you {
  border-color: rgba(91, 140, 255, 0.45);
  background: linear-gradient(120deg, rgba(91, 140, 255, 0.1), transparent 65%), var(--glass);
}
