:root {
  --bg: #1a0b2e;
  --bg2: #2d1245;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-solid: #2a1640;
  --ink: #fdf6e3;
  --muted: #c9b8e8;
  --gold: #f5b942;
  --gold-deep: #e8890c;
  --saffron: #ff7a1a;
  --pink: #ff4d8d;
  --purple: #8b5cf6;
  --green: #34d399;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 20% -10%, #3a1860 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, #52123f 0%, transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  /* Allow vertical scroll so nothing is unreachable on shorter / Windows viewports */
  overflow-x: hidden;
  overflow-y: auto;
  /* Stop accidental text-selection highlighting on the game chrome */
  -webkit-user-select: none;
  user-select: none;
}

/* …but keep text selectable where it matters */
input, textarea, .chat, .chat * { -webkit-user-select: text; user-select: text; }

h1, h2, h3 { font-family: "Baloo 2", sans-serif; margin: 0; }

/* floating diyas background */
.diyas { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.diyas::before, .diyas::after {
  content: "🪔 ✨ 🎆 🪔 🎇 ✨ 🪔 🎆";
  position: absolute; font-size: 28px; opacity: 0.12; white-space: nowrap;
  animation: drift 40s linear infinite;
}
.diyas::after { top: 55%; font-size: 40px; animation-duration: 60s; animation-direction: reverse; }
@keyframes drift { from { transform: translateX(-20%); } to { transform: translateX(20%); } }

/* ---------- Screens ---------- */
.screen { display: none; position: relative; z-index: 1; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- Buttons / fields ---------- */
.btn {
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 16px;
  border: none; border-radius: 12px; padding: 12px 20px; cursor: pointer;
  background: rgba(255,255,255,0.1); color: var(--ink); transition: transform .08s, filter .2s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--saffron)); color: #3a1200; box-shadow: 0 6px 18px rgba(245,185,66,.3); }
.btn.big { width: 100%; padding: 15px; font-size: 18px; }
.btn.tiny { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); }
.btn.danger { background: rgba(239,68,68,.18); border: 1px solid rgba(239,68,68,.5); color: #ffb4b4; }
.btn.danger:hover { background: rgba(239,68,68,.3); color: #fff; }

.field { display: block; text-align: left; margin: 14px 0; }
.field span { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; font-weight: 700; }
input, textarea, select {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px; padding: 12px 14px; outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
.error { color: #ff9b9b; min-height: 20px; font-size: 14px; margin: 8px 0 0; }

/* ---------- Home ---------- */
.home-card {
  width: min(420px, 92vw); background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.logo { font-size: 44px; font-weight: 800; letter-spacing: -1px; }
.logo span { color: var(--gold); }
.tagline { color: var(--muted); margin: 6px 0 22px; font-weight: 600; }
.divider { position: relative; margin: 22px 0 14px; color: var(--muted); font-size: 13px; }
.divider::before { content:""; position:absolute; top:50%; left:0; right:0; height:1px; background:rgba(255,255,255,.14); }
.divider span { position: relative; background: #2a1640; padding: 0 12px; }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 3px; font-weight: 800; text-align: center; }
.join-row .btn { white-space: nowrap; }
.credit { position: fixed; bottom: 14px; color: var(--muted); font-size: 12px; opacity: .7; z-index:1; }

/* ---------- Lobby ---------- */
#screen-lobby.active, #screen-game.active { justify-content: flex-start; }
.lobby-card {
  width: min(900px, 94vw); margin: 24px auto; background: var(--panel);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.code-pill { background: linear-gradient(135deg,var(--gold),var(--saffron)); color:#3a1200; padding: 2px 12px; border-radius: 10px; letter-spacing: 3px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.panel { background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 16px; }
.panel h3 { color: var(--gold); font-size: 17px; margin-bottom: 12px; }
.setting { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.setting label { font-weight: 700; font-size: 14px; color: var(--muted); }
.setting input[type=number] { width: 90px; text-align: center; }
.setting.block { display: block; }
.setting.block label { display:block; margin-bottom: 8px; }
.setting.block small { color: var(--muted); font-weight: 600; opacity:.8; }
.pack-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pack-chip { padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); cursor: pointer; font-weight: 700; font-size: 14px; user-select: none; }
.pack-chip.on { background: linear-gradient(135deg,var(--gold),var(--saffron)); color: #3a1200; border-color: transparent; }
.host-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; opacity:.8; }

/* Words-in-play preview */
.word-count { background: var(--gold); color: #3a1200; font-weight: 800; font-size: 12px;
  padding: 1px 8px; border-radius: 20px; margin-left: 6px; }
.word-preview { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto;
  background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px; }
.wp-item { font-size: 13px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.07);
  color: var(--ink); text-transform: capitalize; white-space: nowrap; }
.wp-custom { background: linear-gradient(135deg, var(--gold), var(--saffron)); color: #3a1200; font-weight: 700; }
.wp-x { cursor: pointer; margin-left: 2px; }
.wp-x:hover { color: #7a1200; }
.word-preview:empty::after { content: "Select a pack to see its words."; color: var(--muted); font-size: 13px; }
.hint-text { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
#btn-start { margin-top: 18px; }

/* player lists */
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; }
.player-list .av { font-size: 22px; }
.player-list .pn { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list .ps { font-weight: 800; color: var(--gold); }
.player-list li.me { outline: 2px solid var(--gold); }
.player-list li.drawer { background: linear-gradient(90deg, rgba(245,185,66,.25), transparent); }
.player-list li.guessed { opacity: .65; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 20px; font-weight: 800; }
.tag.host { background: var(--purple); }
.tag.draw { background: var(--saffron); color:#3a1200; }
.tag.ok { background: var(--green); color:#063; }

/* ---------- Game ---------- */
.game-bar {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: rgba(0,0,0,.25); border-bottom: 1px solid rgba(255,255,255,.1);
}
.gb-left, .gb-right { flex: 1; display: flex; align-items: center; gap: 12px; }
.gb-right { justify-content: flex-end; }
.gb-center { flex: 2; text-align: center; }
.round-chip { color: var(--muted); font-weight: 700; }
.timer { font-family: "Baloo 2"; font-weight: 800; font-size: 26px; min-width: 50px; text-align: center;
  background: rgba(255,255,255,.08); border-radius: 10px; padding: 2px 10px; }
.timer.low { color: #ff6b6b; animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.word-display { font-family: "Baloo 2"; font-weight: 800; font-size: 28px; letter-spacing: 6px; }
.word-hint { font-size: 12px; color: var(--muted); }
.code-mini { color: var(--muted); font-size: 14px; }

.game-layout { flex: 1; display: grid; grid-template-columns: 210px 1fr 300px; gap: 12px; padding: 12px; min-height: 0; }
.players-col, .chat-col { background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px; overflow: hidden; display: flex; flex-direction: column; }
.player-list.compact li { padding: 7px 9px; }
.player-list.compact .av { font-size: 18px; }

.canvas-col { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.canvas-wrap { position: relative; width: 100%; max-width: 900px; max-height: 62vh; aspect-ratio: 900 / 640; margin: 0 auto; }
#board { width: 100%; height: 100%; background: #fffdf7; border-radius: 14px; box-shadow: var(--shadow); touch-action: none; cursor: crosshair; }
.canvas-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(26,11,46,.55); border-radius: 14px; backdrop-filter: blur(2px); font-family: "Baloo 2"; font-weight: 700; font-size: 22px; text-align: center; padding: 20px; }

.tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: rgba(0,0,0,.25); padding: 8px 12px; border-radius: 12px; flex-wrap: wrap; justify-content: center; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); cursor: pointer; }
.swatch.on { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 2px var(--gold); }
#custom-color { width: 34px; height: 34px; padding: 0; border: none; background: none; cursor: pointer; }
.sizes { display: flex; gap: 6px; align-items: center; }
.size-dot { background: rgba(255,255,255,.1); border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.size-dot span { background: #fff; border-radius: 50%; display: block; }
.size-dot.on { background: var(--gold); }
.tool-btn { font-size: 18px; background: rgba(255,255,255,.1); border: none; border-radius: 9px; width: 38px; height: 38px; cursor: pointer; }
.tool-btn.on { background: var(--gold); }

/* chat */
.chat { list-style: none; margin: 0; padding: 0 4px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.chat li { font-size: 14px; padding: 5px 8px; border-radius: 8px; word-break: break-word; line-height: 1.3; }
.chat .system { color: var(--muted); font-style: italic; font-size: 13px; }
.chat .player b { color: var(--gold); }
.chat .correct { background: rgba(52,211,153,.2); color: #b9ffd9; font-weight: 700; }
.chat .close { background: rgba(245,185,66,.18); color: var(--gold); font-weight: 700; }
.chat .guessed-chat { background: rgba(139,92,246,.18); }
.chat .guessed-chat b { color: #c4b5fd; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { padding: 10px 12px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(10,4,20,.7); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal-card { background: var(--panel-solid); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); padding: 28px; text-align: center; box-shadow: var(--shadow); width: min(460px, 92vw); }
.modal-card h3 { color: var(--gold); font-size: 22px; margin-bottom: 18px; }
.word-choices { display: flex; flex-direction: column; gap: 12px; }
.word-choices button { font-family: "Baloo 2"; font-weight: 700; font-size: 20px; padding: 16px; border-radius: 12px; border: 2px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; text-transform: capitalize; }
.word-choices button:hover { background: linear-gradient(135deg,var(--gold),var(--saffron)); color: #3a1200; border-color: transparent; }
.modal-timer { color: var(--muted); margin: 16px 0 0; font-size: 14px; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 60;
  background: var(--panel-solid); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius);
  padding: 26px 34px; text-align: center; box-shadow: var(--shadow); min-width: 300px; }
.toast h3 { font-size: 24px; color: var(--gold); margin-bottom: 10px; }
.toast .big-word { font-family: "Baloo 2"; font-size: 30px; text-transform: capitalize; margin: 8px 0; }
.toast ol { text-align: left; margin: 14px 0 0; padding-left: 26px; }
.toast li { margin: 5px 0; font-weight: 700; }
.toast .win { font-size: 20px; color: var(--green); }

.hidden { display: none !important; }

/* ---------- Join banner + switch link ---------- */
.join-banner {
  background: rgba(245,185,66,.14); border: 1px solid rgba(245,185,66,.35);
  border-radius: 11px; padding: 10px 12px; margin: 0 0 16px; font-weight: 700; font-size: 14px;
}
.join-banner b { color: var(--gold); letter-spacing: 3px; }
#create-block .divider { margin-top: 18px; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit;
  font-size: 13px; text-decoration: underline; margin-top: 12px; }
.link-btn:hover { color: var(--gold); }

/* Invite-link room details */
.room-info { background: rgba(245,185,66,.12); border: 1px solid rgba(245,185,66,.32);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; text-align: left; }
.ri-head { font-weight: 700; font-size: 15px; }
.ri-head b { color: var(--gold); }
.ri-meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.ri-meta b { color: var(--ink); letter-spacing: 2px; }

/* How to play */
.how-to { text-align: left; margin-top: 14px; background: rgba(0,0,0,.18); border-radius: 10px; padding: 2px 14px; }
.how-to summary { cursor: pointer; font-weight: 700; color: var(--gold); padding: 10px 0; font-size: 14px; list-style: none; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to summary::before { content: "ℹ️ "; }
.how-to ul { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.how-to b { color: var(--ink); }

/* ---------- Game portal (landing) ---------- */
.portal { width: min(860px, 94vw); margin: auto; text-align: center; padding: 24px; }
.portal-title { font-size: 40px; font-weight: 800; }
.portal-title span { color: var(--gold); }
.portal-sub { color: var(--muted); font-weight: 600; margin: 8px 0 30px; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.game-card {
  background: var(--panel); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius);
  padding: 26px 22px; text-align: left; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .15s ease, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(245,185,66,.5); }
.game-card.soon { cursor: default; opacity: .55; }
.game-card.soon:hover { transform: none; border-color: rgba(255,255,255,.12); }
.game-card .gc-emoji { font-size: 44px; }
.game-card .gc-name { font-family: "Baloo 2"; font-weight: 800; font-size: 24px; }
.game-card .gc-desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.game-card .gc-cta { margin-top: 10px; font-weight: 800; color: var(--gold); }
.game-card .gc-badge { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.12); color: var(--muted); }
.game-card.live .gc-badge { background: var(--green); color: #063; }

/* back link on the game home */
.back-link { position: absolute; top: 18px; left: 20px; }

/* ---------- Spectator + lobby header + leaderboard ---------- */
.spectate-row { display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 600; text-align: left; }
.spectate-row input { width: auto; }

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

.waiting-note { color: var(--gold); font-weight: 700; margin: 10px 0 6px; }
.waiting-sub { color: var(--muted); font-size: 13px; }

.col-title { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  margin: 0 0 8px; font-family: "Baloo 2"; }
.players-col .col-title { padding: 0 2px; }
.player-list .rank { font-weight: 800; color: var(--muted); width: 18px; text-align: center; font-size: 13px; }
.tag.spec { background: #64748b; }

.spectator-box { margin-top: 14px; }
.spectator-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.spectator-list li { font-size: 13px; color: var(--muted); padding: 4px 8px; background: rgba(255,255,255,.04); border-radius: 8px; }

/* ---------- End-game results table ---------- */
.toast { max-height: 86vh; overflow-y: auto; width: min(480px, 94vw); }
.result-scroll { max-height: 44vh; overflow-y: auto; margin: 12px 0 4px; border-radius: 10px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase;
  padding: 6px 8px; position: sticky; top: 0; background: var(--panel-solid); text-align: left; }
.result-table td { padding: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.result-table td.rk { width: 28px; text-align: center; font-weight: 800; color: var(--gold); }
.result-table td.num, .result-table th:nth-child(n+3) { text-align: center; }
.result-table td.num { font-weight: 700; }
.result-table tr.me-row td { background: rgba(245,185,66,.14); }
.result-table td.pl { font-weight: 700; }
.result-summary { color: var(--ink); font-weight: 700; margin: 10px 0 2px; font-size: 14px; }
.result-legend { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- Full results page ---------- */
#screen-result.active { justify-content: flex-start; }
.result-page {
  width: min(620px, 94vw); margin: 32px auto; padding: 28px 26px;
  background: var(--panel); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: center;
  animation: rise .5s cubic-bezier(.2,.8,.25,1) both;
}
.result-title { font-family: "Baloo 2"; font-weight: 800; font-size: 34px; color: var(--gold); }
.result-winner { font-size: 22px; font-weight: 800; color: var(--green); margin: 6px 0 20px; }

/* Podium */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 10px 0 24px; min-height: 150px; }
.podium-spot { display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 12px 10px 0; width: 120px; }
.podium-spot.me { outline: 2px solid var(--gold); }
.podium-av { font-size: 38px; }
.podium-name { font-weight: 700; font-size: 14px; margin-top: 4px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { color: var(--gold); font-weight: 800; font-size: 18px; }
.podium-bar { width: 100%; margin-top: 8px; border-radius: 8px 8px 0 0; font-size: 26px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(245,185,66,.3), rgba(245,185,66,.08)); }
.spot-0 .podium-bar { height: 90px; background: linear-gradient(180deg, rgba(245,185,66,.55), rgba(245,185,66,.15)); }
.spot-1 .podium-bar { height: 64px; }
.spot-2 .podium-bar { height: 44px; }
.spot-0 { order: 2; } .spot-1 { order: 1; } .spot-2 { order: 3; }

.result-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.result-actions .btn.big { width: 100%; }
.result-wait { color: var(--muted); font-weight: 600; }

/* ---------- Solo whiteboard sandbox ---------- */
body.sandbox .players-col,
body.sandbox .chat-col { display: none; }
body.sandbox .game-layout { grid-template-columns: 1fr; }
body.sandbox .round-chip { display: none; }

/* ---------- Beautify: animations & flourishes ---------- */
/* Confetti */
.confetti {
  position: fixed; top: -40px; z-index: 80; pointer-events: none;
  user-select: none; will-change: transform;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(108vh) rotate(540deg); opacity: 0.15; } }

/* Logo diya glow */
.logo { animation: glow 3.4s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { text-shadow: 0 0 18px rgba(245,185,66,.35); }
  50% { text-shadow: 0 0 34px rgba(255,122,26,.65), 0 0 60px rgba(245,185,66,.3); }
}

/* Screen + card entrances */
.home-card, .lobby-card { animation: rise .5s cubic-bezier(.2,.8,.25,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* Modal + toast pop */
.modal-card, .toast { animation: pop .34s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: translate(-50%,-50%) scale(.85); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.modal-card { animation-name: popCenter; }
@keyframes popCenter { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* Primary button shimmer */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg); animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* Correct-guess chat line pops in */
.chat .correct { animation: popIn .3s ease both; }
@keyframes popIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Drawer card gets a soft pulsing ring */
.player-list li.drawer { animation: drawerPulse 1.8s ease-in-out infinite; }
@keyframes drawerPulse { 50% { box-shadow: inset 0 0 0 1px rgba(245,185,66,.5); } }

/* Timer low-time emphasis already pulses; add a gentle tick scale */
.timer { transition: transform .15s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation: none !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; }
  .players-col { order: 1; }
  .canvas-col { order: 2; }
  .chat-col { order: 3; min-height: 180px; }
  .players-col .player-list { flex-direction: row; flex-wrap: wrap; }
  .players-col .player-list li { flex: 1 1 120px; }
  .word-display { font-size: 22px; letter-spacing: 4px; }
  .gb-center { flex: 1.4; }
}
