/* Games, the calm version: warm cream paper, soft earthy colours (blush, sage, sand, lilac), serif headings, thin lines,
   and cards that look like pinned prints of different heights. Loaded after games.css, so it only has to say what changes. */
:root {
    --paper: #fffdf9; --cream: #f6f0e7; --sand: #efe6d9;
    --gm-ink: #3a312b; --gm-mute: #8b7e73; --gm-line: #e9dfd2;
    --gm-rose: #b8736f; --gm-gold: #c8a56a; --gm-sky: #7a95b0; --gm-mint: #8fae8b; --gm-violet: #9b86b5;
    --gm-grad: linear-gradient(135deg, #c98b86, #b8736f);
    --gm-glass: rgba(255, 252, 247, .8);
    --gm-shadow: 0 1px 2px rgba(70, 45, 30, .05), 0 14px 34px rgba(70, 45, 30, .08);
    --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

/* ── The page: paper, a little grain, three soft colour washes ── */
body.games-body, body.gp-body { background: var(--cream) !important; color: var(--gm-ink); }
body.games-body .background-overlay { display: none; }           /* the colourful wave picture of the shop */
body.games-body::before, body.gp-body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); }
.gm-bg span { font-size: 0; width: min(46vw, 560px); height: min(46vw, 560px); border-radius: 50%; filter: blur(80px); opacity: .55; animation: gmDrift 26s ease-in-out infinite; }
.gm-bg span::before { content: none; }
.gm-bg span:nth-child(1) { left: -12%; top: -8%; background: #ecc9c2; }
.gm-bg span:nth-child(2) { right: -14%; top: 4%; background: #d3dec8; animation-delay: -8s; }
.gm-bg span:nth-child(3) { left: -8%; bottom: -18%; background: #e8d8bf; animation-delay: -15s; }
.gm-bg span:nth-child(4) { right: -10%; bottom: -14%; background: #ddd2e8; animation-delay: -4s; }
.gm-bg span:nth-child(5), .gm-bg span:nth-child(6) { display: none; }
@keyframes gmDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(24px, -18px); } }

/* ── Hero ───────────────────────────────────────────── */
.gm-hero { margin-bottom: 2.2rem; }
.gm-eyebrow { background: none; box-shadow: none; color: var(--gm-mute); font-weight: 600; font-size: .7rem; letter-spacing: .3em; gap: .9rem; padding: 0; }
.gm-eyebrow::before, .gm-eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--gm-line); }
.gm-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.9rem, 7vw, 5.2rem); line-height: 1; letter-spacing: -.015em; margin: 1.1rem 0 .9rem; color: var(--gm-ink); }
.gm-hero h1 em { background: none; -webkit-text-fill-color: currentColor; color: var(--gm-rose); font-weight: 500; }
.gm-wiggle { display: none; }
.gm-hero p { color: var(--gm-mute); font-size: 1.05rem; line-height: 1.7; max-width: 520px; font-weight: 400; }
.gm-steps { gap: .4rem 2rem; margin-top: 1.6rem; }
.gm-steps li { background: none; border: 0; box-shadow: none; padding: 0; font-weight: 500; font-size: .9rem; color: var(--gm-mute); }
.gm-steps b { background: none; width: auto; height: auto; color: var(--gm-rose); font-family: var(--serif); font-style: italic; font-size: 1.35rem; font-weight: 500; margin-right: .2rem; }
.gm-steps b::before { content: "0"; }

/* ── Buttons, fields, the "how do you want to play" card ── */
.gm-btn { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: none; font-weight: 600; color: var(--gm-ink); }
.gm-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(70, 45, 30, .1); }
.gm-btn-primary { background: var(--gm-rose); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(184, 115, 111, .3); }
.gm-btn-ghost { background: transparent; }
.gm-field { color: var(--gm-mute); letter-spacing: .12em; }
.gm-field input, .gm-join input { background: var(--paper); border: 1px solid var(--gm-line); border-radius: 14px; }
.gm-field input:focus, .gm-join input:focus { border-color: var(--gm-rose); box-shadow: 0 0 0 4px rgba(184, 115, 111, .15); }
.gm-room { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: var(--gm-shadow); backdrop-filter: none; border-radius: 28px; }
.gm-ticket::before, .gm-ticket::after { display: none; }
.gm-status { border-top: 1px solid var(--gm-line); }
.gm-code strong { background: var(--cream); border: 1px solid var(--gm-line); border-radius: 10px; color: var(--gm-ink); }
.gm-mode { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: none; border-radius: 18px; }
.gm-mode:hover { box-shadow: 0 12px 26px rgba(70, 45, 30, .12); }
.gm-mode > i { background: #f3ebe0; color: var(--gm-rose); }
.gm-mode.primary { background: var(--gm-rose); border-color: transparent; box-shadow: 0 10px 22px rgba(184, 115, 111, .32); }
.gm-mode.primary > i { background: rgba(255, 255, 255, .22); color: #fff; }
.gm-peer { background: var(--paper); border-width: 1px; }
.gm-peer.me { background: color-mix(in srgb, var(--c, #b8736f) 14%, #fffdf9); }

/* ── Category tabs: plain words with a line underneath ── */
.gm-tabs { display: flex; gap: 1.8rem; background: none; border: 0; border-bottom: 1px solid var(--gm-line); border-radius: 0; box-shadow: none; backdrop-filter: none; padding: 0; margin-bottom: 2.2rem; }
.gm-tabs button { border-radius: 0; padding: .7rem .1rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--gm-mute); font-weight: 600; background: none; }
.gm-tabs button.on { background: none; box-shadow: none; color: var(--gm-ink); border-bottom-color: var(--gm-rose); }
.gm-cat { margin-bottom: 3.2rem; }
.gm-cat-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.5rem); }
.gm-cat-head h2 em { background: none; box-shadow: none; border: 1px solid var(--gm-line); color: var(--gm-mute); }
.gm-cat-ico { background: none; border: 1px solid var(--gm-line); color: var(--gm-rose); box-shadow: none; }
.gm-cat-ico.c3d { background: none; box-shadow: none; color: var(--gm-violet); }
.gm-cat-head p { color: var(--gm-mute); line-height: 1.65; }

/* ── Cards: pinned prints of different heights ──────── */
.gm-grid { display: block; columns: 4 250px; column-gap: 24px; }
.gm-empty { column-span: all; }
.gm-card { --c1: #e8c8c4; --c2: #f4e1db; break-inside: avoid; margin: 0 0 24px; width: 100%; background: var(--paper); border: 1px solid rgba(80, 55, 40, .08); border-radius: 26px; box-shadow: 0 1px 2px rgba(70, 45, 30, .05), 0 12px 28px rgba(70, 45, 30, .07); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.gm-card:nth-child(6n+2) { --c1: #c9d5be; --c2: #e1eadb; }
.gm-card:nth-child(6n+3) { --c1: #ddd0bc; --c2: #efe6d8; }
.gm-card:nth-child(6n+4) { --c1: #d0c6da; --c2: #e6deee; }
.gm-card:nth-child(6n+5) { --c1: #e6c9b5; --c2: #f2e2d5; }
.gm-card:nth-child(6n+6) { --c1: #c3d2d8; --c2: #dce7ea; }
.gm-card.is3d { --c1: #cfc9d8; --c2: #e4e0eb; }
.gm-card:hover { transform: translateY(-5px); box-shadow: 0 2px 4px rgba(70, 45, 30, .06), 0 24px 46px rgba(70, 45, 30, .14); }
.gm-preview { margin: 9px; height: 170px; width: auto; border-radius: 19px; background: linear-gradient(145deg, var(--c1), var(--c2)); }
.gm-card[data-gid="memory"] .gm-preview { height: 214px; }
.gm-card[data-gid="ttt"] .gm-preview { height: 176px; }
.gm-card[data-gid="draw"] .gm-preview { height: 152px; }
.gm-card[data-gid="tod"] .gm-preview { height: 206px; }
.gm-card[data-gid="bomb"] .gm-preview { height: 168px; }
.gm-card[data-gid="rps"] .gm-preview { height: 150px; }
.gm-card[data-gid="quantum"] .gm-preview { height: 148px; }
.gm-card[data-gid="meet-me-here"] .gm-preview { height: 206px; }
.gm-card[data-gid="bsd-city"] .gm-preview { height: 164px; }
.gm-card-body { padding: .9rem 1.2rem 1.25rem; }
.gm-card-head { margin-bottom: .4rem; }
.gm-card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -.005em; }
.gm-card p { color: var(--gm-mute); font-size: .92rem; line-height: 1.6; }
.gm-card-emoji, .gm-card:hover .gm-card-emoji { background: #f3ebe0; color: var(--gm-rose); box-shadow: none; transform: none; width: 34px; height: 34px; font-size: 1rem; border-radius: 11px; }
.gm-tag { background: #f3ebe0; color: var(--gm-mute); font-weight: 600; }
.gm-tag.live { background: #e4ebdb; color: #5f7a59; }
.gm-card-go { color: var(--gm-rose); }
.gm-badge3d { background: rgba(58, 49, 43, .6); }
.gm-lock { background: rgba(70, 52, 42, .46); }
.gm-card.locked .gm-preview { filter: saturate(.55); }

/* the little pictures on the cards, in the same soft colours */
.pv-memory .mc .bk { color: var(--gm-rose); }
.pv-ttt b.x { color: #b8736f; } .pv-ttt b.o { color: #6f8fa8; }
.pv-ttt i { background: rgba(255, 253, 249, .9); box-shadow: 0 3px 0 rgba(70, 45, 30, .08); }
.pv-draw .s1 { stroke: #b8736f; } .pv-draw .s2 { stroke: #8a7aa6; } .pv-draw .s3 { stroke: #6f9aa8; }
.pv-tod .truth em { background: #8a7aa6; } .pv-tod .dare em { background: #b8736f; }
.pv-tod p { color: var(--gm-ink); }
.pv-bomb i.pi { background: #857b92; } .pv-bomb i.cr { background: #dcae7d; box-shadow: inset 0 0 0 3px #c99763; }
.pv-city { background: linear-gradient(180deg, #4a4a6e 0%, #8d7499 62%, #e3b7a2 100%); }

/* ── Game pages ─────────────────────────────────────── */
.gp-top { background: rgba(255, 252, 247, .84); border-bottom: 1px solid var(--gm-line); box-shadow: none; }
.gp-emoji { background: var(--gm-rose); box-shadow: none; width: 38px; height: 38px; border-radius: 12px; }
.gp-title h1 { font-family: var(--serif); font-weight: 600; font-size: 1.75rem; }
.gp-help { background: none; color: var(--gm-mute); }
body.gp-body { --gp-bg: none; }
.theme-memory, .theme-ttt, .theme-draw, .theme-tod, .theme-bomb, .theme-rps { --gp-bg: none; }
body.gp-body::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(circle at 10% 6%, var(--wash1, rgba(236, 201, 194, .55)), transparent 42%), radial-gradient(circle at 92% 92%, var(--wash2, rgba(211, 222, 200, .55)), transparent 44%); }
.theme-memory { --wash1: rgba(236, 201, 194, .6); --wash2: rgba(232, 216, 191, .5); }
.theme-ttt { --wash1: rgba(200, 213, 226, .55); --wash2: rgba(221, 210, 232, .5); }
.theme-draw { --wash1: rgba(211, 222, 200, .6); --wash2: rgba(200, 217, 222, .5); }
.theme-tod { --wash1: rgba(240, 222, 184, .55); --wash2: rgba(236, 201, 194, .5); }
.theme-bomb { --wash1: rgba(232, 208, 180, .6); --wash2: rgba(236, 201, 194, .5); }
.theme-rps { --wash1: rgba(221, 210, 232, .55); --wash2: rgba(236, 201, 194, .5); }
.gp-main { position: relative; z-index: 1; }
.gm-banner { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: 0 6px 16px rgba(70, 45, 30, .07); font-weight: 600; }
.gm-banner.mine { background: var(--gm-rose); border-color: transparent; color: #fff; animation: none; box-shadow: 0 8px 20px rgba(184, 115, 111, .3); }
.gm-score { background: var(--paper); border-width: 1px; box-shadow: none; --c: #b8736f; }
.gm-score:nth-child(2) { --c: #7a95b0; } .gm-score:nth-child(3) { --c: #8fae8b; } .gm-score:nth-child(4) { --c: #c8a56a; }
.mem-front { background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .4), transparent 40%), linear-gradient(135deg, #d9a8a3, #c4857f); box-shadow: 0 8px 16px rgba(184, 115, 111, .28), inset 0 -4px 0 rgba(0, 0, 0, .06); }
.mem-back { border-color: #efe3d6; box-shadow: 0 6px 14px rgba(70, 45, 30, .1); }
.mem-card.matched .mem-back { border-color: #8fae8b; background: linear-gradient(135deg, #f3f7ee, #e6eedd); }
.ttt-board { background: var(--glass, rgba(255, 252, 247, .8)); border: 1px solid var(--gm-line); box-shadow: var(--gm-shadow); }
.ttt-cell { background: linear-gradient(145deg, #fffdf9, #f4ece1); box-shadow: 0 5px 0 #eadfd0, 0 10px 18px rgba(70, 45, 30, .08); }
.ttt-cell:hover:not(:disabled) { box-shadow: 0 8px 0 #eadfd0, 0 14px 22px rgba(70, 45, 30, .12); }
.ttt-cell.x { color: #b8736f; text-shadow: none; } .ttt-cell.o { color: #6f8fa8; text-shadow: none; }
.ttt-cell.win { background: linear-gradient(145deg, #fcf3d8, #f6e6b4); box-shadow: 0 5px 0 #e6cf8e, 0 0 0 3px #e9d38f; animation: none; }
.dr-tools { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: var(--gm-shadow); }
.dr-swatch { box-shadow: 0 0 0 1px var(--gm-line), 0 2px 5px rgba(0, 0, 0, .12); }
.dr-swatch.active { box-shadow: 0 0 0 3px var(--gm-rose), 0 2px 5px rgba(0, 0, 0, .12); }
.dr-canvas { border-color: var(--paper); box-shadow: 0 16px 38px rgba(70, 45, 30, .14), 0 0 0 1px var(--gm-line); }
.td-card { border-color: var(--paper); box-shadow: 0 18px 40px rgba(70, 45, 30, .13); }
.td-card.truth { background: linear-gradient(135deg, #e7edf1, #ede7f1); }
.td-card.dare { background: linear-gradient(135deg, #f6e4dd, #f7edd6); }
.td-card::before { color: rgba(138, 122, 166, .14); }
.td-kind { background: #8a7aa6; } .td-card.dare .td-kind { background: #b8736f; }
.td-text { font-family: var(--serif); font-weight: 600; }
.bm-pill, .bm-seg { background: var(--paper); border: 1px solid var(--gm-line); box-shadow: none; }
.bm-pill.p1 { box-shadow: 0 0 0 1px #b8736f; } .bm-pill.p2 { box-shadow: 0 0 0 1px #7a95b0; }
.bm-canvas { border-color: var(--paper); box-shadow: 0 16px 38px rgba(70, 45, 30, .16), 0 0 0 1px var(--gm-line); background: #f4eadc; }
.bm-seg button.on { background: var(--gm-rose); box-shadow: none; }
.rps-hand { background: var(--paper); border: 1px solid var(--gm-line); backdrop-filter: none; }
.rps-hand.win { background: linear-gradient(180deg, #fffaec, #fbefcb); box-shadow: 0 0 0 3px #e9d38f, 0 18px 36px rgba(200, 165, 106, .35); }
.rps-vs { background: var(--gm-rose); box-shadow: 0 8px 16px rgba(184, 115, 111, .3); }
.rps-btn { border: 1px solid var(--gm-line); box-shadow: 0 5px 0 #eadfd0, 0 12px 22px rgba(70, 45, 30, .1); }
.rps-btn.on { border-color: var(--gm-rose); background: linear-gradient(#fffdf9, #f9eeea); box-shadow: 0 0 0 3px rgba(184, 115, 111, .2), 0 12px 22px rgba(184, 115, 111, .22); }
.gm-gate, .gm-modal-card { background: var(--paper); border: 1px solid var(--gm-line); backdrop-filter: none; }
.gm-gate h2, .gm-modal-card h2 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; }
.gm-gate-or::before, .gm-gate-or::after { border-top-color: var(--gm-line); }
.gm-toast { background: rgba(58, 49, 43, .94); }
.gm-attn { animation-name: gmAttnSoft; }
@keyframes gmAttnSoft { 0%, 100% { box-shadow: var(--gm-shadow); } 25%, 75% { box-shadow: 0 0 0 4px rgba(184, 115, 111, .3), var(--gm-shadow); } }
.gm-confetti span { filter: saturate(.6); }
.gmc-label { box-shadow: 0 3px 10px rgba(70, 45, 30, .18); }

@media (max-width: 720px) {
    .gm-grid { columns: 1; }
    .gm-card[data-gid] .gm-preview { height: 170px; }
    .gm-tabs { gap: 1.1rem; overflow-x: auto; }
}
@media (min-width: 721px) and (max-width: 1000px) { .gm-grid { columns: 2 250px; } }

/* small touch-ups after looking at it */
.gm-steps b { white-space: nowrap; display: inline-block; }
.gm-steps li { display: inline-flex; align-items: baseline; gap: .35rem; }
.ttt-cell { border: 1px solid #eadfd0; }
.ttt-board { background: rgba(255, 252, 247, .9); }

/* ── Number Hunt ───────────────────────────────────── */
.theme-hunt { --gp-bg: none; --wash1: rgba(211, 222, 200, .6); --wash2: rgba(236, 201, 194, .5); }
.gm-card[data-gid="hunt"] .gm-preview { height: 176px; }
.pv-hunt { flex-direction: column; gap: 8px; padding: 12px; justify-content: center; }
.pv-hunt .hb { position: relative; width: 100%; flex: 1; border-radius: 12px; background: #fff; box-shadow: 0 6px 16px rgba(70, 45, 30, .1); overflow: hidden; }
.pv-hunt .pn { position: absolute; translate: -50% -50%; rotate: var(--r); font-style: normal; font-weight: 700; font-family: var(--serif, Georgia, serif); font-size: calc(.85rem * var(--s)); color: #5b4d44; }
.pv-hunt .pn.pick { color: var(--gm-rose, #b8736f); }
.pv-hunt .pn.pick::after { content: ""; position: absolute; inset: -6px -8px; border: 2px solid var(--gm-rose, #b8736f); border-radius: 50%; clip-path: inset(0 100% 0 0); animation: pvRing 3.2s ease-in-out infinite; }
@keyframes pvRing { 0%, 20% { clip-path: inset(0 100% 0 0); } 45%, 85% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
.pv-hunt .hx { display: flex; gap: 4px; }
.pv-hunt .hx u { width: 14px; height: 14px; border-radius: 4px; background: rgba(255, 253, 249, .9); position: relative; }
.pv-hunt .hx u::after { content: "\00d7"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; line-height: 1; color: #b8736f; text-decoration: none; opacity: 0; animation: pvX 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * .16s); }
@keyframes pvX { 0%, 8% { opacity: 0; scale: .4; } 18%, 80% { opacity: 1; scale: 1; } 92%, 100% { opacity: 0; } }

.hn-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 1.2rem; width: 100%; max-width: 980px; align-items: start; }
.hn-main { display: grid; gap: .8rem; min-width: 0; }
.hn-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; min-height: 54px; }
.hn-round { color: var(--gm-mute, #8b7e73); font-weight: 600; font-size: .9rem; margin-right: auto; }
.hn-call { font-size: 1.05rem; padding: .8rem 1.5rem; }
.hn-call:not(:disabled) { animation: hnPulse 1.6s ease-in-out infinite; }
@keyframes hnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 115, 111, .45); } 50% { box-shadow: 0 0 0 10px rgba(184, 115, 111, 0); } }
.hn-target { display: inline-flex; align-items: baseline; gap: .5rem; padding: .3rem 1.1rem; border-radius: 18px; background: var(--paper, #fffdf9); border: 1px solid var(--gm-line, #e9dfd2); color: var(--gm-mute, #8b7e73); }
.hn-target small { font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.hn-target b { font-family: var(--serif, Georgia, serif); font-size: 2.4rem; font-weight: 600; line-height: 1.1; min-width: 1.6ch; text-align: center; color: var(--gm-ink, #3a312b); }
.hn-target.on { background: var(--gm-rose, #b8736f); border-color: transparent; color: rgba(255, 255, 255, .85); }
.hn-target.on b { color: #fff; animation: hnPop .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes hnPop { from { transform: scale(.3); opacity: 0; } }

.hn-board { position: relative; width: 100%; aspect-ratio: 1.3; background: #fff; border-radius: 22px; border: 1px solid var(--gm-line, #e9dfd2); box-shadow: 0 2px 4px rgba(70, 45, 30, .05), 0 18px 40px rgba(70, 45, 30, .1); container-type: inline-size; overflow: hidden; user-select: none; }
.hn { position: absolute; translate: -50% -50%; rotate: var(--r); padding: .05em .12em; border: 0; background: none; cursor: default; font-family: var(--serif, Georgia, serif); font-weight: 600; font-size: calc(var(--s) * 3cqw); line-height: 1; color: #4a3f37; transition: transform .15s; }
.hn.c1 { color: #b8736f; } .hn.c2 { color: #6f8fa8; } .hn.c3 { color: #7a9a6f; } .hn.c4 { color: #8a7aa6; }
.hn-board.hunting .hn:not(:disabled) { cursor: pointer; }
.hn-board.hunting .hn:not(:disabled):hover { transform: scale(1.25); }
.hn-board.frozen { opacity: .55; pointer-events: none; transition: opacity .2s; }
.hn::after { content: ""; position: absolute; inset: -.12em -.2em; border: .09em solid var(--gm-rose, #b8736f); border-radius: 50%; opacity: 0; transform: scale(1.5) rotate(-14deg); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none; }
.hn.ring { opacity: .9; } .hn.ring::after { opacity: 1; transform: scale(1) rotate(-6deg); }
.hn.ring-me::after { border-color: #5f9a6a; } .hn.ring-none::after { border-color: #d3a24a; border-style: dashed; }
.hn.miss { color: #d34c4c; animation: hnShake .4s; }
@keyframes hnShake { 0%, 100% { translate: -50% -50%; } 25% { translate: calc(-50% - 6px) -50%; } 75% { translate: calc(-50% + 6px) -50%; } }

.hn-side { background: var(--paper, #fffdf9); border: 1px solid var(--gm-line, #e9dfd2); border-radius: 22px; padding: 1rem; display: grid; gap: .7rem; box-shadow: 0 10px 24px rgba(70, 45, 30, .07); }
.hn-sidetitle { margin: 0; font-weight: 700; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gm-mute, #8b7e73); }
.hn-xs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border-radius: 16px; background: var(--cream, #f6f0e7); touch-action: manipulation; }
.hn-xs i { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1.5px #e3d8c9; }
.hn-xs i b { font-size: 1.1rem; color: var(--gm-ink, #3a312b); opacity: 0; transform: scale(.3) rotate(-30deg); transition: opacity .12s, transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.hn-xs i.on b { opacity: 1; transform: none; }
.hn-xs i.pen b { color: #d34c4c; }
.hn-xs.tap { cursor: pointer; box-shadow: 0 0 0 3px rgba(184, 115, 111, .35); animation: hnTap 1s ease-in-out infinite; }
.hn-xs.tap i:not(.on):hover { background: #fbeee9; }
@keyframes hnTap { 50% { box-shadow: 0 0 0 6px rgba(184, 115, 111, .12); } }
.hn-count { margin: 0; text-align: center; font-weight: 600; font-size: .85rem; color: var(--gm-mute, #8b7e73); min-height: 1.2em; }
@media (max-width: 760px) { .hn-wrap { grid-template-columns: 1fr; } .hn-board { aspect-ratio: .95; } .hn { font-size: calc(var(--s) * 3.9cqw); } .hn-xs { grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 6px; } .hn-xs i { border-radius: 6px; } .hn-xs i b { font-size: .8rem; } }
@media (prefers-reduced-motion: reduce) { .hn-call, .hn-xs.tap, .pv-hunt .pn.pick::after, .pv-hunt .hx u::after { animation: none !important; } }

.hn-call[hidden] { display: none !important; }

/* ── Math Duel, Make 24, Sudoku Together ───────────── */
.theme-mathduel { --gp-bg: none; --wash1: rgba(236, 201, 194, .6); --wash2: rgba(211, 222, 200, .5); }
.theme-make24 { --gp-bg: none; --wash1: rgba(240, 222, 184, .6); --wash2: rgba(221, 210, 232, .5); }
.theme-sudoku { --gp-bg: none; --wash1: rgba(200, 217, 222, .6); --wash2: rgba(236, 201, 194, .45); }
.gm-card[data-gid="mathduel"] .gm-preview { height: 170px; }
.gm-card[data-gid="make24"] .gm-preview { height: 170px; }
.gm-card[data-gid="sudoku"] .gm-preview { height: 190px; }

/* hub pictures */
.pv-mathduel { flex-direction: column; gap: 9px; padding: 14px; justify-content: center; }
.pv-mathduel .lane { width: 100%; height: 12px; border-radius: 99px; background: rgba(255, 253, 249, .75); overflow: hidden; }
.pv-mathduel .lane b { display: block; height: 100%; border-radius: 99px; background: #b8736f; animation: pvLane 4s ease-in-out infinite; }
.pv-mathduel .lane.b b { background: #6f8fa8; animation-delay: -1.4s; }
@keyframes pvLane { 0% { width: 10%; } 50%, 70% { width: 78%; } 100% { width: 10%; } }
.pv-mathduel .sum { font-family: var(--serif, Georgia, serif); font-size: 2.3rem; font-weight: 600; color: #3a312b; line-height: 1.1; }
.pv-mathduel .ans { padding: .15rem .9rem; border-radius: 99px; background: #fffdf9; color: #b8736f; font-weight: 700; box-shadow: 0 4px 10px rgba(70, 45, 30, .1); animation: pvAns 4s ease-in-out infinite; }
@keyframes pvAns { 0%, 45% { opacity: 0; transform: scale(.6); } 55%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.pv-make24 { flex-direction: column; gap: 12px; padding: 14px; justify-content: center; }
.pv-make24 .cd { display: flex; gap: 8px; }
.pv-make24 .cd b { width: 40px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: #fffdf9; font-family: var(--serif, Georgia, serif); font-size: 1.7rem; color: #3a312b; box-shadow: 0 6px 12px rgba(70, 45, 30, .12); }
.pv-make24 .cd b:nth-child(2) { rotate: -4deg; } .pv-make24 .cd b:nth-child(3) { rotate: 3deg; color: #b8736f; }
.pv-make24 .ex { font-family: var(--serif, Georgia, serif); font-size: 1.05rem; color: #3a312b; white-space: nowrap; }
.pv-make24 .ex em { font-style: normal; font-weight: 700; color: #b8736f; }
.pv-sudoku { padding: 12px; }
.pv-sudoku .sg { display: grid; grid-template-columns: repeat(6, 1fr); width: 138px; aspect-ratio: 1; background: #fffdf9; border-radius: 10px; padding: 4px; gap: 2px; box-shadow: 0 8px 18px rgba(70, 45, 30, .12); }
.pv-sudoku .sg i { display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .85rem; color: #3a312b; border-radius: 4px; background: #f6f0e7; }
.pv-sudoku .sg i.g { background: #efe6d9; }
.pv-sudoku .sg i.f { color: #b8736f; animation: pvFill 4.5s ease-in-out infinite; }
.pv-sudoku .sg i.f:nth-of-type(odd) { color: #6f9a6a; }
@keyframes pvFill { 0%, 25% { color: transparent; } 40%, 85% { } 100% { color: transparent; } }

/* shared bits */
.md-lanes { display: grid; gap: .6rem; width: 100%; max-width: 640px; }
.md-lane { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: .7rem; }
.md-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-lane.me .md-name { color: var(--gm-rose, #b8736f); }
.md-track { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding-right: 26px; }
.md-track > i { height: 16px; border-radius: 6px; background: #efe6d9; transition: background .3s, transform .3s; }
.md-track > i.on { background: var(--gm-rose, #b8736f); transform: scaleY(1.2); }
.md-lane.c1 .md-track > i.on { background: #6f8fa8; }
.md-flag { position: absolute; right: 0; top: 50%; translate: 0 -50%; color: #c8a56a; font-size: 1rem; }
.md-steps { font-weight: 700; font-size: .85rem; color: var(--gm-mute, #8b7e73); text-align: right; }
.md-q { display: grid; justify-items: center; gap: .2rem; width: 100%; max-width: 640px; padding: 1.4rem 1rem; border-radius: 26px; background: var(--paper, #fffdf9); border: 1px solid var(--gm-line, #e9dfd2); box-shadow: 0 2px 4px rgba(70, 45, 30, .05), 0 18px 40px rgba(70, 45, 30, .1); transition: background .3s; }
.md-q small { color: var(--gm-mute, #8b7e73); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }
.md-q b { font-family: var(--serif, Georgia, serif); font-size: clamp(2.6rem, 11vw, 4.6rem); font-weight: 600; line-height: 1.1; color: var(--gm-ink, #3a312b); }
.md-q span { min-height: 1.5em; font-weight: 700; color: var(--gm-rose, #b8736f); font-size: 1.3rem; }
.md-q.pop b { animation: hnPop .4s cubic-bezier(.2, 1.4, .4, 1); }
.md-q.ok { background: #eef5e8; } .md-q.none { background: #f6f0e7; }
.md-in { display: flex; gap: .6rem; width: 100%; max-width: 420px; }
.md-in input { flex: 1; min-width: 0; padding: .9rem 1.2rem; border-radius: 18px; border: 1px solid var(--gm-line, #e9dfd2); background: var(--paper, #fffdf9); font: 600 1.5rem var(--serif, Georgia, serif); text-align: center; color: var(--gm-ink, #3a312b); }
.md-in input:focus { outline: 0; border-color: var(--gm-rose, #b8736f); box-shadow: 0 0 0 4px rgba(184, 115, 111, .16); }
.md-in.locked input { border-color: #d34c4c; background: #fbeeee; animation: hnShakeX .4s; }
@keyframes hnShakeX { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.mk-wrap { display: grid; gap: 1rem; justify-items: center; width: 100%; max-width: 560px; }
.mk-goal { display: inline-flex; align-items: baseline; gap: .6rem; color: var(--gm-mute, #8b7e73); }
.mk-goal small { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: .75rem; }
.mk-goal b { font-family: var(--serif, Georgia, serif); font-size: 3rem; color: var(--gm-rose, #b8736f); line-height: 1; }
.mk-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; width: 100%; }
.mk-card { aspect-ratio: .85; border: 0; border-radius: 22px; background: var(--paper, #fffdf9); font: 600 clamp(2rem, 9vw, 3.4rem) var(--serif, Georgia, serif); color: var(--gm-ink, #3a312b); cursor: pointer; box-shadow: 0 5px 0 #eadfd0, 0 16px 28px rgba(70, 45, 30, .12); transition: transform .15s, box-shadow .15s, opacity .2s; }
.mk-card.c0 { background: linear-gradient(#fffdf9, #f9eeea); } .mk-card.c1 { background: linear-gradient(#fffdf9, #eef3e8); } .mk-card.c2 { background: linear-gradient(#fffdf9, #f1edf6); } .mk-card.c3 { background: linear-gradient(#fffdf9, #f8f1e1); }
.mk-card:hover:not(:disabled) { transform: translateY(-5px) rotate(-1.5deg); }
.mk-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #eadfd0; }
.mk-card.used { opacity: .3; box-shadow: none; transform: scale(.94); }
.mk-expr { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: center; width: 100%; min-height: 70px; padding: .8rem 1rem; border-radius: 20px; background: #fff; border: 1px dashed var(--gm-line, #e9dfd2); font: 600 1.6rem var(--serif, Georgia, serif); }
.mk-expr.shake { animation: hnShakeX .4s; border-color: #d34c4c; }
.mk-tok { padding: .05rem .4rem; border-radius: 10px; color: var(--gm-ink, #3a312b); } .mk-tok.n { background: #f3ebe0; }
.mk-eq { font-style: normal; margin-left: .5rem; color: var(--gm-mute, #8b7e73); } .mk-eq.ok { color: #5f9a6a; }
.mk-empty { color: var(--gm-mute, #8b7e73); font: 500 1rem 'Outfit', sans-serif; }
.mk-answer { color: #5f8059; }
.mk-ops { display: grid; grid-template-columns: repeat(8, 1fr); gap: .5rem; width: 100%; }
.mk-op { padding: .8rem 0; border: 1px solid var(--gm-line, #e9dfd2); border-radius: 16px; background: var(--paper, #fffdf9); font: 600 1.5rem var(--serif, Georgia, serif); color: var(--gm-ink, #3a312b); cursor: pointer; box-shadow: 0 4px 0 #eadfd0; }
.mk-op.wide { font-size: 1.1rem; }
.mk-op:hover:not(:disabled) { border-color: var(--gm-rose, #b8736f); } .mk-op:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #eadfd0; }
.mk-op:disabled, .mk-card:disabled { cursor: default; }
.mk-foot { display: flex; align-items: center; gap: .8rem; color: var(--gm-mute, #8b7e73); font-size: .85rem; min-height: 2.4rem; }

.sd-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1.4rem; }
.sd-stats { display: flex; gap: 1.1rem; color: var(--gm-mute, #8b7e73); font-weight: 600; font-size: .9rem; } .sd-stats i { color: var(--gm-rose, #b8736f); } .sd-stats b { color: var(--gm-ink, #3a312b); }
.sd-p i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gm-rose, #b8736f); margin-right: .4rem; } .sd-p.c1 i { background: #5f9a6a; }
.sd-wrap { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; align-items: flex-start; width: 100%; }
.sd-board { display: grid; grid-template-columns: repeat(9, 1fr); width: min(94vw, 520px); aspect-ratio: 1; background: #fff; border: 3px solid var(--gm-ink, #3a312b); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 4px rgba(70, 45, 30, .05), 0 18px 40px rgba(70, 45, 30, .12); }
.sd-cell { position: relative; display: grid; place-items: center; padding: 0; border: 0; border-right: 1px solid #e3d8c9; border-bottom: 1px solid #e3d8c9; background: #fff; font: 500 clamp(1.1rem, 5vw, 1.9rem) var(--serif, Georgia, serif); color: var(--gm-ink, #3a312b); cursor: pointer; transition: background .12s; }
.sd-cell:nth-child(9n+3), .sd-cell:nth-child(9n+6) { border-right: 2px solid var(--gm-ink, #3a312b); }
.sd-cell:nth-child(n+19):nth-child(-n+27), .sd-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--gm-ink, #3a312b); }
.sd-cell:nth-child(9n) { border-right: 0; } .sd-cell:nth-child(n+73) { border-bottom: 0; }
.sd-cell.given { font-weight: 700; background: #faf6ef; }
.sd-cell.o1 { color: var(--gm-rose, #b8736f); font-weight: 600; } .sd-cell.o2 { color: #4f8a5b; font-weight: 600; } .sd-cell.oh { color: #c8962f; font-weight: 600; }
.sd-cell.rel { background: #f7f0e6; } .sd-cell.same { background: #f6e4df; }
.sd-cell.sel { background: #f3d9d3; box-shadow: inset 0 0 0 2.5px var(--gm-rose, #b8736f); }
.sd-cell.peer { box-shadow: inset 0 0 0 2.5px #5f9a6a; } .sd-cell.peer.p0 { box-shadow: inset 0 0 0 2.5px var(--gm-rose, #b8736f); }
.sd-cell.bad { background: #f8d5d5; animation: hnShakeX .4s; }
.sd-side { display: grid; gap: .9rem; justify-items: center; }
.sd-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.sd-num { position: relative; width: 62px; height: 62px; border: 1px solid var(--gm-line, #e9dfd2); border-radius: 18px; background: var(--paper, #fffdf9); font: 600 1.7rem var(--serif, Georgia, serif); color: var(--gm-ink, #3a312b); cursor: pointer; box-shadow: 0 4px 0 #eadfd0; }
.sd-num small { position: absolute; right: 8px; bottom: 4px; font: 600 .6rem 'Outfit', sans-serif; color: var(--gm-mute, #8b7e73); }
.sd-num:hover:not(:disabled) { border-color: var(--gm-rose, #b8736f); } .sd-num:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #eadfd0; }
.sd-num:disabled { opacity: .4; cursor: default; } .sd-num.done { opacity: .25; }
.sd-new { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; color: var(--gm-mute, #8b7e73); font-weight: 600; font-size: .9rem; }

@media (max-width: 560px) { .md-lane { grid-template-columns: 80px 1fr 40px; } .mk-ops { grid-template-columns: repeat(4, 1fr); } .sd-pad { grid-template-columns: repeat(9, 1fr); } .sd-num { width: 36px; height: 46px; font-size: 1.3rem; border-radius: 12px; } .sd-side { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .pv-mathduel .lane b, .pv-mathduel .ans, .pv-sudoku .sg i.f { animation: none !important; } .pv-mathduel .ans { opacity: 1; } }

/* Number Hunt on a phone: a taller board with bigger numbers, and a wider invisible target around each one for fingers */
.hn::before { content: ""; position: absolute; inset: -.4em -.25em; }
@media (max-width: 760px) { .hn-board { aspect-ratio: .74; } .hn { font-size: calc(var(--s) * 5.2cqw); } }

/* phones: the number row must fit, and taps should not flash the browser's own highlight */
.hn, .hn-xs, .sd-cell, .sd-num, .mk-card, .mk-op { -webkit-tap-highlight-color: transparent; }
@media (max-width: 560px) {
    .sd-side { width: min(94vw, 520px); }
    .sd-pad { width: 100%; grid-template-columns: repeat(9, 1fr); gap: .25rem; }
    .sd-num { width: 100%; min-width: 0; height: 46px; border-radius: 11px; }
}
