/* ============================================================
   Football Imposter — design system
   Dark "stadium at night" palette, lime accent, mobile-first.
   ============================================================ */

:root {
  /* --- surfaces --- */
  --bg: #080B0A;
  --bg-2: #0D1211;
  --surface: #141B19;
  --surface-2: #1C2523;
  --surface-3: #263130;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* --- ink --- */
  --ink: #F1F5F3;
  --ink-2: #A6B4AE;
  --ink-3: #6B7975;

  /* --- accents --- */
  --lime: #C8FF4D;
  --lime-dim: #8FBF2E;
  --lime-glow: rgba(200, 255, 77, 0.28);
  --red: #FF4560;
  --red-glow: rgba(255, 69, 96, 0.3);
  --blue: #4DA6FF;
  --amber: #FFC145;
  --violet: #A98BFF;

  /* --- geometry --- */
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --pad: 20px;

  /* --- motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- safe areas (iPhone notch / home bar) --- */
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   Reset
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; }

input, textarea { user-select: text; -webkit-user-select: text; }

/* Ambient pitch-light glow, slowly drifting so the app never feels static */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 22% 12%, rgba(200, 255, 77, 0.16), transparent 62%),
    radial-gradient(34% 28% at 82% 26%, rgba(169, 139, 255, 0.13), transparent 62%),
    radial-gradient(40% 32% at 50% 96%, rgba(77, 166, 255, 0.11), transparent 62%);
  animation: drift 26s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.03); }
}

/* Faint pitch stripes — reads as grass without being literal */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background: repeating-linear-gradient(
    100deg,
    transparent 0 62px,
    rgba(255, 255, 255, 0.014) 62px 124px
  );
}

/* ============================================================
   App shell + screen transitions
   ============================================================ */

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(var(--sa-t) + 16px) var(--pad) calc(var(--sa-b) + 16px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.is-active {
  display: flex;
  animation: screen-in 0.42s var(--ease-out) both;
}

.screen.is-active.from-back { animation-name: screen-in-back; }

@keyframes screen-in {
  from { opacity: 0; transform: translateX(28px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes screen-in-back {
  from { opacity: 0; transform: translateX(-28px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Typography
   ============================================================ */

.display {
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h1 { font-size: clamp(26px, 7.5vw, 36px); font-weight: 800; letter-spacing: -0.028em; line-height: 1.08; }
h2 { font-size: 21px; font-weight: 750; letter-spacing: -0.018em; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
}
.eyebrow.muted { color: var(--ink-3); }
.eyebrow.danger { color: var(--red); }

.sub { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.tiny { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.center { text-align: center; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ============================================================
   Layout helpers
   ============================================================ */

.stack   { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.stack-l { display: flex; flex-direction: column; gap: 20px; }
.row     { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow    { flex: 1; }
.spacer  { flex: 1 1 auto; min-height: 12px; }
.wrap    { flex-wrap: wrap; }

.screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.footer-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 16px 22px;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.012em;
  border: 1px solid var(--line);
  transition: transform 0.16s var(--spring), background 0.2s, opacity 0.2s, border-color 0.2s;
}

.btn:active { transform: scale(0.965); }

.btn:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(168deg, var(--lime), var(--lime-dim));
  color: #0A1200;
  border-color: transparent;
  box-shadow: 0 8px 26px -10px var(--lime-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-weight: 800;
}

.btn-danger {
  background: linear-gradient(168deg, #FF5C74, #E12B47);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 26px -10px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-weight: 800;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-sm {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14.5px;
  border-radius: var(--r-sm);
  width: auto;
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ============================================================
   Cards & surfaces
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}

.card-tight { padding: 14px; border-radius: var(--r); }

.panel {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 14px 16px;
  border: 1px solid var(--line);
}

/* ============================================================
   Home screen
   ============================================================ */

.home {
  justify-content: center;
  gap: 28px;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: logo-in 0.7s var(--ease-out) both;
}

@keyframes logo-in {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

.logo-ball {
  font-size: 60px;
  line-height: 1;
  filter: drop-shadow(0 8px 24px rgba(200, 255, 77, 0.3));
  animation: ball-float 4.5s ease-in-out infinite;
}

@keyframes ball-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-10px) rotate(6deg); }
}

.logo-title {
  font-size: clamp(34px, 11vw, 52px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.94;
  text-align: center;
  background: linear-gradient(150deg, #FFFFFF 15%, var(--lime) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.18s var(--spring), border-color 0.25s, background 0.25s;
}

.mode-card:active { transform: scale(0.97); }
.mode-card:hover { border-color: var(--line-strong); }

.mode-emoji {
  font-size: 30px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: var(--surface-2);
  flex-shrink: 0;
}

.mode-card .mode-title { font-size: 18px; font-weight: 750; letter-spacing: -0.015em; }
.mode-card .mode-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }
.mode-arrow { color: var(--ink-3); font-size: 22px; flex-shrink: 0; }

/* ============================================================
   Player chips / name list
   ============================================================ */

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: opacity 0.25s, transform 0.25s var(--spring);
  animation: row-in 0.3s var(--ease-out) both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #08120A;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.avatar-lg { width: 60px; height: 60px; font-size: 23px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12.5px; }

.player-row .name { font-weight: 650; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.remove-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 17px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.remove-btn:active { background: var(--red); color: #fff; }

/* ============================================================
   Inputs
   ============================================================ */

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s;
}

.field:focus-within { border-color: var(--lime); }

.field input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 14px 0;
  font-size: 16.5px;
  font-weight: 600;
}

/* Buttons inside a field must hug their label — a full-width .btn here
   collapses the input to zero and makes the field impossible to type in. */
.field .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 72px;
  min-height: 46px;
  padding: 12px 18px;
  font-size: 15px;
  border-radius: 13px;
}

.field input::placeholder { color: var(--ink-3); font-weight: 500; }

.code-input {
  width: 100%;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  padding: 20px 0;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.code-input:focus { border-color: var(--lime); }
.code-input::placeholder { color: var(--ink-3); letter-spacing: 0.28em; }

/* ============================================================
   Segmented control (settings)
   ============================================================ */

.seg {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid var(--line);
}

.seg button {
  flex: 1;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-3);
  transition: background 0.22s var(--ease-out), color 0.22s;
  white-space: nowrap;
}

.seg button.on {
  background: var(--lime);
  color: #0A1200;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 15.5px; font-weight: 650; }
.setting-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

/* ============================================================
   Reveal — the pass-the-phone card
   ============================================================ */

.reveal-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  min-height: 0;
}

.handoff {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: pop-in 0.45s var(--spring) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.86); }
  to   { opacity: 1; transform: none; }
}

.role-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  animation: card-flip-in 0.6s var(--ease-out) both;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

@keyframes card-flip-in {
  from { opacity: 0; transform: perspective(900px) rotateY(-32deg) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* --- crew variant: the player photo --- */
.photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 46vh;
  background: linear-gradient(160deg, var(--surface-3), var(--surface));
  overflow: hidden;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  animation: photo-in 0.8s var(--ease-out) both;
}

@keyframes photo-in {
  from { opacity: 0; transform: scale(1.08); }
  to   { opacity: 1; transform: none; }
}

.photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 11, 10, 0.96) 4%, rgba(8, 11, 10, 0.55) 32%, transparent 62%);
  pointer-events: none;
}

.photo-name {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  z-index: 2;
}

.photo-name .pn-name {
  font-size: clamp(27px, 8.5vw, 40px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.0;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.85);
}

.photo-name .pn-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.meta-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

/* Fallback "kit card" when no photo is available */
.kit-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.kit-shirt {
  width: 54%;
  max-width: 190px;
  aspect-ratio: 1;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: clamp(40px, 15vw, 66px);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 20px 50px -22px rgba(0, 0, 0, 0.9);
}

.kit-flag { font-size: 38px; }

.photo-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 13px;
}

.shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.05) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -100% 0; }
}

/* --- imposter variant --- */
.imposter-face {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(255, 69, 96, 0.28), transparent 70%),
    linear-gradient(170deg, #2A1015, #12080A);
  position: relative;
}

.imposter-mask {
  font-size: 78px;
  line-height: 1;
  filter: drop-shadow(0 10px 30px rgba(255, 69, 96, 0.5));
  animation: mask-in 0.7s var(--spring) both 0.1s;
}

@keyframes mask-in {
  from { opacity: 0; transform: scale(0.4) rotate(-25deg); }
  to   { opacity: 1; transform: none; }
}

.imposter-title {
  font-size: clamp(34px, 11vw, 48px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--red);
  text-shadow: 0 0 40px var(--red-glow);
}

.role-body { padding: 18px; }

/* Hints */
.hint-list { display: flex; flex-direction: column; gap: 8px; }

.hint-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  animation: hint-in 0.4s var(--spring) both;
}

@keyframes hint-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

.hint-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 2px;
}
.hint-value { font-size: 15px; font-weight: 620; line-height: 1.35; }
.hint-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   Clue round — turn indicator + timer
   ============================================================ */

.turn-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  min-height: 0;
}

.turn-name {
  font-size: clamp(36px, 12vw, 56px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  animation: pop-in 0.4s var(--spring) both;
}

.timer-ring {
  position: relative;
  width: 168px;
  height: 168px;
  flex-shrink: 0;
}

.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.timer-ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }

.timer-ring .prog {
  fill: none;
  stroke: var(--lime);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
}

.timer-ring.warn .prog { stroke: var(--amber); }
.timer-ring.crit .prog { stroke: var(--red); }
.timer-ring.crit { animation: pulse 0.9s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}

.timer-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 50px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.turn-dots { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }

.turn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.3s, transform 0.3s var(--spring);
}
.turn-dot.done { background: var(--lime-dim); }
.turn-dot.now  { background: var(--lime); transform: scale(1.5); box-shadow: 0 0 14px var(--lime-glow); }

/* ============================================================
   Voting
   ============================================================ */

.vote-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 2px solid transparent;
  text-align: left;
  transition: transform 0.16s var(--spring), border-color 0.2s, background 0.2s;
}

.vote-option:active { transform: scale(0.975); }

.vote-option.selected {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.1);
}

.vote-option .name { flex: 1; font-weight: 680; font-size: 16.5px; }

.vote-check {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s var(--spring);
}

.vote-option.selected .vote-check {
  background: var(--lime);
  border-color: var(--lime);
  color: #0A1200;
}

.vote-option.disabled { opacity: 0.34; pointer-events: none; }

/* Tally bars */
.tally-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }

.tally-bar-wrap {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.tally-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime-dim), var(--lime));
  width: 0;
  transition: width 0.85s var(--ease-out);
}
.tally-bar.top { background: linear-gradient(90deg, #E12B47, var(--red)); }

.tally-count { font-size: 15px; font-weight: 800; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }

/* Big binary choice: keep playing vs accuse */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 26px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 2px solid var(--line);
  transition: transform 0.18s var(--spring), border-color 0.22s, background 0.22s;
  text-align: center;
}

.choice-card:active { transform: scale(0.96); }
.choice-card.selected { border-color: var(--lime); background: rgba(200, 255, 77, 0.09); }
.choice-card.selected.danger { border-color: var(--red); background: rgba(255, 69, 96, 0.09); }
.choice-emoji { font-size: 38px; line-height: 1; }
.choice-label { font-size: 15.5px; font-weight: 750; letter-spacing: -0.015em; }
.choice-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }

/* ============================================================
   Guess grid (imposter picks the footballer)
   ============================================================ */

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

.guess-card {
  padding: 15px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 2px solid transparent;
  text-align: center;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  min-height: 72px;
  display: grid;
  place-items: center;
  transition: transform 0.16s var(--spring), border-color 0.2s, background 0.2s;
}

.guess-card:active { transform: scale(0.96); }
.guess-card.selected { border-color: var(--lime); background: rgba(200, 255, 77, 0.1); }
.guess-card.correct { border-color: var(--lime); background: rgba(200, 255, 77, 0.2); }
.guess-card.wrong { border-color: var(--red); background: rgba(255, 69, 96, 0.16); }

/* ============================================================
   Result screen
   ============================================================ */

.result-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  min-height: 0;
}

.result-badge {
  font-size: 74px;
  line-height: 1;
  animation: badge-in 0.65s var(--spring) both;
}

@keyframes badge-in {
  from { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  to   { opacity: 1; transform: none; }
}

.result-title {
  font-size: clamp(32px, 10vw, 46px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.result-title.crew { color: var(--lime); }
.result-title.imposter { color: var(--red); }

.result-detail {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 340px;
}

.reveal-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
}

.reveal-strip img {
  width: 62px;
  height: 62px;
  border-radius: var(--r-sm);
  object-fit: cover;
  object-position: center 18%;
  flex-shrink: 0;
  background: var(--surface-3);
}

/* Scoreboard */
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.score-row.leader { border-color: var(--lime); background: rgba(200, 255, 77, 0.07); }
.score-row .name { flex: 1; font-weight: 650; font-size: 15.5px; }
.score-row .pts { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--lime); }
.score-row .rank { width: 22px; font-weight: 800; color: var(--ink-3); font-size: 14px; }
.score-delta { font-size: 12px; font-weight: 700; color: var(--lime); }

/* ============================================================
   Lobby (online)
   ============================================================ */

.code-display {
  text-align: center;
  padding: 22px 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
}

.code-value {
  font-size: clamp(44px, 15vw, 64px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1;
  background: linear-gradient(150deg, #fff, var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}
.conn-dot.on { background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); animation: breathe 2.2s ease-in-out infinite; }
.conn-dot.off { background: var(--red); }

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  flex-shrink: 0;
}
.badge.host { background: rgba(200, 255, 77, 0.18); color: var(--lime); }
.badge.you  { background: rgba(77, 166, 255, 0.18); color: var(--blue); }
.badge.wait { background: rgba(255, 193, 69, 0.16); color: var(--amber); }
.badge.done { background: rgba(200, 255, 77, 0.18); color: var(--lime); }

/* ============================================================
   Waiting / spinner
   ============================================================ */

.wait-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--lime);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Toast
   ============================================================ */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sa-b) + 26px);
  transform: translate(-50%, 20px);
  z-index: 200;
  background: var(--surface-3);
  color: var(--ink);
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 650;
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s, transform 0.28s var(--spring);
  max-width: calc(100vw - 40px);
  text-align: center;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Sheet (modal)
   ============================================================ */

#sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
  display: flex;
  align-items: flex-end;
}

#sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line-strong);
  padding: 10px var(--pad) calc(var(--sa-b) + 24px);
  transform: translateY(100%);
  transition: transform 0.36s var(--ease-out);
}

#sheet-backdrop.show .sheet { transform: none; }

.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  margin: 8px auto 16px;
}

/* ============================================================
   Confetti
   ============================================================ */

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

/* ============================================================
   Misc
   ============================================================ */

.divider { height: 1px; background: var(--line); margin: 4px 0; }

.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink-2);
}

.empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--ink-3);
  font-size: 14px;
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}

/* ============================================================
   Language toggle — top corner
   ============================================================ */

.lang-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.lang-toggle button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  transition: background 0.24s var(--ease-out), color 0.24s, transform 0.18s var(--spring);
}

.lang-toggle button:active { transform: scale(0.92); }

.lang-toggle button.on {
  background: var(--lime);
  color: #0A1200;
}

.lang-flag { font-size: 14px; line-height: 1; }

/* Floating variant used on the home screen */
.home-top {
  position: absolute;
  top: calc(var(--sa-t) + 14px);
  right: var(--pad);
  z-index: 5;
}

/* ============================================================
   Category picker — men / women / managers
   ============================================================ */

.cat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 15px 6px 12px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 2px solid transparent;
  transition: transform 0.18s var(--spring), border-color 0.22s, background 0.22s;
}

.cat-card:active { transform: scale(0.94); }

.cat-card.on {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.11);
}

.cat-emoji { font-size: 26px; line-height: 1; }

.cat-name {
  font-size: 12.5px;
  font-weight: 780;
  letter-spacing: -0.01em;
  text-align: center;
}

.cat-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.cat-card.on .cat-count { color: var(--lime-dim); }

/* ============================================================
   League / pack picker
   ============================================================ */

.league-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.league-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 13px 6px 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 2px solid transparent;
  transition: transform 0.18s var(--spring), border-color 0.22s, background 0.22s;
  min-height: 88px;
}

.league-card:active { transform: scale(0.94); }

.league-card.on {
  border-color: var(--lime);
  background: rgba(200, 255, 77, 0.11);
}

.league-emoji { font-size: 24px; line-height: 1; }

.league-name {
  font-size: 11.5px;
  font-weight: 750;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.league-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.league-card.on .league-count { color: var(--lime-dim); }

/* ============================================================
   Two-imposter flag on the imposter card
   ============================================================ */

.partner-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 90%;
  text-align: center;
  animation: pop-in 0.5s var(--spring) both 0.35s;
}

/* Badge shown in the lobby / setup when two imposters are in play */
.imposter-count-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 69, 96, 0.12);
  border: 1px solid rgba(255, 69, 96, 0.3);
  color: #FF8A9C;
  font-size: 12.5px;
  font-weight: 750;
}

/* ============================================================
   Extra energy: pressable cards, gradient headings
   ============================================================ */

.mode-card {
  position: relative;
  overflow: hidden;
}

/* Light sweep across the mode cards on press */
.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.09) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}

.mode-card:active::after { transform: translateX(100%); }

.mode-emoji {
  background: linear-gradient(150deg, var(--surface-3), var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Big numbers feel better with a bit of glow */
.turn-name, .result-title, .code-value {
  text-wrap: balance;
}

.score-row .rank { font-size: 17px; }

/* Shorter phones: tighten vertical rhythm */
@media (max-height: 700px) {
  .logo-ball { font-size: 46px; }
  .timer-ring { width: 132px; height: 132px; }
  .timer-num { font-size: 40px; }
  .imposter-mask { font-size: 60px; }
  .result-badge { font-size: 58px; }
  .btn { min-height: 52px; padding: 13px 20px; }
  .photo-wrap, .imposter-face { max-height: 38vh; }
}

/* ============================================================
   Avatars: emoji + gallery photos
   ============================================================ */

.avatar-photo { overflow: hidden; padding: 0; }

.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-emoji { font-size: 20px; }
.avatar-lg.avatar-emoji { font-size: 32px; }
.avatar-sm.avatar-emoji { font-size: 15px; }

.avatar-tappable {
  cursor: pointer;
  position: relative;
  transition: transform 0.18s var(--spring);
}
.avatar-tappable:active { transform: scale(0.88); }

.avatar-tappable::after {
  content: "✎";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--surface);
  color: var(--ink-2);
  font-size: 8px;
  display: grid;
  place-items: center;
}

.avatar-preview { display: flex; justify-content: center; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 7px;
}

.emoji-cell {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 2px solid transparent;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: transform 0.16s var(--spring), border-color 0.2s, background 0.2s;
}

.emoji-cell:active { transform: scale(0.88); }
.emoji-cell.on { border-color: var(--lime); background: rgba(200, 255, 77, 0.12); }

/* ============================================================
   QR code in the lobby
   ============================================================ */

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.qr-box {
  width: 172px;
  max-width: 58vw;
  padding: 10px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  animation: pop-in 0.45s var(--spring) both;
}

.qr-box svg { width: 100%; height: auto; display: block; }

/* ============================================================
   Winner screen
   ============================================================ */

.trophy {
  font-size: 84px;
  line-height: 1;
  animation: trophy-in 0.8s var(--spring) both;
  filter: drop-shadow(0 12px 34px rgba(255, 216, 77, 0.45));
}

@keyframes trophy-in {
  0%   { opacity: 0; transform: scale(0.2) rotate(-30deg); }
  60%  { transform: scale(1.18) rotate(8deg); }
  100% { opacity: 1; transform: none; }
}

.winner-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Stats
   ============================================================ */

.award-grid { display: flex; flex-direction: column; gap: 8px; }

.award {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.award-icon { font-size: 22px; flex-shrink: 0; }
.award-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.award-name { font-size: 15.5px; font-weight: 750; letter-spacing: -0.015em; }
.award-value { font-size: 17px; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; }

.win-pct {
  font-size: 19px;
  font-weight: 800;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-cell {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-sm);
  padding: 9px 4px;
  text-align: center;
}

.stat-value { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-value.danger { color: var(--red); }
.stat-label { font-size: 9.5px; font-weight: 700; color: var(--ink-3); margin-top: 2px; line-height: 1.2; }

/* ============================================================
   Custom packs
   ============================================================ */

.pack-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform 0.18s var(--spring), border-color 0.22s;
}

.pack-row:active { transform: scale(0.975); }

.pack-emoji {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.pack-name { font-size: 16.5px; font-weight: 750; letter-spacing: -0.015em; }

.entry-photo {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-3);
}

.entry-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-photo.big { width: 78px; height: 78px; border-radius: var(--r); font-size: 30px; }
