/* Game screens: hub, boards, tiles, result sheet, animations. Loaded after app.css.
   Everything here is scoped to .hub, .game and the sheets, and reads the site's colour tokens. */
:root {
  --gk-ok: var(--lapis); --gk-ok-fg: var(--surface);
  --gk-near: #e0ae36; --gk-near-fg: #251b04;
  /* letters ruled out: a solid slate with light text, clearly darker than untried keys (NYT-style) */
  --gk-no: color-mix(in srgb, var(--fg) 62%, var(--surface)); --gk-no-fg: var(--surface);
  --gk-key: color-mix(in srgb, var(--fg) 13%, var(--surface));
  --gc1: #f2d466; --gc2: #a6cc80; --gc3: #a9c5f1; --gc4: #c9a6e2; --gc-fg: #1d1a12;
  --g-good: #2f7d4a; --g-mid: #b9770e; --g-low: #b3312f;
  --g-land: #f1e8d3; --g-land-line: #b9a77c; --g-sea: #cfdff0; --g-water: #9dbbe0; --g-off: color-mix(in srgb, var(--fg) 6%, var(--surface));
  --g-flame: #f5b93a;
  --g-tile: var(--surface);
  --g-shadow: 0 1px 2px rgb(40 30 10 / .08), 0 6px 18px rgb(40 30 10 / .06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --gk-near: #e6c065; --gk-no: color-mix(in srgb, var(--fg) 24%, var(--surface)); --gk-no-fg: color-mix(in srgb, var(--fg) 72%, var(--surface));
  --gk-key: color-mix(in srgb, var(--fg) 46%, var(--surface));
  --g-good: #5fbf7f; --g-mid: #e2a542; --g-low: #f0857f;
  --g-land: #3a3626; --g-land-line: #7d7150; --g-sea: #17233d; --g-water: #2c4a7c;
  --g-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 22px rgb(0 0 0 / .28);
} }
:root[data-theme="dark"] {
  --gk-near: #e6c065; --gk-no: color-mix(in srgb, var(--fg) 24%, var(--surface)); --gk-no-fg: color-mix(in srgb, var(--fg) 72%, var(--surface));
  --gk-key: color-mix(in srgb, var(--fg) 46%, var(--surface));
  --g-good: #5fbf7f; --g-mid: #e2a542; --g-low: #f0857f;
  --g-land: #3a3626; --g-land-line: #7d7150; --g-sea: #17233d; --g-water: #2c4a7c;
  --g-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 22px rgb(0 0 0 / .28);
}

/* ---------- shared ---------- */
.game, .hub { display: grid; gap: 12px; width: 100%; max-width: 560px; margin-inline: auto; position: relative; min-width: 0; }
.game > *, .hub > * { min-width: 0; }
.game [hidden], .hub [hidden] { display: none !important; }
.game button, .hub button, .gsheet button { font-family: var(--font-ui); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.game .ghead { display: flex; align-items: center; gap: 6px 8px; flex-wrap: nowrap; }
.game .ghead h1 { flex: 1 1 auto; margin: 0; font-size: clamp(1.25rem, 5.4vw, 1.6rem); line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.game .ghead .back { flex: none; border: 0; background: none; color: var(--muted); font-size: .95rem; padding: 8px 6px 8px 0; min-height: 40px; cursor: pointer; white-space: nowrap; }
.game .ghead .back:hover { color: var(--fg); }
.game .ghead .back { display: inline-flex; align-items: center; gap: 4px; }
.game .ghead .gbk { font-size: 1.7rem; line-height: .8; margin-top: -3px; }
@media (max-width: 480px) { .game .ghead .gbkt { display: none; } .game .ghead .back { min-width: 36px; padding-right: 2px; } }
.game .gnum { flex: none; font-family: var(--font-ui); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.game .glvl { font-weight: 700; }
.game .glvl.l1 { color: var(--g-good); } .game .glvl.l2 { color: var(--g-mid); } .game .glvl.l3 { color: var(--g-low); }
.game .gbtn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: grid; place-items: center; cursor: pointer; padding: 0; }
.game .gbtn:hover { border-color: var(--lapis); color: var(--lapis); }
.game .gi, .hub .gi, .gsheet .gi { width: 20px; height: 20px; flex: none; }
.game .gintro { margin: 0; color: var(--muted); font-family: var(--font-ui); font-size: .95rem; text-align: center; }
.game .gfoot { margin: 0 auto; text-align: center; font-size: .85rem; color: var(--muted); font-family: var(--font-ui); max-width: 40ch; }
.game .gbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.game .qnext, .game .ghost, .gsheet .qnext, .gsheet .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; transition: transform .12s, filter .12s, background-color .15s; }
.game .qnext, .gsheet .qnext { border: 0; background: var(--lapis); color: var(--surface); justify-self: auto; }
.game .ghost, .gsheet .ghost { border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; }
.game .ghost.small { min-height: 40px; min-width: 44px; padding: 4px 12px; font-size: .9rem; }
.game .qnext.big, .gsheet .qnext.big { min-height: 50px; padding: 12px 26px; font-size: 1.08rem; }
.game .qnext:disabled, .game .ghost:disabled { opacity: .42; cursor: default; }
.game button:not(:disabled):active, .hub button:active, .gsheet button:active { transform: scale(.96); }
.game .loading, .hub .loading { color: var(--muted); }
/* a short message that shows over its line for a moment */
.game [data-msg] { position: relative; }
.game [data-msg].pulse::after { margin: 0; content: attr(data-msg); position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: max-content; max-width: min(100%, 34ch); padding: 6px 14px; border-radius: 12px; background: var(--fg); color: var(--bg); font: 700 .9rem/1.25 var(--font-ui); letter-spacing: 0; text-transform: none; text-align: center; z-index: 4; box-shadow: var(--g-shadow); animation: gmsg 2.1s both; pointer-events: none; }
.game [data-msg][data-tone="good"].pulse::after { background: var(--g-good); color: #fff; }
.game [data-msg][data-tone="gold"].pulse::after { background: var(--gk-near); color: var(--gk-near-fg); }
@keyframes gmsg { 0% { opacity: 0; scale: .9; } 8%, 80% { opacity: 1; scale: 1; } 100% { opacity: 0; } }
@keyframes gshake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes gpop { 0% { transform: scale(.82); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.game .shake { animation: gshake .42s; }
/* loading: the shape of what is coming */
.gskel { display: grid; gap: 8px; margin-top: 56px; }
.gskel i { border-radius: 10px; background: color-mix(in srgb, var(--fg) 8%, var(--surface)); animation: gskel 1.2s infinite alternate; }
.gskel.grid { grid-template-columns: repeat(5, 1fr); width: min(100%, 320px); margin-inline: auto; } .gskel.grid i { aspect-ratio: 1; }
.gskel.tiles { grid-template-columns: repeat(4, 1fr); } .gskel.tiles i { height: 64px; }
.gskel.map i { height: 52vh; }
@keyframes gskel { to { opacity: .45; } }

/* the card left on the page when a game is over */
.game .gdone { display: grid; gap: 10px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--g-shadow); text-align: left; }
.game .gdone.win { border-color: color-mix(in srgb, var(--gk-near) 60%, var(--line)); }
.game .gdone h2 { margin: 0; font-size: 1.7rem; line-height: 1.1; }
.game .gdone p { margin: 0; }
.game .gcount, .hub .gcount, .gsheet .gcount { margin: 0; font-family: var(--font-ui); font-size: .92rem; color: var(--muted); text-align: center; }
.gcount b { font-variant-numeric: tabular-nums; color: var(--fg); letter-spacing: .02em; }
.gpeace { color: var(--fg); font-family: var(--font-body); font-style: italic; text-align: center; margin: 0; }
.game .eyebrow, .gsheet .eyebrow, .hub .eyebrow { color: color-mix(in srgb, var(--gold) 76%, var(--fg)); }
.game .blank { display: inline-block; height: .95em; vertical-align: -.12em; border-bottom: 2px solid color-mix(in srgb, var(--gold) 70%, var(--fg)); background: color-mix(in srgb, var(--gold) 12%, transparent); border-radius: 3px 3px 0 0; margin-inline: 1px; }
.gsheet .blank { display: inline-block; height: .95em; vertical-align: -.12em; border-bottom: 2px solid var(--muted); margin-inline: 1px; }
.game .gap { display: inline-grid; place-items: center; min-width: 4.2em; height: 1.35em; vertical-align: -.2em; border: 2px dashed var(--lapis); border-radius: 8px; color: var(--lapis); font: 700 .85em var(--font-ui); }

/* win: light rises, sparks drift */
.game .glow { position: absolute; inset: -8px; overflow: hidden; pointer-events: none; z-index: 6; border-radius: 18px; }
.game .glow .halo { position: absolute; left: 50%; top: 34%; width: 150%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgb(250 214 110 / .5) 0, rgb(250 214 110 / .16) 34%, transparent 62%); animation: ghalo 2.3s ease-out both; }
.game .glow .spark { position: absolute; bottom: 12%; left: var(--x); width: 9px; height: 13px; border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%; background: radial-gradient(circle at 50% 72%, #fff5c2 0 24%, var(--g-flame) 62%, #e0791a); opacity: 0; scale: var(--s); animation: gspark 1.7s var(--d) ease-out both; }
@keyframes ghalo { 0% { opacity: 0; scale: .3; } 30% { opacity: 1; } 100% { opacity: 0; scale: 1.15; } }
@keyframes gspark { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46vh) translateX(8px); } }

/* ---------- sheets ---------- */
.gsheet-wrap { position: fixed; inset: 0; z-index: 35; display: grid; align-items: end; justify-items: center; background: rgb(12 14 24 / .52); animation: gfadein .2s both; }
.gsheet { position: relative; width: min(100%, 520px); max-height: min(92vh, 92dvh); overflow: auto; overscroll-behavior: contain; display: grid; gap: 14px; align-content: start; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); background: var(--surface); color: var(--fg); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .28); animation: gslide .34s cubic-bezier(.2, .9, .25, 1) both; outline: 0; }
.gsheet::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin-top: -10px; }
@media (min-width: 700px) { .gsheet-wrap { align-items: center; } .gsheet { border-radius: 22px; } .gsheet::before { display: none; } }
@keyframes gfadein { from { opacity: 0; } }
@keyframes gslide { from { transform: translateY(40%); opacity: 0; } }
.gsheet-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 2; }
.gsheet h2 { margin: 0; font-size: 1.9rem; line-height: 1.1; display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.gsheet h2 .gi { width: 26px; height: 26px; color: var(--lapis); }
.gsheet p { margin: 0; }
.gsheet .rhead { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 4px 34px 0; }
.gsheet .rhead h2 { font-size: clamp(1.9rem, 9vw, 2.5rem); justify-content: center; }
.gsheet.result.win .rhead h2 { color: color-mix(in srgb, var(--gold) 55%, var(--fg)); }
.gsheet .rsub { color: var(--muted); font-family: var(--font-ui); }
.gsheet .rgrid { display: grid; gap: 4px; justify-items: center; margin-top: 4px; }
.gsheet .rgrid .emo { font-size: 1.35rem; letter-spacing: .08em; line-height: 1.4; overflow-wrap: anywhere; text-align: center; }
.sqrow { display: flex; gap: 4px; }
.sqrow i { width: 20px; height: 20px; border-radius: 5px; background: var(--gk-no); }
.sqrow i.correct { background: var(--gk-ok); } .sqrow i.present { background: var(--gk-near); }
.sqrow i.c1, .why.c1 summary i, .demo-dots .c1 { background: var(--gc1); } .sqrow i.c2, .why.c2 summary i, .demo-dots .c2 { background: var(--gc2); }
.sqrow i.c3, .why.c3 summary i, .demo-dots .c3 { background: var(--gc3); } .sqrow i.c4, .why.c4 summary i, .demo-dots .c4 { background: var(--gc4); }
.gsheet .gshare { justify-self: center; width: min(100%, 300px); }
.gsheet .rbody { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line)); font-size: 1rem; line-height: 1.45; }
.gsheet .rbody .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gsheet .why summary { cursor: pointer; font: 700 .98rem var(--font-ui); display: flex; align-items: center; gap: 8px; min-height: 36px; }
.gsheet .why summary i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.gsheet .why p { margin: 2px 0 8px 22px; }
.gsheet .why .chips { margin: 0 0 8px 22px; }
.gsheet .taprow, .game .taprow { display: flex; gap: 10px; align-items: baseline; } .gsheet .taprow i, .game .taprow i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--g-low); }
.gsheet .taprow.good i, .game .taprow.good i { background: var(--g-good); } .gsheet .taprow.mid i, .game .taprow.mid i { background: var(--g-mid); }
.gsheet .rclue { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; } .gsheet .rclue .cnd { flex: none; margin-top: -8px; }
.gstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.gstats div { display: grid; gap: 2px; align-content: start; }
.gstats b { font: 700 1.9rem/1 var(--font-body); font-variant-numeric: lining-nums; }
.gstats span { font: .74rem/1.2 var(--font-ui); color: var(--muted); }
.ghist { display: grid; gap: 4px; }
.ghist .eyebrow { margin-bottom: 2px; }
.ghist .hrow { display: grid; grid-template-columns: 2.6em 1fr; gap: 6px; align-items: center; font: 700 .82rem var(--font-ui); }
.ghist .hrow span { text-align: right; color: var(--muted); }
.ghist .hrow i { display: block; font-style: normal; min-width: 22px; padding: 2px 7px; border-radius: 5px; text-align: right; background: color-mix(in srgb, var(--fg) 14%, var(--surface)); color: var(--fg); animation: gbar .5s ease-out both; transform-origin: left; }
.ghist .hrow.now i { background: var(--lapis); color: var(--surface); }
@keyframes gbar { from { transform: scaleX(.1); } }
.gnextwrap { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.gnext { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gnext > * { flex: 1 1 200px; }
.gsheet.rules { gap: 12px; }
.gsheet .rules { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 10px; }
.gsheet .rules li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; line-height: 1.4; }
.gsheet .rules li::before { content: counter(r); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--lapis) 14%, var(--surface)); color: var(--lapis); font: 700 .9rem var(--font-ui); }
.gsheet .gdemo { display: grid; gap: 10px; justify-items: center; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--fg) 4%, var(--surface)); }
.demo-row { display: flex; gap: 6px; align-items: center; justify-content: center; }
.demo-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font: .9rem var(--font-ui); justify-self: start; }
.demo-key li { display: flex; gap: 10px; align-items: center; }
.demo-dots { display: flex; gap: 6px; } .demo-dots i { width: 22px; height: 22px; border-radius: 6px; }
.demo-tap { font: .9rem var(--font-ui); gap: 0; } .demo-tap i { width: 56px; border-top: 2px dashed var(--g-good); } .demo-tap b { margin-left: 12px; }
.dpin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); } .dpin.you { background: var(--g-low); } .dpin.ans { background: var(--g-good); }

/* ---------- hub ---------- */
.hub { gap: 14px; }
.hubhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hubhead > div:first-child { display: grid; gap: 2px; }
.hubhead h1 { margin: 0; font-size: 2.1rem; line-height: 1; }
.hubhead .eyebrow { font-size: .8rem; }
.hdots { display: flex; gap: 7px; padding-bottom: 6px; }
.hdots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--gold) 55%, var(--line)); transition: background-color .3s; }
.hdots i.on { background: var(--gk-near); border-color: var(--gk-near); }
.hubline { margin: -4px 0 2px; color: var(--muted); font-family: var(--font-ui); font-size: .95rem; }
.hub h2 { margin: 8px 0 -4px; font: 700 .82rem var(--font-ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.hub .gcards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.hub .gcards.mores { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hub .gcard { --tint: var(--lapis); display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 14px 14px 14px 12px; min-height: 84px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); cursor: pointer; box-shadow: var(--g-shadow); transition: transform .14s, border-color .15s, box-shadow .15s; }
.hub .gcard:hover { border-color: var(--tint); transform: translateY(-1px); }
.hub .gcard.g-loaves { --tint: #b98215; } .hub .gcard.g-links { --tint: #6f4aa8; } .hub .gcard.g-pilgrim { --tint: #b2442f; }
.hub .gcard.g-threads { --tint: #2f7d59; } .hub .gcard.g-tap { --tint: #2c6fa6; }
.hub .gbadge { position: relative; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 16%, var(--surface)); color: color-mix(in srgb, var(--tint) 82%, var(--fg)); }
.hub .gbadge > .gi { width: 30px; height: 30px; background: none; }
.hub .gcard.lead .gbadge { width: 64px; height: 64px; border-radius: 18px; } .hub .gcard.lead .gbadge > .gi { width: 34px; height: 34px; }
.hub .gtick { position: absolute; right: -5px; bottom: -5px; width: 24px; height: 24px; border-radius: 50%; background: var(--g-good); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.hub .gbadge .gtick .gi { width: 13px; height: 13px; stroke-width: 3.2; }
.hub .gtext { display: grid; gap: 3px; min-width: 0; }
.hub .gname { font: 700 1.22rem/1.15 var(--font-body); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub .gname em { font: 700 .66rem var(--font-ui); letter-spacing: .07em; text-transform: uppercase; font-style: normal; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--gk-near) 30%, var(--surface)); color: color-mix(in srgb, var(--gold) 60%, var(--fg)); }
.hub .gdesc { font: .92rem/1.3 var(--font-ui); color: var(--muted); }
.hub .gcard.done .gdesc { color: var(--g-good); font-weight: 700; }
.hub .gstreak { font: 600 .78rem var(--font-ui); color: color-mix(in srgb, var(--gold) 70%, var(--fg)); }
.hub .ggo { font-size: 1.6rem; color: var(--tint); line-height: 1; }
.hub .gcard.featured { border-color: color-mix(in srgb, var(--gk-near) 70%, var(--line)); background: color-mix(in srgb, var(--gk-near) 7%, var(--surface)); }
.hub .gcount { margin-top: 6px; line-height: 1.7; }

/* ---------- Five Loaves ---------- */
.game.loaves { gap: 8px; }
.game .wmsg { min-height: 1.6em; margin: 0; text-align: center; font: 700 .95rem var(--font-ui); color: var(--fg); }
.game .wmsg[data-tone="bad"] { color: var(--g-low); } .game .wmsg[data-tone="good"] { color: var(--g-good); font-size: 1.1rem; }
.game .wmsg.pulse { animation: gpop .3s; }
.game .wgrid { display: grid; gap: 6px; width: min(100%, 330px, max(210px, calc((100vh - 372px - var(--gdock, 0px)) * .82))); margin-inline: auto; }
.game .wrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wt { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 46% 46% 16% 16% / 40% 40% 16% 16%; background: var(--surface); color: var(--fg); font: 700 clamp(1.2rem, 6vw, 1.85rem) var(--font-ui); text-transform: uppercase; box-shadow: none; user-select: none; }
.wt.filled { border-color: color-mix(in srgb, var(--fg) 45%, var(--line)); }
.wt.pop { animation: gpop .14s; }
.wt.correct, .game .kb button.correct { background: var(--gk-ok); border-color: var(--gk-ok); color: var(--gk-ok-fg); box-shadow: none; }
.wt.present, .game .kb button.present { background: var(--gk-near); border-color: var(--gk-near); color: var(--gk-near-fg); box-shadow: none; }
.wt.absent, .game .kb button.absent { background: var(--gk-no); border-color: var(--gk-no); color: var(--gk-no-fg); box-shadow: none; }
.wt.sm { width: 34px; font-size: 1.05rem; flex: none; } .demo-row .wt { width: 46px; font-size: 1.4rem; }
/* each loaf turns over in its turn; until its moment it keeps the plain face */
.wrow.flip .wt { animation: gflip .5s calc(var(--i) * 230ms) ease-in-out backwards; }
@keyframes gflip { 0%, 49.9% { background: var(--surface); border-color: color-mix(in srgb, var(--fg) 45%, var(--line)); color: var(--fg); } 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.wrow.bounce .wt { animation: gbounce .7s calc(var(--i) * 90ms) ease-out; }
@keyframes gbounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-16px); } 60% { transform: translateY(3px); } }
.game .kb { display: grid; gap: 6px; width: min(100%, 500px); margin: 4px auto 0; user-select: none; }
.game .kbrow { display: flex; gap: 5px; justify-content: center; }
.game .kb button { flex: 1 1 0; min-width: 0; max-width: 44px; height: 54px; padding: 0; border: 0; border-radius: 8px; background: var(--gk-key); color: var(--fg); font: 700 1.02rem var(--font-ui); cursor: pointer; transition: background-color .2s, transform .08s; }
.game .kb button.wide { flex: 1.6 1 0; max-width: 70px; font-size: .78rem; }
@media (max-height: 720px) { .game .kb button { height: 46px; } }

/* ---------- Lineage Links ---------- */
.game .lsolved { display: grid; gap: 8px; }
.game .lsolved:empty { display: none; }
.game .lgroup, .gsheet .lgroup { display: grid; gap: 2px; padding: 12px 10px; min-height: 68px; align-content: center; text-align: center; border: 0; border-radius: 12px; color: var(--gc-fg); font-family: var(--font-ui); }
.lgroup.c1 { background: var(--gc1); } .lgroup.c2 { background: var(--gc2); } .lgroup.c3 { background: var(--gc3); } .lgroup.c4 { background: var(--gc4); }
.lgroup b { text-transform: uppercase; letter-spacing: .05em; font-size: .92rem; color: var(--gc-fg); }
.lgroup span { font-size: .95rem; color: var(--gc-fg); overflow-wrap: anywhere; }
.game .lgroup.new { animation: gmerge .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes gmerge { 0% { opacity: 0; transform: scale(.86) translateY(14px); } 100% { opacity: 1; transform: none; } }
.game .lgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.game .ltile { min-height: 68px; padding: 4px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--fg) 9%, var(--surface)); color: var(--fg); font: 700 clamp(.74rem, 3.5vw, 1rem) var(--font-ui); cursor: pointer; overflow-wrap: anywhere; hyphens: auto; transition: background-color .14s, color .14s, transform .14s; }
.game .ltile.long { font-size: clamp(.62rem, 2.9vw, .88rem); }
.game .ltile.on { background: var(--lapis); color: var(--surface); transform: scale(.96); }
.game .ltile.jump { animation: gjump .36s calc(var(--i) * 80ms) ease-out; }
@keyframes gjump { 0%, 100% { translate: 0 0; } 45% { translate: 0 -11px; } }
.game .ltile.gone { opacity: 0; transform: scale(.8); transition: opacity .22s, transform .22s; }
.game .ltile.shake { animation: gshake .42s; }
.game .lmist { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 30px; font: .92rem var(--font-ui); color: var(--muted); }
.game .mdots { display: inline-flex; gap: 6px; }
.game .mdots i { width: 13px; height: 13px; border-radius: 50%; background: var(--fg); transition: background-color .2s; }
.game .mdots i.off { background: color-mix(in srgb, var(--fg) 16%, var(--surface)); }
.game .mdots i.pop { animation: gdot .45s; }
@keyframes gdot { 0% { transform: scale(1.7); background: var(--g-low); } 100% { transform: scale(1); } }
.game .lbtns { justify-content: center; }

/* ---------- Threads ---------- */
.game .tclue { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gk-near) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gk-near) 40%, var(--line)); font-size: 1.12rem; line-height: 1.25; }
.game .tword { min-height: 1.9em; margin: 0; text-align: center; font: 700 1.25rem/1.5 var(--font-ui); letter-spacing: .14em; color: var(--lapis); }
.game .tgrid-wrap { position: relative; margin-inline: auto; }
.game .tgrid { display: grid; gap: 7px; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; z-index: 1; }
.game .tlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.game .tcell { aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--g-tile); color: var(--fg); font: 700 clamp(1rem, 5vw, 1.35rem) var(--font-ui); cursor: pointer; box-shadow: 0 1px 2px rgb(40 30 10 / .1); transition: background-color .12s, transform .12s, border-color .12s; }
.tcell.sel { background: color-mix(in srgb, var(--lapis) 26%, var(--surface)); border-color: var(--lapis); transform: scale(1.06); }
.tcell.found { background: color-mix(in srgb, var(--lapis) 78%, var(--surface)); border-color: transparent; color: var(--surface); box-shadow: none; opacity: 1; }
.tcell.span { background: var(--gk-near); border-color: transparent; color: var(--gk-near-fg); box-shadow: none; opacity: 1; }
.game .tcell:disabled { cursor: default; }
.game .tcell.hinted { border: 2px dashed var(--gk-near); background: color-mix(in srgb, var(--gk-near) 22%, var(--surface)); animation: ghint 1.4s infinite alternate; }
@keyframes ghint { to { background: color-mix(in srgb, var(--gk-near) 5%, var(--surface)); } }
.game .tcell.pop { animation: gpop .34s calc(var(--i) * 55ms) backwards; }
.demo-row .tcell { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font: 700 1.05rem var(--font-ui); }
.game .tlines line { stroke-linecap: round; stroke-width: 12; }
.game .tlines .lf { stroke: color-mix(in srgb, var(--lapis) 78%, var(--surface)); }
.game .tlines .ls { stroke: var(--gk-near); }
.game .tlines .lsel { stroke: color-mix(in srgb, var(--lapis) 34%, transparent); }
.game .tlines .new { stroke-dasharray: 1; animation: gdraw .12s calc(var(--i) * 55ms) linear backwards; }
@keyframes gdraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.game .tbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.game .tprog { font: .95rem var(--font-ui); color: var(--muted); } .game .tprog b { color: var(--fg); font-size: 1.15rem; }
.game .thint { gap: 8px; }
.game .hbank { min-width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--fg) 12%, var(--surface)); font-size: .8rem; }
.game .hbank.has { background: var(--gk-near); color: var(--gk-near-fg); }
.game .hmeter { display: inline-flex; gap: 3px; } .game .hmeter i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--gk-near); } .game .hmeter i.on { background: var(--gk-near); }

/* ---------- maps (Holy Land Tap, and the Place station) ---------- */
.game .tapq { display: grid; gap: 4px; font-size: 1.12rem; line-height: 1.3; }
.game .tapq:empty { display: none; }
.game .tapmeta { display: flex; align-items: center; gap: 10px; }
.game .rdots { display: inline-flex; gap: 5px; flex: 1; }
.game .rdots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--fg) 14%, var(--surface)); }
.game .rdots i.now { box-shadow: 0 0 0 2px var(--lapis); background: var(--surface); }
.game .rdots i.good, .game .taprow.good i { background: var(--g-good); } .game .rdots i.mid { background: var(--g-mid); } .game .rdots i.low { background: var(--g-low); }
.game .tapsum { font: 700 .9rem var(--font-ui); font-variant-numeric: tabular-nums; }
.game .tapmap { position: relative; height: 52vh; min-height: 230px; border-radius: 16px; overflow: hidden; border: 1px solid var(--g-land-line); background: var(--g-off); box-shadow: var(--g-shadow); }
.game .tapmap.wideext { height: 52vh; min-height: 230px; }
.game .tapmap svg { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.game .tapmap.small { height: 270px; min-height: 0; } .game .tapmap.small svg { touch-action: manipulation; }
.game .tapmap.sum { height: 210px; min-height: 0; } .game .tapmap.sum.wide { height: 170px; } .game .tapmap.sum svg { cursor: default; touch-action: auto; }
.game .tapsums { display: grid; gap: 8px; }
.game .tapmap .off { fill: var(--g-off); }
.game .tapmap .sea { fill: var(--g-sea); }
.game .tapmap .land { fill: var(--g-land); stroke: var(--g-land-line); stroke-width: .8; vector-effect: non-scaling-stroke; }
.game .tapmap .lake { fill: var(--g-water); stroke: color-mix(in srgb, var(--g-water) 70%, var(--fg)); stroke-width: .5; vector-effect: non-scaling-stroke; }
.game .tapmap .river { fill: none; stroke: var(--g-water); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.game .tapmap .mlabel { font-family: var(--font-ui); pointer-events: none; user-select: none; }
.game .tapmap .mlabel.c { fill: var(--fg); font-weight: 700; paint-order: stroke; stroke: var(--g-land); stroke-width: 2.5px; stroke-linejoin: round; }
.game .tapmap .mlabel.r { fill: color-mix(in srgb, var(--g-land-line) 75%, var(--fg)); letter-spacing: .2em; font-weight: 700; opacity: .8; }
.game .tapmap .mlabel.w { fill: color-mix(in srgb, var(--lapis) 70%, var(--fg)); font-style: italic; font-family: var(--font-body); opacity: .9; }
.game .tapmap .mdot { fill: var(--fg); stroke: var(--g-land); stroke-width: 1; vector-effect: non-scaling-stroke; }
.game .tapmap .pin { fill: var(--g-low); stroke: #fff; }
.game .tapmap .ans { fill: var(--g-good); stroke: #fff; }
.game .tapmap .drop { animation: gdrop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes gdrop { 0% { opacity: 0; transform: translateY(-22px) scale(.4); } 60% { opacity: 1; } 100% { transform: none; } }
.game .tapmap .gline { stroke: var(--g-low); stroke-dasharray: .03 .03; stroke-linecap: round; }
.game .tapmap .gline.good { stroke: var(--g-good); } .game .tapmap .gline.mid { stroke: var(--g-mid); }
.game .tapmap .plabel { font-family: var(--font-ui); font-weight: 700; fill: var(--fg); paint-order: stroke; stroke: none; pointer-events: none; }
.game .tapmap .plbg { fill: var(--surface); stroke: var(--g-land-line); stroke-width: .6; vector-effect: non-scaling-stroke; opacity: .94; }
.game .mtag { position: absolute; left: 8px; bottom: 8px; top: auto; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); font: .74rem var(--font-ui); color: var(--muted); pointer-events: none; }
.game .tapbar { position: sticky; bottom: calc(var(--gdock, 0px) + 8px); z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--g-shadow); }
.game .tapbar .qmeta { margin: 0; }
.game .tapres { display: grid; gap: 6px; width: 100%; }
.game .tapres p { margin: 0; font-size: .9rem; line-height: 1.35; }
.game .tapline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-family: var(--font-ui); }
.game .tapline > b { font: 700 1.2rem var(--font-body); }
.game .tappts { margin-left: auto; font-variant-numeric: tabular-nums; } .game .tappts b { font-size: 1.35rem; color: var(--g-low); }
.game .tapres.good .tappts b { color: var(--g-good); } .game .tapres.mid .tappts b { color: var(--g-mid); }
.game .tapend { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.game .tapend .chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 140px; }

/* ---------- Pilgrimage ---------- */
.game.pilgrim { max-width: 560px; }
.game .pboard { display: grid; gap: 10px; justify-items: center; padding: 12px 14px 8px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--gk-near) 35%, var(--line)); background: linear-gradient(color-mix(in srgb, var(--gk-near) 10%, var(--surface)), var(--surface) 70%); box-shadow: var(--g-shadow), 0 0 0 6px var(--bg); }
/* on a tall phone the candles and the guess box stay in view while the stations scroll under them */
@media (min-height: 800px) { .game .pboard { position: sticky; top: calc(var(--gtop, 0px) + 6px); z-index: 5; } }
.candles { display: flex; align-items: flex-end; justify-content: center; gap: 9px; min-height: 44px; }
.candles .ccount { margin-left: 8px; font: .9rem var(--font-ui); color: var(--muted); align-self: center; } .candles .ccount b { color: var(--fg); font-size: 1.15rem; }
.cnd { position: relative; display: inline-grid; justify-items: center; align-content: end; width: 14px; height: 40px; flex: none; }
.cnd .wax { display: block; width: 11px; height: 22px; border-radius: 3px 3px 1px 1px; background: linear-gradient(90deg, #efe3c4, #fbf4e1 45%, #e0d0a6); border: 1px solid #c9b684; }
.cnd .fl { display: block; width: 9px; height: 14px; margin-bottom: 1px; border-radius: 50% 50% 50% 50% / 66% 66% 34% 34%; background: radial-gradient(circle at 50% 72%, #fff7cf 0 22%, var(--g-flame) 60%, #df741a); transform-origin: 50% 100%; opacity: 0; transform: scale(.2); }
.cnd:not(.lit) .wax { filter: grayscale(.7) brightness(.93); opacity: .7; }
.cnd.lit .fl { opacity: 1; transform: none; box-shadow: 0 0 12px 4px rgb(245 185 58 / .42); animation: gflick 2.6s ease-in-out infinite; }
.cnd.lit.new .fl { animation: gignite .7s ease-out, gflick 2.6s .7s ease-in-out infinite; }
.cnd.out::after { content: ""; position: absolute; top: 2px; left: 50%; width: 6px; height: 12px; margin-left: -3px; border-radius: 50%; border-left: 2px solid var(--muted); opacity: 0; animation: gsmoke 1.1s ease-out; }
@keyframes gflick { 0%, 100% { transform: scale(1) rotate(-2deg); } 30% { transform: scale(1.06, .94) rotate(2deg); } 60% { transform: scale(.95, 1.07) rotate(-1deg); } }
@keyframes gignite { 0% { opacity: 0; transform: scale(.2); } 40% { opacity: 1; transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes gsmoke { 0% { opacity: .8; transform: translateY(4px); } 100% { opacity: 0; transform: translateY(-16px) scaleX(1.6); } }
.candles.mini { min-height: 36px; gap: 6px; }
.game .pname { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.game .pname .pw { display: flex; gap: 4px; }
.game .pname i { width: clamp(22px, 7.2vw, 34px); height: clamp(30px, 9.4vw, 42px); border-radius: 7px; border: 2px solid color-mix(in srgb, var(--fg) 28%, var(--line)); background: var(--surface); display: grid; place-items: center; font: 700 clamp(.95rem, 4.6vw, 1.3rem) var(--font-ui); font-style: normal; color: var(--fg); }
.game .pname i.rev { border-color: var(--gk-near); background: color-mix(in srgb, var(--gk-near) 26%, var(--surface)); }
.game .pname i.typed { border-color: var(--lapis); }
.game .pname i.won { border-color: var(--gk-near); background: var(--gk-near); color: var(--gk-near-fg); animation: gpop .4s backwards; }
.game .pname i.told { border-color: transparent; background: var(--gk-no); color: var(--gk-no-fg); }
.game .pguess { display: grid; gap: 6px; width: 100%; }
.game .pguess:empty { display: none; }
.game .pgform { display: flex; gap: 8px; }
.game .pgform input { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font: 1.05rem var(--font-ui); }
.game .pgform input:focus { outline: 2px solid var(--lapis); outline-offset: 1px; border-color: transparent; }
.game .pnote { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; font: .85rem var(--font-ui); color: var(--muted); min-height: 32px; }
.game .pnote s { color: var(--g-low); }
.game .plinks { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.game .linkish { border: 0; background: none; padding: 8px 0; min-height: 40px; color: var(--lapis); font: 700 .88rem var(--font-ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.game .linkish small { font-weight: 400; color: var(--muted); }
.game .stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.game .station { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.game .station.open { border-color: var(--lapis); box-shadow: var(--g-shadow); padding: 14px; }
.game .station { opacity: 1; }
.game .station:not(.open):not(.done) { opacity: .62; }
.game .station.open { box-shadow: var(--g-shadow); }
.game .sthead { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.game .sthead b { font: 700 1.08rem var(--font-body); }
.game .sthead .sti { width: 22px; height: 22px; color: var(--lapis); flex: none; }
.game .sthead .cnd { height: 30px; margin-top: -6px; } .game .sthead .cnd .wax { height: 14px; } .game .sthead .cnd .fl { width: 8px; height: 12px; }
.game .stnote { margin-left: auto; font: .78rem var(--font-ui); color: var(--muted); }
.game .station.good .stnote { color: color-mix(in srgb, var(--gold) 75%, var(--fg)); font-weight: 700; }
.game .station p { margin: 0; }
.game .sthint { font: .95rem var(--font-ui); color: var(--muted); }
.game .pclue { font-style: normal; font-size: 1rem; line-height: 1.45; animation: gfadein .5s both; }
.game .stbody { display: grid; gap: 10px; }
.game .stq { font-weight: 700; }
.game .stskip { justify-self: start; border: 0; background: none; padding: 6px 0; min-height: 36px; color: var(--muted); font: .84rem var(--font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.game .tiles { display: flex; gap: 5px; justify-content: center; }
.game .lt { flex: 1 1 0; min-width: 0; max-width: 44px; padding: 0; height: 46px; border-radius: 9px; border: 0; background: color-mix(in srgb, var(--fg) 11%, var(--surface)); color: var(--fg); font: 700 1.2rem var(--font-ui); cursor: pointer; transition: opacity .12s, transform .12s; }
.game .lt.used { opacity: .22; transform: scale(.9); }
.game .wans { display: flex; gap: 4px; justify-content: center; align-items: center; min-height: 44px; }
.game .wans i { flex: 1 1 0; max-width: 28px; height: 36px; border-bottom: 2px solid color-mix(in srgb, var(--fg) 40%, var(--line)); display: grid; place-items: center; font: 700 1.2rem var(--font-ui); font-style: normal; }
.game .wans .ghost { margin-left: 8px; }
.game .vq { font-size: 1.1rem; line-height: 1.5; }
.game .vopts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game .vopts button { min-height: 48px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font: 700 1rem var(--font-ui); cursor: pointer; }
.game .vopts button:hover { border-color: var(--lapis); }
.game .vopts .right { background: var(--g-good); border-color: var(--g-good); color: #fff; }
.game .vopts .wrong { background: var(--g-low); border-color: var(--g-low); color: #fff; animation: gshake .42s; }
.game .station .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.game .pchip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font: 600 1rem var(--font-ui); cursor: pointer; }
.game .pchip.on { background: var(--lapis); border-color: var(--lapis); color: var(--surface); }

.game .tcell:focus-visible, .game .ltile:focus-visible, .game .lt:focus-visible, .game .kb button:focus-visible, .hub .gcard:focus-visible, .game .gbtn:focus-visible, .gsheet button:focus-visible { outline: 3px solid var(--gk-near); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .game *, .hub *, .gsheet-wrap, .gsheet, .gsheet * { animation: none !important; transition: none !important; }
  .game .glow, .cnd.out::after { display: none; }
  .game [data-msg].pulse::after { animation: none; }
}
