/* Shared tool geometry; status and navigation remain distinct. */
.game-toolbar{--tool-ink:#173f35;--tool-paper:#fffef4;display:flex;flex-wrap:nowrap;gap:6px;align-items:center;padding:8px;margin:12px 0 0;justify-content:flex-start;border:1px solid #173f3530;border-radius:12px;background:#efefdf;color:var(--tool-ink)}
.game-toolbar>[role=status]{margin-right:auto;min-width:0;font-size:14px;font-variant-numeric:tabular-nums;padding:0 8px;font-weight:700}
.game-toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;flex:none;padding:8px 12px;font-size:14px;border:1px solid #173f3540;border-radius:8px;background:var(--tool-paper);color:var(--tool-ink);white-space:nowrap;transition:transform .16s cubic-bezier(.16,1,.3,1)}
.game-toolbar svg{flex:none;width:20px;height:20px;stroke-linecap:round;stroke-linejoin:round}
.game-toolbar [data-game-sheet=leaderboard]{margin-left:6px}.game-toolbar button[aria-pressed=true],.game-toolbar button[aria-expanded=true]{background:var(--tool-ink);color:var(--tool-paper)}
.game-toolbar button:active,.game-sheet button:active{transform:translateY(1px)}.game-toolbar button:focus-visible{outline:3px solid var(--tool-ink);outline-offset:3px}
@media(hover:hover){.game-toolbar button:hover{box-shadow:inset 0 0 0 1px currentColor}.game-sheet button:hover,.game-sheet-game:hover{border-color:#173f35;background:#e9eddf}.game-sheet button[aria-pressed=true]:hover{background:#295b4d;color:#fffef4}}
.game-week-best{height:44px;margin:0;padding:10px 12px;font-size:13px;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;font-variant-numeric:tabular-nums;border-bottom:1px solid #173f3526}
.game-notes{margin:24px 0;font-size:16px}.game-notes summary{min-height:44px;cursor:pointer;padding:10px 0}.game-notes p{margin:10px 0;line-height:1.6}
.sd-page .play-main,.xw-page .play-main{padding-top:8px}
.sd-page .back-link,.xw-page .back-link{margin-bottom:2px}
.sd-page .game-page-head,.xw-page .game-page-head{border:0;margin:0;padding:0}
.sd-page .game-page-head h1,.xw-page .game-page-head h1{font:clamp(23px,3vw,34px)/1.15 Georgia,serif;margin:4px 0}
.sd-page .game-page-head .eyebrow,.xw-page .game-page-head .eyebrow{font-size:12px;letter-spacing:.1em;margin:4px 0}
.sd-page .sdr-howto{font-size:16px;font-weight:400;line-height:1.45;margin:10px 0}
.sd-page .sdr-game{margin-top:8px}
.sd-page .sdr-status{position:sticky;top:8px;z-index:6;border-color:#ffffff25;border-radius:14px}
.sd-page .sdr-status{--tool-ink:#eee4cf;--tool-paper:#282319}.sd-page .sdr-status button{font-size:14px;background:#282319;color:#eee4cf;border-color:#eee4cf55;border-radius:8px}.sd-page .sdr-status button[aria-pressed=true]{background:#eee4cf;color:#282319}.sd-page .game-week-best{color:#eee4cf;border-color:#eee4cf30}
.sd-page .sdr-status #sd-magnifier[aria-pressed=false]{background:transparent;color:#eee4cf}
.mm-page .game-toolbar{padding:4px 8px;margin:2px 0 0;gap:6px}.mm-page .game-toolbar button{padding:8px 12px}
.game-sheet{position:fixed;inset:auto 0 0;width:100%;height:auto;max-width:none;max-height:82dvh;margin:0;border:0;border-radius:20px 20px 0 0;padding:20px 20px max(24px,env(safe-area-inset-bottom));background:#fffef4;color:#173f35;box-shadow:0 -12px 50px #0004;overflow:auto;overscroll-behavior:contain;font:16px/1.45 Arial,sans-serif}
.game-sheet[open]{animation:sheet-in .22s ease-out}.game-sheet::backdrop{background:#0008}
.game-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;padding-bottom:12px;border-bottom:1px solid #173f3526}.game-sheet h2{font:28px/1.15 Georgia,serif;margin:0}.game-sheet .game-sheet-heading button{padding:0;width:44px;border-radius:8px}.game-sheet-heading svg{width:20px;height:20px}
.game-sheet button,.game-sheet-actions a{min-width:44px;min-height:44px;padding:10px 14px;border:1px solid #173f3540;border-radius:8px;background:transparent;color:#173f35;font:inherit;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.game-sheet :focus-visible{outline:3px solid #173f35;outline-offset:2px}
.game-sheet-subtitle{font-size:14px;margin:0 0 16px;opacity:.8}.game-sheet-segments{display:flex;gap:4px;margin:0 0 16px;padding:4px;border-radius:12px;background:#e9eddf}.game-sheet-segments button{flex:1;padding:8px;border-color:transparent}.game-sheet-segments [aria-pressed=true],.game-sheet-actions button{background:#173f35;color:#fffef4}
.game-sheet-results{min-height:100px}.game-sheet-list{list-style:none;margin:0;padding:0}.game-sheet-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:64px;border-bottom:1px solid #173f351c;font-size:15px}
.game-sheet-medal{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#ecebdd;font-weight:700}.game-sheet-row:nth-child(1) .game-sheet-medal{background:#e8b923}.game-sheet-row:nth-child(2) .game-sheet-medal{background:#c9ccd1}.game-sheet-row:nth-child(3) .game-sheet-medal{background:#d59a6a}
.game-sheet-name{font-weight:700;overflow-wrap:anywhere}.game-sheet-score{text-align:right;font-variant-numeric:tabular-nums}.game-sheet-score small{display:block;font-size:12px;color:#526c60}.game-sheet-chase{font-size:13px;margin:12px 0}
.game-sheet-personal{padding:12px;border-radius:12px;background:#e9eddf;margin-top:16px;font-size:14px}.game-sheet-personal p{margin:6px 0 0}.game-sheet-actions{display:flex;gap:8px;margin-top:18px;flex-wrap:wrap}
.game-sheet-games{display:grid;gap:12px;margin:20px 0}.game-sheet-game{display:grid;grid-template-columns:80px minmax(0,1fr);gap:12px;align-items:center;padding:10px;border:1px solid #173f3528;border-radius:12px;text-decoration:none;color:inherit}.game-sheet-game img{width:80px;height:64px;object-fit:cover;border-radius:8px}.game-sheet-game strong{display:block;font-size:16px;line-height:1.25}.game-sheet-game small{display:block;margin-top:6px;color:#775400;font-size:13px;line-height:1.4}.game-sheet-game:focus-visible{outline-offset:3px}
@keyframes sheet-in{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
@media(min-width:760px){.game-sheet{inset:0 0 0 auto;width:420px;max-height:100dvh;height:100dvh;border-radius:0;padding:28px}.game-sheet[open]{animation-name:sheet-side}@keyframes sheet-side{from{transform:translateX(40px);opacity:0}to{transform:none;opacity:1}}}
@media(max-width:700px){.game-toolbar{padding:6px;gap:4px}.game-toolbar .tool-label{display:none}.game-toolbar button,.mm-page .game-toolbar button{width:44px;padding:8px}.game-toolbar>[role=status]{font-size:12px;padding:0 4px}.game-toolbar [data-game-sheet=leaderboard]{margin-left:3px}.sd-page .play-main,.xw-page .play-main{padding-left:16px;padding-right:16px}.game-sheet{padding-left:16px;padding-right:16px}}
@media(prefers-reduced-motion:reduce){.game-sheet[open]{animation:none}}
.sd-page .play-main{max-width:1640px;padding-left:24px;padding-right:24px}
.sd-page .sdr-game{--sdr-width:100%;width:100%;margin-left:0}
.mm-page .mm-levels button{min-height:44px;min-width:44px}
@media(max-width:700px){.sd-page .play-main{padding-left:16px;padding-right:16px}}
.xw-page .game-toolbar{gap:8px;margin-bottom:0;padding:8px;border-radius:12px}
.xw-page .game-toolbar button{font-size:14px;border-radius:8px}
@media(max-width:700px){.xw-page .game-toolbar{gap:4px;padding:6px}}
@media(max-width:700px){.sd-page .sdr-game{width:calc(100% + 16px);margin-left:-8px}}
@media(max-width:700px){.xw-page .play-main{padding-left:8px;padding-right:8px}}

.game-toolbar ::selection,.game-sheet ::selection{background:#173f35;color:#fffef4}.game-sheet{scrollbar-color:#84988c #fffef4}
@media(prefers-reduced-motion:reduce){.game-toolbar button,.game-sheet button{transition:none;transform:none}}

.sd-page .win-banner{background:#eee4cf;color:#173f35}

/* No accidental blue selection (Vivek 30 Sep 18:4x): the game toolbar and the
   leaderboard/games sheet stop a text selection on press or drag; their own
   buttons already inherit this from the shared button rule. Leaderboard names
   and the nickname input are untouched. */
.game-toolbar,.game-sheet-heading,.game-sheet-segments,.game-sheet-medal{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}

/* Memory Match, 3D table live: the table header shows the pair count, so the bar's copy goes transparent (space kept: no shift; it stays the screen-reader live region) */
.p3-live #mm-status{color:transparent;user-select:none;-webkit-user-select:none}

/* Pop-colour header band only; keep all game geometry and controls unchanged. */
body .play-main>.game-page-head{--yellow:#f5db48;background:var(--yellow);color:var(--ink);box-shadow:0 0 0 100vmax var(--yellow);clip-path:inset(0 -100vmax)}
body .play-main>.game-page-head h1,body .play-main>.game-page-head p,body .play-main>.game-page-head summary{color:var(--ink);opacity:1}
/* Spot the Difference runs a dark page theme where --ink is light: the band keeps the base ink (#173f35 on #f5db48 = 8.4:1). */
body.sd-page .play-main>.game-page-head,body.sd-page .play-main>.game-page-head h1,body.sd-page .play-main>.game-page-head p,body.sd-page .play-main>.game-page-head .eyebrow{color:#173f35}
