/* Brimbob subpages: how-to-play, faq, archive. Colours, type and motion tokens come from tokens.css,
   buttons (.btn, .btn-primary, .btn-secondary, .btn-ghost) and the beaker/Bob art from app.css.
   CSP: no inline styles anywhere. Motion is transform/opacity only and always honours reduced motion
   (the system setting and the game's own "Reduce motion" setting, :root[data-motion="reduce"]). */

/* ---------------- cross-document view transitions ---------------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.pg-head { view-transition-name: site-head; }
.pg-nav-ind { view-transition-name: nav-ind; }
.pg-foot-mark { view-transition-name: foot-mark; }
::view-transition-group(nav-ind) { animation-duration: .42s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: pg-vt-out .16s ease-in both; }
::view-transition-new(root) { animation: pg-vt-in .36s var(--ease-out) .05s both; }
@keyframes pg-vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes pg-vt-in { from { opacity: 0; transform: translateY(18px); } }
:root[data-motion="reduce"]::view-transition-group(*),
:root[data-motion="reduce"]::view-transition-old(*),
:root[data-motion="reduce"]::view-transition-new(*) { animation: none !important; }

/* ---------------- fonts: no swap, so no layout shift ---------------- */
/* The same self-hosted Fredoka and Inter files as tokens.css, under page-only family names with
   font-display: optional. They are preloaded, so they are normally there for the first paint (and always from
   the cache once the game or another page has loaded them). On a slow cold load a font that misses the first
   paint is skipped for that page view instead of swapping in later and re-wrapping the text (CLS stays 0).
   The stand-in is the local Arial, scaled to Inter's and Fredoka's widths and line metrics (measured in Chrome). */
@font-face { font-family: 'Fredoka Page'; font-style: normal; font-weight: 600 700; font-display: optional; src: url(../assets/fonts/fredoka-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka Page'; font-style: normal; font-weight: 600 700; font-display: optional; src: url(../assets/fonts/fredoka-latin-ext.woff2) format('woff2'); unicode-range: U+0100-014F, U+0152-016F, U+0172-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter Page'; font-style: normal; font-weight: 400 800; font-display: optional; src: url(../assets/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Page'; font-style: normal; font-weight: 400 800; font-display: optional; src: url(../assets/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter Fallback'; font-weight: 400 500; src: local('Arial'), local('ArialMT'); size-adjust: 106.75%; ascent-override: 90.77%; descent-override: 22.58%; line-gap-override: 0%; }
@font-face { font-family: 'Inter Fallback'; font-weight: 600 800; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 101.42%; ascent-override: 95.55%; descent-override: 23.76%; line-gap-override: 0%; }
@font-face { font-family: 'Fredoka Fallback'; font-weight: 600 700; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 93.07%; ascent-override: 104.65%; descent-override: 25.36%; line-gap-override: 0%; }
.pg-body {
  --font-display: 'Fredoka Page', 'Nunito', 'Fredoka Fallback', 'Montserrat', system-ui, sans-serif;
  --font-ui: 'Inter Page', 'Nunito', 'Inter Fallback', 'Montserrat', system-ui, sans-serif;
}

/* ---------------- page base ---------------- */
.pg-body { background: var(--bg); color: var(--ink); }
.pg { display: block; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.pg:focus { outline: none; }
.pg-wrap { max-width: 1080px; margin: 0 auto; }
.pg-narrow { max-width: 780px; }
.pg a:not(.btn):not(.pg-arch-card):not(.pg-pill-link) { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.pg a:not(.btn):not(.pg-arch-card):not(.pg-pill-link):hover { text-decoration-thickness: 2.5px; }
.muted { color: var(--muted); }

.pg-kicker { font: 700 13px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pg-h1 { margin: 10px 0 14px; font: 700 clamp(38px, 9.4vw, 62px)/1.02 var(--font-display); letter-spacing: -.015em; text-wrap: balance; }
.pg-h2 { margin-bottom: 14px; font: 700 clamp(28px, 6.2vw, 40px)/1.08 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.pg-h3 { font: 700 20px/1.2 var(--font-display); }
.pg-lead { max-width: 36em; font-size: clamp(17px, 2.3vw, 20px); line-height: 1.55; }
.pg-text { max-width: 42em; font-size: 17px; line-height: 1.62; }
.pg-text + .pg-text, .pg-text p + p { margin-top: 12px; }
.pg-sec { padding-top: clamp(48px, 9vw, 88px); scroll-margin-top: 12px; }
.pg-note { margin-top: 12px; font-size: 15px; color: var(--muted); }
.pg-sub-h { margin: 36px 0 8px; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
kbd {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 8px;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line);
  font: 700 14px/1 var(--font-ui); color: var(--ink);
}

/* ---------------- header ---------------- */
.pg-head { position: relative; z-index: 5; padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.pg-head-in { position: relative; max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; }
.pg-wordmark, .pg-foot-mark { display: inline-flex; align-items: center; gap: 6px; min-height: 64px; padding-right: 8px; color: var(--ink); text-decoration: none; border-radius: 14px; }
.pg-wordmark .logo-bob, .pg-foot-mark .logo-bob { width: 44px; height: auto; }
.pg-wordmark .logo-word, .pg-foot-mark .logo-word { font: 700 25px/1 var(--font-display); letter-spacing: -.01em; }
/* Bob holds still in the chrome and only hops on hover/focus (no endless loop in the header). */
.pg-head .bob *, .pg-foot .bob *, .pg-arch-foot .bob * { animation: none !important; }
.pg-wordmark:hover .bob .bob-tilt, .pg-wordmark:focus-visible .bob .bob-tilt, .pg-foot-mark:hover .bob .bob-tilt { animation: pg-hop .6s var(--ease-pop) 1 !important; }
@keyframes pg-hop { 0% { transform: none; } 40% { transform: translateY(-7px) rotate(-8deg); } 70% { transform: translateY(1px) rotate(3deg); } 100% { transform: none; } }

.pg-nav { width: 100%; padding-bottom: 6px; }
.pg-nav-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1.5px solid var(--line);
}
/* On phones "Play today" sits on the wordmark row; the three page links form a tab row below it. */
.pg-nav-play { position: absolute; top: 8px; right: 0; }
.pg-nav-cta { white-space: nowrap; }
.pg-nav-link {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 8px; border-radius: var(--r-pill); color: var(--ink); text-align: center;
  font: 600 15px/1.15 var(--font-ui); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.pg-nav-link[aria-current="page"] { font-weight: 800; }
.pg-nav-ind {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: var(--shadow-1);
  background: var(--brand-wash, color-mix(in srgb, var(--brand) 26%, var(--surface))); border: 1.5px solid color-mix(in srgb, var(--brand-deep) 55%, var(--line));
}
.pg-nav-t { position: relative; }
.pg-nav-link:not([aria-current])::after {
  content: ""; position: absolute; left: 50%; bottom: 9px; width: 28px; height: 2.5px; margin-left: -14px; border-radius: 2px;
  background: var(--brand-deep); transform: scaleX(0); transition: transform .25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .pg-nav-link:not([aria-current]):hover::after { transform: scaleX(1); } }
.pg-nav-link:focus-visible { outline-offset: 0; border-radius: var(--r-pill); }

@media (min-width: 780px) {
  .pg-head-in { flex-wrap: nowrap; min-height: 76px; }
  .pg-nav { width: auto; padding: 0; }
  .pg-nav-list { display: flex; align-items: center; gap: 2px; padding: 0; background: none; border: 0; }
  .pg-nav-play { position: static; margin-right: 8px; }
  .pg-nav-link { padding: 0 16px; }
}
@media (max-width: 359px) {
  .pg-wordmark .logo-bob { width: 36px; }
  .pg-wordmark .logo-word { font-size: 22px; }
  .pg-nav-link { font-size: 14px; padding: 0 4px; }
}

/* ---------------- footer ---------------- */
.pg-foot {
  margin-top: clamp(64px, 10vw, 112px); padding: 24px max(var(--gutter), env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--surface-2); border-top: 1.5px solid var(--line);
}
.pg-foot-in { max-width: 1080px; margin: 0 auto; display: grid; gap: 6px; }
.pg-foot-nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -12px; }
.pg-foot-nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 0 12px; border-radius: 12px;
  color: var(--ink); font: 600 15px var(--font-ui); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: text-decoration-color .2s;
}
@media (hover: hover) and (pointer: fine) { .pg-foot-nav a:hover { text-decoration-color: currentColor; } }
/* The current page is marked by its underline only: the same weight keeps every item the same width, so the
   row never wraps one item onto a line of its own on one page and not on the others. */
.pg-foot-nav a[aria-current="page"] { text-decoration-color: var(--brand-deep); text-decoration-thickness: 2.5px; }
@media (max-width: 399px) { .pg-foot-nav { margin-left: -8px; } .pg-foot-nav a { padding: 0 8px; } }
.pg-foot-note { max-width: 40em; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (min-width: 780px) {
  .pg-foot-in { grid-template-columns: auto 1fr; align-items: center; column-gap: 24px; }
  .pg-foot-nav { justify-content: flex-end; margin-left: 0; }
  .pg-foot-note { grid-column: 1 / -1; }
}

/* ---------------- hero ---------------- */
.pg-hero { display: grid; gap: 8px; align-items: center; padding-top: 18px; }
.pg-hero-text { display: block; padding-top: 28px; }
.pg-hero-art { position: relative; order: -1; display: grid; place-items: center; height: 184px; }
.pg-hero-glass { position: relative; width: 133px; height: 184px; }
.pg-hero-glass .beaker { width: 100%; height: 100%; }
.pg-bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pg-bubbles i {
  position: absolute; bottom: -24px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bubble); border: 2px solid color-mix(in srgb, var(--liq-sky) 26%, transparent);
  animation: pg-rise 9s linear infinite; animation-play-state: paused;
}
.pg-bubbles i:nth-child(1) { left: 8%; width: 18px; height: 18px; animation-delay: -1s; }
.pg-bubbles i:nth-child(2) { left: 24%; width: 10px; height: 10px; animation-delay: -5s; }
.pg-bubbles i:nth-child(3) { left: 72%; animation-delay: -3s; }
.pg-bubbles i:nth-child(4) { left: 88%; width: 22px; height: 22px; animation-delay: -7s; }
.pg-bubbles i:nth-child(5) { left: 60%; width: 9px; height: 9px; animation-delay: -8.5s; }
.pg-hero-art.is-live .pg-bubbles i { animation-play-state: running; }
@keyframes pg-rise { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translateY(-360px); opacity: 0; } }

.pg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.pg-facts li { padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1); }
.pg-facts b { display: block; font: 700 30px/1.05 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pg-facts span { display: block; margin-top: 2px; font: 600 14px/1.3 var(--font-ui); color: var(--muted); }
@media (min-width: 600px) { .pg-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .pg-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; padding-top: 36px; }
  .pg-hero-text { padding-top: 56px; }
  .pg-hero-art { order: 0; height: 400px; }
  .pg-hero-glass { width: 290px; height: 400px; }
}

/* ---------------- basics: numbered steps ---------------- */
.pg-steps { display: grid; gap: 12px; counter-reset: step; }
.pg-steps li {
  position: relative; padding: 18px 18px 18px 74px; border-radius: 20px;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
}
.pg-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 3px 0 var(--brand-deep); font: 700 20px/1 var(--font-display);
}
.pg-steps p { margin-top: 6px; line-height: 1.55; }
@media (min-width: 760px) { .pg-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-steps li:last-child { grid-column: 1 / -1; } }
@media (min-width: 1020px) { .pg-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); } .pg-steps li { grid-column: span 2; } .pg-steps li:nth-child(4), .pg-steps li:nth-child(5) { grid-column: span 3; } }

/* ---------------- demos ---------------- */
.pg-demo[data-liquid="violet"] { --liq: var(--liq-violet); }
.pg-demo[data-liquid="sky"] { --liq: var(--liq-sky); }
.pg-demo[data-liquid="coral"] { --liq: var(--liq-coral); }
.pg-explorer { --liq: var(--liq-mint); }

.pg-demo-grid { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 720px) and (max-width: 1019px) { .pg-demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-demo:last-child { grid-column: 1 / -1; } }
@media (min-width: 1020px) { .pg-demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pg-demo {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 24px;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
}
.pg-demo-h { display: flex; align-items: center; gap: 8px; min-height: 48px; padding-right: 124px; font: 700 21px/1.15 var(--font-display); }
.pg-demo-h .bi { width: 24px; height: 24px; flex: none; color: var(--ok-text); }
.pg-replay { position: absolute; top: 16px; right: 16px; gap: 6px; padding: 0 16px; }
.pg-replay .ic { width: 16px; height: 16px; }
.pg-demo-stage {
  position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 18px 14px 12px; border-radius: 18px; background: var(--surface-2); overflow: hidden;
}
.pg-demo-glass { width: 128px; height: 177px; }
.pg-demo-glass .beaker { width: 100%; height: 100%; }
/* The brim is printed next to the glass, so the beaker's own small BRIM tag is not needed at this size. */
.pg-demo .bk-tag, .pg-explorer .bk-tag { display: none; }
.pg-demo-side { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pg-demo-brim { font: 600 14px var(--font-ui); color: var(--muted); }
.pg-demo-brim b { color: var(--ink); font-weight: 800; }
.pg-dcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pg-dcard {
  display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 36px; padding: 4px 5px 4px 9px;
  border-radius: 11px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 2px 0 var(--line);
  font: 700 14px/1 var(--font-display);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), border-color .2s, background-color .25s;
}
.pg-dl { color: var(--muted); }
.pg-dv {
  display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 5px; border-radius: 8px;
  background: var(--glass); font: 700 14px/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.pg-dcard.is-lift { transform: translateY(-5px) scale(1.05); border-color: var(--liq); box-shadow: 0 8px 14px -8px rgba(19, 34, 58, .45); }
.pg-dcard.is-poured { border-color: var(--liq); background: color-mix(in srgb, var(--liq) 16%, var(--surface)); box-shadow: none; }
.pg-dcard.is-poured .pg-dv, .pg-dcard.is-shown .pg-dv { background: var(--surface); border: 1.5px solid var(--line); }
.pg-dcard.is-poured .pg-dv { border-color: var(--liq); }
.pg-dcard.is-shown .pg-dv { border-style: dashed; }
.pg-dcard.is-flip .pg-dv { animation: pg-flip .34s var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes pg-flip { from { transform: rotateY(90deg); } to { transform: none; } }
.pg-demo-read { display: grid; gap: 2px; align-content: start; }
.pg-dr-fill { font: 800 26px/1.05 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
/* The status line is as tall as the longest text it will show: hidden .pg-dr-max copies share its grid cell,
   so a change from "Watch it pour…" to "Surface tension! · 100 pts" never moves the glass or the page (CLS 0
   at every width and with either font). */
.pg-dr-pts { display: grid; font: 600 14px/1.25 var(--font-ui); color: var(--muted); }
.pg-dr-pts > span { grid-area: 1 / 1; min-width: 0; }
.pg-dr-max { visibility: hidden; }
.pg-demo.is-spill .pg-dr-fill { color: var(--danger-text); }
.pg-demo-text { font-size: 15px; line-height: 1.55; }
/* The smallest phones: the cards beside the glass get one column, so a revealed "120" never widens a card. */
@media (max-width: 359px) { .pg-dcards { grid-template-columns: minmax(0, 1fr); } .pg-dr-fill { font-size: 22px; } }
.pg-demo-stage.is-shaking { animation: pg-shake .25s linear; }
@keyframes pg-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }

/* Infinite art loops (waves, Bob's float, the brim pulse) run only while their art is on screen. */
.pg-demo:not(.is-live) .beaker, .pg-demo:not(.is-live) .beaker *,
.pg-explorer:not(.is-live) .beaker, .pg-explorer:not(.is-live) .beaker *,
.pg-hero-art:not(.is-live) .beaker, .pg-hero-art:not(.is-live) .beaker * { animation-play-state: paused !important; }

/* ---------------- scoring explorer + table ---------------- */
.pg-explorer {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 18px; margin: 22px 0 18px;
  padding: 18px; border-radius: 24px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
}
.pg-ex-glass { width: 120px; height: 166px; }
.pg-ex-glass .beaker { width: 100%; height: 100%; }
.pg-ex-ctl { min-width: 0; display: grid; gap: 8px; }
.pg-ex-label { font: 700 17px var(--font-display); }
.pg-ex-out { font: 600 16px/1.3 var(--font-ui); }
.pg-ex-out b { font: 800 26px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pg-ex-pts { display: inline-block; min-width: 1.9ch; text-align: right; }
.pg-ex-pts.is-pop { animation: pg-pop .32s var(--ease-pop); }
@keyframes pg-pop { from { transform: scale(1.35); } to { transform: none; } }
.pg-ex-badge { display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 32px; padding: 4px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); font: 600 14px/1.2 var(--font-ui); }
.pg-ex-badge[data-phase="tense"], .pg-ex-badge[data-phase="brimful"] { border-color: var(--gold); }
.pg-ex-badge[data-phase="brimful"] { background: var(--gold-wash, color-mix(in srgb, var(--gold) 16%, var(--surface))); }
.pg-ex-badge[data-phase="surface"] { border-color: var(--liq-sky); background: color-mix(in srgb, var(--liq-sky) 12%, var(--surface)); }
.pg-ex-badge[data-phase="spill"] { border-color: var(--danger); color: var(--danger-text); }
.pg-ex-ic:empty { display: none; }
.pg-ex-ic .bi { display: block; width: 18px; height: 18px; }

/* Range: the track shows the safe zone, the full-score band (99–103%) and the spill zone. */
.pg-ex-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 48px; margin: 0; background: transparent; cursor: pointer;
  --t0: calc(99% / 1.1); --t1: calc(103% / 1.1);
}
.pg-ex-range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 6px; border: 1.5px solid var(--field-line);
  background: linear-gradient(to right, var(--glass) 0 var(--t0), var(--gold) var(--t0) var(--t1), var(--danger) var(--t1) 100%);
}
.pg-ex-range::-moz-range-track {
  height: 12px; border-radius: 6px; border: 1.5px solid var(--field-line);
  background: linear-gradient(to right, var(--glass) 0 var(--t0), var(--gold) var(--t0) var(--t1), var(--danger) var(--t1) 100%);
}
.pg-ex-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: -10.5px; border-radius: 50%;
  background: var(--brand); border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--brand-deep);
  transition: transform .15s var(--ease-out);
}
.pg-ex-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); border: 3px solid var(--ink); }
.pg-ex-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.pg-ex-range:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 12px; }
@media (min-width: 720px) {
  .pg-explorer { grid-template-columns: 170px minmax(0, 1fr); gap: 32px; padding: 22px 28px; max-width: 760px; }
  .pg-ex-glass { width: 170px; height: 234px; }
}

.pg-table-box { max-width: 760px; }
.pg-score-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 1.4; }
.pg-score-table caption { caption-side: top; padding: 0 0 10px; text-align: left; font: 600 15px var(--font-ui); color: var(--muted); }
.pg-score-table th, .pg-score-table td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); background: var(--surface); }
.pg-score-table thead th { background: var(--surface-2); font: 700 12px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pg-score-table tbody th { font-weight: 700; }
.pg-score-table tr > :first-child { border-left: 1.5px solid var(--line); }
.pg-score-table tr > :last-child { border-right: 1.5px solid var(--line); }
.pg-score-table thead th { border-top: 1.5px solid var(--line); }
.pg-score-table thead th:first-child { border-top-left-radius: 18px; }
.pg-score-table thead th:last-child { border-top-right-radius: 18px; }
.pg-score-table tbody tr:last-child > * { border-bottom: 1.5px solid var(--line); }
.pg-score-table tbody tr:last-child > :first-child { border-bottom-left-radius: 18px; }
.pg-score-table tbody tr:last-child > :last-child { border-bottom-right-radius: 18px; }
.pg-score-table td:last-child { font-variant-numeric: tabular-nums; }
.pg-score-table tr.is-top > * { background: var(--gold-wash, color-mix(in srgb, var(--gold) 12%, var(--surface))); }
.pg-bdg { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.pg-bdg .bi { width: 18px; height: 18px; flex: none; }
@media (max-width: 480px) { .pg-score-table { font-size: 14px; } .pg-score-table th, .pg-score-table td { padding: 10px 8px; } }

.pg-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 760px; margin-top: 14px; }
.pg-tiers li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); }
.pg-tiers b { font: 700 17px/1.2 var(--font-display); }
.pg-tiers span { font: 600 14px var(--font-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-tiers li:last-child { border-color: var(--gold); background: var(--gold-wash, color-mix(in srgb, var(--gold) 14%, var(--surface))); }
@media (min-width: 720px) { .pg-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------- clock, pourbot, share, daily ---------------- */
.pg-two-col { display: grid; gap: 20px; }
@media (min-width: 900px) { .pg-two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; } }
.pg-keys, .pg-streak-box { padding: 18px 20px; border-radius: 22px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1); }
.pg-keys dl { display: grid; gap: 10px; margin-top: 12px; }
.pg-keys dl div { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 10px; }
.pg-keys dt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.pg-keys dd { margin: 0; font-size: 15px; }
.pg-streak-box p { margin-top: 8px; line-height: 1.6; }
.pg-streak-box .pg-h3 { display: flex; align-items: center; gap: 8px; }
.pg-sb-ic .ic { width: 22px; height: 22px; color: var(--liq-sky); }

.pg-bot-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 820px; padding: 20px; border-radius: 24px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1); }
.pg-bot-ava { display: grid; justify-items: center; gap: 6px; }
.pg-bot { width: 72px; height: 72px; }
.pg-rule { margin: 0; padding-left: 14px; border-left: 4px solid var(--liq-teal); font-size: 16px; line-height: 1.6; }
.pg-bot-after { margin-top: 12px; font-size: 16px; }
@media (max-width: 480px) { .pg-bot-card { grid-template-columns: minmax(0, 1fr); } .pg-bot-ava { justify-items: start; grid-auto-flow: column; align-items: center; justify-content: start; } .pg-bot { width: 56px; height: 56px; } }

.pg-share-grid { display: grid; gap: 18px; margin: 20px 0 18px; }
@media (min-width: 860px) { .pg-share-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center; } }
.pg-share-fig { margin: 0; }
.pg-share-pre {
  margin: 0; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-2);
  font: 500 15px/1.65 ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.pg-sl { display: inline-block; }
.pg-share-fig figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.pg-legend { display: grid; gap: 8px; }
.pg-legend li { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 40px; font-size: 15px; line-height: 1.45; }
.pg-lg-k { display: grid; place-items: center; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 17px; }

/* ---------------- call to action ---------------- */
.pg-cta {
  display: grid; justify-items: center; gap: 10px; margin-top: clamp(56px, 9vw, 96px); padding: 30px 22px 32px; text-align: center;
  border-radius: 28px; background: var(--brand-wash, color-mix(in srgb, var(--brand) 20%, var(--surface))); border: 2px solid var(--brand);
}
.pg-cta .pg-h2 { margin: 0; }
.pg-cta p { max-width: 34em; font-size: 17px; line-height: 1.55; }
.pg-cta .btn { margin-top: 8px; }
.pg-cta-bob { width: 100px; height: auto; margin-bottom: -4px; }
@media (hover: hover) and (pointer: fine) { .pg-cta:hover .pg-cta-bob .bob-tilt { animation: pg-hop .6s var(--ease-pop) 1; } }
.pg-cta:not(.is-live) .bob, .pg-cta:not(.is-live) .bob * { animation-play-state: paused !important; }

/* ---------------- FAQ ---------------- */
.pg-jump ul { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pg-faq-group { padding-top: clamp(40px, 7vw, 64px); scroll-margin-top: 12px; }
.pg-faq-h { font-size: clamp(24px, 5vw, 32px); }
.pg-qa-list { display: grid; gap: 10px; }
.pg-qa {
  border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s; scroll-margin-top: 12px;
}
.pg-qa[open] { border-color: color-mix(in srgb, var(--brand-deep) 70%, var(--line)); box-shadow: var(--shadow-2); }
.pg-qa > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; padding: 12px 14px 12px 20px;
  border-radius: 20px; list-style: none; cursor: pointer; font: 600 18px/1.3 var(--font-display); -webkit-tap-highlight-color: transparent;
}
.pg-qa > summary::-webkit-details-marker { display: none; }
.pg-qa > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pg-qa-chev {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2);
  transition: transform .32s var(--ease-out), background-color .2s;
}
.pg-qa-chev .ic { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .pg-qa > summary:hover .pg-qa-chev { background: var(--surface-3); } }
.pg-qa[open] .pg-qa-chev { transform: rotate(180deg); background: var(--brand); color: var(--on-brand); }
.pg-qa.is-closing .pg-qa-chev { transform: none; background: var(--surface-2); color: var(--ink); }
.pg-qa-a { padding: 0 20px 20px; font-size: 16px; line-height: 1.62; }
.pg-qa-a p + p { margin-top: 10px; }
.pg-src-sec .pg-text { margin-bottom: 14px; }
.pg-src-live ul { display: grid; gap: 10px; }
.pg-src-item { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); }
.pg-src-item h3 { font: 700 17px/1.3 var(--font-display); }
.pg-src-item dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin-top: 8px; font-size: 14px; }
.pg-src-item dl div { display: contents; }
.pg-src-item dt { color: var(--muted); }
.pg-src-item dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pg-src-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pg-pill-link, .pg-jump a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line);
  color: var(--ink); font: 600 15px var(--font-ui); text-decoration: none !important;
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-spring), border-color .15s;
}
.pg-pill-link .ic { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .pg-pill-link:hover, .pg-jump a:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--line); border-color: var(--muted); }
}
/* Pressed: the pill travels down by its lip, like every key in the game (base.css .btn:active). */
.pg-pill-link:active, .pg-jump a:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); transition-duration: .06s; transition-timing-function: ease-out; }

/* ---------------- archive ---------------- */
/* The list is drawn from the player's local data; its box keeps room so nothing below it moves (CLS 0). */
.pg-arch { display: flex; flex-direction: column; min-height: 72vh; margin-top: 28px; }
.pg-arch-progress { min-height: 1.5em; font: 600 16px/1.5 var(--font-ui); color: var(--muted); }
.pg-arch-noscript { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); }
.pg-arch-month { padding-top: 24px; }
.pg-arch-mh { margin-bottom: 12px; font: 700 24px/1.2 var(--font-display); }
.pg-arch-grid { display: grid; gap: 10px; }
@media (min-width: 720px) { .pg-arch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .pg-arch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pg-arch-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 76px;
  padding: 12px 12px 12px 16px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow-1);
  color: var(--ink); text-decoration: none;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s;
}
@media (hover: hover) and (pointer: fine) {
  .pg-arch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--muted); }
  .pg-arch-card:hover > .ic { transform: translateX(3px); }
}
.pg-arch-card:active { transform: scale(.98); transition-duration: .06s; transition-timing-function: ease-out; }
.pg-arch-card > .ic { width: 20px; height: 20px; color: var(--muted); transition: transform .18s var(--ease-out); }
.pg-ac-n { min-width: 2.6ch; font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.pg-ac-mid { display: grid; gap: 3px; min-width: 0; }
.pg-ac-date { font: 600 15px/1.3 var(--font-ui); }
.pg-ac-res { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 14px/1.3 var(--font-ui); color: var(--muted); }
.pg-ac-res b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.pg-ac-today { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand); font: 700 12px/1.6 var(--font-ui); letter-spacing: .03em; }
.pg-arch-card.is-today { border: 2px solid var(--brand-deep); }
.pg-ac-bars { display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.pg-ac-bars i { position: relative; display: block; width: 9px; height: 30px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.pg-ac-bars i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--liq-teal);
  transform-origin: 50% 100%; transform: scaleY(var(--s, 0)); transition: transform .6s var(--ease-out) var(--d, 0ms);
}
.pg-ac-bars i.is-full::after { background: var(--gold); }
.pg-ac-bars i.is-spill::after { background: var(--danger); transform: scaleY(.18); }
.pg-arch-card.is-none .pg-ac-bars, .pg-arch-card.is-progress .pg-ac-bars { opacity: .7; }
.pg-arch-months.is-pending .pg-ac-bars i::after { transform: scaleY(0); }
.pg-arch-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 40px; color: var(--muted); font: 600 15px var(--font-ui); }
.pg-arch-bob { width: 40px; height: auto; }
.pg-item-in { animation: pg-in .5s var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes pg-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------------- scroll reveals ---------------- */
/* pages.js marks only elements that start below the fold, so nothing visible on load is ever hidden. */
[data-reveal].is-pending:not([data-reveal="stagger"]) { opacity: 0; transform: translateY(22px); }
[data-reveal="stagger"].is-pending > * { opacity: 0; transform: translateY(18px); }
[data-reveal].is-in:not([data-reveal="stagger"]) { transition: opacity .55s var(--ease-out), transform .65s var(--ease-out); }
[data-reveal="stagger"].is-in > * { transition: opacity .5s var(--ease-out) var(--d, 0ms), transform .6s var(--ease-out) var(--d, 0ms); }

/* ---------------- reduced motion (system or the game's setting) ---------------- */
@media (prefers-reduced-motion: reduce) {
  .pg-bubbles i { display: none; }
  [data-reveal].is-pending, [data-reveal="stagger"].is-pending > * { opacity: 1 !important; transform: none !important; }
  .pg-item-in, .pg-ex-pts.is-pop, .pg-dcard.is-flip .pg-dv, .pg-demo-stage.is-shaking,
  .pg-wordmark:hover .bob .bob-tilt, .pg-wordmark:focus-visible .bob .bob-tilt, .pg-foot-mark:hover .bob .bob-tilt, .pg-cta:hover .pg-cta-bob .bob-tilt { animation: none !important; }
  .pg-nav-link::after, .pg-arch-card, .pg-arch-card > .ic, .pg-pill-link, .pg-jump a, .pg-qa-chev, .pg-dcard { transition: none !important; }
  .pg-arch-card:hover, .pg-pill-link:hover, .pg-jump a:hover, .pg-arch-card:hover > .ic, .pg-arch-card:active { transform: none; }
}
:root[data-motion="reduce"] .pg-bubbles i { display: none; }
:root[data-motion="reduce"] [data-reveal].is-pending, :root[data-motion="reduce"] [data-reveal="stagger"].is-pending > * { opacity: 1 !important; transform: none !important; }
:root[data-motion="reduce"] .pg-item-in, :root[data-motion="reduce"] .pg-ex-pts.is-pop, :root[data-motion="reduce"] .pg-dcard.is-flip .pg-dv,
:root[data-motion="reduce"] .pg-demo-stage.is-shaking, :root[data-motion="reduce"] .pg-wordmark:hover .bob .bob-tilt,
:root[data-motion="reduce"] .pg-wordmark:focus-visible .bob .bob-tilt, :root[data-motion="reduce"] .pg-foot-mark:hover .bob .bob-tilt,
:root[data-motion="reduce"] .pg-cta:hover .pg-cta-bob .bob-tilt { animation: none !important; }
:root[data-motion="reduce"] .pg-arch-card:hover, :root[data-motion="reduce"] .pg-pill-link:hover, :root[data-motion="reduce"] .pg-jump a:hover,
:root[data-motion="reduce"] .pg-arch-card:hover > .ic, :root[data-motion="reduce"] .pg-arch-card:active { transform: none; }

@media print {
  .pg-head, .pg-foot, .pg-hero-art, .pg-demo-stage, .pg-replay, .pg-explorer, .pg-cta .btn { display: none !important; }
}
