:root {
  --bg: #1a1033;
  --bg2: #2a1b5b;
  --accent: #ff6b9d;
  --accent2: #7ee8fa;
  --text: #f5f0ff;
  --muted: #b8a8d6;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.18);
  --good: #6ee7b7;
  --bad: #fb7185;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  background: var(--bg);
}

/* Twemoji: render replaced emoji <img>s inline at the surrounding font size. */
img.twemoji {
  height: 1em;
  width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
  display: inline-block;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--bg2), var(--bg) 70%) no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
.hidden { display: none !important; }

/* ==================== HOST SCREEN ==================== */
body.host { padding: 32px 48px; }
.title { font-size: 56px; margin: 0 0 6px; letter-spacing: -1px; }
.title.small { font-size: 32px; margin: 0 0 16px; }
.subtitle { color: var(--muted); font-size: 22px; margin: 0 0 32px; }

.lobby-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  margin-bottom: 36px;
}

.join-card, .players-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 24px;
}
.join-card { text-align: center; }
.join-card h2, .players-card h2 { margin-top: 0; font-weight: 600; }
.join-url { font-size: 18px; color: var(--accent2); word-break: break-all; margin-bottom: 12px; }
.qr { width: 240px; height: 240px; background: white; padding: 8px; border-radius: 12px; }
.room-code { margin-top: 14px; font-size: 18px; color: var(--muted); }
.room-code span { color: var(--text); font-weight: 700; letter-spacing: 6px; font-size: 28px; }

.player-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.player-list li {
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 18px;
}
.player-list li.empty { color: var(--muted); }
.color-dot { width: 18px; height: 18px; border-radius: 50%; }

.standings {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--card-border);
}
.standings.hidden { display: none; }
.standings-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.standings-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.standings-header .ghost { font-size: 12px; padding: 4px 10px; }
.standings-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.standings-list li {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 8px 12px;
}
.standings-list .rank { width: 28px; text-align: center; font-size: 18px; }
.standings-list .rank-num { color: var(--muted); font-weight: 600; font-size: 14px; }
.standings-list .who { flex: 1; font-size: 16px; }
.standings-list .pts { font-size: 18px; color: var(--accent2); }

.score-strip .score-total {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(126,232,250,0.15);
  color: var(--accent2);
  font-size: 13px;
  font-weight: 700;
}

.test-mode {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--card-border);
}
.test-mode h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.test-mode .muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.test-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.test-buttons .ghost { font-size: 13px; padding: 6px 12px; }

.games-title { font-size: 28px; margin: 16px 0 18px; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px 18px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--accent); background: rgba(255,107,157,0.12); }
.game-card .emoji { font-size: 44px; }
.game-card .name { font-size: 20px; font-weight: 600; margin: 8px 0 4px; }
.game-card .desc { color: var(--muted); font-size: 14px; }

.lobby-footer { display: flex; justify-content: center; margin: 28px 0 8px; }
.credits-btn { font-size: 14px; padding: 8px 18px; }

/* ---------- Credits overlay ---------- */
.credits-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: radial-gradient(ellipse at center, #1a1033 0%, #0b0719 80%);
  overflow: hidden;
  cursor: pointer;
}
.credits-overlay.hidden { display: none; }
.credits-close {
  position: absolute; top: 16px; right: 20px;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  width: 40px; height: 40px; line-height: 1;
  font-size: 20px; cursor: pointer;
}
.credits-close:hover { background: rgba(255,255,255,0.18); }
.credits-stage {
  position: absolute; inset: 0;
  display: flex; justify-content: center;
  perspective: 600px;
  pointer-events: none;
}
.credits-scroll {
  position: absolute;
  top: 100%;
  width: min(720px, 92vw);
  text-align: center;
  color: #fff;
  animation: credits-roll 60s linear forwards;
}
.credits-scroll.fast { animation-duration: 25s; }
.credits-scroll h1 {
  font-size: clamp(40px, 7vw, 72px);
  margin: 60px 0 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b9d, #c084fc, #7ee8fa);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: 1px;
}
.credits-scroll h2 {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 600;
  color: var(--accent2);
  margin: 64px 0 20px;
  letter-spacing: 6px;
  text-transform: uppercase;
}
.credits-scroll .credits-dedication {
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.5;
  color: #fff;
  margin: 24px auto 80px;
  font-style: italic;
  max-width: 600px;
  text-shadow: 0 2px 8px rgba(255,107,157,0.4);
}
.credits-scroll .credits-dedication strong {
  color: #ff6b9d;
  font-style: normal;
  font-weight: 700;
}
.credits-scroll .credits-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: baseline;
  margin: 14px 0;
  font-size: clamp(16px, 2vw, 20px);
}
.credits-scroll .credits-role {
  text-align: right;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}
.credits-scroll .credits-name {
  text-align: left;
  color: #fff;
  font-weight: 700;
}
.credits-scroll .credits-finale {
  margin: 80px 0 60px;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  color: #ff6b9d;
  animation: credits-pulse 2.4s ease-in-out infinite;
}
.credits-scroll .credits-tiny {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-top: 40px;
  padding-bottom: 80px;
}

@keyframes credits-roll {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(-100% - 100vh)); }
}
@keyframes credits-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50%      { transform: scale(1.05); opacity: 1; }
}

.game-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.game-title-bar { font-size: 24px; font-weight: 600; flex: 1; }
.score-strip { display: flex; gap: 14px; }
.score-strip .pill {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 6px 14px;
  display: flex; align-items: center; gap: 8px;
}
.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--card-border);
  border-radius: 999px; padding: 8px 16px;
  cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }

.game-root {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 28px;
  min-height: 60vh;
}

/* ==================== CONTROLLER ==================== */
body.controller { padding: 0; }
.screen.pad { padding: 14px 14px 18px; }
.controller .title { color: var(--text); }
.controller .title.small { font-size: 22px; margin: 0 0 10px; }
.controller #gameScreen.screen.pad { padding: 10px 12px 14px; }
.controller label { display: block; margin: 14px 0; font-size: 16px; color: var(--muted); }
.controller input {
  width: 100%;
  padding: 14px 16px;
  font-size: 22px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  margin-top: 6px;
  text-transform: none;
}
#codeInput { text-transform: uppercase; letter-spacing: 8px; text-align: center; font-weight: 700; }
.controller button.primary {
  width: 100%; padding: 16px;
  border-radius: 14px; border: 0;
  background: linear-gradient(135deg, var(--accent), #c026d3);
  color: white; font-size: 20px; font-weight: 700;
  margin-top: 16px;
  cursor: pointer;
}
.controller #gameScreen button.primary { padding: 12px; font-size: 16px; margin-top: 10px; }
.controller .msg { margin-top: 14px; color: var(--bad); min-height: 24px; }
.color-chip { width: 72px; height: 72px; border-radius: 50%; margin: 24px auto; box-shadow: 0 0 30px currentColor; }
.controller #gameScreen input { padding: 10px 12px; font-size: 16px; margin-top: 4px; }
.ctrl-scores {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(255,255,255,0.06); border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px; font-size: 14px;
}
.ctrl-scores .row { display: flex; justify-content: space-between; }

/* Phone-side countdown timer */
.ctrl-timer {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(20, 12, 50, 0.92);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  margin: -2px auto 8px;
  width: fit-content;
  border: 1px solid var(--card-border);
  color: var(--text);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.ctrl-timer.warn { color: #fde68a; border-color: #fde68a; }
.ctrl-timer.crit {
  color: #fff;
  background: #e11d48;
  border-color: #fff;
  animation: timerPulse .7s ease-in-out infinite alternate;
}
@keyframes timerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* Big shared styles for game UIs */
.big-word {
  font-size: 64px; font-weight: 800; letter-spacing: 4px;
  text-align: center; padding: 18px 0;
}
.controller .big-word {
  font-size: 30px; letter-spacing: 1px; padding: 4px 0 8px;
}
.timer {
  font-size: 22px; color: var(--muted); text-align: center; margin-bottom: 8px;
}
.banner {
  text-align: center; padding: 12px 16px;
  background: rgba(255,255,255,0.08); border-radius: 12px; margin-bottom: 14px;
}
.controller .banner { padding: 10px 12px; margin-bottom: 8px; }
.role-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: white; font-size: 14px; font-weight: 700;
  margin-bottom: 12px;
}
.controller .role-tag { font-size: 12px; padding: 3px 9px; margin-bottom: 6px; }

/* Sketch / canvas */
.canvas-wrap {
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; justify-content: center; align-items: center;
}
.canvas-wrap canvas { display: block; touch-action: none; background: #fff; }

.guess-feed { margin-top: 16px; max-height: 200px; overflow-y: auto; }
.guess-feed .item { padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,0.06); margin-bottom: 6px; }

/* Letter tiles */
.letter-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 24px; }
.tile {
  background: linear-gradient(180deg, #fff7e6, #f6c177);
  color: #3d2c00;
  width: 64px; height: 72px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800;
  box-shadow: 0 4px 0 #d09c4d;
}
.tile.small { width: 44px; height: 52px; font-size: 24px; box-shadow: 0 3px 0 #d09c4d; }

/* Word ladder */
.ladder-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ladder-col { background: rgba(255,255,255,0.06); border-radius: 14px; padding: 16px; }
.ladder-col h3 { margin-top: 0; }
.ladder-step { font-family: ui-monospace, monospace; font-size: 22px; padding: 6px 0; letter-spacing: 4px; }
.ladder-step.target { color: var(--good); }
.ladder-step.start { color: var(--accent2); }

/* Reveal chain */
.chain { display: flex; flex-direction: column; gap: 14px; }
.chain-item { background: rgba(255,255,255,0.06); border-radius: 14px; padding: 14px; }
.chain-item .who { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.chain-item .text { font-size: 26px; }
.chain-item canvas { background: #fff; border-radius: 8px; }

/* Reveal cards (How Well) */
.reveal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reveal-card { background: rgba(255,255,255,0.06); border-radius: 14px; padding: 16px; }
.reveal-card h3 { margin-top: 0; }
.reveal-card .actual { font-size: 20px; color: var(--good); }
.reveal-card .guess { font-size: 18px; color: var(--accent2); }
.reveal-card.match { border: 2px solid var(--good); }

@media (max-width: 720px) {
  body.host { padding: 16px; }
  .title { font-size: 36px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .ladder-cols, .reveal-grid { grid-template-columns: 1fr; }
}

/* ==================== AVATAR PICKER ==================== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.avatar-btn {
  font-size: 32px;
  padding: 10px 0;
  border-radius: 12px;
  border: 2px solid var(--card-border);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.avatar-btn:hover { transform: translateY(-2px); }
.avatar-btn.selected {
  border-color: var(--accent);
  background: rgba(255,107,157,0.18);
  transform: scale(1.05);
}
.me-avatar {
  font-size: 72px;
  text-align: center;
  margin: 18px 0 4px;
  line-height: 1;
}

/* Player list with avatars */
.player-list li .avatar-emoji { font-size: 28px; line-height: 1; }
.score-strip .avatar-emoji { font-size: 22px; line-height: 1; }

/* ==================== REMOTE CONTROL (controller-side host) ==================== */
.remote-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--card-border);
}
.remote-toggle {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.remote-help {
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.remote-game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.remote-game {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 8px;
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}
.remote-game:active { transform: scale(0.96); background: rgba(255,255,255,0.14); }
.remote-game .emoji { font-size: 28px; line-height: 1; }
.remote-game .name { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.remote-reset {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

/* Floating ☰ button shown during a game so a player can return to menu */
.remote-fab {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.45);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.remote-fab:active { transform: scale(0.92); }

.remote-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
.remote-sheet-inner {
  width: 100%;
  max-width: 480px;
  background: var(--bg2);
  border-top: 1px solid var(--card-border);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
}
.remote-sheet-inner h3 {
  margin: 0 0 4px;
  font-size: 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.remote-sheet-inner button { padding: 14px; font-size: 16px; }

/* ==================== CELEBRATION OVERLAY ==================== */
#celebration {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
}
#celebration.hidden { display: none; }
#celebration .burst {
  font-size: 120px;
  font-weight: 900;
  color: var(--good);
  text-shadow: 0 0 24px rgba(110, 231, 183, 0.8), 0 8px 32px rgba(0,0,0,0.5);
  animation: pop 1.6s cubic-bezier(.2,1.4,.4,1) forwards;
  text-align: center;
}
#celebration .sub {
  margin-top: 12px;
  font-size: 32px;
  color: var(--text);
  text-align: center;
}
@keyframes pop {
  0%   { transform: scale(0.2) rotate(-12deg); opacity: 0; }
  40%  { transform: scale(1.15) rotate(2deg); opacity: 1; }
  60%  { transform: scale(0.95) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* ==================== TOASTS ==================== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}
.toast {
  background: rgba(20, 12, 50, 0.95);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 18px;
  color: var(--text);
  font-size: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: toastIn .25s ease, toastOut .35s ease 3.4s forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-10px); } }

/* ==================== EMPTY-ROOM STATE ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .icon { font-size: 80px; margin-bottom: 16px; }
.empty-state h2 { margin: 0 0 8px; font-size: 32px; }
.empty-state p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.empty-state .primary {
  background: linear-gradient(135deg, var(--accent), #c026d3);
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== SCORE STRIP PULSE ==================== */
.score-strip .pill { transition: transform .25s ease, background .3s ease, border-color .3s ease; }
.score-strip .pill.bump {
  animation: scoreBump .8s ease;
  background: rgba(110, 231, 183, 0.25);
  border-color: var(--good);
}
@keyframes scoreBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  60%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.score-strip .score-num { display: inline-block; min-width: 22px; text-align: right; }

/* ==================== DRAW CONTROLS (color palette + size) ==================== */
.draw-controls {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; align-items: center;
}
.swatch-row, .size-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  cursor: pointer; padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform .12s ease, border-color .12s ease;
}
.swatch:hover { transform: scale(1.1); }
.swatch.selected {
  border-color: var(--accent2);
  transform: scale(1.18);
  box-shadow: 0 0 0 3px rgba(126,232,250,0.4), 0 2px 6px rgba(0,0,0,0.3);
}
.size-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.1);
  border: 2px solid var(--card-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.size-btn.selected { border-color: var(--accent); background: rgba(255,107,157,0.2); }
.size-dot { display: inline-block; background: #fff; border-radius: 50%; }

/* ==================== ANIMATED FINAL RESULTS ==================== */
.final-results { padding: 12px 0 24px; }
.final-title {
  text-align: center;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffd166, #ff6b9d, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 2.4s ease-in-out infinite alternate;
  margin-bottom: 32px;
}
@keyframes titleGlow {
  from { filter: drop-shadow(0 0 12px rgba(255, 107, 157, 0.4)); }
  to   { filter: drop-shadow(0 0 28px rgba(192, 132, 252, 0.8)); }
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: end;
  max-width: 720px;
  margin: 0 auto 36px;
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.podium-slot.empty { visibility: hidden; }
.podium-avatar {
  font-size: 64px;
  animation: avatarBounce 1.2s ease;
  line-height: 1;
}
@keyframes avatarBounce {
  0%   { transform: translateY(-200px) scale(0.4); opacity: 0; }
  60%  { transform: translateY(20px) scale(1.1); opacity: 1; }
  80%  { transform: translateY(-8px) scale(0.95); }
  100% { transform: translateY(0) scale(1); }
}
.podium-name { font-size: 22px; font-weight: 700; margin: 8px 0 4px; }
.podium-score {
  font-size: 36px; font-weight: 900;
  color: var(--good);
  text-shadow: 0 0 14px rgba(110, 231, 183, 0.6);
  margin-bottom: 12px;
}
.podium-block {
  width: 100%;
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  border: 1px solid var(--card-border);
  border-bottom: 0;
  transform-origin: bottom;
  animation: podiumRise .8s cubic-bezier(.2,1.2,.4,1) backwards;
}
.podium-block .medal { font-size: 44px; line-height: 1; }
.podium-block .place-num { font-size: 22px; font-weight: 800; color: var(--muted); margin-top: 6px; }
.podium-slot.place-1 .podium-block { height: 200px; background: linear-gradient(180deg, #facc15, #b45309); animation-delay: .6s; }
.podium-slot.place-2 .podium-block { height: 150px; background: linear-gradient(180deg, #cbd5e1, #475569); animation-delay: .3s; }
.podium-slot.place-3 .podium-block { height: 110px; background: linear-gradient(180deg, #fb923c, #7c2d12); animation-delay: 0s; }
@keyframes podiumRise {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

.bars {
  max-width: 720px;
  margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px;
  gap: 14px;
  align-items: center;
  opacity: 0;
  animation: barIn .5s ease forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes barIn { to { opacity: 1; } }
.bar-name { font-size: 18px; font-weight: 600; }
.bar-track {
  height: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: var(--accent);
  animation: barFill 1.4s cubic-bezier(.2,1,.4,1) forwards;
  animation-delay: calc(var(--delay, 0ms) + 200ms);
  box-shadow: 0 0 12px currentColor;
}
@keyframes barFill { to { width: var(--target, 0%); } }
.bar-score {
  text-align: right;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent2);
}
.final-actions { text-align: center; margin-top: 32px; }
.final-actions .primary {
  background: linear-gradient(135deg, var(--accent), #c026d3);
  color: white; border: 0;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .podium { gap: 10px; }
  .podium-avatar { font-size: 44px; }
  .podium-name { font-size: 16px; }
  .podium-score { font-size: 24px; }
  .bar-row { grid-template-columns: 110px 1fr 50px; }
  .final-title { font-size: 36px; }
}

/* ==================== EMOJI DECODE ==================== */
.emoji-puzzle {
  font-size: 96px; text-align: center;
  padding: 24px 12px; line-height: 1.2;
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  margin: 16px auto;
  letter-spacing: 6px;
}
.emoji-puzzle-phone {
  font-size: 56px; text-align: center;
  padding: 14px 8px; margin: 8px auto 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  letter-spacing: 4px;
  line-height: 1.2;
}
.emoji-solvers {
  margin-top: 14px; display: flex; flex-direction: column; gap: 6px;
  align-items: center; font-size: 18px;
}
.solver-row { padding: 4px 12px; border-radius: 8px; background: rgba(255,255,255,0.06); }

/* ==================== HIGHER OR LOWER ==================== */
.hl-stage {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; margin: 18px 0;
}
.hl-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color .3s ease, background .3s ease;
}
.hl-card.correct { border-color: var(--good); background: rgba(34,197,94,0.15); }
.hl-card.wrong   { border-color: var(--bad);  background: rgba(225,29,72,0.15); }
.hl-label { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.hl-value { font-size: 48px; font-weight: 800; color: var(--accent2); }
.hl-value.hl-hidden { color: var(--muted); font-size: 60px; }
.hl-vs { font-size: 28px; color: var(--muted); font-weight: 800; }
.hl-status { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 15px; }
.hl-lock { background: rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 999px; }
.hl-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; align-items: center; font-size: 16px; }

/* phone-side */
.hl-prompt {
  text-align: center; padding: 12px 8px; margin: 4px 0 12px;
  background: rgba(255,255,255,0.06); border-radius: 12px;
  font-size: 22px;
}
.hl-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.controller .hl-buttons button.primary { margin-top: 0; padding: 18px 8px; font-size: 18px; }
.hl-higher { background: linear-gradient(135deg, #22c55e, #15803d) !important; }
.hl-lower  { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
.hl-buttons button.locked-in { outline: 3px solid var(--accent2); transform: scale(1.02); }
.hl-buttons button:disabled { opacity: 0.55; }

/* Higher or Lower — phone view (mirrors host card layout) */
.hl-question {
  text-align: center; font-size: 15px; margin: 4px 0 8px;
  color: var(--text);
}
.hl-cards-phone {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 8px; align-items: center; margin: 6px 0 8px;
}
.hl-card-mini {
  background: rgba(255,255,255,0.08);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  min-height: 84px;
  display: flex; flex-direction: column; justify-content: center;
}
.hl-card-mini.hl-card-mystery { border-style: dashed; opacity: 0.95; }
.hl-card-mini.reveal-higher { border-color: var(--good); background: rgba(34,197,94,0.18); }
.hl-card-mini.reveal-lower  { border-color: var(--bad);  background: rgba(225,29,72,0.18); }
.hl-mini-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; line-height: 1.2; }
.hl-mini-value { font-size: 22px; font-weight: 800; color: var(--accent2); line-height: 1.1; word-break: break-word; }
.hl-mini-value.hl-mystery { color: var(--muted); font-size: 32px; }
.hl-vs-mini { font-size: 14px; font-weight: 800; color: var(--muted); }
.hl-unit {
  text-align: center; font-size: 12px; color: var(--muted);
  margin: 0 0 10px;
}

/* Full-screen result flash on the player's phone (used by all games) */
.result-flash {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff;
  pointer-events: none;
  animation: result-flash-in 0.45s cubic-bezier(.22,1.4,.36,1) both;
}
.result-flash-correct {
  background: radial-gradient(circle at center, rgba(34,197,94,0.96), rgba(15,118,67,0.96) 75%);
}
.result-flash-wrong {
  background: radial-gradient(circle at center, rgba(225,29,72,0.96), rgba(127,16,40,0.96) 75%);
  animation: result-flash-in 0.45s cubic-bezier(.22,1.4,.36,1) both, result-flash-shake 0.45s ease-in-out 0.05s 2;
}
.result-flash-meh {
  background: radial-gradient(circle at center, rgba(100,116,139,0.96), rgba(51,65,85,0.96) 75%);
}
.result-flash-emoji { font-size: 96px; line-height: 1; margin-bottom: 12px; animation: result-flash-pop 0.6s ease-out both; }
.result-flash-text {
  font-size: 56px; font-weight: 900; letter-spacing: 3px;
  text-shadow: 0 4px 16px rgba(0,0,0,0.45);
  padding: 0 16px;
  animation: result-flash-pop 0.6s ease-out 0.05s both;
}
.result-flash-sub {
  font-size: 22px; font-weight: 600; opacity: 0.92; margin-top: 10px;
  padding: 0 16px;
  animation: result-flash-pop 0.6s ease-out 0.15s both;
}
.result-flash.result-flash-out { animation: result-flash-out 0.4s ease-in forwards; }

@keyframes result-flash-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes result-flash-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
@keyframes result-flash-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes result-flash-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-12px); }
  75%      { transform: translateX(12px); }
}

/* Subtle variant — small toast at the top of the screen instead of a takeover */
.result-flash.result-flash-subtle {
  position: fixed;
  top: 16px;
  left: 50%;
  right: auto; bottom: auto;
  transform: translateX(-50%);
  z-index: 9000;
  display: inline-flex; flex-direction: row;
  align-items: center; justify-content: center;
  pointer-events: none;
  text-shadow: none;
  animation: result-flash-subtle-in 0.3s cubic-bezier(.22,1.4,.36,1) both;
  width: max-content; max-width: calc(100vw - 24px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
/* Single pill containing emoji + text + (optional) sub */
.result-flash.result-flash-subtle .result-flash-emoji,
.result-flash.result-flash-subtle .result-flash-text,
.result-flash.result-flash-subtle .result-flash-sub {
  display: inline; line-height: 1;
  font-size: 15px; font-weight: 700; letter-spacing: 0.4px;
  margin: 0; padding: 0; background: none;
  text-shadow: none; animation: none; box-shadow: none; border: 0;
}
.result-flash.result-flash-subtle .result-flash-emoji { margin-right: 6px; font-size: 18px; }
.result-flash.result-flash-subtle .result-flash-sub  { margin-left: 8px; font-weight: 500; opacity: 0.85; font-size: 13px; }

.result-flash-subtle.result-flash-correct { background: rgba(22, 101, 52, 0.95); color: #d1fae5; border-color: rgba(34,197,94,0.55); }
.result-flash-subtle.result-flash-wrong   { background: rgba(127, 16, 40, 0.95); color: #fecdd3; border-color: rgba(225,29,72,0.55); }
.result-flash-subtle.result-flash-meh     { background: rgba(51, 65, 85, 0.95); color: #e2e8f0; border-color: rgba(148,163,184,0.4); }
.result-flash.result-flash-subtle.result-flash-out { animation: result-flash-subtle-out 0.3s ease-in forwards; }

@keyframes result-flash-subtle-in {
  0%   { opacity: 0; transform: translate(-50%, -12px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes result-flash-subtle-out {
  0%   { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -12px); }
}

.wl-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
  align-items: stretch;
}
.controller #gameScreen .wl-actions button.primary,
.controller #gameScreen .wl-actions button.ghost,
.controller .wl-actions button.primary,
.controller .wl-actions button.ghost {
  margin: 0; padding: 0 12px; font-size: 16px; font-weight: 700;
  border-radius: 14px; box-sizing: border-box;
  border: 1px solid transparent;
  line-height: 1;
  width: 100%;
  height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.controller .wl-actions button.ghost {
  border-color: var(--card-border);
  background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer;
}
.controller .wl-actions button.ghost img.twemoji {
  height: 1em; width: 1em; vertical-align: middle; margin: 0;
}
.controller .wl-actions button.ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* Animated "Get ready" intro screen */
.get-ready {
  text-align: center; padding: 28px 16px;
  background: linear-gradient(135deg, rgba(255,107,157,0.18), rgba(126,232,250,0.12));
  border: 1px solid rgba(255,107,157,0.35);
  border-radius: 16px;
  margin-bottom: 14px;
  animation: getReadyPop .5s ease-out;
}
.get-ready .gr-emoji {
  font-size: 56px;
  display: block;
  animation: grBounce 1.4s ease-in-out infinite;
}
.get-ready .gr-text {
  font-size: 28px; font-weight: 800; margin-top: 6px;
  background: linear-gradient(135deg, #ff6b9d, #7ee8fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.get-ready .gr-text .gr-dots::after {
  content: '...';
  display: inline-block;
  animation: grDots 1.2s steps(4, end) infinite;
  width: 1.5em;
  text-align: left;
}
.controller .get-ready { padding: 18px 12px; margin-bottom: 8px; }
.controller .get-ready .gr-emoji { font-size: 40px; }
.controller .get-ready .gr-text { font-size: 20px; }
@keyframes getReadyPop {
  0%   { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes grBounce {
  0%,100% { transform: translateY(0)   scale(1); }
  50%     { transform: translateY(-8px) scale(1.05); }
}
@keyframes grDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ============================================================
   Blind Draw
   ============================================================ */
.bd-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; margin: 8px 0 12px; }
.bd-submitted { color: var(--muted); font-size: 18px; }

.bd-round { font-size: 28px; font-weight: 700; color: var(--accent2); margin-bottom: 6px; }
.bd-prompt-label { color: var(--muted); font-size: 16px; }
.bd-prompt { font-size: 44px; font-weight: 800; color: var(--text); margin: 4px 0 8px; }
.bd-hint { color: var(--muted); font-size: 16px; font-style: italic; }

/* Host gallery grid */
.bd-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 8px;
}
.bd-tile {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--card-border);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.bd-tile.bd-winner {
  border-color: #facc15;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.45);
  transform: translateY(-4px);
}
.bd-tile-num {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.bd-tile-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 8px;
}
.bd-tile-label { margin-top: 8px; font-size: 18px; color: var(--text); }
.bd-tile-sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.bd-vote-pill {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.bd-tile.bd-winner .bd-vote-pill {
  background: #facc15;
  color: #1a1033;
}

/* Controller blind canvas */
.bd-blind-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}
.bd-blind-canvas {
  display: flex;
  justify-content: center;
  max-width: 100%;
}
.bd-blind-canvas canvas {
  /* Make the player's strokes invisible without disabling pointer events */
  opacity: 0 !important;
  max-width: 100%;
  height: auto;
}
.bd-blind-cover {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.92), rgba(190, 24, 93, 0.92));
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ==================== UI MODAL (replaces native alert/confirm) ==================== */
.ui-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 24, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10010;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.ui-modal-overlay.open { opacity: 1; }

.ui-modal {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(160deg, var(--bg2), var(--bg));
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px 22px 18px;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ui-modal-overlay.open .ui-modal { transform: translateY(0) scale(1); }

.ui-modal-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.ui-modal-body {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.ui-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.ui-modal-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  min-width: 88px;
}
.ui-modal-btn:hover { background: rgba(255,255,255,0.12); }
.ui-modal-btn:active { transform: scale(0.96); }
.ui-modal-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

.ui-modal-ok {
  background: linear-gradient(135deg, var(--accent), #d6477a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 157, 0.35);
}
.ui-modal-ok:hover { background: linear-gradient(135deg, #ff7daa, #e05489); }
.ui-modal-ok.danger {
  background: linear-gradient(135deg, #f43f5e, #b91c1c);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}
.ui-modal-ok.danger:hover { background: linear-gradient(135deg, #fb5d77, #c92626); }

@media (max-width: 480px) {
  .ui-modal { padding: 18px 18px 14px; border-radius: 16px; }
  .ui-modal-title { font-size: 17px; }
  .ui-modal-body { font-size: 15px; margin-bottom: 16px; }
  .ui-modal-btn { padding: 12px 16px; font-size: 15px; flex: 1; min-width: 0; }
}
.bd-blind-cover-emoji { font-size: 64px; line-height: 1; margin-bottom: 8px; }
.bd-blind-cover-text { font-size: 20px; font-weight: 700; color: #fff; }
.bd-blind-cover-text span { font-size: 14px; font-weight: 400; color: rgba(255,255,255,0.85); }

/* Controller vote grid */
.bd-vote-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  margin: 8px 0 12px;
}
.bd-vote-tile {
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  color: inherit;
  font: inherit;
}
.bd-vote-tile:active { transform: scale(0.97); }
.bd-vote-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 107, 157, 0.5);
}
.bd-vote-tile.own { opacity: 0.45; cursor: not-allowed; }
.bd-vote-num {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.bd-vote-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 6px;
}
.bd-vote-own {
  position: absolute;
  bottom: 4px; right: 6px;
  font-size: 11px;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 6px;
  color: #fff;
}

/* ==================== CONTROLLER FINAL RESULTS ==================== */
.ctrl-final {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 8px;
}
.ctrl-final-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 6px;
}
.ctrl-final-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctrl-final-row {
  display: grid;
  grid-template-columns: 28px 28px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  animation: ctrlFinalIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}
.ctrl-final-row:nth-child(1) { animation-delay: 0.1s; }
.ctrl-final-row:nth-child(2) { animation-delay: 0.18s; }
.ctrl-final-row:nth-child(3) { animation-delay: 0.26s; }
.ctrl-final-row:nth-child(4) { animation-delay: 0.34s; }
.ctrl-final-row:nth-child(5) { animation-delay: 0.42s; }
.ctrl-final-row:nth-child(6) { animation-delay: 0.50s; }
@keyframes ctrlFinalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ctrl-final-row.is-me {
  background: rgba(255,107,157,0.18);
  border-color: rgba(255,107,157,0.55);
  box-shadow: 0 0 0 2px rgba(255,107,157,0.18);
}
.ctrl-final-medal { font-size: 18px; text-align: center; }
.ctrl-final-rank { color: var(--muted); font-weight: 600; font-size: 13px; }
.ctrl-final-avatar { font-size: 22px; line-height: 1; text-align: center; }
.ctrl-final-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctrl-final-score { font-weight: 700; font-size: 18px; color: var(--accent2); justify-self: end; }
.ctrl-final-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.ctrl-final-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transform-origin: left;
  animation: ctrlFinalBar 0.9s ease-out 0.35s backwards;
}
@keyframes ctrlFinalBar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.ctrl-final-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.ctrl-final-actions button { padding: 14px; font-size: 16px; }
