/* ==========================================================================
   Cricket Word Master — visual design
   Rounded, glossy, casual-game look: Fredoka for headings and tiles, Nunito for
   text, Lora for the moment of the day. Five colour themes share one structure.
   ========================================================================== */

/* ---------- themes ---------- */
:root {
  /* clue colours: the tinted tiles and the legend share these (dark enough for white letters) */
  --clue0: color-mix(in srgb, var(--accent) 84%, #000);
  --clue1: color-mix(in srgb, var(--blue) 84%, #000);
  --clue2: color-mix(in srgb, var(--violet) 84%, #000);
  --font-title: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-verse: 'Lora', 'Georgia', serif;
  --radius: 20px;
  --radius-sm: 14px;
  /* motion tokens for sliding chrome: ease-out-expo in, ease-in out (web.dev sidenav recipe) */
  --dur-in: 260ms; --dur-out: 200ms; --ease-in: cubic-bezier(.16, 1, .3, 1); --ease-out: cubic-bezier(.7, 0, .84, 0);

  /* Sky blue (default): a bright, airy match-day blue with sunny coral and aqua highlights */
  --bg-grad: linear-gradient(180deg, #eef8ff 0%, #d6edff 42%, #b7dcff 100%);
  --blob-1: #8df1ff; --blob-2: #fff2a8; --blob-3: #ffb8d9;
  --card: rgba(255, 255, 255, .74);
  --card-solid: #ffffff;
  --ink: #0e2a5c;
  --ink-2: #4b6b9b;
  --line: rgba(14, 42, 92, .12);
  --accent: #ff7a45;
  --accent-2: #19b5ff;
  --indigo: #ff7a45;
  --indigo-2: #19b5ff;
  --gold: #ffb703;
  --gold-2: #ffd166;
  --green: #22c27a;
  --blue: #2f9cf5;
  --violet: #8f6bff;
  --red: #ff4d6d;
  --slate: #4b5563;
  --primary-grad: linear-gradient(180deg, #ffb35c 0%, #ff6a3d 100%);
  --primary-shadow: #c8441a;
  --primary-ink: #ffffff;
  --btn-shadow: rgba(30, 90, 160, .22);
  --tile-edge: #8ec6ff;
  --tile-face: linear-gradient(180deg, #ffffff 0%, #e4f2ff 100%);
  --tile-ink: #0e2a5c;
  --tile-sel: linear-gradient(180deg, #ffb35c 0%, #ff6a3d 100%);
  --tile-sel-edge: #c8441a;
  --tile-wrong: linear-gradient(180deg, #ff8585, #e63946);
  --tile-gold: linear-gradient(180deg, #fff1a8 0%, #ffb703 100%);
  --tile-blue: linear-gradient(180deg, #dff6ff 0%, #4cc9f0 100%);
  --tile-violet: linear-gradient(180deg, #f1e5ff 0%, #b57bee 100%);
  --tile-slate: linear-gradient(180deg, #9aa3b2 0%, #3f4753 100%);
  --tile-wild: linear-gradient(180deg, #17b3a8 0%, #0b5550 100%);
  --shadow: 0 14px 36px rgba(30, 90, 160, .18);
  --glow: 0 0 24px rgba(25, 181, 255, .45);
}
:root[data-theme="green"], :root[data-theme="green"] body {
  --bg-grad: linear-gradient(180deg, #03241a 0%, #064d2f 50%, #0c7a46 100%);
  --blob-1: #ffd166; --blob-2: #2ecc71; --blob-3: #ffffff;
  --card: rgba(6, 50, 32, .80); --card-solid: #0a4a2f;
  --ink: #f6fff8; --ink-2: #a9dcbf; --line: rgba(255, 255, 255, .14);
  --accent: #ffd166; --accent-2: #7ee8a2; --indigo: #ffd166; --indigo-2: #7ee8a2;
  --gold: #ffcc4d; --gold-2: #ffe08a; --green: #34d399; --blue: #67d3ff; --violet: #c084fc; --red: #ff6b7a;
  --primary-grad: linear-gradient(180deg, #ffe08a 0%, #f4a300 100%); --primary-shadow: #8c5f10; --primary-ink: #1f2a1a;
  --btn-shadow: rgba(0, 0, 0, .45);
  --tile-edge: #6fc49a; --tile-face: linear-gradient(180deg, #ffffff 0%, #e2f8ea 100%); --tile-ink: #064d2f;
  --tile-sel: linear-gradient(180deg, #34d399 0%, #0f8a4a 100%); --tile-sel-edge: #065f33;
  --shadow: 0 14px 36px rgba(0, 0, 0, .45); --glow: 0 0 24px rgba(255, 209, 102, .5);
}
:root[data-theme="floodlight"], :root[data-theme="floodlight"] body {
  --bg-grad: linear-gradient(180deg, #02040a 0%, #0a1430 55%, #12306e 100%);
  --blob-1: #4cc9f0; --blob-2: #ffffff; --blob-3: #ff9933;
  --card: rgba(14, 22, 48, .82); --card-solid: #131b3a;
  --ink: #f2f6ff; --ink-2: #9fb0d8; --line: rgba(255, 255, 255, .12);
  --accent: #4cc9f0; --accent-2: #ff9933; --indigo: #4cc9f0; --indigo-2: #ff9933;
  --gold: #ffcc4d; --gold-2: #ffe08a; --green: #34d399; --blue: #67d3ff; --violet: #c084fc; --red: #ff6b7a;
  --primary-grad: linear-gradient(180deg, #67d3ff 0%, #1d4ed8 100%); --primary-shadow: #12308a;
  --btn-shadow: rgba(0, 0, 0, .55);
  --tile-edge: #5b7bd6; --tile-face: linear-gradient(180deg, #ffffff 0%, #e4ecff 100%); --tile-ink: #0a1430;
  --tile-sel: linear-gradient(180deg, #67d3ff 0%, #1d4ed8 100%); --tile-sel-edge: #12308a;
  --shadow: 0 14px 36px rgba(0, 0, 0, .55); --glow: 0 0 24px rgba(76, 201, 240, .55);
}
:root[data-theme="turf"] {
  --bg-grad: linear-gradient(180deg, #e9fbe4 0%, #c8f0c0 50%, #a7e39d 100%);
  --blob-1: #86efac; --blob-2: #fde68a; --blob-3: #bae6fd;
  --card: rgba(255, 255, 255, .84); --card-solid: #ffffff;
  --ink: #163a22; --ink-2: #4f7d5c; --line: rgba(20, 90, 40, .14);
  --accent: #15803d; --accent-2: #f59e0b; --indigo: #15803d; --indigo-2: #f59e0b;
  --gold: #f4a300; --gold-2: #ffd166; --green: #16a34a; --blue: #0ea5e9; --violet: #9d4edd; --red: #ef476f;
  --primary-grad: linear-gradient(180deg, #4ade80 0%, #15803d 100%); --primary-shadow: #14532d;
  --btn-shadow: rgba(20, 90, 40, .22);
  --tile-edge: #7cc98f; --tile-face: linear-gradient(180deg, #ffffff 0%, #e8f9e8 100%); --tile-ink: #163a22;
  --tile-sel: linear-gradient(180deg, #ffb347 0%, #ff7a00 100%); --tile-sel-edge: #b84a00;
  --shadow: 0 14px 36px rgba(20, 90, 40, .18); --glow: 0 0 24px rgba(21, 128, 61, .45);
}
:root[data-theme="whites"] {
  --bg-grad: linear-gradient(180deg, #fbf7ee 0%, #f1e8d6 100%);
  --blob-1: #f3d9a4; --blob-2: #c7d7f5; --blob-3: #ffe9c9;
  --card: rgba(255, 253, 248, .9); --card-solid: #fffdf8;
  --ink: #16213e; --ink-2: #6b6f8a; --line: rgba(20, 30, 60, .14);
  --accent: #0b2a6f; --accent-2: #c9922f; --indigo: #0b2a6f; --indigo-2: #c9922f;
  --gold: #c9922f; --gold-2: #e8c15c; --green: #3f7d4f; --blue: #3b7fa8; --violet: #6b4ba3; --red: #a63a2f;
  --primary-grad: linear-gradient(180deg, #2f55b8 0%, #0b2a6f 100%); --primary-shadow: #061a45;
  --btn-shadow: rgba(20, 30, 60, .22);
  --tile-edge: #b9c3dc; --tile-face: linear-gradient(180deg, #ffffff 0%, #eef1f8 100%); --tile-ink: #0b2a6f;
  --tile-sel: linear-gradient(180deg, #5a7bd6 0%, #0b2a6f 100%); --tile-sel-edge: #061a45;
  --shadow: 0 14px 36px rgba(20, 30, 60, .16); --glow: 0 0 24px rgba(11, 42, 111, .35);
}
/* Sky blue is the default on every device; Green, Floodlight (the old navy night look), Whites and Turf are picked on the menu. */


/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-grad) fixed;
}
/* drifting soft blobs behind everything */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none;
  animation: drift 26s ease-in-out infinite alternate;
}
body::before { width: 60vmax; height: 60vmax; left: -20vmax; top: -15vmax; background: radial-gradient(circle, var(--blob-1), transparent 65%); }
body::after { width: 55vmax; height: 55vmax; right: -18vmax; bottom: -20vmax; background: radial-gradient(circle, var(--blob-2), transparent 65%); animation-delay: -12s; animation-duration: 32s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.12); } }

button { font: inherit; color: inherit; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; margin: 0; letter-spacing: .01em; line-height: 1.1; }
.hint { color: var(--ink-2); font-style: italic; font-size: .92em; }
.muted { color: var(--ink-2); }
.verse { font-family: var(--font-verse); font-size: 1.08em; line-height: 1.5; }
mark { background: color-mix(in srgb, var(--gold) 40%, transparent); color: inherit; padding: 0 .15em; border-radius: 6px; }
.label { font-size: .68em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

#app {
  height: 100vh; height: 100svh;
  max-width: 640px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex; flex-direction: column;
  transition: max-width .2s ease;
}
#app.wide { max-width: 1000px; }
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.active { display: flex; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; border-radius: var(--radius-sm); padding: 12px 18px; cursor: pointer;
  background: var(--card-solid); color: var(--ink);
  font-family: var(--font-title); font-weight: 600; font-size: 1em; line-height: 1.1;
  box-shadow: 0 4px 0 var(--btn-shadow), 0 10px 20px rgba(0, 0, 0, .06);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; user-select: none;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow), 0 4px 10px rgba(0, 0, 0, .06); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--primary-grad); color: var(--primary-ink); box-shadow: 0 5px 0 var(--primary-shadow), 0 14px 28px rgba(255, 93, 143, .3); text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn.primary:active { box-shadow: 0 1px 0 var(--primary-shadow), 0 6px 14px rgba(255, 93, 143, .25); }
.btn.big { padding: 16px 30px; font-size: 1.25em; border-radius: 18px; }
.btn.active { outline: 3px solid var(--accent); outline-offset: -1px; }
.btn.icon { padding: 10px 12px; min-width: 44px; min-height: 44px; }
.btn.whatsapp { background: linear-gradient(180deg, #34e07a, #1fbe5a); color: #fff; box-shadow: 0 4px 0 #14803c, 0 10px 20px rgba(31, 190, 90, .3); }
a.btn { text-decoration: none; }

/* ---------- menu ---------- */
#screen-menu { justify-content: flex-start; align-items: center; text-align: center; gap: 14px; overflow-y: auto; padding: 14px 0; scrollbar-width: none; }
#screen-menu::-webkit-scrollbar { display: none; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo .kicker { font-family: var(--font-title); letter-spacing: .4em; color: var(--ink-2); font-size: .75em; font-weight: 700; }
.logo-tiles { display: flex; }
.logo-tile {
  width: 60px; height: 52px; margin: 0 -7px; display: grid; place-items: center; position: relative;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--tile-edge); font-family: var(--font-title); font-weight: 700; font-size: 26px; color: var(--tile-ink);
  animation: logoFloat 3.2s ease-in-out infinite;
}
.logo-tile:nth-child(2) { animation-delay: .3s; } .logo-tile:nth-child(3) { animation-delay: .6s; } .logo-tile:nth-child(4) { animation-delay: .9s; } .logo-tile:nth-child(5) { animation-delay: 1.2s; }
.logo-tile::before { content: ''; position: absolute; inset: 0 0 4px 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,0) 55%), var(--tile-face); z-index: -1; }
.logo-tile.gold { background: #c98a00; } .logo-tile.gold::before { background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 55%), var(--tile-gold); }
.logo-tile.sel { background: var(--tile-sel-edge); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); } .logo-tile.sel::before { background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 55%), var(--tile-sel); }
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.logo h1 { font-size: 2.4em; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .04em; }
.tagline { color: var(--ink-2); margin: 0; font-weight: 600; }
.day-streak { margin: 0; font-family: var(--font-title); color: var(--accent); font-weight: 600; }
.menu-stats { display: flex; gap: 10px; justify-content: center; }
.menu-stats > div { display: flex; flex-direction: column; min-width: 96px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.menu-stats strong { font-family: var(--font-title); font-size: 1.35em; color: var(--ink); }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: min(340px, 100%); }
.menu-buttons .row { display: flex; gap: 10px; }
.menu-buttons .row .btn { flex: 1; }
.btn.daily { flex-direction: column; gap: 2px; padding: 11px 16px; }
.btn.daily small { font-family: var(--font-body); font-weight: 600; font-size: .72em; color: var(--ink-2); }
.menu-foot { font-size: .78em; color: var(--ink-2); margin: 0; }
.moment-card { width: min(440px, 100%); background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0)), var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-align: center; box-shadow: var(--shadow); }
.moment-card p { margin: 0; font-family: var(--font-verse); font-style: italic; font-size: 1.05em; line-height: 1.45; }
.moment-card .ref { font-family: var(--font-title); color: var(--accent); font-weight: 600; }
.moment-card .row { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.moment-card .row .btn { flex: 1; padding: 10px 10px; font-size: .95em; }
.theme-row { display: flex; gap: 10px; align-items: center; justify-content: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; padding: 0; transition: transform .15s ease; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { box-shadow: 0 0 0 3px var(--accent), 0 2px 6px rgba(0,0,0,.18); }
.swatch[data-theme="blue"] { background: linear-gradient(135deg, #ff7a45, #8ec6ff 55%, #ffffff); }
.swatch[data-theme="green"] { background: linear-gradient(135deg, #064d2f, #34d399 55%, #ffd166); }
.swatch[data-theme="floodlight"] { background: linear-gradient(135deg, #02040a, #1d4ed8 55%, #67d3ff); }
.swatch[data-theme="whites"] { background: linear-gradient(135deg, #f1e8d6, #0b2a6f 55%, #c9922f); }
.swatch[data-theme="turf"] { background: linear-gradient(135deg, #15803d, #a7e39d 55%, #ffd166); }

/* ---------- ad banner slots ---------- */
.ad-banner { width: 100%; min-height: 54px; display: flex; justify-content: center; }
.ad-banner-sim { width: 100%; max-width: 360px; height: 54px; border: 1px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-size: .78em; padding: 0 10px; background: var(--card); }
.ad-badge { display: inline-block; font: 800 .7em/1 sans-serif; letter-spacing: .05em; padding: 3px 5px; border-radius: 4px; background: var(--ink-2); color: #fff; }

/* ---------- game layout ---------- */
.game-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
.game-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.game-side { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) {
  .game-wrap { flex-direction: row; gap: 22px; }
  .game-main { flex: 1; min-width: 0; }
  .game-side { width: 310px; flex: none; padding-top: 10px; }
}

/* ---------- HUD ---------- */
.hud { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; margin-bottom: 8px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)), var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hud .label { display: block; }
.hud .val { font-family: var(--font-title); font-weight: 700; font-size: 1.3em; line-height: 1.1; }
.hud .timer .val { font-size: 1.9em; font-variant-numeric: tabular-nums; text-align: center; color: var(--accent); }
.hud .timer .val.low { color: var(--red); animation: pulse .6s ease-in-out infinite; }
.hud .score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 5px; }
.progress > div { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--gold)); box-shadow: 0 0 12px var(--gold); transition: width .4s ease; position: relative; overflow: hidden; }
.progress > div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: shimmer 2.2s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.streak-badge { display: none; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--primary-grad); color: #fff; font-family: var(--font-title); font-weight: 600; font-size: .85em; position: relative; overflow: hidden; box-shadow: var(--glow); }
.streak-badge.on { display: inline-flex; animation: pulse .5s ease; }
.streak-badge i { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.9); width: 100%; transition: width 1s linear; }

.bonus-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 6px; background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.bonus-bar .label { white-space: nowrap; }
.bonus-letters { display: flex; gap: 4px; flex: 1; }
.bonus-letters .bl { width: 24px; height: 28px; border-radius: 7px; background: var(--line); display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; color: var(--accent); }
.bonus-letters .bl.on { background: var(--gold-2); color: var(--tile-ink); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.bonus-len { font-size: .78em; color: var(--ink-2); white-space: nowrap; font-weight: 700; }

/* ---------- board and tiles ---------- */
#board-wrap { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
#board { position: relative; --tile-w: 64px; --tile-h: 56px; contain: layout; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.tile {
  position: absolute; width: var(--tile-w); height: var(--tile-h);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--tile-edge);
  display: grid; place-items: center;
  font-family: var(--font-title); font-weight: 700; font-size: calc(var(--tile-w) * .46);
  color: var(--tile-ink); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
  transition: transform .15s ease;
}
.tile.selected, .tile.appear, .tile.vanish, .tile.pop, .tile.hint { will-change: transform; }
.tile::before { content: ''; position: absolute; inset: 0 0 5px 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 55%), var(--tile-face); }
.tile .glyph { position: relative; z-index: 1; transform: translateY(-2px); }
.tile::after { content: attr(data-tag); display: none; position: absolute; z-index: 1; bottom: 14%; padding: 1px 6px; border-radius: 999px; font: 800 calc(var(--tile-w) * .15)/1.3 var(--font-body); color: #fff; background: rgba(0,0,0,.35); }
.tile[data-tag]::after, .tile.sp1::after, .tile.sp2::after, .tile.sp3::after, .tile.sp4::after { display: block; }
.tile.sp1 { background: #c98a00; } .tile.sp1::before { background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 55%), var(--tile-gold); } .tile.sp1::after { content: '×3'; }
.tile.sp2 { background: #1f8fc0; } .tile.sp2::before { background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 55%), var(--tile-blue); } .tile.sp2::after { content: '+15s'; }
.tile.sp3 { background: #7a3fc0; } .tile.sp3::before { background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 55%), var(--tile-violet); } .tile.sp3::after { content: '★'; }
.tile.sp4 { background: #1f2329; color: #f6f3ff; } .tile.sp4::before { background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 55%), var(--tile-slate); } .tile.sp4::after { content: '✕'; }
.tile.wild { background: #073a36; color: #fff; } .tile.wild::before { background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 55%), var(--tile-wild); }
.tile.selected { background: var(--tile-sel-edge); color: #fff; transform: scale(1.1); z-index: 3; }
.tile.selected::before { background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 55%), var(--tile-sel); }
.tile.selected .glyph { text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.tile.wrong { background: #9b1c2e; color: #fff; animation: shake .35s ease; }
.tile.wrong::before { background: var(--tile-wrong); }
.tile.swap-src { animation: pulse .9s ease-in-out infinite; z-index: 3; background: var(--tile-sel-edge); color: #fff; }
.tile.swap-src::before { background: var(--tile-sel); }
.tile.hint { animation: hintPulse 1.1s ease-in-out infinite; z-index: 2; background: #c98a00; }
.tile.hint::before { background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 55%), var(--tile-gold); }
.tile.hint::after { content: attr(data-tag); }
.tile.appear { animation: appear .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.tile.vanish { animation: vanish .36s ease-in both; }
.tile.pop { animation: tilePop .35s ease; }
@media (hover: hover) { .tile:hover { transform: scale(1.06); z-index: 2; } .tile.selected:hover { transform: scale(1.12); } }
.tile .cmark { position: absolute; z-index: 2; top: 10%; right: 19%; width: calc(var(--tile-w) * .3); height: calc(var(--tile-w) * .3); border-radius: 50%; color: #fff; font: 800 calc(var(--tile-w) * .17)/1 var(--font-body); font-style: normal; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.35), 0 0 0 2px #fff; animation: markPulse 1.4s ease-in-out infinite; }
.tile .cmark + .cmark { right: auto; left: 19%; }
.tile .cmark + .cmark + .cmark { top: auto; bottom: 14%; left: auto; right: 19%; }
.c0 { background-color: var(--clue0); }
.c1 { background-color: var(--clue1); }
.c2 { background-color: var(--clue2); }

@keyframes appear { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes vanish { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes hintPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes markPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes tilePop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

#ready-overlay, .level-banner {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 20;
  font-family: var(--font-title); font-weight: 700; font-size: 3.4em;
  background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); opacity: 0; transition: opacity .2s ease;
}
#ready-overlay.show { opacity: 1; animation: pop .3s cubic-bezier(.2, .9, .3, 1.4); }
.level-banner { opacity: 1; animation: levelIn 1.7s ease both; text-align: center; }
.level-banner small { display: block; font-size: .4em; letter-spacing: .3em; text-transform: uppercase; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes levelIn { 0% { opacity: 0; transform: scale(.7); } 15% { opacity: 1; transform: scale(1); } 85% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

/* effects */
.fx-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 25; }
.callout { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); pointer-events: none; z-index: 26; font-family: var(--font-title); font-weight: 700; font-size: 3em; color: #fff; text-shadow: 0 4px 0 var(--accent), 0 0 30px rgba(255,255,255,.8); -webkit-text-stroke: 1px rgba(0,0,0,.08); animation: callout 1.1s cubic-bezier(.2, .9, .3, 1.2) forwards; white-space: nowrap; }
.callout.gold { text-shadow: 0 4px 0 #c98a00, 0 0 30px rgba(255, 220, 120, .95); }
@keyframes callout { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(-4deg); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(2deg); } 35% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1.05); } }

/* ---------- word bar + controls ---------- */
.word-bar + .dock { margin-top: 10px; }
.word-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 7px 12px; background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius-sm); }
#current-word { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; min-height: 34px; }
#current-word .cw, .handle .cw { width: 32px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--tile-sel); color: #fff; font-family: var(--font-title); font-weight: 700; box-shadow: 0 3px 0 var(--tile-sel-edge); animation: appear .2s ease; }
#current-word .cw.wild { background: var(--tile-gold); color: var(--tile-ink); box-shadow: 0 3px 0 #c98a00; }
#current-score { font-family: var(--font-title); font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 1.1em; }
.controls { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; margin-top: 10px; }
.controls.helps { grid-template-columns: 1fr 1fr 1fr; margin-top: 8px; }
.controls .btn { padding: 11px 6px; min-height: 44px; }
.controls.helps .btn { font-size: .95em; padding: 10px 6px; }
.swaps { display: inline-flex; gap: 3px; }
.swaps i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.swaps i.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
#btn-swap.empty { color: var(--ink-2); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font: 800 .75em/1 var(--font-body); }
#btn-hint.empty .count { background: var(--line); color: var(--ink-2); }
#found-words { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 2px; min-height: 34px; scrollbar-width: none; }
#found-words::-webkit-scrollbar { display: none; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--card-solid); border: 1px solid var(--line); font-size: .9em; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 0 var(--line); }
.chip.scrip { background: var(--gold-2); border-color: transparent; color: var(--tile-ink); box-shadow: 0 2px 0 #c98a00; }

/* ---------- clue panel ---------- */
.panel-card { background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)), var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.panel-card .label { display: block; }
.clues-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.clue-toggle { padding: 8px 12px; font-size: .9em; }
.clues-label { margin-top: 10px; }
.wordcount { display: flex; align-items: baseline; gap: 8px; }
.wordcount strong { font-family: var(--font-title); font-size: 1.5em; color: var(--accent); }
.wordcount small { color: var(--ink-2); font-weight: 600; }
.clues { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clue { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--card-solid); border: 1px solid var(--line); animation: clueIn .4s ease both; box-shadow: 0 3px 0 var(--line); }
.clue .box { width: 30px; height: 30px; flex: none; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background-image: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%); display: grid; place-items: center; font: 800 .8em/1 var(--font-body); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.clue p { margin: 0; font-size: .95em; line-height: 1.35; font-family: var(--font-verse); font-style: italic; text-wrap: balance; }
.clue .len { display: block; margin-top: 4px; font-size: .72em; color: var(--ink-2); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.clue.found { background: color-mix(in srgb, var(--green) 16%, var(--card-solid)); border-color: var(--green); animation: clueFound .6s ease; }
.clue.found .box { background-color: var(--green) !important; }
.clue.found p { text-decoration: line-through; color: var(--ink-2); }
.clue.found .len { color: var(--green); }
@keyframes clueIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes clueFound { 0% { transform: scale(1); } 35% { transform: scale(1.05); } 100% { transform: scale(1); } }
/* ---------- phones: the board fills the screen; the HUD and the controls slide in and out ---------- */
.peek, .handle { display: none; }
@media (max-width: 899px) {
  #screen-game.active { position: fixed; inset: 0; z-index: 5; padding: 0; max-width: none; }
  .game-wrap { position: relative; height: 100%; gap: 0; }
  .game-main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
  #board-wrap { position: absolute; left: 0; right: 0; top: calc(52px + env(safe-area-inset-top, 0px)); bottom: calc(66px + env(safe-area-inset-bottom, 0px)); top: calc(104px + env(safe-area-inset-top, 0px)); }
  .topbar, .dock, .handle, .peek, .game-side { transition: transform var(--dur-in) var(--ease-in), visibility 0s linear 0s; }
  .topbar { position: absolute; left: 10px; right: 10px; top: calc(6px + env(safe-area-inset-top, 0px)); z-index: 35; }
  .topbar .hud { margin-bottom: 6px; }
  .game-main.play .topbar { transform: translate3d(0, calc(-100% - 24px), 0); visibility: hidden; pointer-events: none; transition: transform var(--dur-out) var(--ease-out), visibility 0s linear var(--dur-out); }
  .peek { position: absolute; top: calc(6px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 34; display: inline-flex; align-items: center; gap: 10px; padding: 5px 6px 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--card-solid) 94%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); font-family: var(--font-title); font-weight: 700; color: var(--ink); appearance: none; cursor: pointer; transform: translate3d(-50%, calc(-100% - 24px), 0); visibility: hidden; transition: transform var(--dur-out) var(--ease-out), visibility 0s linear var(--dur-out); }
  .game-main.play .peek { transform: translate3d(-50%, 0, 0); visibility: visible; transition: transform var(--dur-in) var(--ease-in), visibility 0s; }
  .peek .pt { color: var(--accent); font-variant-numeric: tabular-nums; min-width: 3em; font-size: 1.15em; }
  .peek .pt.low { color: var(--red); animation: pulse .6s ease-in-out infinite; }
  .peek .ps { font-size: .95em; font-weight: 600; color: var(--ink-2); } .peek .ps b { color: var(--ink); }
  .peek .pp { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: .75em; }
  .peek .pbar { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
  .peek .pbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .4s ease; }
  .dock { position: absolute; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 35; padding: 8px; border-radius: var(--radius); background: color-mix(in srgb, var(--card-solid) 94%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .dock .controls { margin-top: 8px; }
  .game-main.play .dock { transform: translate3d(0, calc(100% + 24px), 0); visibility: hidden; pointer-events: none; transition: transform var(--dur-out) var(--ease-out), visibility 0s linear var(--dur-out); }
  .handle { position: absolute; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 34; display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 52px; border-radius: 18px; background: color-mix(in srgb, var(--card-solid) 94%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .word-bar { position: absolute; left: 10px; right: 10px; top: calc(54px + env(safe-area-inset-top, 0px)); z-index: 33; min-height: 44px; padding: 4px 10px; transition: opacity var(--dur-in) ease; }
  .game-main:not(.play) .word-bar { opacity: 0; pointer-events: none; }
  #current-word:empty::before { content: 'Tap letters to spell'; color: var(--ink-2); font-size: .9em; font-weight: 600; }
  .handle .hw { flex: 1; display: flex; gap: 4px; overflow: hidden; align-items: center; min-height: 36px; padding-left: 4px; }
  .handle .hs { font-family: var(--font-title); font-weight: 700; color: var(--accent); white-space: nowrap; font-size: .9em; }
  .handle .btn { padding: 10px 12px; min-height: 44px; }
  .handle #handle-tools { flex: 1; } .handle #handle-clues { flex: 1; }
  .handle:not(.selecting) #handle-submit, .handle:not(.selecting) #handle-clear { display: none; }
  .game-side { position: absolute; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 36; max-height: 72%; transform: translate3d(0, calc(100% + 24px), 0); visibility: hidden; transition: transform var(--dur-out) var(--ease-out), visibility 0s linear var(--dur-out); }
  .game-wrap.sheet .game-side { transform: none; visibility: visible; transition: transform var(--dur-in) var(--ease-in), visibility 0s; }
  .game-side .panel-card { padding: 10px 12px; max-height: 100%; display: flex; flex-direction: column; background: var(--card-solid); }
  .game-side .clues { display: flex !important; overflow: auto; min-height: 0; }
  .clues-label { display: none; }
  .clue p { font-size: .9em; }
  .hud, .bonus-bar, .word-bar, .panel-card, .moment-card, .menu-stats > div { backdrop-filter: none; }
  .hud, .bonus-bar, .word-bar { background-color: color-mix(in srgb, var(--card-solid) 94%, transparent); }
  .hud .score { gap: 2px; }
}
@media (max-width: 899px) and (orientation: landscape) {
  #board-wrap { top: calc(8px + env(safe-area-inset-top, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 150px; right: 150px; }
  .peek { left: 10px; transform: translate3d(0, calc(-100% - 24px), 0); } .game-main.play .peek { transform: none; }
  .handle, .dock, .game-side { left: 10px; right: auto; width: 320px; }
  .word-bar { right: auto; width: 132px; top: calc(60px + env(safe-area-inset-top, 0px)); flex-direction: column; align-items: flex-start; }
  #current-word .cw { width: 24px; height: 28px; font-size: .85em; }
}
@media (prefers-reduced-motion: reduce) { :root { --dur-in: 1ms; --dur-out: 1ms; } }
@media (min-width: 900px) {
  .game-side .clue-toggle { display: none; }
  .game-side.collapsed .clues { display: flex; }
}

/* ---------- overlays, popups, toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(40, 20, 60, .45); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s ease; padding: 16px; }
.overlay.show { opacity: 1; pointer-events: auto; }
.panel { background: var(--card-solid); border-radius: 26px; box-shadow: var(--shadow); padding: 26px; width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.popup { background: var(--card-solid); border-radius: 26px; box-shadow: var(--shadow); padding: 22px 24px; width: min(470px, 100%); max-height: 90vh; overflow: auto; transform: scale(.92) translateY(10px); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.popup-overlay.show .popup { transform: none; }
.popup h2 { font-size: 1.45em; margin-bottom: 8px; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popup-body p { margin: 8px 0; }
.popup-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.popup.tutorial ol { padding-left: 1.2em; margin: 0; }
.popup.tutorial li { margin: 7px 0; }
.sw { display: inline-block; padding: 0 7px; border-radius: 6px; font: 800 .8em/1.6 var(--font-body); color: #fff; }
.sw.gold { background: #e09b00; } .sw.blue { background: #1f8fc0; } .sw.violet { background: #7a3fc0; } .sw.dark { background: #23262b; }
.input { width: 100%; font: inherit; font-weight: 600; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--card-solid); color: var(--ink); outline: none; }
.input:focus { border-color: var(--accent); }

#toast { position: fixed; left: 50%; bottom: 150px; transform: translate(-50%, 20px); z-index: 60; background: rgba(40, 24, 60, .92); color: #fff; padding: 12px 18px; border-radius: 16px; max-width: min(520px, 92vw); opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; text-align: center; font-size: .95em; font-weight: 600; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.verse { text-align: left; }
#toast.verse strong { font-family: var(--font-title); color: var(--gold-2); margin-right: 6px; }
#toast.verse .ref { opacity: .85; font-size: .9em; }
#toast.verse em { display: block; margin-top: 4px; font-family: var(--font-verse); font-weight: 400; }
.float { position: fixed; z-index: 70; transform: translate(-50%, 0); pointer-events: none; font-family: var(--font-title); font-weight: 700; font-size: 1.5em; color: #fff; text-shadow: 0 3px 0 var(--accent), 0 0 12px rgba(0,0,0,.2); animation: floatUp 1.4s ease-out forwards; white-space: nowrap; }
.float.gold { font-size: 1.9em; text-shadow: 0 3px 0 #c98a00, 0 0 14px rgba(255, 200, 80, .8); }
.float.scrip { text-shadow: 0 3px 0 #c98a00, 0 0 12px rgba(255, 200, 80, .7); }
.float.note { font-size: 1em; font-family: var(--font-body); font-weight: 800; color: var(--ink); text-shadow: 0 1px 0 #fff, 0 0 8px #fff; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }

/* ---------- simulated ads ---------- */
.ad-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 90; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s ease; padding: 16px; }
.ad-overlay.show { opacity: 1; }
.ad-card { width: min(380px, 100%); background: #fff; color: #222; border-radius: 16px; overflow: hidden; font-family: Helvetica, Arial, sans-serif; }
.ad-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: .75em; color: #666; background: #f2f2f2; }
.ad-top .ad-badge { background: #ffd500; color: #222; }
.ad-creative { padding: 36px 24px; text-align: center; background: linear-gradient(160deg, #1d2b64, #f8cdda); color: #fff; }
.ad-creative .ad-logo { font-size: 42px; margin-bottom: 8px; }
.ad-creative h3 { font-family: inherit; font-size: 1.3em; margin: 0 0 6px; }
.ad-creative p { margin: 0; font-size: .95em; opacity: .9; }
.ad-bottom { display: flex; justify-content: space-between; align-items: center; padding: 12px; }
.ad-bottom .ad-timer { font-size: .9em; color: #444; }
.ad-bottom .btn { background: #fff; color: #222; box-shadow: 0 3px 0 #ccc; font-family: inherit; }
.ad-bottom .btn.primary { background: #1a73e8; color: #fff; box-shadow: 0 3px 0 #0b47a1; }

/* ---------- checkpoint ---------- */
#screen-checkpoint, #screen-results { justify-content: center; align-items: center; text-align: center; gap: 14px; }
#screen-checkpoint h2, #screen-results h2 { font-size: 2em; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cp-list { list-style: none; padding: 6px 0; margin: 0; width: min(400px, 100%); background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cp-list li { display: flex; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); animation: rowIn .4s ease both; font-weight: 600; }
.cp-list li:last-child { border-bottom: 0; }
.cp-list strong { font-family: var(--font-title); color: var(--accent); font-size: 1.1em; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.total { font-size: .8em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.total strong { display: block; font-family: var(--font-title); font-size: 2.4em; color: var(--ink); letter-spacing: 0; text-transform: none; }

/* ---------- verse hunt ---------- */
#screen-hunt { gap: 10px; }
.vh-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 12px; background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.vh-head .val { font-family: var(--font-title); font-weight: 700; font-size: 1.35em; }
.vh-head .timer .val { font-size: 1.9em; text-align: center; font-variant-numeric: tabular-nums; color: var(--accent); }
.vh-head .timer .val.low { color: var(--red); animation: pulse .6s ease-in-out infinite; }
.vh-head .right { text-align: right; }
.vh-head .label { display: block; }
.vh-card { background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; min-height: 0; overflow: auto; box-shadow: var(--shadow); max-width: 680px; width: 100%; margin: 0 auto; }
.vh-card .kicker { font-family: var(--font-title); font-size: .8em; letter-spacing: .3em; color: var(--ink-2); font-weight: 700; }
#vh-verse { font-family: var(--font-verse); font-size: 1.2em; line-height: 1.5; font-style: italic; }
#vh-verse .blank { color: var(--accent); letter-spacing: .08em; font-style: normal; }
#vh-ref { color: var(--accent); font-family: var(--font-title); font-weight: 600; font-size: .95em; min-height: 1.2em; opacity: 0; transition: opacity .3s ease; }
#vh-ref.show { opacity: 1; }
.vh-slots, .vh-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vh-slot, .vh-letter { width: 46px; height: 52px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; font-family: var(--font-title); font-weight: 700; font-size: 1.35em; border: 0; }
.vh-slot { background: var(--line); box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }
.vh-slot.filled { background: var(--tile-sel); color: #fff; box-shadow: 0 4px 0 var(--tile-sel-edge); }
.vh-slot.ok { background: var(--green); color: #fff; box-shadow: 0 4px 0 #0a8a5c; }
.vh-slot.bad { background: var(--red); color: #fff; box-shadow: 0 4px 0 #b4213a; animation: shake .35s ease; }
.vh-letter { background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 55%), var(--tile-face); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge); transition: transform .08s ease; }
.vh-letter:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tile-edge); }
.vh-letter.used { opacity: .25; pointer-events: none; }
.vh-actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- results ---------- */
.res-score { font-size: .8em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.res-score strong { display: block; font-family: var(--font-title); font-size: 3.4em; letter-spacing: 0; text-transform: none; line-height: 1; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#screen-results.best .res-score strong { animation: pop .5s cubic-bezier(.2, .9, .3, 1.4); }
.res-mode { margin: 0; color: var(--accent); font-family: var(--font-title); font-weight: 600; }
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 10px; text-align: left; }
.res-grid > div { padding: 10px 14px; background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.res-grid .label { display: block; }
.res-grid strong { font-family: var(--font-title); font-size: 1.15em; }
.res-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-height: 110px; overflow: auto; }
.res-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- collection ---------- */
#screen-collection { gap: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.col-head h2 { font-size: 1.7em; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { appearance: none; border: 0; background: var(--card-solid); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; font-family: var(--font-title); font-weight: 600; font-size: .95em; box-shadow: 0 3px 0 var(--btn-shadow); color: var(--ink); }
.tab small { color: var(--ink-2); font-family: var(--font-body); font-weight: 700; }
.tab.active { background: var(--primary-grad); color: #fff; box-shadow: 0 3px 0 var(--primary-shadow); }
.tab.active small { color: rgba(255,255,255,.85); }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow: auto; flex: 1; min-height: 0; padding: 4px 2px 10px; }
.col-item { appearance: none; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card-solid); box-shadow: 0 3px 0 var(--line); }
.col-item strong { font-family: var(--font-title); letter-spacing: .03em; font-weight: 600; }
.col-item span { font-size: .8em; color: var(--ink-2); font-weight: 600; }
.col-item.found { cursor: pointer; border-color: var(--gold); box-shadow: 0 3px 0 var(--gold); }
.col-item.found strong { color: var(--accent); }
.col-item.locked { opacity: .55; }
.col-item.secret { cursor: default; } .col-item.locked.secret { opacity: .75; }

/* ---------- story page ---------- */
body.page { overflow: auto; height: auto; min-height: 100%; }
.site-head { max-width: 780px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-head .brand { font-family: var(--font-title); font-weight: 700; font-size: 1.15em; text-decoration: none; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-head nav { display: flex; gap: 6px; }
.site-head nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.site-head nav a.current { background: var(--card-solid); color: var(--accent); box-shadow: 0 2px 0 var(--btn-shadow); }
.doc { max-width: 780px; margin: 0 auto; padding: 0 16px 48px; display: flex; flex-direction: column; gap: 26px; }
.hero { background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 28px; padding: 30px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.big-verse { margin: 0; font-family: var(--font-verse); font-style: italic; font-size: 1.5em; line-height: 1.4; }
.hero .ref { font-family: var(--font-title); color: var(--accent); font-weight: 600; font-size: 1.05em; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.story { background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 28px; padding: 28px 26px; box-shadow: var(--shadow); }
.story h1 { font-size: 2.1em; margin-bottom: 4px; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.story h2 { font-size: 1.25em; margin: 28px 0 8px; color: var(--accent); }
.story p { margin: 0 0 15px; font-size: 1.1em; line-height: 1.7; }
.story blockquote { margin: 0 0 15px; padding: 12px 18px; border-left: 4px solid var(--gold); font-family: var(--font-verse); font-style: italic; color: var(--ink-2); background: color-mix(in srgb, var(--gold) 10%, transparent); border-radius: 0 12px 12px 0; }
.story .meta { font-size: .85em; color: var(--ink-2); font-weight: 700; }
.status { background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); }
.status h2, .library-wrap h2 { font-size: 1.5em; margin-bottom: 6px; }
.status-grid { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 22px; align-items: start; margin-top: 14px; }
#card { width: 100%; height: auto; border-radius: 18px; box-shadow: var(--shadow); background: #222; }
.status-controls { display: flex; flex-direction: column; gap: 10px; }
.status-controls input[type=file] { font-size: .9em; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.lib-item { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-solid); text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 var(--line); transition: transform .1s ease; }
.lib-item:hover { transform: translateY(-2px); }
.lib-item strong { font-family: var(--font-title); font-size: .98em; font-weight: 600; }
.lib-item span { font-size: .85em; color: var(--ink-2); font-weight: 600; }
.lib-item.current { border-color: var(--accent); box-shadow: 0 3px 0 var(--accent); }
.site-foot { text-align: center; color: var(--ink-2); font-size: .85em; font-weight: 600; }
.site-foot a { color: var(--accent); }
@media (max-width: 560px) { .status-grid { grid-template-columns: 1fr; } #card { max-width: 260px; margin: 0 auto; } }

@media (max-width: 400px) {
  body { font-size: 15.5px; }
  .controls { gap: 6px; }
  .controls .btn { padding: 10px 4px; font-size: .95em; }
  .bonus-letters .bl { width: 20px; height: 24px; }
  .hud .timer .val { font-size: 1.5em; }
  .menu-stats > div { min-width: 86px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { body::before, body::after, .logo-tile, .progress > div::after { animation: none; } }

/* ---------- team picker ---------- */
/* seven-letter top row of the logo */
.logo-tiles.seven .logo-tile { width: min(46px, 11.5vw); height: min(52px, 13vw); font-size: min(1.55em, 6.2vw); }

/* narrow phones: keep the bonus bar on one line */
@media (max-width: 480px) {
  .bonus-bar { gap: 6px; }
  .bonus-bar .label { display: none; }
  .bonus-len { font-size: .78em; white-space: nowrap; }
  .bonus-letters .bl { width: 18px; height: 26px; font-size: .82em; }
  .bonus-bar .btn { padding-left: 12px; padding-right: 12px; }
}

/* ---------- levels, coins, leaderboard ---------- */
#screen-menu { position: relative; }
.coin-pill {
  position: absolute; top: 6px; right: 6px; z-index: 2; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 13px;
  font-family: var(--font-title); font-weight: 700; font-size: .95em; box-shadow: 0 3px 0 var(--btn-shadow);
}
.coin-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-shadow); }
.btn.primary.big small { display: block; font-size: .58em; font-weight: 700; opacity: .92; letter-spacing: .02em; margin-top: 2px; }
.hud .tier { display: block; font-size: .62em; color: var(--ink-2); margin-top: 3px; font-weight: 700; letter-spacing: .04em; }
.cp-coins { margin: 0; color: var(--gold-2); font-weight: 700; text-align: center; min-height: 1.4em; }
.screen.scroll { overflow: auto; gap: 12px; padding-bottom: 12px; }
.levels-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.lvl {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-family: var(--font-title); font-weight: 700; display: grid; place-items: center; cursor: pointer; font-size: .95em; position: relative; padding: 0;
}
.lvl.done { background: var(--primary-grad); color: var(--primary-ink); border-color: transparent; }
.lvl.current { outline: 3px solid var(--accent); box-shadow: var(--glow); }
.lvl.locked { opacity: .35; cursor: default; }
.lvl small { position: absolute; bottom: 1px; right: 3px; font-size: .55em; opacity: .95; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.board-list li.mine { border-color: var(--accent); box-shadow: var(--glow); }
.board-list .rank { width: 28px; font-family: var(--font-title); font-weight: 700; color: var(--accent); }
.board-list .who { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.board-list .who small { color: var(--ink-2); font-size: .8em; }
.board-list strong { font-family: var(--font-title); font-size: 1.1em; }
.coin-big { font-family: var(--font-title); font-size: 1.9em; text-align: center; margin: 0; }
.popup .coin-line { margin-top: 4px; }
@media (max-width: 480px) { .levels-grid { gap: 4px; } .lvl { font-size: .8em; border-radius: 8px; } .coin-pill { top: 2px; right: 2px; } }

/* clue tiles: the given letters of each clue are tinted in the clue's colour */
.tile.given:not(.selected):not(.hint):not(.wrong) { animation: givenPulse 1.6s ease-in-out infinite; z-index: 2; color: #fff; }
.tile.given:not(.selected):not(.hint):not(.wrong) .glyph { text-shadow: 0 2px 0 rgba(0,0,0,.28); }
.tile.given0:not(.selected):not(.hint):not(.wrong) { background: color-mix(in srgb, var(--clue0) 68%, #000); }
.tile.given0:not(.selected):not(.hint):not(.wrong)::before { background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%), var(--clue0); }
.tile.given1:not(.selected):not(.hint):not(.wrong) { background: color-mix(in srgb, var(--clue1) 68%, #000); }
.tile.given1:not(.selected):not(.hint):not(.wrong)::before { background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%), var(--clue1); }
.tile.given2:not(.selected):not(.hint):not(.wrong) { background: color-mix(in srgb, var(--clue2) 68%, #000); }
.tile.given2:not(.selected):not(.hint):not(.wrong)::before { background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%), var(--clue2); }
@keyframes givenPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.lvl small { letter-spacing: -1px; }

  #app, .screen { min-height: 0; }
  #board-wrap { min-height: 340px; }
}

/* ---------- tiny cricket animations: red ball, stumps, bat, old-school scoreboard ---------- */
.menu-ball { width: 26px; height: 26px; margin: -2px auto 0; animation: ballRoll 9s ease-in-out infinite; }
.menu-ball svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
@keyframes ballRoll {
  0%, 62% { transform: translateX(-130px) rotate(0deg); opacity: 0; }
  64% { opacity: 1; }
  78% { transform: translateX(0) rotate(540deg) translateY(0); }
  82% { transform: translateX(14px) rotate(600deg) translateY(-10px); }
  86% { transform: translateX(28px) rotate(660deg) translateY(0); }
  92%, 100% { transform: translateX(36px) rotate(700deg); opacity: 1; }
}
/* split-flap scoreboard: dark board, cream digits that flip when the score changes */
.sb { display: inline-flex; gap: 2px; padding: 3px 4px; border-radius: 7px; background: #15191f; box-shadow: inset 0 0 0 1px #2b313a, 0 2px 0 rgba(0,0,0,.25); vertical-align: middle; }
.sb .sb-d { display: inline-grid; place-items: center; min-width: .78em; height: 1.25em; border-radius: 4px; background: linear-gradient(180deg, #30363f 0%, #30363f 49%, #262b33 51%, #262b33 100%); color: #fff2c2; font-family: var(--font-title); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; position: relative; transform-style: preserve-3d; }
.sb .sb-d::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.45); }
.sb .sb-d.sep { min-width: .35em; background: none; color: #fff2c2; }
.sb .sb-d.flip { animation: sbFlip .42s cubic-bezier(.3, .8, .4, 1.3); }
.sb.big { padding: 5px 6px; border-radius: 10px; font-size: .78em; }
.sb.big .sb-d { min-width: .82em; height: 1.3em; border-radius: 6px; }
@keyframes sbFlip { 0% { transform: rotateX(-90deg); filter: brightness(1.6); } 60% { transform: rotateX(12deg); } 100% { transform: rotateX(0); } }
.hud .score .sb { font-size: 1em; }
/* stumps beside the word bar: bails fly when a word is wrong, and on the time's-up card */
.fx-stumps { position: absolute; width: 40px; height: 40px; pointer-events: none; z-index: 27; transform: translate(-50%, -100%); animation: stumpsIn .9s ease both; }
.fx-stumps svg { width: 40px; height: 40px; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.fx-stumps .bail-l { animation: bailL .8s cubic-bezier(.2, .8, .3, 1) both; transform-origin: 16px 9px; }
.fx-stumps .bail-r { animation: bailR .8s cubic-bezier(.2, .8, .3, 1) both .05s; transform-origin: 32px 9px; }
@keyframes bailL { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(-16px, -22px) rotate(-200deg); opacity: 0; } }
@keyframes bailR { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(18px, -26px) rotate(220deg); opacity: 0; } }
@keyframes stumpsIn { 0% { opacity: 0; transform: translate(-50%, -90%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -115%) scale(1); } }
.stumps-out { width: 64px; height: 64px; margin: 0 auto 4px; display: block; overflow: visible; }
.stumps-out .bail-l { animation: bailL 1s ease-out .3s both; transform-origin: 16px 9px; }
.stumps-out .bail-r { animation: bailR 1s ease-out .35s both; transform-origin: 32px 9px; }
/* a bat swings beside a big hit */
.fx-bat { position: absolute; left: 50%; top: 52%; width: 22px; height: 60px; margin-left: 80px; pointer-events: none; z-index: 26; transform-origin: 50% 8%; animation: batSwing .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.fx-bat svg { width: 22px; height: 60px; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
@keyframes batSwing { 0% { opacity: 0; transform: rotate(-70deg) scale(.8); } 20% { opacity: 1; } 45% { transform: rotate(40deg) scale(1.05); } 75% { opacity: 1; transform: rotate(28deg) scale(1); } 100% { opacity: 0; transform: rotate(24deg) translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .menu-ball, .sb .sb-d.flip, .fx-stumps, .fx-bat, .stumps-out .bail-l, .stumps-out .bail-r { animation: none; } }

/* ---------- topic packs ---------- */
.btn.small { padding: 6px 12px; font-size: .85em; vertical-align: middle; }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 4px 2px 12px; }
.topic-card { appearance: none; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0)), var(--card); box-shadow: var(--shadow); cursor: pointer; color: var(--ink); transition: transform .1s ease; }
.topic-card:hover { transform: translateY(-2px); }
.topic-card .era { font-size: .7em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.topic-card strong { font-family: var(--font-title); font-size: 1.1em; font-weight: 600; }
.topic-card .blurb { font-size: .85em; color: var(--ink-2); line-height: 1.35; }
.topic-card .prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.topic-card .prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 3px; }
.topic-card small { font-size: .78em; color: var(--ink-2); font-weight: 700; }
.topic-card.locked { opacity: .72; }

/* ---------- rulebook and first-time demo ---------- */
.popup.rules { width: min(760px, 100%); }
.rules-grid { display: grid; grid-template-columns: 1fr; gap: 8px; text-align: left; }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.3)); border: 1px solid var(--line); }
.rule .ico { font-size: 1.3em; line-height: 1; width: 28px; flex: none; text-align: center; margin-top: 2px; }
.rule strong { font-family: var(--font-title); font-weight: 600; display: block; }
.rule p { margin: 1px 0 0; font-size: .86em; line-height: 1.3; color: var(--ink-2); }
@media (min-width: 700px) { .rules-grid { grid-template-columns: 1fr 1fr; } }
.popup.demo { width: min(520px, 100%); text-align: center; padding: 18px 18px 16px; }
.demo-title { font-size: 1.25em; margin: 0 0 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-stage { position: relative; height: 232px; border-radius: 18px; background: linear-gradient(180deg, #eaf6ff, #cfe7ff); overflow: hidden; cursor: pointer; }
.demo-board { position: absolute; left: 14px; top: 22px; width: 170px; height: 180px; }
.dt { position: absolute; width: 54px; height: 48px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: var(--tile-edge); display: grid; place-items: center; font: 700 22px var(--font-title); color: var(--tile-ink); transition: transform .2s ease; }
.dt::before { content: ''; position: absolute; inset: 0 0 4px 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 55%), var(--tile-face); }
.dt span { position: relative; z-index: 1; }
.dt.tint0 { background: color-mix(in srgb, var(--clue0) 68%, #000); color: #fff; animation: givenPulse 1.6s ease-in-out infinite; } .dt.tint0::before { background: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%), var(--clue0); }
.dt.on { background: var(--tile-sel-edge); color: #fff; transform: scale(1.1); z-index: 2; animation: none; } .dt.on::before { background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 55%), var(--tile-sel); }
.demo-clue { position: absolute; right: 14px; top: 26px; width: 200px; text-align: left; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; animation: clueIn .4s ease both; }
.demo-clue .box { width: 30px; height: 30px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background-image: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 55%); display: grid; place-items: center; font: 800 .8em/1 var(--font-body); color: #fff; }
.demo-clue p { margin: 0; font-family: var(--font-verse); font-style: italic; font-size: .88em; line-height: 1.3; }
.demo-clue small { display: block; grid-column: 2; font-size: .68em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.demo-clue.found { background: color-mix(in srgb, var(--green) 16%, #fff); } .demo-clue.found .box { background-color: var(--green); } .demo-clue.found p { text-decoration: line-through; color: var(--ink-2); }
.demo-word { position: absolute; left: 14px; right: 14px; bottom: 12px; background: #fff; border-radius: 12px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-title); font-weight: 700; letter-spacing: .12em; min-height: 40px; box-shadow: var(--shadow); }
.demo-word b { color: var(--accent); letter-spacing: 0; }
.demo-callout { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.5); font-family: var(--font-title); font-weight: 700; font-size: 2.4em; color: #fff; text-shadow: 0 4px 0 var(--accent), 0 0 24px rgba(255,255,255,.8); opacity: 0; transition: all .35s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; }
.demo-callout.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.demo-chip { position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border-radius: 999px; background: var(--primary-grad); color: #fff; font-family: var(--font-title); font-weight: 600; font-size: .9em; box-shadow: var(--glow); animation: appear .4s ease .6s both; }
.demo-level, .demo-super, .demo-invite { position: absolute; inset: 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.demo-level .progress { height: 14px; } .demo-level .progress > div { width: 20%; transition: width 1.1s ease; }
.demo-stars { font-size: 2em; color: var(--gold); opacity: 0; transform: scale(.6); transition: all .4s cubic-bezier(.2, .9, .3, 1.4); }
.demo-coins { font-family: var(--font-title); font-weight: 600; color: var(--ink); opacity: 0; transition: opacity .4s ease .2s; }
.demo-level.done .demo-stars, .demo-level.done .demo-coins { opacity: 1; transform: none; }
.demo-scr, .demo-ans { display: flex; gap: 6px; justify-content: center; min-height: 44px; }
.demo-scr i, .demo-ans i { width: 38px; height: 44px; border-radius: 10px; display: grid; place-items: center; font: 700 1.2em var(--font-title); font-style: normal; }
.demo-scr i { background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 55%), var(--tile-face); color: var(--tile-ink); box-shadow: 0 4px 0 var(--tile-edge); }
.demo-ans i { background: var(--tile-sel); color: #fff; box-shadow: 0 4px 0 var(--tile-sel-edge); animation: appear .25s ease; }
.demo-super small { color: var(--ink-2); font-weight: 600; }
.demo-invite .btn.whatsapp { align-self: center; pointer-events: none; }
.demo-reward { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 8px 14px; box-shadow: var(--shadow); font-weight: 600; }
.demo-reward span { color: var(--ink-2); font-size: .85em; } .demo-reward strong { font-family: var(--font-title); color: var(--accent); }
.demo-caption { margin: 10px 0 6px; min-height: 3.4em; font-size: .95em; line-height: 1.35; }
.demo-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.demo-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .demo-dots i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.demo-nav { display: flex; gap: 10px; justify-content: center; }
@media (max-width: 480px) { .demo-board { transform: scale(.9); transform-origin: top left; } .demo-clue { width: 170px; right: 8px; } }

/* ---------- tiles v2: rounded, matte, gapped hexagons drawn as SVG (see the research report) ---------- */
.tile { background: none !important; clip-path: none; overflow: visible; }
.tile::before { content: none; }
.tile .hx { position: absolute; left: 5%; top: 4%; width: 90%; height: 90%; overflow: visible; }
.tile .ledge { fill: var(--tile-edge); transform: translateY(4px); }
.tile .face { fill: url(#g-face); transition: transform .08s ease; }
.tile .chip { display: none; }
.tile .glyph { transition: transform .08s ease; }
.tile:active .face, .tile:active .glyph { transform: translateY(3px); }
.tile.selected { color: #fff; }
.tile.selected .face, .tile.swap-src .face { fill: url(#g-sel); }
.tile.selected .ledge, .tile.swap-src .ledge { fill: var(--tile-sel-edge); }
.tile.selected .hx { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent) 55%, transparent)); }
.tile.wrong { color: #fff; } .tile.wrong .face { fill: url(#g-wrong); } .tile.wrong .ledge { fill: #9b1c2e; }
.tile.swap-src { color: #fff; }
.tile.hint .face, .tile.sp1 .face { fill: url(#g-gold); } .tile.hint .ledge, .tile.sp1 .ledge { fill: #c98a00; }
.tile.sp2 .face { fill: url(#g-blue); } .tile.sp2 .ledge { fill: #1f8fc0; }
.tile.sp3 .face { fill: url(#g-violet); } .tile.sp3 .ledge { fill: #7a3fc0; }
.tile.sp4 { color: #fff; } .tile.sp4 .face { fill: url(#g-slate); } .tile.sp4 .ledge { fill: #1f2329; }
.tile.wild { color: #fff; } .tile.wild .face { fill: url(#g-wild); } .tile.wild .ledge { fill: #073a36; }
/* clue tiles: a flat pale tint of the clue colour plus a corner chip in the full colour; dark letters */
.tile.given:not(.selected):not(.hint):not(.wrong) { color: #fff; animation: none; }
.tile.given:not(.selected):not(.hint):not(.wrong) .glyph { text-shadow: none; fill: #fff; }
.tile.given:not(.selected):not(.hint):not(.wrong) .ledge { fill: color-mix(in srgb, var(--clue0) 70%, #000); }
.tile.given:not(.selected):not(.hint):not(.wrong) .chip { display: block; }
.tile.given0:not(.selected):not(.hint):not(.wrong) .face { fill: var(--clue0); } .tile.given0 .chip { fill: #fff; }
.tile.given1:not(.selected):not(.hint):not(.wrong) .face { fill: var(--clue1); } .tile.given1 .chip { fill: #fff; }
.tile.given2:not(.selected):not(.hint):not(.wrong) .face { fill: var(--clue2); } .tile.given2 .chip { fill: #fff; }
/* the legend mirrors the tile: same pale tint, same chip, the clue number in the clue colour */
.clue .box { position: relative; background-image: none; color: var(--clue0); text-shadow: none; }
.clue .box::after { content: ''; position: absolute; top: 3px; right: 7px; width: 7px; height: 7px; border-radius: 50%; }
.clue .box.c0 { background-color: var(--clue0); color: #fff; } .clue .box.c0::after { background: #fff; }
.clue .box.c1 { background-color: var(--clue1); color: #fff; } .clue .box.c1::after { background: #fff; }
.clue .box.c2 { background-color: var(--clue2); color: #fff; } .clue .box.c2::after { background: #fff; }
.clue.found .box { color: #fff; } .clue.found .box::after { display: none; }
/* the demo's mini tiles follow the same look */
.dt.tint0 { background: color-mix(in srgb, var(--clue0) 70%, #000); color: #fff; animation: none; } .dt.tint0::before { background: var(--clue0); }
/* selection path under the tiles */
.path-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.path-layer polyline { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 11; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- reward loop: callout pools, rank ribbons, warm bonus, so-close, board shake, peek streak ---------- */
.callout.rank { font-size: 1.5em; top: 22%; padding: 6px 18px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); -webkit-text-stroke: 0; box-shadow: var(--glow); animation: rankIn 1.5s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes rankIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -90%) scale(1); } }
.callout.close { color: #fff; text-shadow: 0 4px 0 #d98e00, 0 0 24px rgba(255, 200, 80, .8); font-size: 2.2em; }
.tile.close { animation: shake .35s ease; } .tile.close .face { fill: url(#g-gold); } .tile.close .ledge { fill: #c98a00; }
.bonus-bar.warm { animation: warmPulse .9s ease; } .bonus-bar.warm .bl { background: color-mix(in srgb, var(--gold) 45%, var(--line)); }
@keyframes warmPulse { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent), var(--glow); } }
#board-wrap.shake { animation: boardShake .09s ease 2; }
@keyframes boardShake { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, -2px); } }
.peek .pk { display: none; font-size: .85em; padding: 2px 8px; border-radius: 999px; background: var(--primary-grad); color: #fff; }
.peek .pk.on { display: inline-block; }
.cp-best { margin: 0; font-family: var(--font-title); color: var(--ink); font-weight: 600; }
.cp-best .chip { margin-left: 6px; }
.cp-praise { margin: 0; color: var(--accent); font-family: var(--font-title); font-weight: 600; min-height: 1.3em; }
.hud .score .streak-badge, .peek .pk { font-variant-numeric: tabular-nums; }

/* ---------- challenge results (head to head) ---------- */
.vs-card { background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.vs-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-title); margin-bottom: 6px; }
.vs-head span { color: var(--ink-2); font-size: .85em; }
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; text-align: center; padding: 5px 0; border-top: 1px solid var(--line); font-weight: 700; }
.vs-row em { color: var(--ink-2); font-style: normal; font-size: .8em; font-weight: 600; align-self: center; }
.vs-row .win { color: var(--accent); }
.vs-verdict { margin: 8px 0 0; text-align: center; font-family: var(--font-title); font-weight: 700; }

/* ---------- share nudge: the host slides in from the top ---------- */
.nudge { position: fixed; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 70; max-width: 460px; margin: 0 auto; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 20px; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); transform: translate3d(0, calc(-100% - 30px), 0); opacity: 0; transition: transform var(--dur-in) var(--ease-in), opacity var(--dur-in) ease; }
.nudge.show { transform: none; opacity: 1; }
.nudge-pic { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold, #ffd166); }
.nudge-body { flex: 1; min-width: 0; } .nudge-body p { margin: 0 0 6px; font-weight: 700; font-size: .95em; line-height: 1.3; }
.nudge-row { display: flex; gap: 8px; } .nudge-go { flex: 1; padding: 9px 10px; min-height: 40px; } .nudge-x { padding: 9px 12px; min-height: 40px; }

/* ---------- cookie notice ---------- */
.consent-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 90; max-width: 560px; margin: 0 auto; padding: 12px 14px; border-radius: 18px; background: var(--card-solid, #fff); color: var(--ink, #111); border: 1px solid var(--line, #ddd); box-shadow: 0 10px 30px rgba(0,0,0,.25); transform: translate3d(0, calc(100% + 30px), 0); transition: transform .26s cubic-bezier(.16, 1, .3, 1); font-size: .9em; }
.consent-bar.show { transform: none; } .consent-bar p { margin: 0 0 10px; line-height: 1.45; } .consent-bar a { color: var(--accent); }
.consent-row { display: flex; gap: 8px; } .consent-row .btn { flex: 1; min-height: 42px; padding: 9px 10px; }
