/* =========================================================
   Mr.Scratch — Glassmorphism Dark Theme
   Dominant: Indigo #6366f1 | Font: Fredoka / Heebo
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  /* Dominant: indigo */
  --primary:       #6366f1;
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --primary-glow:  rgba(99, 102, 241, 0.55);

  /* Accents */
  --accent:   #f59e0b;
  --good:     #34d399;
  --bad:      #f87171;
  --rose:     #f472b6;
  --purple:   #a78bfa;

  /* Glass */
  --glass:        rgba(255, 255, 255, 0.07);
  --glass-hi:     rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.13);

  /* Text */
  --ink:      #f1f5f9;
  --ink-soft: rgba(241, 245, 249, 0.65);
  --muted:    rgba(241, 245, 249, 0.38);
  --line:     rgba(255, 255, 255, 0.1);

  /* Shape */
  --radius:     22px;
  --radius-sm:  14px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
  --shadow-glow: 0 0 24px var(--primary-glow), 0 8px 32px rgba(0,0,0,0.45);

  font-family: 'Fredoka', 'Heebo', -apple-system, 'Segoe UI', system-ui, sans-serif;
}
html[dir="rtl"] {
  font-family: 'Heebo', 'Fredoka', -apple-system, 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1,h2,h3,h4 { margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }
a  { color: var(--primary-light); }

/* ---------- Animated background ---------- */
body {
  background: #0d0d1a;
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Animated gradient layer */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(-45deg, #0d0d1a, #1a0a2e, #0f172a, #1e1b4b, #0d0d1a);
  background-size: 400% 400%;
  animation: bgShift 18s ease infinite;
}
/* Radial orbs for depth */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 25%, rgba(99,102,241,.22) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 85% 80%, rgba(139,92,246,.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 20%, rgba(244,114,182,.1) 0%, transparent 55%);
  animation: orbDrift 24s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes bgShift {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes orbDrift {
  0%   { transform: scale(1)   translateY(0); }
  100% { transform: scale(1.1) translateY(-20px); }
}

/* ---------- Layout ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 14px 56px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(13, 13, 26, 0.65);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  /* anchor for the settings panel absolute positioning */
  overflow: visible;
}
.logo { font-weight: 700; font-size: 1.35rem; letter-spacing: .5px; }
.logo-mark        { color: var(--ink); }
.logo-mark.accent { color: var(--primary-light); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Settings panel ---------- */
.settings-panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 260px;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  z-index: 50;
  animation: settingsPop .2s cubic-bezier(.34,1.4,.64,1);
}
@keyframes settingsPop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-options {
  display: flex;
  gap: 8px;
}
.settings-opt {
  flex: 1;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.settings-opt:hover { background: var(--glass-hi); color: var(--ink); }
.settings-opt.active {
  background: rgba(99,102,241,.22);
  border-color: var(--primary);
  color: var(--ink);
  box-shadow: 0 0 14px var(--primary-glow);
}
.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.lang-toggle {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: .85rem;
  color: var(--ink-soft);
  transition: background .15s, color .15s, transform .1s;
}
.lang-toggle:hover  { background: var(--glass-hi); color: var(--ink); }
.lang-toggle:active { transform: scale(.95); }

/* Home (and other icon-only) buttons in the topbar */
.icon-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1;
  color: var(--ink-soft);
  transition: background .15s, color .15s, transform .1s;
  padding: 0;
}
.icon-btn:hover  { background: var(--glass-hi); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }

/* Disconnected player styling — small warning dot beside the name. */
.disconnected { opacity: .55; }
.dc-dot {
  display: inline-block;
  margin-inline-end: 4px;
  font-size: .9em;
  filter: saturate(1.3);
}

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: screenIn .3s ease; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Glass card ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 28px);
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.card.center { text-align: center; }
.hero {
  max-width: 500px; margin-inline: auto;
  text-align: center;
  padding-top: 28px;
}

/* ---------- Mascot ---------- */
.mascot-wrap {
  display: flex; justify-content: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 28px rgba(99,102,241,.5));
}
.mascot-svg {
  width: 100px; height: auto;
  animation: mascotFloat 4s ease-in-out infinite;
  transform-origin: center bottom;
}
@keyframes mascotFloat {
  0%,100% { transform: translateY(0)   rotate(-2deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}

/* ---------- Home screen text ---------- */
.tagline {
  color: var(--ink-soft);
  margin-top: -.15em; margin-bottom: 1.2rem;
  font-size: 1.05rem;
}

/* ---------- Forms ---------- */
.field { display: block; margin: 10px 0; text-align: start; }
.field > span {
  display: block; font-weight: 700; font-size: .85rem;
  color: var(--ink-soft); margin-bottom: 6px;
  letter-spacing: .3px;
}
input[type="text"], select {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,.07);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
input[type="text"]::placeholder { color: var(--muted); }
input[type="text"]:focus,
select:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,.1);
}
select option { background: #1e1b4b; color: var(--ink); }

/* ---------- Buttons ---------- */
button.primary {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border: 0;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 1rem;
  min-height: 48px;
  letter-spacing: .2px;
  box-shadow: 0 0 20px var(--primary-glow), 0 4px 14px rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .2s ease, filter .15s ease;
  position: relative; overflow: hidden;
}
button.primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  border-radius: inherit;
}
button.primary:hover  { transform: translateY(-2px); box-shadow: 0 0 32px var(--primary-glow), 0 8px 24px rgba(0,0,0,.35); }
button.primary:active { transform: translateY(0); }
button.primary.cta { animation: ctaPulse 2.8s ease-in-out infinite; }
@keyframes ctaPulse {
  0%,100% { box-shadow: 0 0 20px var(--primary-glow); }
  50%      { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(139,92,246,.3); }
}

button.secondary {
  background: rgba(99,102,241,.18);
  color: var(--primary-light);
  border: 1.5px solid var(--primary);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700; min-height: 48px;
  transition: background .15s, transform .1s;
}
button.secondary:hover  { background: rgba(99,102,241,.3); }
button.secondary:active { transform: scale(.97); }

button.ghost {
  background: var(--glass);
  color: var(--ink-soft);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700; min-height: 44px;
  transition: background .15s, color .15s, transform .1s;
}
button.ghost:hover  { background: var(--glass-hi); color: var(--ink); }
button.ghost:active { transform: scale(.97); }

button:disabled { opacity: .45; cursor: not-allowed; pointer-events: auto; }

/* ---------- Rows / dividers ---------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-block: 12px; }

.divider {
  text-align: center; color: var(--muted); margin: 14px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; height: 1px;
  width: 38%; background: var(--line);
}
.divider::before { inset-inline-start: 0; }
.divider::after  { inset-inline-end: 0; }

.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.join-row input {
  text-transform: uppercase; letter-spacing: 5px;
  text-align: center; font-weight: 700; font-size: 1.1rem;
  border-radius: 50px;
}

/* ---------- Rules ---------- */
.rules {
  margin-top: 20px; text-align: start;
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.rules summary {
  cursor: pointer; font-weight: 700;
  color: var(--primary-light);
  list-style-position: inside;
}
.rules ol,
.rules ul  { padding-inline-start: 22px; line-height: 1.65; color: var(--ink-soft); margin: 10px 0 0; }
.rules li  { margin: 5px 0; font-size: .93rem; }

/* ---------- Utility ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Lobby ---------- */
.badge-public {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #0d0d1a;
  font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill);
  letter-spacing: .2px;
}

.room-code-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; margin: 6px 0 20px;
}
.room-code-pill {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0d0d1a;
  font-weight: 700; font-size: 1.25rem;
  letter-spacing: 7px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 16px rgba(245,158,11,.4);
  animation: codePulse 3s ease-in-out infinite;
}
@keyframes codePulse {
  0%,100% { box-shadow: 0 0 16px rgba(245,158,11,.35); }
  50%      { box-shadow: 0 0 28px rgba(245,158,11,.65); }
}

.players-list {
  list-style: none; padding: 0; margin: 8px 0 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 8px;
}
.players-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.players-list li.is-bot { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.25); }
.badge-ready {
  font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(52, 211, 153, 0.15);
  color: var(--good);
  border: 1px solid rgba(52, 211, 153, 0.35);
  letter-spacing: .2px;
}
.players-list li .badge {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; font-size: .68rem; font-weight: 700;
  padding: 2px 9px; border-radius: var(--radius-pill);
  letter-spacing: .3px;
}
.players-list li.is-bot .badge { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.players-list li .score { margin-inline-start: auto; font-weight: 700; color: var(--accent); }
.bot-row .remove-bot {
  background: transparent; border: 0;
  color: var(--bad); font-size: 1rem;
  padding: 0 2px; margin-inline-start: auto;
  line-height: 1; transition: transform .1s;
}
.bot-row .remove-bot:hover { transform: scale(1.2); }

/* Kick button — small ✕ shown to host next to any non-host player */
.kick-btn {
  background: none;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 0.65rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
}
.kick-btn:hover { opacity: 1; background: rgba(248, 113, 113, 0.2); }

/* ---------- Avatar picker ---------- */
.player-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.avatar-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 1px 3px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.avatar-btn:hover {
  border-color: var(--primary-light);
  background: var(--glass-hi);
}
.avatar-picker {
  display: none; /* hidden until avatar-btn is clicked */
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 50;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(15, 15, 35, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.avatar-picker:not([hidden]) {
  display: flex; /* shown when JS removes the hidden attribute */
}
.ap-opt {
  font-size: 1.55rem;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1;
  transition: background .12s, border-color .12s, transform .12s;
}
.ap-opt:hover:not(:disabled) {
  background: var(--glass-hi);
  border-color: var(--primary-light);
  transform: scale(1.12);
}
.ap-opt:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.ap-opt.taken { position: relative; }
.ap-opt.taken::after {
  content: '🔒';
  position: absolute;
  bottom: 2px;
  inset-inline-end: 0;
  font-size: 0.55rem;
  line-height: 1;
}

/* ---------- Ready icon ---------- */
.ready-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}
button.ready-icon.ready-mine {
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-inline-start: auto;
}
button.ready-icon.ready-mine:hover {
  border-color: var(--glass-border);
  background: var(--glass-hi);
}
/* Other player's ready icon — no auto-margin, flows after name */
span.ready-icon { margin-inline-start: 6px; }

.host-controls { margin-top: 12px; }

/* ---------- Ready section (bottom of public lobby) ---------- */
#ready-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ready-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
}
.ready-check-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--good);
}
.ready-helper {
  margin: 8px 0 0;
  padding-inline-start: 30px;
}

/* ---------- Game grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: minmax(210px, 270px) 1fr;
  gap: 14px;
  align-items: start;
}
.sidebar {
  display: flex; flex-direction: column; gap: 10px;
}

/* ---------- Role box ---------- */
.role-box {
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(251,191,36,.1));
  border: 1px solid rgba(245,158,11,.35);
  padding: 16px; border-radius: var(--radius-sm);
  animation: roleIn .4s cubic-bezier(.34,1.56,.64,1);
}
.role-box.is-impostor {
  background: linear-gradient(135deg, rgba(248,113,113,.18), rgba(239,68,68,.1));
  border-color: rgba(248,113,113,.4);
}
@keyframes roleIn {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.role-label {
  font-size: .72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px;
}
.role-value {
  font-size: 1.45rem; font-weight: 700; margin-bottom: 10px;
  color: var(--accent);
}
.role-box.is-impostor .role-value { color: var(--bad); }
.word-row { margin-top: 6px; }
.word-label { font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.word-value { font-weight: 600; color: var(--ink-soft); }
.word-value.strong { font-size: 1.15rem; color: var(--good); font-weight: 700; }

/* ---------- Turn indicator ---------- */
.turn-indicator {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 14px; border-radius: var(--radius-sm);
}
.turn-line       { color: var(--ink-soft); font-size: .9rem; }
.turn-line.strong {
  font-size: 1.5rem; font-weight: 800; color: var(--primary-light);
  margin-top: 6px; letter-spacing: .3px;
  text-shadow: 0 0 18px rgba(167, 139, 250, .35);
}
/* When it's the local player's turn, hit them over the head with it. */
.turn-line.strong.is-me {
  color: var(--accent);
  font-size: 1.7rem;
  text-shadow: 0 0 22px rgba(245, 158, 11, .55);
  animation: yourTurnPulse 1.6s ease-in-out infinite;
}
@keyframes yourTurnPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.04); filter: brightness(1.2); }
}

/* ---------- Timer bar ---------- */
.timer-bar {
  height: 12px; background: rgba(255,255,255,.08);
  border-radius: var(--radius-pill); overflow: hidden; margin-top: 10px;
  border: 1px solid rgba(255,255,255,.05);
}
.timer-bar > div {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--good), var(--accent), var(--bad));
  transition: width .1s linear, background .15s ease;
  border-radius: var(--radius-pill);
}
.timer-bar.low > div {
  background: var(--bad);
  animation: timerLowPulse .55s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(248, 113, 113, .8);
}
@keyframes timerLowPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ---------- Scoreboard ---------- */
.scoreboard h4 {
  font-size: .8rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.scoreboard ul { list-style: none; padding: 0; margin: 0; }
.scoreboard li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 10px;
  font-size: .93rem;
}
.scoreboard li.me {
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.25);
  font-weight: 700;
}
.scoreboard li:not(.me):nth-child(odd) { background: rgba(255,255,255,.03); }

/* ---------- Canvas area ---------- */
.canvas-area {
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
}
.canvas-wrap {
  width: 100%; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 14px;
  border: 1.5px solid var(--glass-border);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.4);
  touch-action: none;
}
#board {
  display: block; width: 100%; height: 100%;
  cursor: crosshair; background: #fff;
  touch-action: none; /* prevent scroll/zoom while drawing */
}
#board.frozen { cursor: not-allowed; }

/* ---------- Palette ---------- */
.palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 4px 0; }
.palette button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  padding: 0;
  transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.palette button:hover   { transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.palette button.selected {
  border-color: rgba(255,255,255,.9);
  transform: scale(1.18);
  box-shadow: 0 0 10px rgba(255,255,255,.4), 0 4px 12px rgba(0,0,0,.5);
}
.palette button:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Drawing indicator strip ---------- */
/* Sits between canvas and palette. Visible for the whole turn so players
   always know at a glance who is drawing without any effort. */
.drawing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: .2px;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s;
}
/* When it's YOUR turn — bright amber, pulsing glow */
.drawing-indicator.is-me {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--accent);
  animation: drawingIndicatorPulse 1.8s ease-in-out infinite;
}
@keyframes drawingIndicatorPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, .2); }
  50%       { box-shadow: 0 0 32px rgba(245, 158, 11, .55); }
}
/* In-game: match the canvas width exactly */
#screen-game .drawing-indicator {
  width: min(88cqw, calc((100cqh - 120px) * 4 / 3));
  font-size: 1.05rem;
}

/* Active drawer highlight in the scoreboard sidebar */
#screen-game .scoreboard li.drawing {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---------- Vote screen ---------- */
.vote-list {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
  margin: 14px 0;
}
.vote-list button:not(.kick-btn) {
  width: 100%; text-align: center;
  background: var(--glass);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px 10px; font-weight: 700; font-size: 1rem;
  color: var(--ink);
  transition: transform .1s ease, border-color .15s, background .15s, box-shadow .15s;
}
/* Vote breakdown on the results screen: 👤 pips next to each player. */
#result-votes .vote-pips {
  font-size: 1.05rem;
  letter-spacing: 2px;
}
.impostor-tag {
  color: #ef4444;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: .04em;
  margin-inline-start: 6px;
  text-transform: uppercase;
}
.vote-list button:not(.kick-btn):not(:disabled):hover {
  border-color: var(--primary);
  background: rgba(99,102,241,.15);
  transform: translateY(-2px);
  box-shadow: 0 0 16px var(--primary-glow);
}
.vote-list button.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,.22);
  box-shadow: 0 0 20px var(--primary-glow);
}
.vote-list button:not(.kick-btn):disabled { cursor: default; }

/* ---------- Guess screen ---------- */
#screen-guess .card { max-width: 500px; margin-inline: auto; }
#guess-form input {
  font-size: 1.3rem; text-align: center;
  max-width: 280px; display: block; margin-inline: auto;
  letter-spacing: 1px;
}
#guess-form button { display: block; margin: 16px auto 0; }

/* ---------- Results ---------- */
#screen-results > .card { padding: 32px 36px; }
#screen-results h2 { font-size: 2rem; text-align: center; margin-bottom: 20px; }
#screen-results h3 { font-size: 1.3rem; margin-top: 28px; margin-bottom: 4px; }

.result-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  gap: 16px; font-size: 1.05rem;
}
.result-line strong { color: var(--primary-light); font-size: 1.2rem; }
#result-guess-line strong.good { color: var(--good); }
#results-actions { justify-content: center; gap: 12px; margin-top: 24px; }

/* Result scores list — bigger rows */
#result-scores.players-list li { padding: 14px 18px; font-size: 1.1rem; }
#result-scores.players-list li.me { font-size: 1.15rem; padding: 16px 18px; }

/* Winner banner */
.winner-banner {
  text-align: center; padding: 14px;
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(251,191,36,.1));
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 1.3rem; font-weight: 700; color: var(--accent);
  animation: winnerPulse 1.5s ease-in-out infinite;
}
@keyframes winnerPulse {
  0%,100% { box-shadow: 0 0 0 rgba(245,158,11,0); }
  50%      { box-shadow: 0 0 28px rgba(245,158,11,.45); }
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 28px;
  left: 50%; transform: translateX(-50%);
  background: rgba(15,15,30,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  color: var(--ink); padding: 12px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow); z-index: 200;
  font-weight: 600; white-space: nowrap;
  animation: toastIn .22s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .game-grid  { grid-template-columns: 1fr; }
  .sidebar    { order: 2; }
  .canvas-area{ order: 1; }
  .players-list { grid-template-columns: 1fr 1fr; }
  .vote-list  { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 14px; }
}
@media (max-width: 440px) {
  .players-list, .vote-list { grid-template-columns: 1fr; }
  #app { padding-inline: 10px; }
}

/* ---------- RTL ---------- */
html[dir="rtl"] .join-row input { letter-spacing: 2px; }
html[dir="rtl"] .room-code-pill { letter-spacing: 4px; }

/* =========================================================
   HOME SCREEN — Full-screen centered layout
   Card fills viewport with 20px inset on all sides,
   floating above the animated background.
   ========================================================= */

/* Lock body scroll while home screen is visible */
body:has(#screen-home.active) {
  overflow: hidden;
}

/* Override default .screen.active display:block → fixed overlay */
#screen-home.active {
  position: fixed;
  inset: 20px;          /* 20px margin from every edge */
  z-index: 3;           /* below topbar (z-index:20) */
  display: flex !important;
  align-items: center;
  justify-content: center;
  /* Reset animation so it applies to the card, not the container */
  animation: none;
}

/* The glass card — full size within the fixed container */
#screen-home .hero {
  flex: 1;
  align-self: stretch;
  max-width: none;
  margin: 0;
  padding: clamp(64px, 10vh, 100px) clamp(24px, 6vw, 80px) clamp(28px, 5vh, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-y: auto;

  /* Soft purple glowing border — the hero effect */
  background: rgba(15, 10, 40, 0.72);
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow:
    /* outer purple glow */
    0 0 0 1px rgba(139, 92, 246, 0.15),
    0 0 40px rgba(139, 92, 246, 0.35),
    0 0 90px rgba(99, 102, 241, 0.18),
    /* inner subtle glow */
    inset 0 0 80px rgba(139, 92, 246, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    /* depth shadow */
    0 24px 64px rgba(0, 0, 0, 0.55);

  animation: homeCardIn .45s cubic-bezier(.34, 1.3, .64, 1);
}

@keyframes homeCardIn {
  from { opacity: 0; transform: scale(.97) translateY(6px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Constrain form content width so it doesn't stretch edge-to-edge on ultrawide */
#screen-home .hero .field,
#screen-home .hero .join-row,
#screen-home .hero .row,
#screen-home .hero .create-row,
#screen-home .hero .divider {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

#screen-home .hero .row {
  justify-content: center;
}

/* Back row at top of public screen */
.screen-back-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.screen-back-row .icon-btn {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
}

#screen-home .hero .rules {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  text-align: start;
}

/* --- Home screen: Public Rooms button (dark green, moody, pill) --- */
button.btn-public-cta {
  background: rgba(20, 83, 45, 0.38);
  color: #4ade80;
  border: 1.5px solid rgba(34, 197, 94, 0.5);
  padding: 18px 32px;
  border-radius: 50px;
  font-weight: 700; font-size: 1.1rem;
  min-height: 56px;
  width: 100%;
  letter-spacing: .2px;
  box-shadow: 0 0 18px rgba(34,197,94,.12), 0 4px 14px rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
button.btn-public-cta:hover {
  background: rgba(20, 83, 45, 0.58);
  border-color: rgba(34, 197, 94, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(34,197,94,.28), 0 8px 24px rgba(0,0,0,.35);
}
button.btn-public-cta:active { transform: translateY(0); }

/* --- Home screen: Create Private Room button (dark purple, moody, pill) --- */
button.btn-private-cta {
  background: rgba(76, 29, 149, 0.32);
  color: #c4b5fd;
  border: 1.5px solid rgba(124, 58, 237, 0.45);
  padding: 14px 26px;
  border-radius: 50px;
  font-weight: 700; font-size: 1rem;
  min-height: 48px;
  width: 100%;
  letter-spacing: .2px;
  box-shadow: 0 0 14px rgba(124,58,237,.1), 0 4px 14px rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
button.btn-private-cta:hover {
  background: rgba(76, 29, 149, 0.52);
  border-color: rgba(124, 58, 237, 0.75);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(124,58,237,.28), 0 8px 24px rgba(0,0,0,.35);
}
button.btn-private-cta:active { transform: translateY(0); }

/* ---------- Public rooms list ---------- */
.public-rooms-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}
@media (min-width: 600px) {
  .public-rooms-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
.public-room-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  transition: background .2s, border-color .2s;
}
.public-room-card:hover {
  background: var(--glass-hi);
  border-color: rgba(255,255,255,0.22);
}
.public-room-card .pr-host {
  font-weight: 600;
  flex: 1;
  min-width: 80px;
  font-size: 1rem;
}
.public-room-card .pr-count {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--glass-hi);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.public-room-card .pr-count.almost-full {
  color: var(--accent);
}
.public-room-card .pr-meta {
  font-size: .85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.public-room-card button.small {
  padding: 6px 16px;
  font-size: .88rem;
  min-height: unset;
  margin-inline-start: auto;
}

/* Title & tagline breathing room */
#screen-home .hero h1 {
  margin-bottom: .2em;
}
#screen-home .hero .tagline {
  margin-bottom: 1.6rem;
}

/* Mobile: inset shrinks so card still has a clear border */
@media (max-width: 500px) {
  #screen-home.active { inset: 10px; }
  #screen-home .hero  { padding-inline: 18px; }
}

/* =========================================================
   GAME SCREEN — Full-screen layout below the topbar
   All screens during gameplay escape the #app max-width
   and fill the viewport.
   ========================================================= */

/* --- Shared: all in-game screens (lobby, game, vote, guess, results, public) --- */
#screen-lobby.active,
#screen-game.active,
#screen-vote.active,
#screen-guess.active,
#screen-results.active,
#screen-public.active {
  position: fixed;
  top: 56px;   /* just below the topbar */
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  animation: none;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Lobby / vote / guess / public — centred card */
#screen-lobby.active,
#screen-vote.active,
#screen-guess.active,
#screen-public.active {
  display: flex !important;
  align-items: safe center;
  justify-content: center;
  padding: 10px;
}

/* Results — truly centred */
#screen-results.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

#screen-lobby .card,
#screen-vote  > .card,
#screen-guess > .card,
#screen-results > .card,
#screen-public > .card {
  width: 100%;
  max-width: 860px;
}

/* ---- Public rooms screen enlargements ---- */
#screen-public > .card { padding: 28px 32px; }
#screen-public .screen-back-row h2 { font-size: 1.9rem; }

/* ---- Lobby enlargements ---- */
#screen-lobby .card { padding: 28px 32px; }
#screen-lobby h2 { font-size: 1.9rem; }
#screen-lobby h3 { font-size: 1.25rem; margin-top: 20px; }
#screen-lobby .room-code-pill { font-size: 2rem; letter-spacing: 5px; padding: 8px 22px; }
#screen-lobby .room-code-row { font-size: 1rem; gap: 14px; margin-bottom: 16px; }
#screen-lobby .players-list li { padding: 13px 16px; font-size: 1.05rem; }
#screen-lobby .field span { font-size: 1rem; }
#screen-lobby select,
#screen-lobby input[type="text"] { font-size: 1rem; padding: 10px 14px; }

/* ---- Vote screen enlargements ---- */
#screen-vote > .card { padding: 28px 32px; }
#screen-vote h2 { font-size: 2rem; text-align: center; margin-bottom: 4px; }
#screen-vote .muted:not(#vote-status) { font-size: 1.05rem; text-align: center; }
#vote-status { font-size: 1rem; margin-top: 12px; }
.vote-list button:not(.kick-btn) { padding: 24px 14px; font-size: 1.15rem; }

/* ---- Guess screen enlargements ---- */
#screen-guess > .card { padding: 32px 36px; }
#screen-guess h2 { font-size: 2rem; text-align: center; }
#screen-guess p { font-size: 1.05rem; text-align: center; margin-top: 6px; }
#screen-guess .card > div[style*="font-size"] { font-size: 3.5rem !important; }
#guess-form input { font-size: 1.4rem; max-width: 320px; }

/* --- Game screen: fill every pixel --- */
#screen-game.active {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

/* Grid: sidebar gets a fixed generous width; canvas fills the rest */
#screen-game .game-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: 270px 1fr;
  gap: 8px;
  align-items: stretch;
}

/* Sidebar: stretch to grid height, distribute cards evenly */
#screen-game .sidebar {
  min-height: 0;
  overflow: hidden;          /* no outer scroll — cards fill exact height */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Each sidebar card grows to fill available height */
#screen-game .sidebar > .card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;          /* gap handles spacing */
}

/* Role box: top card */
#screen-game .sidebar > .card:nth-child(1) { flex: 1.4; }
/* Scoreboard: largest — list can be long */
#screen-game .sidebar > .card:nth-child(2) { flex: 2.6; overflow-y: auto; }

/* ── Role box ── */
#screen-game .role-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;     /* center horizontally */
  text-align: center;
  padding: 16px 14px;
  gap: 6px;
}
#screen-game .role-label {
  font-size: .9rem;
  letter-spacing: 2px;
}
#screen-game .role-value {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
#screen-game .word-row {
  width: 100%;
  text-align: center;
  margin-top: 4px;
}
#screen-game .word-label {
  font-size: .88rem;
  letter-spacing: 1.5px;
}
#screen-game .word-value {
  font-size: 1.25rem;
}
#screen-game .word-value.strong {
  font-size: 1.8rem;
}

/* ── Canvas clock & round badge ──
   The clock lives in the top corner of the canvas, replacing the old sidebar
   turn indicator. Pulses red in the final 3 seconds. */
#screen-game .canvas-wrap {
  position: relative; /* anchor for clock/round badges */
}
.canvas-clock,
.canvas-round {
  position: absolute;
  top: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(13, 13, 26, 0.78);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  user-select: none;
  pointer-events: none;
}
.canvas-clock {
  inset-inline-start: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 78px;
  justify-content: center;
  font-size: 1.25rem;
}
.canvas-clock .clock-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.canvas-round {
  inset-inline-end: 12px;
  font-size: .95rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.canvas-round strong {
  color: var(--primary-light);
  font-size: 1.05rem;
  margin-inline-start: 4px;
}
/* Last 3 seconds: scream "TIME!" */
.canvas-clock.low {
  background: rgba(248, 113, 113, 0.92);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
  box-shadow: 0 0 22px rgba(248, 113, 113, .8), 0 4px 14px rgba(0, 0, 0, .5);
  animation: clockLowPulse .6s ease-in-out infinite;
}
@keyframes clockLowPulse {
  0%, 100% { transform: scale(1);    filter: brightness(1); }
  50%      { transform: scale(1.12); filter: brightness(1.25); }
}

/* ── Turn-start announcement overlay ──
   Full-screen dim + huge centered name. Visible ~1.8s before the turn timer
   actually begins (server holds the turn during this window).
   NOTE: display is managed via the .active class — NOT the hidden attribute —
   to avoid the CSS specificity conflict where display:flex overrides [hidden]. */
.turn-announce {
  display: none; /* hidden by default */
  position: fixed;
  inset: 0;
  z-index: 100; /* above topbar */
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 22, 0.74);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.turn-announce.active {
  display: flex;
  animation: turnAnnounceFade .25s ease;
}
.turn-announce.out {
  animation: turnAnnounceFadeOut .35s ease forwards;
}
.turn-announce-inner {
  text-align: center;
  padding: 28px 40px;
  transform: scale(.92);
  animation: turnAnnouncePop .55s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
.turn-announce-round {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.turn-announce-name {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--primary-light);
  text-shadow: 0 0 32px rgba(167, 139, 250, .55), 0 4px 18px rgba(0, 0, 0, .6);
  line-height: 1.1;
}
.turn-announce-name.is-me {
  color: var(--accent);
  text-shadow: 0 0 38px rgba(245, 158, 11, .7), 0 4px 18px rgba(0, 0, 0, .6);
}
@keyframes turnAnnounceFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes turnAnnounceFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; visibility: hidden; }
}
@keyframes turnAnnouncePop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Scoreboard ── */
#screen-game .scoreboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 2px 2px 4px;
}
#screen-game .scoreboard h4 {
  font-size: 1rem;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
#screen-game .scoreboard ul {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#screen-game .scoreboard li {
  padding: 14px 18px;
  font-size: 1.25rem;
  border-radius: 12px;
}
/* Highlight current user's score more prominently */
#screen-game .scoreboard li.me {
  font-size: 1.32rem;
  padding: 16px 18px;
}

/* Canvas card: size container so children can use cq units */
#screen-game .canvas-area {
  container-type: size;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}

/* Canvas wrapper: shrink-to-fit 4:3, ~85% of available space */
#screen-game .canvas-wrap {
  width:  min(88cqw, calc((100cqh - 120px) * 4 / 3));
  height: auto;
  aspect-ratio: 4 / 3;
  flex: none;
  max-width: unset;
  max-height: unset;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.4);
  overflow: hidden;
}

/* Canvas fills the wrapper exactly */
#screen-game #board {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  background: #fff;
}

/* --- Mobile: stack + scroll --- */
@media (max-width: 780px) {
  #screen-game.active {
    overflow-y: auto;
    overflow-x: hidden;
  }
  #screen-game .game-grid {
    grid-template-columns: 1fr;
    align-items: start;
    /* Undo desktop height-filling — mobile scrolls instead */
    flex: none;
    min-height: unset;
    height: auto;
  }
  /* On mobile use simple width-based 4:3 */
  #screen-game .canvas-area {
    container-type: unset;
    /* Natural content height — no centering or size-containment tricks */
    flex: none;
    min-height: unset;
    height: auto;
    justify-content: flex-start;
    overflow: visible;
  }
  #screen-game .canvas-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  #screen-game #board {
    width: 100%;
    height: 100%;
  }
  /* Sidebar: let cards show at natural height, no clipping */
  #screen-game .sidebar {
    overflow: visible;
    min-height: unset;
    flex: none;
  }
  #screen-game .sidebar > .card {
    flex: none;
    overflow: visible;
    min-height: unset;
  }
  #screen-game .drawing-indicator { width: 100%; }
}
