:root {
  --bg: #2b3a67;
  --bg-2: #1f2b4d;
  --panel: #ffffff;
  --panel-2: #f0f2ff;
  --text: #24293d;
  --text-light: #6b7290;
  --primary: #ff6b6b;
  --primary-2: #ff4d4d;
  --accent: #4ecdc4;
  --accent-2: #ffe66d;
  --success: #51cf66;
  --danger: #ff5252;
  --radius: 14px;
  --shadow: 0 4px 12px rgba(0,0,0,0.12);
  --vvh: 100vh;
}

[data-theme="dark"] {
  --bg: #14182b;
  --bg-2: #0c0f1e;
  --panel: #1e2340;
  --panel-2: #262c4d;
  --text: #f0f1fa;
  --text-light: #9aa0c3;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: 'Nunito', system-ui, sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
  color: var(--text);
  position: relative;
}

* { box-sizing: border-box; }

/* Background effects */
.bg-decor { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.35;
  animation: blob-float 14s ease-in-out infinite;
}
.blob-a { width: 320px; height: 320px; background: var(--primary); top: -80px; left: -80px; }
.blob-b { width: 280px; height: 280px; background: var(--accent); bottom: -90px; right: -60px; animation-delay: -4s; }
.blob-c { width: 220px; height: 220px; background: var(--accent-2); top: 40%; right: 10%; animation-delay: -8s; opacity: 0.22; }
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -24px) scale(1.08); }
}
.floaty {
  position: absolute; font-size: 1.6rem; opacity: 0.18;
  animation: floaty-drift 9s ease-in-out infinite;
}
.floaty-1 { top: 12%; left: 8%; }
.floaty-2 { top: 22%; right: 10%; animation-delay: -2s; font-size: 1.3rem; }
.floaty-3 { bottom: 18%; left: 12%; animation-delay: -5s; font-size: 1.4rem; }
.floaty-4 { bottom: 30%; right: 14%; animation-delay: -7s; }
@keyframes floaty-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(8deg); }
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 32px;
  position: relative;
  z-index: 1;
}
.screen.active { display: flex; }

/* Home Screen */
.hero { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.logo-wrap { position: relative; display: inline-block; }
.logo {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 3px 3px 0 var(--primary-2);
  margin: 10px 0 0;
  letter-spacing: 0.5px;
}
.logo span { color: var(--accent-2); }
.doodle-underline { display: block; width: 220px; height: 22px; margin: -4px auto 0; overflow: visible; }
.doodle-underline .stroke {
  fill: none; stroke-linecap: round;
  stroke-dasharray: 340; stroke-dashoffset: 340;
  animation: draw-doodle 1.1s ease-out 0.15s forwards;
}
.doodle-underline .stroke-1 { stroke: var(--primary); stroke-width: 4; }
.doodle-underline .stroke-2 { stroke: var(--accent-2); stroke-width: 3; animation-delay: 0.35s; opacity: 0.85; }
@keyframes draw-doodle { to { stroke-dashoffset: 0; } }

.tagline {
  font-weight: 600; color: #cfd4ff; margin: 8px 0 8px; font-size: 0.95rem;
}
.powered-badge {
  font-size: 0.72rem; font-weight: 600; color: var(--text-light);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 16px;
}
.powered-badge strong { color: var(--accent-2); font-weight: 800; }

.feature-strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 460px; margin: 0 0 16px; }
.feature-pill {
  display: flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 700;
  color: var(--text-light); background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 6px 12px;
}

.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 18px; width: 100%; max-width: 420px; margin-bottom: 14px; position: relative;
}
.card-label {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.divider { display: flex; align-items: center; text-align: center; color: var(--text-light); font-size: 0.72rem; margin: 4px 0 10px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(120,120,150,0.25); }
.divider span { padding: 0 8px; }

.avatar-picker { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.avatar-circle {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem; border: 4px solid #fff; box-shadow: var(--shadow);
}
.icon-btn { background: var(--panel-2); border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; padding: 0; box-shadow: none; }

input[type="text"], select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #dfe2f5;
  font-size: 1rem; font-family: inherit; background: var(--panel-2); color: var(--text); margin-bottom: 10px;
}
button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 12px;
  font-weight: 700; font-size: 1rem; padding: 12px 18px; width: 100%;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--accent), #35a39c); color: #003a37; }
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-small { width: auto; padding: 8px 14px; font-size: 0.85rem; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.how-it-works { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: 460px; margin-top: 6px; }
.hiw-step {
  display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700;
  color: var(--text-light); background: var(--panel); border-radius: 999px; padding: 6px 12px 6px 6px;
}
.hiw-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-2); color: #4a3b00;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800;
}
.hiw-arrow { color: var(--text-light); opacity: 0.5; }
@media (max-width: 640px) { .hiw-arrow { display: none; } }

.theme-toggle { position: fixed; top: 12px; right: 12px; z-index: 20; }
.theme-toggle button { width: 40px; height: 40px; border-radius: 50%; padding: 0; font-size: 1.1rem; background: var(--panel); }

/* Hide floating theme toggle completely when game is active */
#screen-game.active ~ .theme-toggle,
body:has(#screen-game.active) .theme-toggle {
  display: none !important;
}

/* ==============================================================================
   GAME SCREEN: FIXED VIEWPORT, NO PAGE SCROLLING
============================================================================== */
#screen-game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--vvh, 100dvh);
  max-height: var(--vvh, 100dvh);
  overflow: hidden;
  padding: 6px 10px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}
#screen-game.active { display: flex; }

.skribbl-game-wrap {
  width: 100%;
  max-width: 800px;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
}

/* 1. TOPBAR */
.skribbl-topbar {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin-bottom: 4px;
  gap: 6px;
  color: #0f172a !important;
  box-sizing: border-box;
}

.clock-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.clock-icon { display: none; }

.skribbl-clock {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  transition: all 0.2s ease;
  margin-top: 3px;
}
.skribbl-clock::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 2px;
  width: 8px;
  height: 5px;
  background: #1e293b;
  border-radius: 6px 6px 0 0;
  transform: rotate(-35deg);
}
.skribbl-clock::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 2px;
  width: 8px;
  height: 5px;
  background: #1e293b;
  border-radius: 6px 6px 0 0;
  transform: rotate(35deg);
}
.skribbl-clock.urgent {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
  animation: clock-wiggle 0.4s infinite alternate ease-in-out;
}
.skribbl-clock.urgent::before,
.skribbl-clock.urgent::after {
  background: #ef4444;
}
@keyframes clock-wiggle {
  0% { transform: rotate(-6deg) scale(1); }
  100% { transform: rotate(6deg) scale(1.08); }
}

.skribbl-round-sub {
  font-size: 0.68rem;
  font-weight: 800;
  color: #334155;
  margin-top: 1px;
  white-space: nowrap;
}

.guess-col {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 4px;
}

.guess-heading {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1;
  margin-bottom: 2px;
}

.guess-word {
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: clamp(1px, 1.6vw, 3px);
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.word-len-sup {
  font-size: 0.80rem;
  font-weight: 800;
  color: #64748b;
  margin-left: 2px;
  letter-spacing: normal;
}

.actions-col {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn-skribbl {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  font-size: 1.1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.1s ease;
}
.icon-btn-skribbl:active { transform: scale(0.92); }
#thumbUpBtn { background: #f0fdf4; border-color: #86efac; }
#thumbUpBtn:hover { background: #dcfce7; border-color: #4ade80; }
#thumbDownBtn { background: #fef2f2; border-color: #fca5a5; }
#thumbDownBtn:hover { background: #fee2e2; border-color: #f87171; }

/* 2. CANVAS CONTAINER: ZERO DEAD SPACE, DRAWING REACHES ALL EDGES */
.skribbl-canvas-container {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100px;
  max-height: calc(100% - 195px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  box-sizing: border-box;
}

/* Canvas fills 100% of container so every edge is 100% drawable */
canvas#drawCanvas {
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 0;
  min-height: 0;
  display: block;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

/* DRAWER TOOLBAR: Sits neatly at the bottom of canvas container */
.skribbl-drawer-toolbar {
  flex: 0 0 auto;
  width: 100%;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  background: #f8fafc;
  border-top: 1.5px solid #e2e8f0;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.brush-size-picker {
  display: flex;
  align-items: center;
  gap: 3px;
}
.brush-dot-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.brush-dot-btn span {
  border-radius: 50%;
  background: #1e293b;
  display: block;
}
.brush-dot-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

.palette-wrapper {
  display: grid;
  grid-template-columns: repeat(9, 18px);
  gap: 2px;
}
.swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.swatch:hover { transform: scale(1.15); z-index: 2; }
.swatch.active {
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px #2563eb;
  transform: scale(1.1);
  z-index: 3;
}

.tool-actions {
  display: flex;
  gap: 3px;
}
.tool-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  font-size: 0.90rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.tool-btn.active {
  background: #dbeafe;
  border-color: #2563eb;
}

/* 3. LOWER SPLIT VIEW (LEADERBOARD + CHAT SIDE-BY-SIDE) */
.skribbl-lower-split {
  flex: 0 0 135px;
  height: 135px;
  min-height: 80px;
  max-height: 160px;
  display: grid;
  grid-template-columns: 46% 54%;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

/* PLAYERS COLUMN (LEFT) - Only this list scrolls */
.skribbl-players-column {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.skribbl-player-card {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 6px;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 36px;
  color: #0f172a !important;
}

.skribbl-player-card .player-rank {
  font-weight: 800;
  font-size: 0.82rem;
  min-width: 18px;
  color: #1e293b !important;
}
.skribbl-player-card .player-details {
  flex: 1;
  min-width: 0;
  line-height: 1.15;
}
.skribbl-player-card .player-name {
  font-weight: 700;
  font-size: 0.80rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0f172a !important;
}
.skribbl-player-card.is-me .player-name {
  color: #1d4ed8 !important;
}
.skribbl-player-card .player-score {
  font-size: 0.68rem;
  color: #475569 !important;
  font-weight: 600;
}
.skribbl-player-card .player-pencil {
  font-size: 0.95rem;
  animation: pencil-wiggle 1s infinite alternate ease-in-out;
}
@keyframes pencil-wiggle {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

.skribbl-player-card .player-avatar-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.90rem;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Correct Guess Bright Green Card */
.skribbl-player-card.guessed {
  background: #55d955 !important;
  border-color: #38b038 !important;
  color: #052e05 !important;
}
.skribbl-player-card.guessed .player-rank,
.skribbl-player-card.guessed .player-name,
.skribbl-player-card.guessed .player-score {
  color: #052e05 !important;
}

/* CHAT COLUMN (RIGHT) - Only chat log scrolls */
.skribbl-chat-column {
  height: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  color: #0f172a !important;
}

.skribbl-chat-log {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 6px;
  font-size: 0.80rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #0f172a !important;
}

.chat-msg {
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1.3;
  word-break: break-word;
  color: #0f172a !important;
}
.chat-msg.draw { color: #2563eb !important; font-weight: 700; }
.chat-msg.join { color: #16a34a !important; font-weight: 600; }
.chat-msg.leave { color: #dc2626 !important; font-weight: 600; }
.chat-msg.correct-banner {
  background: #dcfce7 !important;
  color: #15803d !important;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 6px;
  border-left: 3px solid #16a34a;
}
.chat-msg.close-alert {
  background: #fef3c7 !important;
  color: #b45309 !important;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 6px;
  border-left: 3px solid #f59e0b;
}
.chat-msg.system { color: #64748b !important; font-style: italic; }
.chat-msg.guess {
  background: #f1f5f9;
  color: #0f172a !important;
}
.chat-msg.guess:nth-child(even) {
  background: #e2e8f0;
}
.chat-msg.guess .who {
  font-weight: 700;
  color: #1e293b !important;
  margin-right: 4px;
}
.chat-msg.guess .text-body {
  color: #0f172a !important;
}

/* 4. PINNED INPUT BAR (Always fixed at bottom) */
.skribbl-input-bar {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
}

.skribbl-input-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  background: #ffffff;
  color: #0f172a !important;
  outline: none;
  margin-bottom: 0;
}
.skribbl-input-bar input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.skribbl-send-btn {
  width: auto;
  min-width: 55px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

/* ==============================================================================
   MOBILE KEYBOARD-OPEN ADAPTATION (PREVENTS SQUISHED CANVAS)
============================================================================== */
body.keyboard-open #screen-game {
  padding: 2px 4px !important;
}
body.keyboard-open .skribbl-topbar {
  padding: 2px 6px !important;
  margin-bottom: 2px !important;
}
body.keyboard-open .skribbl-clock {
  width: 32px !important;
  height: 32px !important;
  font-size: 0.90rem !important;
}
body.keyboard-open .skribbl-round-sub {
  font-size: 0.58rem !important;
}
body.keyboard-open .guess-heading {
  font-size: 0.58rem !important;
}
body.keyboard-open .guess-word {
  font-size: 1.0rem !important;
}
body.keyboard-open .icon-btn-skribbl {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.90rem !important;
}

/* Canvas stays large and clear when typing */
body.keyboard-open .skribbl-canvas-container {
  flex: 1 1 0 !important;
  min-height: 140px !important;
  max-height: none !important;
}

/* Lower split collapses to compact single-card strip matching Skribbl */
body.keyboard-open .skribbl-lower-split {
  flex: 0 0 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  margin: 2px 0 !important;
}
body.keyboard-open .skribbl-player-card {
  min-height: 28px !important;
  padding: 2px 4px !important;
}
body.keyboard-open .skribbl-player-card .player-name {
  font-size: 0.70rem !important;
}
body.keyboard-open .skribbl-player-card .player-score {
  font-size: 0.58rem !important;
}
body.keyboard-open .skribbl-player-card .player-avatar-box {
  width: 18px !important;
  height: 18px !important;
  font-size: 0.75rem !important;
}
body.keyboard-open .skribbl-chat-log {
  font-size: 0.70rem !important;
  padding: 2px 4px !important;
}
body.keyboard-open .chat-msg {
  padding: 1px 3px !important;
  font-size: 0.70rem !important;
}
body.keyboard-open .skribbl-input-bar {
  padding: 3px 4px !important;
}
body.keyboard-open .skribbl-input-bar input {
  padding: 5px 8px !important;
  font-size: 0.85rem !important;
}
body.keyboard-open .skribbl-send-btn {
  padding: 5px 10px !important;
  font-size: 0.85rem !important;
  min-width: 46px !important;
}

/* Floating reactions */
.floating-reaction {
  position: absolute;
  font-size: 2.2rem;
  pointer-events: none;
  animation: reaction-fly 1.8s ease-out forwards;
  z-index: 15;
}
@keyframes reaction-fly {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  50% { transform: translateY(-40px) scale(1.3); opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* In-game Settings Modal */
.game-settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-box {
  background: var(--panel);
  border-radius: 16px;
  padding: 22px;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.settings-box h3 { margin-top: 0; margin-bottom: 16px; text-align: center; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
}

/* Word choice overlay */
.word-choice-overlay {
  position: fixed; inset: 0; background: rgba(20,24,50,0.85); z-index: 40;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.word-choice-overlay h2 { color: #fff; margin-bottom: 8px; }
.word-choice-timer {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-2);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  font-size: 1.3rem; margin: 4px 0 16px; color: #1e293b;
}
.word-choice-timer.urgent { background: #ef4444; color: #fff; animation: clock-wiggle 0.4s infinite alternate; }
.word-choice-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.word-choice-btns button { width: auto; padding: 14px 22px; font-size: 1.1rem; }

/* Results Screen */
.results-podium { display: flex; align-items: flex-end; gap: 10px; justify-content: center; margin: 20px 0; }
.podium-spot { background: var(--panel); border-radius: 12px 12px 0 0; padding: 10px; text-align: center; width: 90px; }
.podium-spot.gold { height: 130px; background: #ffe66d; color: #1e293b; }
.podium-spot.silver { height: 100px; background: #dcdfe8; color: #1e293b; }
.podium-spot.bronze { height: 80px; background: #f0c29a; color: #1e293b; }

.player-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 10px; }
.player-row .mini-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.player-row .pname { flex: 1; font-weight: 600; font-size: 0.9rem; }
.player-row .pscore { font-size: 0.85rem; color: var(--text-light); }

.hidden { display: none !important; }
.center-text { text-align: center; }
.small-note { font-size: 0.78rem; color: var(--text-light); text-align: center; margin-top: 6px; }