/* ---------- Fonts (brand files, Latin subset) ---------- */
@font-face { font-family: 'Nunito Sans'; src: url('../assets/fonts/nunito-sans.woff') format('woff'); font-weight: 200 1000; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces.woff') format('woff'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-italic.woff') format('woff'); font-weight: 100 900; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --title: 'Fraunces', Georgia, serif;
  --display: 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Nunito Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gold: #e09b1f;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[data-theme='dark'] {
  --bg: #161412; --bg2: #0f0d0b;
  --ink: #f6ecdb; --ink-2: rgba(246, 236, 219, .66); --ink-3: rgba(246, 236, 219, .38);
  --line: rgba(246, 236, 219, .14); --chip: rgba(246, 236, 219, .07); --chip-hi: rgba(246, 236, 219, .14);
  --accent: #e9ae45; --solid-ink: #1a1206;
  --card-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), 0 4px 10px -4px rgba(0, 0, 0, .5);
  --backdrop: rgba(10, 8, 7, .62);
  --glow: rgba(255, 186, 100, .42);
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #e8e2d7; --bg2: #ddd6c9;
  --ink: #23201c; --ink-2: rgba(35, 32, 28, .62); --ink-3: rgba(35, 32, 28, .38);
  --line: rgba(35, 32, 28, .12); --chip: rgba(35, 32, 28, .04); --chip-hi: rgba(35, 32, 28, .08);
  --accent: #a3141f; --solid-ink: #fbf8f3;
  --card-shadow: 0 18px 36px -18px rgba(80, 40, 10, .45), 0 4px 10px -4px rgba(80, 40, 10, .2);
  --backdrop: rgba(232, 226, 215, .74);
  --glow: rgba(255, 176, 90, .5);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg2); color: var(--ink); font-family: var(--body);
  overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Layers: backdrop canvas, 3D canvas, DOM views, snow canvas, top bar */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
body.info-open #fx { z-index: 81; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; }
body.gl-passive #gl { pointer-events: none; }
body.overlay3d #gl { z-index: 31; pointer-events: none; }
body.inspecting #gl { z-index: 31; pointer-events: auto; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; z-index: 60; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-t)) clamp(16px, 3vw, 32px) 14px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand { margin: -6px 0 0 -6px; border-radius: 50%; }
.brand .logo { width: clamp(64px, 7vw, 92px); height: clamp(64px, 7vw, 92px); color: var(--ink); transition: color .35s ease; }
.brand:hover .logo { color: var(--accent); }
.topbar { align-items: flex-start; }
.tools { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .3s, transform .3s var(--ease);
}
@media (hover: hover) { .icon-btn:hover { background: var(--chip-hi); } } /* (a tap on a phone doesn't leave it lit) */
.icon-btn:active { transform: scale(.92); }
/* the icon's colour is set on the stroke itself (not inherited through currentColor): phone browsers only repaint an
   inherited currentColor at the end of a theme change, so the icons lagged behind everything else */
.icon-btn { --icon: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--icon); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#btn-sound .spk { fill: var(--icon); stroke: none; }
#btn-sound .mute { display: none; }
#btn-sound.off .wave { display: none; }
#btn-sound.off .mute { display: block; }
#btn-snow svg { stroke-width: 1.45; }
#btn-snow .slash { display: none; }
#btn-snow.off .slash { display: block; }
#btn-snow.off { --icon: var(--ink-3); }
#btn-full .shrink { display: none; } #btn-full.on .grow { display: none; } #btn-full.on .shrink { display: block; } /* expand / shrink */
/* sun and moon cross-fade over the same 0.8 s as the rest of the theme change */
#btn-theme .sun { opacity: 0; } #btn-theme .sun, #btn-theme .moon, html.theme-fade #btn-theme .sun, html.theme-fade #btn-theme .moon { transition: opacity .8s cubic-bezier(.4, 0, .25, 1), stroke .8s cubic-bezier(.4, 0, .25, 1) !important; }
/* snow amount: a slim slider that drops in under the snow button on hover (press and hold on touch) */
.ctl { position: relative; }
.amt { position: absolute; top: calc(100% + 8px); left: 50%; display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: 999px; background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink-2); opacity: 0; transform: translate(-50%, -5px); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); touch-action: none; }
.amt::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* keeps the hover bridge to the button */
.ctl.open .amt { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ctl.instant .amt { transition: none; }
.amt svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.amt .lo { width: 9px; height: 9px; } .amt .hi { width: 14px; height: 14px; }
#vol-amt .lo { width: 13px; height: 13px; } #vol-amt .hi { width: 16px; height: 16px; }
.amt .track { position: relative; width: 96px; height: 3px; border-radius: 2px; background: var(--line); cursor: pointer; }
.amt .track::after { content: ''; position: absolute; inset: -10px 0; } /* a taller target than it looks */
.amt .fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, .47) * 100%); border-radius: 2px; background: var(--ink-2); }
.amt .knob { position: absolute; top: 50%; left: calc(var(--v, .47) * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.amt.drag .knob, .amt .track:hover .knob { transform: scale(1.15); }
/* Sub-navigation: the modes of the product you're in */
.subnav { position: absolute; left: 50%; top: calc(18px + var(--safe-t)); transform: translate(-50%, -6px); display: flex; align-items: center; gap: 6px; opacity: 0; pointer-events: none !important; transition: opacity .5s var(--ease), transform .5s var(--ease); max-width: calc(100vw - 260px); }
.subnav.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto !important; }
.sub-back { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .25s; }
@media (hover: hover) { .sub-back:hover { background: var(--chip-hi); } }
.sub-back svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sub-pills { display: flex; gap: 2px; padding: 4px; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow-x: auto; scrollbar-width: none; }
.sub-pills::-webkit-scrollbar { display: none; }
.sub-pills a { padding: 8px 15px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: color .25s, background .35s var(--ease); }
.sub-pills a:hover { color: var(--ink); }
.sub-pills a[aria-current='page'] { background: var(--ink); color: var(--bg2); }
@media (max-width: 720px) { .subnav { top: calc(84px + var(--safe-t)); max-width: calc(100vw - 24px); } }
[data-theme='dark'] #btn-theme .moon { opacity: 0; }
[data-theme='dark'] #btn-theme .sun { opacity: 1; }

/* ---------- Views ---------- */
.view { position: fixed; inset: 0; z-index: 10; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .55s var(--ease), visibility 0s .55s; }
.view.on { opacity: 1; visibility: visible; transition: opacity .55s var(--ease), visibility 0s; }
.view.on > * { pointer-events: auto; }

/* Home */
#view-home { pointer-events: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.labels { position: absolute; inset: 0; pointer-events: none !important; }
.label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, 0); white-space: nowrap; text-align: center; padding: 6px 10px; border-radius: 12px;
  font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .01em; pointer-events: auto; cursor: pointer;
  transition: opacity .4s var(--ease), color .3s;
}
.label small { display: block; font-family: var(--body); font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; transition: color .3s; }
.label.hot small { color: var(--accent); }

/* Gallery */
.gallery-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: calc(112px + var(--safe-t)) clamp(16px, 4vw, 56px) calc(90px + var(--safe-b)); }
@media (max-width: 720px) { .gallery-scroll { padding-top: calc(146px + var(--safe-t)); } }
.gallery-head { max-width: 1180px; margin: 0 auto 26px; text-align: center; }
/* a quiet centred label above the grid, not a headline */
#gallery-title { font-family: var(--body); font-weight: 600; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); margin: 8px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); padding: 6px 10px 6px 4px; margin-left: -4px; border-radius: 99px; transition: color .2s, background .2s; }
.back:hover { color: var(--ink); background: var(--chip); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h2 { font-family: var(--display); font-weight: 300; font-size: clamp(32px, 4.6vw, 54px); margin: 10px 0 6px; letter-spacing: -.02em; }
.sub { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.segs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.pill { white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 99px;
  font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--chip); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .3s var(--ease), background .3s, opacity .3s;
}
.pill:hover { background: var(--chip-hi); }
.pill:active { transform: scale(.95); }
.pill.solid { background: var(--accent); color: var(--solid-ink); border-color: transparent; }
.pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill[aria-disabled='true'] { opacity: .45; pointer-events: none; }

.grid { max-width: 1180px; margin: 0 auto; display: grid; gap: clamp(12px, 2vw, 24px); grid-template-columns: repeat(auto-fill, minmax(var(--cell, 132px), 1fr)); }
@media (min-width: 720px) { .grid { --cell: 150px; } }
.grid.memory { grid-template-columns: repeat(6, 1fr); max-width: 1180px; } /* as wide as the playing cards, so the tiles are bigger */
@media (max-width: 720px) { .grid.memory { grid-template-columns: repeat(4, 1fr); } }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: var(--ar); border-radius: var(--rad); perspective: 900px; z-index: 0; }
.thumb:hover { z-index: 3; }
.thumb.pending { opacity: 0; }
.grid.fresh .thumb { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 14ms); }
.thumb .face {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden; box-shadow: var(--card-shadow);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }

.thumb.away { visibility: hidden; }
.thumb.hov .face { visibility: hidden; } /* the real 3D card is standing in for it (hover) */

/* Inspect */
.backdrop { position: fixed; inset: 0; z-index: 30; background: var(--backdrop); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); opacity: 0; pointer-events: none; transition: opacity .55s var(--ease); }
body.inspecting .backdrop { opacity: 1; }
.inspect-ui { position: fixed; inset: 0; z-index: 35; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); }
body.inspecting .inspect-ui { opacity: 1; }
body.inspecting .inspect-ui > * { pointer-events: auto; }
.inspect-ui .close { position: absolute; top: calc(14px + var(--safe-t)); right: clamp(16px, 3vw, 32px); }
.inspect-ui .nav { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); border: 1px solid var(--line); transition: background .25s, transform .3s var(--ease); }
.inspect-ui .nav:hover { background: var(--chip-hi); }
.inspect-ui .nav:active { transform: scale(.9); }
.inspect-ui .nav svg, .inspect-ui .close svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.inspect-ui .prev { left: clamp(10px, 3vw, 40px); }
.inspect-ui .next { right: clamp(10px, 3vw, 40px); }
body.insp-single .inspect-ui .nav { display: none; }
.caption { position: absolute; left: 0; right: 0; bottom: calc(26px + var(--safe-b)); text-align: center; pointer-events: none !important; }
.caption span { display: block; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.caption small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
@media (max-width: 640px) { .inspect-ui .nav { top: auto; bottom: calc(18px + var(--safe-b)); margin: 0; width: 46px; height: 46px; } }

/* hints at the top of the book and puzzle */
.view-hint { position: absolute; left: 0; right: 0; top: calc(78px + var(--safe-t)); text-align: center; margin: 0; font-size: 13px; color: var(--ink-3); pointer-events: none !important; transition: opacity .6s; }
.learned { opacity: 0 !important; transition: opacity .8s var(--ease) !important; } /* a hint the visitor no longer needs */
.pill.armed { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); } /* "Sure? Tap again" */
.thumb:focus-visible { outline-offset: 4px; border-radius: var(--rad, 10px); }


/* Curtain + loader */
.curtain { position: fixed; inset: 0; z-index: 60; background: var(--bg2); opacity: 0; pointer-events: none; transition: opacity .38s var(--ease-io); }
.curtain.on { opacity: 1; }
.loader { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--bg2); transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1); }
.loader .logo { display: none; } /* the logo is already in its place under the cover */
.loader.done { opacity: 0; pointer-events: none; }
.loader.gone { visibility: hidden; }

@keyframes breathe { from { opacity: .35; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Memory match HUD */
#view-match { pointer-events: none; }
.mm-hud { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 8px; border-radius: 22px; background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); pointer-events: auto; white-space: nowrap; }
.lvl { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--chip); }
.lvl button { padding: 7px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .3s var(--ease), color .2s; }
.lvl button[aria-pressed='true'] { background: var(--ink); color: var(--bg2); }
.stats { display: flex; gap: 16px; margin: 0; }
.stats div { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.stats dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .mm-hud { flex-wrap: wrap; justify-content: center; width: calc(100vw - 24px); gap: 8px 12px; padding: 10px; }
  .stats { gap: 12px; } .stats .best { display: none; }
}
.mm-win { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%) scale(.96); padding: 26px 30px; border-radius: 24px; text-align: center; background: var(--chip-hi); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 0; pointer-events: none !important; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.mm-win.on { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto !important; }
.mm-win p { margin: 0 0 16px; font-size: 17px; font-weight: 700; }

/* Storybook */
#view-book { pointer-events: none; }
.bk-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); pointer-events: auto; }
.bk-bar span { min-width: 150px; text-align: center; font-size: 14px; font-weight: 700; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background .25s, opacity .25s; }
@media (hover: hover) { .nav-btn:hover { background: var(--chip-hi); } }
#bk-zoom.on { background: var(--chip-hi); }
#bk-zoom.on .v { display: none; } /* plus becomes minus */
.nav-btn:disabled { opacity: .3; pointer-events: none; }
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Puzzle */
#view-puzzle { pointer-events: none; }
.pz-bar { gap: 6px; padding: 6px 6px 6px 16px; }
.pz-bar .pill { height: 38px; padding: 0 14px; }
.pz-count { min-width: 70px; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: left !important; }
.pill[aria-pressed='true'] { background: var(--ink); color: var(--bg2); }
#pz-done { top: 22%; }
@media (max-width: 480px) { .pz-bar { gap: 4px; padding: 5px 5px 5px 12px; } .pz-bar .pill { height: 36px; padding: 0 10px; font-size: 13px; } .pz-count { min-width: 52px; font-size: 13px; } }

/* Card games */
#view-solitaire, #view-gofish, #view-crazy8 { pointer-events: none; }
.game-bar { gap: 10px; padding: 6px 6px 6px 14px; white-space: nowrap; }
.game-bar .pill { height: 38px; padding: 0 14px; }
.game-bar .pill[hidden] { display: none; }
/* Go Fish, Crazy Eights: what each side says, one line at a time, just under the bar at the top */
.duel-say { position: absolute; left: 50%; top: calc(80px + var(--safe-t)); transform: translateX(-50%); max-width: calc(100vw - 32px); margin: 0; padding: 9px 18px; border-radius: 22px;
  font-size: 15px; font-weight: 700; text-align: center; color: var(--ink); background: var(--chip-hi); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none !important; transition: opacity .35s var(--ease); }
.duel-say.on { opacity: 1; }
.duel-say.pop { animation: say-pop .38s var(--ease); }
.duel-say[data-who='them']::before { content: 'Computer · '; color: var(--ink-3); font-weight: 600; }
.duel-say[data-who='you']::before { content: 'You · '; color: var(--ink-3); font-weight: 600; }
@media (max-width: 720px) { .duel-say { top: calc(140px + var(--safe-t)); width: max-content; border-radius: 20px; font-size: 14px; padding: 8px 14px; } }
@keyframes say-pop { from { transform: translateX(-50%) translateY(-4px) scale(.97); } to { transform: translateX(-50%); } }
/* Crazy Eights: the suit an 8 asked for, beside the pile; and the suit picker */
.c8-badge { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; line-height: 1; color: var(--ink);
  background: var(--chip-hi); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transform: scale(.6); pointer-events: none !important; transition: opacity .3s var(--ease), transform .45s cubic-bezier(.2, 1.4, .3, 1); }
.c8-badge.on { opacity: 1; transform: none; }
.c8-badge[data-red='1'], .c8-suits [data-red='1'] { color: #c22a33; }
.c8-suits { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -42%) scale(.96); padding: 18px 20px 20px; border-radius: 24px; text-align: center; background: var(--chip-hi); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 0; pointer-events: none !important; transition: opacity .35s var(--ease), transform .45s var(--ease); }
.c8-suits.on { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto !important; }
.c8-suits p { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.c8-suits div { display: flex; gap: 10px; }
.c8-suits button { width: 60px; height: 60px; border-radius: 18px; font-size: 34px; line-height: 1; color: var(--ink); background: var(--chip); border: 1px solid var(--line); transition: transform .2s var(--ease), background-color .2s; }
.c8-suits button:hover { background: var(--chip-hi); transform: translateY(-2px); }
.c8-suits button:active { transform: scale(.94); }
@media (max-width: 720px) { .game-bar { flex-wrap: wrap; justify-content: center; width: calc(100vw - 24px); border-radius: 22px; padding: 8px; } .sub-pills a { padding: 7px 10px; font-size: 13px; } #view-puzzle .view-hint, #view-book .view-hint { display: none; } }

.gallery-scroll::-webkit-scrollbar { display: none; }

/* theme switch: every colour eases together, like a light being dimmed or raised */
html.theme-fade, html.theme-fade *:not(#dim-shot), html.theme-fade *::before, html.theme-fade *::after {
  transition-property: background-color, color, border-color, fill, stroke, box-shadow, opacity, transform !important;
  transition-duration: .8s, .8s, .8s, .8s, .8s, .8s, .35s, .35s !important;
  transition-timing-function: cubic-bezier(.4, 0, .25, 1) !important;
}

/* About panel: a frosted glass card over a blurred page */
.info { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(8, 7, 6, .28); backdrop-filter: blur(0) saturate(1); -webkit-backdrop-filter: blur(0) saturate(1); opacity: 0; transition: opacity .5s var(--ease), backdrop-filter .5s var(--ease), -webkit-backdrop-filter .5s var(--ease); }
[data-theme='light'] .info { background: rgba(232, 226, 215, .3); }
/* opening is unhurried: the room behind softens into blur over the same time the card rises in */
.info.on { opacity: 1; backdrop-filter: blur(16px) saturate(1.05); -webkit-backdrop-filter: blur(16px) saturate(1.05); transition: opacity .8s var(--ease), backdrop-filter .9s var(--ease), -webkit-backdrop-filter .9s var(--ease); }
.info[hidden] { display: none; }
.info-card { position: relative; width: fit-content; max-width: 100%; padding: 68px 48px 72px; border-radius: 26px; color: var(--ink);
  background: color-mix(in srgb, var(--bg) 62%, transparent); border: 1px solid var(--line); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .6), inset 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); transform: translateY(14px) scale(.94); transition: transform .5s var(--ease); }
.info.on .info-card { transform: none; transition: transform .95s cubic-bezier(.2, 1.15, .3, 1); }
.info-cols { display: grid; grid-template-columns: minmax(190px, auto) 18px minmax(190px, auto); gap: 30px; align-items: stretch; }
.info-div { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-3); }
.info-div i { flex: 1; width: 1px; background: linear-gradient(var(--line-fade, transparent), var(--line)); }
.info-div i:last-child { background: linear-gradient(var(--line), transparent); }
.info-div svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) { .info-cols { grid-template-columns: 1fr; gap: 22px; } .info-div { flex-direction: row; } .info-div i { height: 1px; width: auto; background: linear-gradient(90deg, transparent, var(--line)); } .info-div i:last-child { background: linear-gradient(90deg, var(--line), transparent); } }
.info-group { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
.info-logo-link { display: block; margin: 20px 0 14px; color: var(--ink); transition: color .3s, transform .4s var(--ease); }
.info-logo-link:hover { color: var(--accent); transform: translateY(-2px) scale(1.03); }
.info-logo { display: block; height: 128px; width: auto; fill: currentColor; }
.info-label { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.info-group a:not(.info-logo-link) { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px 8px 13px; border-radius: 999px; font-size: 14.5px; color: var(--ink); text-decoration: none;
  background: var(--chip); border: 1px solid var(--line); transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease), box-shadow .3s; }
.info-group a:not(.info-logo-link):hover { background: var(--chip-hi); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-1px); box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.info-group a:not(.info-logo-link):active { transform: translateY(0) scale(.97); }
.info-group a:not(.info-logo-link) svg { width: 18.4px; height: 18.4px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: translateY(1px); }

/* ---------- Phones and tablets ---------- */
/* holding anything (the snow or sound button opens its slider) never selects the page or pops up the browser's menu */
html { -webkit-tap-highlight-color: transparent; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* no full screen on touch screens: phones manage it themselves, and it gets in the way */
@media (hover: none), (pointer: coarse) { #btn-full { display: none !important; } }
/* held sideways (short and wide) */
@media (orientation: landscape) and (max-height: 540px) {
  .view-hint { display: none; } /* no room above the controls: the first-time hints step aside */
  .info { padding: 8px; }
  .info-card { padding: 18px 30px 20px; max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
  .info-cols { gap: 20px; }
  .info-logo { height: 66px; }
  .info-logo-link { margin: 10px 0 6px; }
  .info-group a:not(.info-logo-link) { margin-top: 5px; padding: 6px 14px 6px 11px; font-size: 13.5px; }
}
