/* Chainmates web: an editorial puzzle page.
 * Newsprint paper, near-black ink, hairline rules. One signal colour (--accent) that comes from the mode
 * (football = chalk-line green; the brand default is safety orange) and is used only for actions and the live link.
 * Brass marks under par and nothing else (a birdie in brass, an eagle in deeper, solid brass); par is a solid ink finish. Red marks a miss. Type: Zilla Slab (display) + Libre Franklin (text).
 * Radii: 6px and 10px only. Motion: one token set; transform/opacity only; no decorative loops. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;
  --font-body: "Libre Franklin", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Zilla Slab", "Roboto Slab", Rockwell, Georgia, serif;

  --paper: #f6f3ec; --paper-2: #eeeadf; --card: #fbfaf6;
  --ink: #1a1917;   --ink-2: #4a4740;   --ink-3: #6b665a;
  --rule: #dcd6c9;  --rule-2: #bab3a3;
  --accent: #e8590c; --accent-ink: #b0440a; --accent-soft: #fbe5d8; --on-accent: #ffffff;
  --brass: #e2b33c;  --brass-ink: #855c00; --brass-deep: #c99412; --brass-soft: #f3e2b4;
  --bad: #c42b1c;    --bad-soft: #f7e0dc;
  --scrim: rgba(26, 25, 23, .42);
  --lift: 0 10px 30px -12px rgba(26, 25, 23, .28);

  --r-s: 6px;
  --r-m: 10px;
  --header-h: 60px;

  /* motion: one set for everything (JS reads the durations; reduced motion zeroes them) */
  --dur-xs: 120ms;
  --dur-s: 180ms;
  --dur-m: 260ms;
  --dur-l: 360ms;
  --dur-xl: 420ms;
  --stagger: 28ms;
  --lock-step: 80ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.3, 1.35, .5, 1);
}
/* football mode: the chalk line */
:root[data-sport="nfl"] { --accent: #0b7a45; --accent-ink: #0a6a3c; --accent-soft: #dcefe3; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141311; --paper-2: #1e1c19; --card: #1b1a17;
    --ink: #ede9e0;   --ink-2: #bdb7ab;   --ink-3: #8b8579;
    --rule: #33302a;  --rule-2: #4b473f;
    --accent: #ff7a3d; --accent-ink: #ff9a6a; --accent-soft: #3a2216; --on-accent: #141311;
    --brass-ink: #e9c25a; --brass-deep: #f2c640; --brass-soft: #3a2f14;
    --bad: #ff6b5a; --bad-soft: #3b1b17;
    --scrim: rgba(0, 0, 0, .55);
    --lift: 0 12px 34px -10px rgba(0, 0, 0, .6);
  }
  :root[data-sport="nfl"]:not([data-theme="light"]) { --accent: #46c486; --accent-ink: #6fd8a2; --accent-soft: #15301f; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141311; --paper-2: #1e1c19; --card: #1b1a17;
  --ink: #ede9e0;   --ink-2: #bdb7ab;   --ink-3: #8b8579;
  --rule: #33302a;  --rule-2: #4b473f;
  --accent: #ff7a3d; --accent-ink: #ff9a6a; --accent-soft: #3a2216; --on-accent: #141311;
  --brass-ink: #e9c25a; --brass-deep: #f2c640; --brass-soft: #3a2f14;
  --bad: #ff6b5a; --bad-soft: #3b1b17;
  --scrim: rgba(0, 0, 0, .55);
  --lift: 0 12px 34px -10px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"][data-sport="nfl"] { --accent: #46c486; --accent-ink: #6fd8a2; --accent-soft: #15301f; }
:root[data-theme="light"] { color-scheme: light; }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.45; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums lining-nums; overflow-x: clip;
}
main { flex: 1 0 auto; outline: none; view-transition-name: main-view; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
html, button, a, summary, select, [role="option"] { -webkit-tap-highlight-color: transparent; }
button, summary, [role="option"] { touch-action: manipulation; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
a { color: var(--ink); text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
b, strong { font-weight: 700; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: min(640px, calc(100% - 32px)); margin: 0 auto; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 500; padding: 10px 14px; border-radius: var(--r-s); background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------------ header */
.topbar { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--paper); border-bottom: 1px solid var(--rule); view-transition-name: topbar; }
.topbar-inner { min-height: var(--header-h); display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; color: var(--ink); text-decoration: none; border-radius: var(--r-s); }
.brand-mark { flex: none; display: block; transition: transform var(--dur-m) var(--ease-spring); }
@media (hover: hover) { .brand:hover .brand-mark { transform: rotate(-10deg); } }
.brand-text { display: grid; min-width: 0; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 25px; line-height: .95; letter-spacing: -.01em; white-space: nowrap; }
.brand-accent { color: inherit; }
.brand-sub { display: flex; align-items: baseline; min-width: 0; margin-top: 3px; font-size: 12.5px; line-height: 1.2; white-space: nowrap; }
.brand-mode { flex: none; color: var(--accent-ink); font-weight: 700; }
.brand-kicker { min-width: 0; color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.brand-kicker:not(:empty)::before { content: "·"; margin: 0 6px; color: var(--ink-3); }
.brand-mode[hidden] + .brand-kicker::before { content: none; }
.brand-kicker b { color: var(--ink); font-weight: 700; }
@media (max-width: 430px) { .brand-kicker .k-word { display: none; } }
.top-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0; flex: none; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--ink-2); text-decoration: none;
  transition: background-color var(--dur-s) var(--ease-out), color var(--dur-s) var(--ease-out), transform var(--dur-s) var(--ease-out);
}
@media (hover: hover) { .icon-btn:hover { background: var(--paper-2); color: var(--ink); } }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { display: block; }
.icon-btn[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
#btnTheme svg { display: none; }
#btnTheme[data-mode="auto"] .ic-auto, #btnTheme[data-mode="light"] .ic-light, #btnTheme[data-mode="dark"] .ic-dark { display: block; animation: fadeIn var(--dur-s) var(--ease-out) both; }
.sport-pick select { height: 34px; border-radius: var(--r-s); border: 1px solid var(--rule-2); background: var(--card); padding: 0 8px; }
@media (max-width: 374px) { .icon-btn { width: 36px; height: 36px; } .brand-mark { width: 28px; height: 28px; } .brand-title { font-size: 22px; } }

/* ------------------------------------------------------------------ masthead */
.hero { border-bottom: 2px solid var(--ink); }
.hero-inner { padding: 16px 0 18px; }
.hero-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.hero-kicker b { color: var(--ink); font-weight: 700; }
.hero-status { color: var(--accent-ink); font-weight: 700; }
.hero-status.practice { color: var(--ink-2); }
/* a themed day: the theme on its own line; a game night adds the matchup as two ClubChips ("KC at LV") */
.hero-theme { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; color: var(--ink); font-weight: 600; }
.theme-game { display: inline-flex; align-items: center; gap: 6px; }
.theme-game .at { color: var(--ink-3); font-size: 12.5px; font-weight: 500; font-style: italic; }
.theme-game .club { height: 20px; min-width: 34px; font-size: 10px; }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); padding: 16px 0 14px; }
.pcard { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pcard-end { text-align: right; align-items: flex-end; }
.pcard-label { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.pcard-name { font-family: var(--font-display); font-weight: 700; font-size: 27px; line-height: 1.02; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pcard-meta { color: var(--ink-2); font-size: 13px; }
.pcard .career { margin-top: 2px; }
.pcard-end .career { justify-content: flex-end; }
.gap-link { position: relative; display: grid; place-items: center; }
.gap-link::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 50%; width: 1px; background: var(--rule); }
.gap-link .knot { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--rule-2); color: var(--ink); }
.hero-foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.par-badge { flex: none; display: inline-grid; justify-items: center; align-content: center; min-width: 70px; height: 36px; padding: 0 10px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); line-height: 1; }
.pb-par { font-family: var(--font-display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.pb-n { display: inline-block; }
.pb-n.bump { animation: numSwap var(--dur-l) var(--ease-spring) both; }
.mode-note { flex: 1 1 auto; min-width: 0; color: var(--ink-2); font-size: 13px; }
.mode-note.swap { animation: wordIn var(--dur-m) var(--ease-out) both; }
.mode-played { margin-left: auto; color: var(--ink-2); font-size: 13px; }
.mode-played b { color: var(--ink); font-weight: 700; }
/* Hard / Easy: one hairline frame, an ink block slides under the chosen word */
.modes { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; height: 36px; padding: 3px; border-radius: var(--r-s); box-shadow: inset 0 0 0 1px var(--rule-2); background: var(--card); }
.modes-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 4px; background: var(--ink); transition: transform var(--dur-l) var(--ease-spring); will-change: transform; }
.modes[data-on="easy"] .modes-thumb { transform: translateX(100%); }
.modes button { position: relative; z-index: 1; min-width: 56px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 700; transition: color var(--dur-s) var(--ease-out); }
.modes button[aria-pressed="true"] { color: var(--paper); }
@media (hover: hover) { .modes button[aria-pressed="false"]:hover { color: var(--ink); } }
.modes button:active { transform: scale(.96); }
.modes.nope .modes-thumb { animation: nope 420ms var(--ease-out); }
.hero.intro .matchup, .hero.intro .hero-foot { animation: rise var(--dur-l) var(--ease-out) both; }
.hero.intro .hero-foot { animation-delay: 60ms; }
.hero.intro .gap-link .knot { animation: popIn var(--dur-l) var(--ease-spring) 120ms both; }
@media (min-width: 560px) {
  .hero-inner { padding: 22px 0 22px; }
  .pcard-name { font-size: 36px; }
  .matchup { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); padding: 22px 0 18px; }
}

/* ------------------------------------------------------------------ club chip (team colour + abbreviation) */
.club {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 30px; height: 18px; padding: 0 5px; border-radius: 3px;
  background: var(--c1, #8a94a1); color: var(--ci, #fff);
  box-shadow: inset 0 -2px 0 var(--c2, transparent);
  font-family: var(--font-body); font-size: 9.5px; font-weight: 800; line-height: 1; letter-spacing: .04em;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .club { box-shadow: inset 0 -2px 0 var(--c2, transparent), 0 0 0 1px rgba(255, 255, 255, .14); } }
:root[data-theme="dark"] .club { box-shadow: inset 0 -2px 0 var(--c2, transparent), 0 0 0 1px rgba(255, 255, 255, .14); }

/* easy mode's career line: each stint is a ClubChip joined to its years, chronological, strung on a hairline */
.career { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; min-width: 0; clip-path: inset(-2px -1px); }
.stint { position: relative; display: inline-flex; align-items: stretch; flex: none; height: 18px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--rule-2); background: var(--card); }
.stint .club { border-radius: 3px 0 0 3px; }
.stint .yrs { display: grid; place-items: center; padding: 0 5px 0 4px; color: var(--ink-2); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.stint + .stint::before { content: ""; position: absolute; left: -8px; top: 50%; width: 6px; height: 1px; background: var(--rule-2); }
.pcard-end .stint + .stint::before { content: none; }
.pcard-end .stint:not(:last-child)::after { content: ""; position: absolute; right: -8px; top: 50%; width: 6px; height: 1px; background: var(--rule-2); }
.stint-more { color: var(--ink-3); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
/* switching modes: the career lines slide in (easy) or fold away (hard) */
.careers-in .career .stint, .careers-in .career .stint-more { animation: stintIn var(--dur-m) var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 8) * 30ms); }
.careers-out .career { animation: careerOut var(--dur-m) var(--ease-in) both; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-s); border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 14.5px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-s) var(--ease-out), background-color var(--dur-s) var(--ease-out), opacity var(--dur-s) var(--ease-out);
}
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--paper-2); } }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .38; cursor: default; }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .btn-primary:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); } }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (hover: hover) { .btn-ink:hover:not(:disabled) { background: var(--ink-2); } }
.btn-wide { width: 100%; }
.btn-lg { min-height: 50px; font-size: 15.5px; }
.linklike { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; font: inherit; }

/* ------------------------------------------------------------------ the chain */
.game-body { padding: 4px 0 24px; }
.chain-card { position: relative; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 0 8px; }
.card-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.card-meta { color: var(--ink-2); font-size: 13px; text-align: right; }
.card-meta b { color: var(--ink); }
/* the one shimmer: a single brass sweep at the birdie moment */
.shimmer { position: absolute; inset: 40px -8px 0; overflow: hidden; pointer-events: none; z-index: 2; border-radius: var(--r-m); }
.shimmer::before { content: ""; position: absolute; top: -10%; bottom: -10%; left: -20%; width: 14%; opacity: 0; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(226, 179, 60, .32) 50%, transparent); }
.chain-card.birdie-shine .shimmer::before { animation: sweep 900ms var(--ease-in-out) both; animation-delay: var(--shine-delay, 0ms); }

.chain { list-style: none; margin: 0; padding: 0; }
.step { position: relative; }
.node { position: relative; z-index: 1; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; transform-origin: 18px 50%; }
.node-dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.node-who { min-width: 0; }
.node-who strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.node-who small { display: block; margin-top: 1px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-who .career { margin-top: 5px; }
.node-tag { margin-right: 6px; color: var(--ink-3); font-weight: 600; }
.node-start .node-dot { background: var(--ink); color: var(--paper); }
.node-target .node-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chain-card.is-birdie .node-target .node-dot { background: var(--brass); border-color: var(--brass); color: #1a1917; }
/* an eagle gilds the whole chain: every rail turns brass and every marker gets a brass ring (drawn link by link at the lock-up) */
.chain-card.is-eagle .node-target .node-dot { background: var(--brass-deep); border-color: var(--brass-deep); }
.chain-card.is-eagle .node-dot { position: relative; }
.chain-card.is-eagle .node-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--brass); pointer-events: none; }
.chain-card.is-eagle .rail-line::after { content: ""; position: absolute; inset: 0; background: var(--brass-deep); transform-origin: 50% 0; }
.chain-card.is-eagle .rail-knot { border-color: var(--brass-deep); color: var(--brass-ink); }
.chain-card.eagle-lock .rail-line::after { animation: drawDown var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--k, 0) * var(--lock-step) * 1.6); }
.chain-card.eagle-lock .node-dot::after { animation: ringIn var(--dur-l) var(--ease-spring) both; animation-delay: calc(var(--k, 0) * var(--lock-step) * 1.6 + 120ms); }
.chain-card.eagle-lock .shimmer::before { animation-duration: 1100ms; }
.node-ghost .node-dot { border-style: dashed; border-color: var(--rule-2); color: var(--ink-3); }
.node-ghost .node-who strong { color: var(--ink-2); }
.node-lost .node-dot { border-color: var(--bad); color: var(--bad); }

/* connectors: a centred line through the markers, with a link glyph on it; the reason sits beside it */
.conn { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 42px; padding: 4px 0 4px 50px; color: var(--ink-2); font-size: 13.5px; line-height: 1.3; }
.rail { position: absolute; left: 18px; top: -6px; bottom: -6px; width: 0; }
.rail-line { position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--ink); transform-origin: 50% 0; }
.rail-knot { position: absolute; left: -11px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink); }
.rail-knot svg { display: block; }
.reason { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.reason > span:last-child { min-width: 0; }
.reason b { color: var(--ink); font-weight: 600; }
/* the live link: the open connector you are trying to make */
.conn-next .rail-line { background: repeating-linear-gradient(180deg, var(--accent) 0 3px, transparent 3px 7px); }
.conn-next .rail-knot { border-color: var(--accent); color: var(--accent); }
.conn-next b { color: var(--ink); font-weight: 600; }
.conn-pending { min-height: 26px; }
.conn-pending .rail-line { background: repeating-linear-gradient(180deg, var(--rule-2) 0 3px, transparent 3px 7px); }
.conn-pending .rail-knot { display: none; }
.more-btn { min-height: 28px; padding: 0 8px; border-radius: var(--r-s); border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.more-btn[aria-expanded="true"] { background: var(--paper-2); color: var(--ink); }
.more-list { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.more-list:not([hidden]) span { animation: fadeIn var(--dur-m) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
.more-list span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }

/* a new link: the line draws down, the glyph lands, the player springs in, then the reason appears */
.step.enter .rail-line, .target.enter .rail-line { animation: drawDown var(--dur-m) var(--ease-out) both; }
.step.enter .rail-knot, .target.enter .rail-knot { animation: popIn var(--dur-m) var(--ease-spring) 120ms both; }
.step.enter .node, .target.enter .node { animation: linkIn var(--dur-l) var(--ease-spring) 100ms both; }
.step.enter .reason, .target.enter .reason { animation: chipIn var(--dur-m) var(--ease-out) 220ms both; }
/* undo: the same, in reverse */
.step.retract .node { animation: linkOut var(--dur-s) var(--ease-in) both; }
.step.retract .reason, .step.retract .rail-knot, .step.retract .more-btn { animation: fadeOut var(--dur-xs) var(--ease-in) both; }
.step.retract .rail-line { animation: drawUp var(--dur-m) var(--ease-in-out) 80ms both; }
/* solve: the lock-up runs down the chain */
.chain-card.lock .node { animation: lockPulse var(--dur-l) var(--ease-spring) both; animation-delay: calc(var(--k, 0) * var(--lock-step)); }
.chain-card.lock .rail-knot { animation: knotTurn var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--k, 0) * var(--lock-step) - 40ms); }

.slot { position: relative; }
.target { padding-bottom: 8px; }
.finder { position: relative; z-index: 5; margin: 2px 0 4px; }
.field {
  position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 14px;
  border-radius: var(--r-s); background: var(--card); color: var(--ink-3); border: 1.5px solid var(--rule-2);
  transition: border-color var(--dur-s) var(--ease-out), box-shadow var(--dur-s) var(--ease-out);
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent-ink); }
.field-ic { flex: none; }
.field input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; padding: 0; margin: 0; background: transparent; color: var(--ink); font-size: 16px; font-weight: 500; -webkit-appearance: none; appearance: none; }
.field input::placeholder { color: var(--ink-3); font-weight: 400; }
.field-clear { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-s); display: grid; place-items: center; background: transparent; color: var(--ink-2); }
@media (hover: hover) { .field-clear:hover { background: var(--paper-2); } }
.field.miss { animation: shake 360ms var(--ease-out); border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.field.miss::after { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; pointer-events: none; border: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); animation: flashOut 800ms var(--ease-out) both; }

/* the failed connection: a red link snaps off the chain and falls away */
.fail-stub { position: absolute; left: 0; right: 0; top: 0; height: 42px; pointer-events: none; z-index: 3; }
.fail-stub .rail-line { background: var(--bad); animation: failLine 800ms var(--ease-out) both; }
.fail-stub .rail-knot { border-color: var(--bad); color: var(--bad); animation: failKnot 800ms var(--ease-out) both; }
.fail-stub .fail-name { position: absolute; left: 50px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-size: 13.5px; font-weight: 600; white-space: nowrap; max-width: calc(100% - 56px); overflow: hidden; text-overflow: ellipsis; text-decoration: line-through; text-decoration-thickness: 1.5px; animation: failName 1000ms var(--ease-out) both; }

/* autocomplete: rows fade up in sequence; one highlight block glides between them */
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 4px;
  max-height: 360px; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r-s);
  box-shadow: var(--lift); transform-origin: 50% 0; animation: dropIn var(--dur-m) var(--ease-out) both; scrollbar-width: thin;
}
.ac.up { top: auto; bottom: calc(100% + 6px); transform-origin: 50% 100%; }
.ac-hl { position: absolute; left: 4px; right: 4px; top: 0; height: 0; border-radius: 4px; background: color-mix(in srgb, var(--accent) 11%, var(--card)); pointer-events: none; opacity: 0; will-change: transform; }
.ac-hl.on { opacity: 1; }
.ac-hl.glide { transition: transform var(--dur-s) var(--ease-out), height var(--dur-s) var(--ease-out), opacity var(--dur-xs) linear; }
.ac-row {
  position: relative; display: block;
  min-height: 54px; padding: 8px 10px; border-radius: 4px; cursor: pointer;
  animation: rowIn var(--dur-m) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger));
}
.ac-row + .ac-row::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 1px; background: var(--rule); }
.ac-row strong { display: block; font-size: 15.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-row strong mark { background: none; color: inherit; font-weight: 700; }
.ac-row small { display: block; color: var(--ink-2); font-size: 12.5px; }
.ac-row .career { flex-wrap: nowrap; margin-top: 5px; overflow: hidden; }
.ac-tag { margin-left: 6px; color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.ac-empty { padding: 14px 12px; color: var(--ink-2); font-size: 13.5px; }

/* the hint: a short line of copy with the team as a ClubChip; on reveal the bulb lights and the words slide in */
.hint-pill { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 2px; padding: 10px 12px 11px; border-radius: var(--r-s); background: var(--paper-2); color: var(--ink); animation: rise var(--dur-m) var(--ease-out) both; }
.hint-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--rule-2); color: var(--ink); }
.hint-ic svg { display: block; }
.hint-line { margin: 4px 0 0; min-width: 0; font-size: 14.5px; line-height: 1.5; }
.hint-k { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.hw { display: inline-block; }
.hw-team { white-space: nowrap; }
.hw-team .club { margin-right: 5px; vertical-align: 1px; }
.hw-team b { font-weight: 700; }
.hint-pill.reveal .hint-ic { animation: popIn var(--dur-l) var(--ease-spring) 60ms both; }
.hint-pill.reveal .hint-ic svg { animation: bulbOn 700ms var(--ease-out) 160ms both; }
.hint-pill.reveal .hint-k { display: inline-block; animation: wordIn var(--dur-m) var(--ease-out) 100ms both; }
.hint-pill.reveal .hw { animation: wordIn var(--dur-m) var(--ease-out) both; animation-delay: calc(var(--w, 0) * 32ms + 180ms); }
.hint-pill.reveal .hw-team { animation-name: chipLand; animation-duration: var(--dur-l); animation-timing-function: var(--ease-spring); }
.result-wrap { }
.result-strip { display: grid; gap: 12px; align-items: center; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 0 16px; border-top: 1px solid var(--rule); animation: rise var(--dur-l) var(--ease-out) both; }
.result-strip .rs-score { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; }
.result-strip .rs-score.is-birdie { position: relative; display: inline-block; color: var(--brass-ink); }
.result-strip .rs-score.is-birdie::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 3px; border-radius: 2px; background: var(--brass); transform-origin: 0 50%; animation: growX var(--dur-xl) var(--ease-out) 260ms both; }
.result-strip .rs-score.is-eagle { position: relative; display: inline-block; color: var(--brass-ink); }
.result-strip .rs-score.is-eagle::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 5px; border-top: 2px solid var(--brass-deep); border-bottom: 2px solid var(--brass-deep); transform-origin: 0 50%; animation: growX var(--dur-xl) var(--ease-out) 260ms both; }
.result-strip .rs-score.is-par { color: var(--ink); }
.result-strip .rs-score.is-x { color: var(--bad); }
.result-strip small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.result-strip .rs-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 420px) { .result-strip:has(.rs-actions a) { grid-template-columns: minmax(0, 1fr); } .result-strip .rs-actions { justify-content: flex-start; } }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.controls-btns { display: flex; gap: 4px; margin-left: auto; }
@media (max-width: 400px) { .controls-btns .btn { padding: 0 12px; } }
.downs { display: flex; align-items: center; gap: 6px; }
.downs-label { margin-right: 4px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.down { position: relative; width: 13px; height: 13px; border-radius: 2px; background: var(--ink); }
.down.used { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.down.pop::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--bad); animation: downOut var(--dur-l) var(--ease-in) both; }
.downs.last .down:not(.used) { background: var(--bad); }
.rule-note { margin: 12px 0 0; color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; z-index: 400; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 10px); transform: translateX(-50%); width: min(440px, calc(100% - 32px)); display: grid; gap: 6px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-s); background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500; line-height: 1.35; box-shadow: var(--lift); animation: toastIn var(--dur-m) var(--ease-out) both; }
.toast small { display: block; margin-top: 2px; opacity: .72; font-size: 12.5px; }
.toast .t-ic { flex: none; width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; border: 1.5px solid currentColor; opacity: .8; }
.toast.bad .t-ic { border-color: var(--bad); background: var(--bad); color: #fff; opacity: 1; }
.toast.out { animation: toastOut var(--dur-s) var(--ease-in) both; }

/* ------------------------------------------------------------------ sheets (dialog = scrim + panel; JS drives drag) */
html.modal-open { overflow: hidden; }
dialog { color: var(--ink); }
.sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.sheet::backdrop { background: transparent; }
.sheet[open] { display: grid; place-items: center; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity var(--dur-m) var(--ease-out); }
.sheet.shown .sheet-scrim { opacity: 1; }
.sheet-panel {
  position: relative; width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 880px); display: flex; flex-direction: column;
  border-radius: var(--r-m); background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--lift); overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: transform var(--dur-l) var(--ease-spring), opacity var(--dur-s) var(--ease-out); will-change: transform;
}
.sheet.shown .sheet-panel { opacity: 1; transform: none; }
.sheet.closing .sheet-panel { transition: transform var(--dur-s) var(--ease-in), opacity var(--dur-s) var(--ease-in); }
.sheet-small .sheet-panel { width: min(480px, calc(100vw - 32px)); }
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.sheet-grab { display: none; }
@media (max-width: 760px) {
  .sheet[open] { place-items: end stretch; }
  .sheet-panel { width: 100%; max-height: 92dvh; border-radius: var(--r-m) var(--r-m) 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); opacity: 1; transform: translateY(105%); transition: transform var(--dur-l) var(--ease-out); }
  .sheet-small .sheet-panel { width: 100%; }
  .sheet.closing .sheet-panel { transition: transform var(--sheet-out, var(--dur-m)) var(--ease-out); }
  .sheet.dragging .sheet-panel, .sheet.dragging .sheet-scrim { transition: none; }
  .sheet-grab { display: block; position: absolute; z-index: 8; top: 0; left: 0; right: 0; height: 24px; touch-action: none; cursor: grab; }
  .sheet-grab::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--rule-2); }
  [data-drag] { touch-action: none; }
}
.close-btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; flex: none; border-radius: var(--r-s); border: 0; background: transparent; color: var(--ink-2); }
@media (hover: hover) { .close-btn:hover { background: var(--paper-2); color: var(--ink); } }
.close-btn:active { transform: scale(.92); }
.sheet-hero .close-btn { position: absolute; top: 12px; right: 10px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 16px 10px 20px; border-bottom: 1px solid var(--rule); }
.dlg-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; }
.dlg-body { padding: 14px 20px 22px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.dlg-body p { margin: 0 0 12px; }
.dlg-body strong { color: var(--ink); font-weight: 600; }
.dlg-body .lede { color: var(--ink); font-size: 16px; }
/* How to play: today's puzzle first, worded for the mode it's played in */
.today-block { margin: 0 0 14px; padding: 2px 0 14px; border-bottom: 2px solid var(--ink); animation: rise var(--dur-m) var(--ease-out) 40ms both; }
.today-block h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 6px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.today-block h3 span { color: var(--accent-ink); font-weight: 700; }
.today-block .ladder { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; color: var(--ink); }
.today-block .ladder b { font-weight: 700; }
.today-block p:last-child { margin: 0; }
.rules { margin: 0 0 16px; padding: 0; list-style: none; }
.rules li { padding: 10px 0; border-top: 1px solid var(--rule); animation: rise var(--dur-m) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms + 80ms); }
.rules li:last-child { border-bottom: 1px solid var(--rule); }
.rules .runin { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); margin-right: 4px; }
.dlg-body .legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--rule); }
.dlg-body .legal-links a { font-weight: 600; }
.dlg-body .fine { color: var(--ink-3); font-size: 13px; }

.confirm { width: min(380px, calc(100vw - 32px)); padding: 20px 20px 16px; border: 1px solid var(--rule); border-radius: var(--r-m); background: var(--paper); color: var(--ink); box-shadow: var(--lift); }
.confirm::backdrop { background: var(--scrim); animation: fadeIn var(--dur-m) var(--ease-out) both; }
.confirm[open] { animation: confirmIn var(--dur-m) var(--ease-out) both; }
.confirm h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.05; margin-bottom: 8px; }
.confirm p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.confirm p b { color: var(--ink); font-weight: 600; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* results sheet */
.sheet-hero { position: relative; padding: 26px 20px 18px; text-align: center; border-bottom: 1px solid var(--rule); }
.sheet-hero .kicker { display: block; color: var(--ink-2); font-size: 13px; }
.sheet-hero .kicker b { color: var(--ink); }
.score-big { display: block; margin: 6px 0 2px; font-family: var(--font-display); font-weight: 700; font-size: 76px; line-height: .95; animation: scoreIn var(--dur-xl) var(--ease-spring) 100ms both; }
.score-big.is-birdie { color: var(--brass-ink); }
/* a birdie gets a brass rule that draws in under the word, after the chain's brass sweep */
.score-big.is-birdie::after { content: ""; display: block; width: 72px; height: 4px; margin: 8px auto 4px; border-radius: 2px; background: var(--brass); transform-origin: 50% 50%; animation: growX var(--dur-xl) var(--ease-out) 380ms both; }
.score-big.is-par { color: var(--ink); }
/* the eagle: the strongest lock-up. Two brass links snap together, the word lands bigger, a double brass rule draws in under it */
.eagle-mark { display: block; margin: 8px auto 0; }
.eagle-mark rect { animation: linkSnapL var(--dur-xl) var(--ease-spring) 80ms both; transform-box: fill-box; transform-origin: 50% 50%; }
.eagle-mark rect + rect { animation-name: linkSnapR; }
.score-big.is-eagle { font-size: 88px; margin-top: 2px; color: var(--brass-ink); animation-delay: 220ms; }
.score-big.is-eagle::after { content: ""; display: block; width: 112px; height: 7px; margin: 16px auto 6px; border-top: 2.5px solid var(--brass-deep); border-bottom: 2.5px solid var(--brass-deep); transform-origin: 50% 50%; animation: growX var(--dur-xl) var(--ease-out) 480ms both; }
.score-big.is-x { color: var(--bad); }
.sheet-hero h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; animation: rise var(--dur-l) var(--ease-out) 160ms both; }
.sheet-hero p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; animation: rise var(--dur-l) var(--ease-out) 200ms both; }
.sheet-body { padding: 0 20px 20px; }
.sheet-sec { padding: 16px 0; border-bottom: 1px solid var(--rule); animation: rise var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 200ms); }
.sheet-sec h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sheet-sec h3 span { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--ink-3); }
.share-preview { margin: 0 0 10px; padding: 12px 14px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--rule); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; color: var(--ink); }
.share-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { position: relative; display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 14.5px; font-weight: 600; }
.mini-list li .ml-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink); font-size: 8px; font-weight: 700; }
.mini-list li .ml-dot.s { background: var(--ink); color: var(--paper); }
.mini-list li .ml-dot.e { background: var(--ink); color: var(--paper); }
.mini-list li .ml-dot.e.brass { background: var(--brass); border-color: var(--brass); color: #1a1917; }
.mini-list li .ml-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list li.ml-link { min-height: 28px; padding-left: 32px; color: var(--ink-2); font-size: 12.5px; font-weight: 400; gap: 8px; }
.mini-list li.ml-link::before { content: ""; position: absolute; left: 10px; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.mini-list li.ml-link.miss { color: var(--bad); }
.mini-list li.ml-link.miss::before { background: repeating-linear-gradient(180deg, var(--bad) 0 3px, transparent 3px 7px); }
.optimal-note { margin: 10px 0 0; color: var(--ink-2); font-size: 13px; }
.countdown { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 0 4px; animation: rise var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 200ms); }
.countdown span { color: var(--ink-2); font-size: 14px; }
.countdown time { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1; }
.practice-note { margin: 0; color: var(--ink-2); font-size: 14px; }

/* figures (stats) as a ruled grid */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.tile { padding: 12px 4px 10px; background: var(--paper); text-align: center; animation: fadeIn var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
.tile b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; }
.tile small .nw { white-space: nowrap; }
.tile small { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12.5px; line-height: 1.2; text-wrap: balance; }
.hist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hist li { display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center; gap: 10px; }
.hist .h-lab { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-2); text-align: right; }
.hist .h-track { position: relative; height: 26px; }
.hist .h-bar { position: absolute; left: 0; top: 0; bottom: 0; min-width: 26px; width: calc(var(--w, 0) * 1%); border-radius: 3px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); transform-origin: 0 50%; animation: growX var(--dur-xl) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 100ms); }
.hist .h-num { position: absolute; top: 0; bottom: 0; left: 0; min-width: 26px; width: calc(var(--w, 0) * 1%); display: grid; place-items: center end; padding: 0 8px; color: var(--ink-2); font-size: 13px; font-weight: 700; animation: fadeIn var(--dur-m) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 360ms); }
.hist li.on .h-bar { background: var(--ink); box-shadow: none; }
.hist li.on .h-num { color: var(--paper); }
.hist li.is-birdie .h-bar { background: var(--brass-soft); box-shadow: inset 0 0 0 1px var(--brass); }
.hist li.is-birdie .h-num { color: var(--brass-ink); }
.hist li.is-birdie.on .h-bar { background: var(--brass); box-shadow: none; }
.hist li.is-birdie.on .h-num { color: #1a1917; }
.hist li.is-birdie .h-lab { color: var(--brass-ink); }
.hist li.is-eagle .h-bar { background: var(--brass-deep); box-shadow: none; }
.hist li.is-eagle .h-num { color: #1a1917; }
.hist li.is-eagle.on .h-bar { box-shadow: inset 0 0 0 2px var(--ink); }
.hist li.is-eagle .h-lab { color: var(--brass-ink); font-size: 17px; }
.eagle-note { margin: -4px 0 12px; color: var(--ink-2); font-size: 13.5px; }
.eagle-note b { color: var(--brass-ink); }
.hist li.is-par .h-lab { color: var(--ink); }
.page-card { padding: 4px 0 18px; }
.page-card + .page-card { padding-top: 16px; border-top: 1px solid var(--rule); }
.page-card h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 21px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.page-card h2 small { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--ink-3); }
.empty-note { color: var(--ink-2); font-size: 14px; padding: 6px 0 2px; }

/* pages (archive / stats) */
.view-page { padding: 20px 0 28px; }
.page-title { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); }
.page-title h1 { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 36px; line-height: 1; }
.page-title h1 svg { flex: none; }
.page-title p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.back-row { margin-top: 18px; display: flex; justify-content: center; }
.archive { list-style: none; margin: 0; padding: 0; }
.archive li + li { border-top: 1px solid var(--rule); }
.arch-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 8px 10px 4px;
  color: inherit; text-decoration: none; border-radius: var(--r-s);
  animation: rise var(--dur-m) var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 14) * 24ms);
  transition: background-color var(--dur-s) var(--ease-out);
}
@media (hover: hover) { .arch-row:hover { background: var(--paper-2); } }
.arch-row:active { background: var(--paper-2); }
.arch-row.today { background: var(--paper-2); }
.arch-n { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; padding-left: 4px; }
.arch-n small { display: block; font-family: var(--font-body); font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-bottom: 2px; }
.arch-who { min-width: 0; }
.arch-who strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-who small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-who .today-tag { color: var(--accent-ink); font-weight: 700; font-size: 13px; }
.badge { display: inline-block; min-width: 46px; padding: 5px 8px 4px; border-radius: 4px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); white-space: nowrap; }
.badge.birdie { background: var(--brass-soft); color: var(--brass-ink); box-shadow: inset 0 0 0 1.5px var(--brass); }
.badge.eagle { background: var(--brass-deep); color: #1a1917; box-shadow: none; }
.badge.par { background: var(--ink); color: var(--paper); box-shadow: none; }
.badge.x { color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.badge.play { font-family: var(--font-body); font-size: 14px; font-weight: 700; color: var(--accent-ink); box-shadow: none; padding-right: 0; }
.badge.prog { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: none; }
.badge-wrap { display: grid; justify-items: end; gap: 3px; }
.badge-wrap small { color: var(--ink-3); font-size: 12px; }

/* status: skeleton while loading, plain notices for error / locked */
.view-status { padding: 0 0 28px; }
.skel-wrap { padding-top: 18px; animation: fadeIn var(--dur-l) var(--ease-out) both; }
.skel { background: var(--paper-2); border-radius: 4px; }
.skel-line { height: 12px; width: 52%; }
.skel-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 22px 0 18px; }
.skel-name { height: 28px; margin-bottom: 10px; }
.skel-meta { height: 12px; width: 60%; }
.skel-rule { height: 2px; background: var(--rule-2); margin-bottom: 18px; }
.skel-node { height: 44px; margin-bottom: 14px; }
.skel-field { height: 52px; margin-bottom: 14px; }
.skel-note { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.status-card { margin-top: 36px; display: grid; justify-items: center; gap: 6px; padding: 28px 8px; text-align: center; color: var(--ink-2); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); animation: rise var(--dur-l) var(--ease-out) both; }
.status-card strong { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }
.status-card .status-big { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; color: var(--ink); }
.status-card.error .status-big { color: var(--bad); }
.status-card .btn { margin-top: 12px; }
.status-card code { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.status-art { margin-bottom: 4px; }

/* idle content never animates behind a sheet */
html.modal-open .downs .down { animation-play-state: paused !important; }

/* view changes: View Transitions where supported, a quick crossfade otherwise */
.view.view-in { animation: viewIn var(--dur-m) var(--ease-out) both; }
::view-transition-old(main-view) { animation: vtOut var(--dur-s) var(--ease-in) both; }
::view-transition-new(main-view) { animation: vtIn var(--dur-m) var(--ease-out) both; }

/* ------------------------------------------------------------------ footer */
.footer { padding: 22px 16px calc(30px + env(safe-area-inset-bottom)); text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }
.footer-inner { padding-top: 18px; border-top: 1px solid var(--rule); }
.footer-mark { display: block; margin: 0 auto 10px; color: var(--rule-2); }
.footer p { margin: 0 0 4px; }
.footer a, .footer .linklike { color: inherit; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.footer-links a, .footer-links .linklike { display: inline-flex; align-items: center; min-height: 34px; color: var(--ink-2); }
.footer-links span { display: none; }
.footer #footAttribution { display: inline-flex; align-items: center; min-height: 34px; }

/* ------------------------------------------------------------------ keyframes (all short, all transform/opacity) */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes chipIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: none; } }
@keyframes scoreIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes sweep { 0% { opacity: 0; transform: translateX(0) skewX(-18deg); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(950%) skewX(-18deg); } }
@keyframes drawDown { from { transform: scaleY(0); } to { transform: none; } }
@keyframes drawUp { from { transform: none; } to { transform: scaleY(0); } }
@keyframes linkIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes linkOut { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes lockPulse { 0% { transform: none; } 45% { transform: translateX(4px); } 100% { transform: none; } }
@keyframes knotTurn { from { transform: none; } to { transform: rotate(180deg); } }
@keyframes shake { 0%, 100% { transform: none; } 18% { transform: translateX(-7px); } 38% { transform: translateX(6px); } 58% { transform: translateX(-4px); } 78% { transform: translateX(2px); } }
@keyframes flashOut { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes failLine { 0% { transform: scaleY(0); opacity: 1; } 25% { transform: none; opacity: 1; } 55% { opacity: 1; } 100% { transform: translateY(10px) scaleY(.4); opacity: 0; } }
@keyframes failKnot { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: none; } 55% { opacity: 1; transform: rotate(-20deg); } 100% { opacity: 0; transform: rotate(-50deg) translateY(14px); } }
@keyframes failName { 0% { opacity: 0; transform: translate(-6px, -50%); } 18% { opacity: 1; transform: translate(0, -50%); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(0, -30%); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes chipLand { from { opacity: 0; transform: translateY(-6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes bulbOn { 0% { transform: none; } 35% { transform: rotate(-14deg) scale(1.12); } 70% { transform: rotate(6deg); } 100% { transform: none; } }
@keyframes downOut { from { opacity: 1; transform: scale(1.25); } to { opacity: 0; transform: scale(.3); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes confirmIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes numSwap { 0% { opacity: 0; transform: translateY(-8px) scale(.8); } 100% { opacity: 1; transform: none; } }
@keyframes nope { 0%, 100% { transform: none; } 30% { transform: translateX(14px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes stintIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes careerOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes ringIn { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes linkSnapL { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes linkSnapR { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

/* reduced motion: no movement, durations ~0 (JS reads the tokens, so its delays collapse too); fades only where they carry meaning */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-xs: 1ms; --dur-s: 1ms; --dur-m: 1ms; --dur-l: 1ms; --dur-xl: 1ms; --stagger: 0ms; --lock-step: 0ms; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .toast, .view.view-in, .hint-pill { animation: fadeIn 150ms linear both !important; }
  .sheet-scrim { transition: opacity 150ms linear !important; }
  .sheet-panel { transform: none !important; transition: opacity 150ms linear !important; }
  .sheet:not(.shown) .sheet-panel { opacity: 0; }
  ::view-transition-old(main-view), ::view-transition-new(main-view) { animation-duration: 120ms !important; }
}
