/* MYWORDIQ — one stylesheet: tokens, base, layout, components, games. */

/* ---------- Tokens ---------- */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --sunken: #eceef3;
  --ink: #12141c;
  --muted: #555b6b;
  --line: #dfe2ea;
  --line-strong: #b9bfcc;
  --good: #166a45;
  --bad: #a8321f;

  /* One accent per game. Same lightness family so they sit together. */
  --mwi: #3b3ac4;
  --spares: #a8430e;
  --loop: #0a6e63;
  --accent: var(--mwi);
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));

  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(18 20 28 / 0.05), 0 8px 24px -12px rgb(18 20 28 / 0.14);
  --wrap: 1120px;
  --read: 70ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f15;
    --surface: #161922;
    --sunken: #1e222d;
    --ink: #eceef4;
    --muted: #a4abbb;
    --line: #272c39;
    --line-strong: #454c5e;
    --good: #5fd0a0;
    --bad: #ff9a85;
    --mwi: #9a99ff;
    --spares: #f39a5f;
    --loop: #4fcab9;
    --on-accent: #0d0f15;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
  }
}
[data-game='mywordiq'] { --accent: var(--mwi); }
[data-game='spares'] { --accent: var(--spares); }
[data-game='clueloop'] { --accent: var(--loop); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 var(--s4); }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); z-index: 50; }
.skip:focus { top: var(--s3); }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; gap: var(--s5); min-height: 60px; }
.brand { font: 800 1.3rem/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 0.8rem; letter-spacing: 0; }
.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__link { display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 0.97rem; }
.nav__link:hover { color: var(--ink); background: var(--sunken); }
.nav__link[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.nav__sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 8px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: var(--s3) 16px var(--s4); }
  .nav[data-open='true'] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__link { padding: 13px 12px; font-size: 1.05rem; }
  .nav__link[aria-current='page'] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
  .nav__sep { width: auto; height: 1px; margin: 8px 0; }
}

/* ---------- Buttons, badges, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn--wide { flex: 1 1 180px; }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 0.93rem; }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: 1.08rem; border-radius: 14px; }
.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.badge--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 0.95rem var(--font-body); cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 1rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; min-width: 0; flex: 1 1 140px; }
.input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }

/* ---------- Sections & cards ---------- */
.section { padding: var(--s7) 0; }
.section--tight { padding: var(--s6) 0; }
.section__head { max-width: 46rem; margin-bottom: var(--s5); }
.eyebrow { font: 650 0.8rem/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s3); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.grid { display: grid; gap: var(--s4); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); }
.card h3 { margin-bottom: var(--s2); }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.card__more { color: var(--accent); font-weight: 650; }
.muted { color: var(--muted); }

/* Game cards (home + how-to pages) */
.game-card { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.game-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.game-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.game-card__name { font: 750 1.6rem/1 var(--font-display); letter-spacing: -0.03em; }
.game-card__blurb { color: var(--muted); margin: 0; flex: 1; }
.game-card__cta { color: var(--accent); font-weight: 650; }
.game-card__demo { display: flex; gap: 5px; align-items: center; min-height: 40px; }
.mini { width: 32px; height: 36px; display: grid; place-items: center; border-radius: 7px; border: 1.5px solid var(--line-strong); font: 700 0.95rem var(--font-display); }
.mini--on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mini--ghost { border-style: dashed; color: var(--muted); }
.mini--gap { border: 0; width: 14px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: var(--s7) 0 var(--s6); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: var(--s7); align-items: start; }
.hero__copy { padding-top: var(--s5); }
.hero__title { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -0.045em; margin-bottom: var(--s4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero__facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: var(--s5) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.hero__facts li::before { content: '✓'; margin-right: 6px; color: var(--accent); font-weight: 700; }
@media (max-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); } .hero { padding-top: var(--s5); } .hero__copy { padding-top: 0; } }

/* ---------- Game shell ---------- */
.game-page { padding: var(--s5) 0 var(--s7); }
.game-page__intro { text-align: center; max-width: 34rem; margin: 0 auto var(--s5); }
.game-page__title { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.04em; margin-bottom: var(--s2); }
.game-page__tag { color: var(--muted); margin: 0; }
.game { width: min(100%, 560px); margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(16px, 4vw, 28px); display: flex; flex-direction: column; gap: var(--s4); min-height: 320px; }
.game__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.game__meta { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.game__number { font: 700 1.05rem var(--font-display); }
.game__date { color: var(--muted); font-size: 0.92rem; }
.game__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.game__links a { display: inline-flex; align-items: center; min-height: 44px; }
.game__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s5); margin: var(--s5) auto 0; padding: 0; list-style: none; font-weight: 600; font-size: 0.97rem; }
.skeleton { height: 280px; border-radius: 12px; background: var(--sunken); display: grid; place-items: center; color: var(--muted); }

.clue-card { background: var(--accent-soft); border-radius: var(--radius); padding: var(--s5) var(--s4); text-align: center; }
.clue-card__eyebrow { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s2); }
.clue-card__clue { font: 600 clamp(1.25rem, 4.4vw, 1.6rem)/1.3 var(--font-display); letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.clue-card__hint { margin: var(--s3) 0 0; font-size: 0.98rem; color: var(--muted); text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-strong); }
.clue-card .clue-card__hint { text-align: center; }

/* Tiles */
.tiles { position: relative; --gap: 6px; --size: min(52px, calc((100% - (var(--n) - 1) * var(--gap)) / var(--n))); container-type: inline-size; }
.tiles__row { display: flex; justify-content: center; gap: var(--gap); }
.tile { flex: 0 1 52px; min-width: 0; aspect-ratio: 1 / 1.08; display: grid; place-items: center; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--surface); font: 700 clamp(1rem, 6cqi, 1.6rem)/1 var(--font-display); text-transform: uppercase; transition: border-color 0.15s ease, background 0.2s ease, transform 0.15s ease; }
.tile--filled { border-color: var(--ink); }
.tile--caret { border-color: var(--line-strong); }
.tiles:focus-within .tiles__row { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
.tiles:focus-within .tile--caret { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.tile--locked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); border-style: double; border-width: 4px; }
.tile--correct { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile--revealed { background: var(--sunken); border-style: dashed; color: var(--muted); }
.tile--mark { border-color: var(--bad); border-style: dashed; color: var(--bad); background: var(--surface); text-decoration: line-through; }
.tiles__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; padding: 0; cursor: text; }
.tiles--disabled { opacity: 0.6; }
.tiles--static .tile { animation: pop 0.28s ease both; }
.tiles--shake { animation: shake 0.32s ease; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes pop { from { transform: scale(0.86); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

.feedback { min-height: 1.6em; margin: 0; text-align: center; font-weight: 550; font-size: 0.98rem; }
.feedback[data-kind='good'] { color: var(--good); }
.feedback[data-kind='bad'] { color: var(--bad); }
.feedback[data-kind='good']:not(:empty)::before { content: '✓ '; }
.feedback[data-kind='bad']:not(:empty)::before { content: '✕ '; }
.attempts { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--muted); font-size: 0.9rem; }
.attempts__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); }
.attempts__dot--used { background: var(--ink); border-color: var(--ink); }
.attempts__text { margin-left: 6px; }
.guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; justify-items: center; }
.guesses__row { display: flex; gap: 3px; font: 600 0.95rem var(--font-display); color: var(--muted); }
.guesses__ch { width: 1.5em; text-align: center; padding: 2px 0; border-bottom: 2px solid transparent; }
.guesses__ch--hit { color: var(--accent); font-weight: 800; border-bottom-color: var(--accent); }

/* Finish panel */
.finish { border-top: 1px solid var(--line); padding-top: var(--s5); display: grid; gap: var(--s4); text-align: center; animation: rise 0.4s ease both; }
.finish__headline { font-size: clamp(1.7rem, 6vw, 2.3rem); margin: 0; color: var(--accent); outline: none; }
.finish--miss .finish__headline { color: var(--ink); }
.finish__detail p { margin: 0; color: var(--muted); }
.finish__share { margin: 0 auto; padding: 14px 18px; background: var(--sunken); border-radius: 12px; font: 500 0.95rem/1.5 ui-monospace, 'SF Mono', Menlo, monospace; text-align: left; white-space: pre-wrap; max-width: 100%; overflow-wrap: anywhere; }
.finish__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.share-fallback { width: 100%; min-height: 110px; margin-top: var(--s3); font: 0.95rem ui-monospace, monospace; padding: 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s2); margin: 0; }
.stat { background: var(--sunken); border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column-reverse; }
.stat__value { margin: 0; font: 750 1.5rem/1.1 var(--font-display); }
.stat__label { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.stats__note { grid-column: 1 / -1; margin: 0; font-size: 0.88rem; color: var(--muted); }
.countdown { margin: 0; color: var(--muted); }
.countdown__time { color: var(--ink); font-variant-numeric: tabular-nums; }
.more-games { border-top: 1px solid var(--line); padding-top: var(--s4); }
.more-games__title { font-size: 1rem; font-family: var(--font-body); letter-spacing: 0; font-weight: 600; color: var(--muted); }
.more-games__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s2); }
.game-chip { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; text-decoration: none; color: var(--ink); }
.game-chip:hover { border-color: var(--accent); }
.game-chip__name { font: 750 1.1rem var(--font-display); }
.game-chip__blurb { font-size: 0.88rem; color: var(--muted); }

/* States */
.state { text-align: center; padding: var(--s6) var(--s4); display: grid; gap: var(--s3); justify-items: center; }
.state__title { font-size: 1.4rem; margin: 0; }
.state p { color: var(--muted); margin: 0; max-width: 32rem; }
.state__actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; margin-top: var(--s2); }

/* ---------- SPARES ---------- */
.pips { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pip { flex: 1; height: 6px; border-radius: 3px; background: var(--sunken); }
.pip--done { background: var(--accent); }
.pip--now { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 10px); }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ladder__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; }
.ladder__row .tiles { --gap: 5px; }
.ladder__row .tile { flex-basis: 42px; border-radius: 8px; }
.ladder__label { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ladder__drop { display: inline-grid; place-items: center; min-width: 38px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 750 0.95rem var(--font-display); letter-spacing: 0; }
.ladder__row--new { animation: rise 0.35s ease both; }
.tray { border: 1.5px dashed var(--accent); border-radius: var(--radius); padding: var(--s4); display: grid; gap: var(--s3); background: var(--accent-soft); }
.tray__head { display: flex; justify-content: space-between; align-items: baseline; }
.tray__title { margin: 0; font-size: 0.82rem; font-family: var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.tray__count { font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tray__slots { display: flex; gap: 8px; justify-content: center; }
.spare { width: 46px; height: 50px; display: grid; place-items: center; border-radius: 50% 50% 12px 12px; border: 2px dashed var(--line-strong); background: var(--surface); font: 750 1.35rem var(--font-display); }
.spare--got { border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.spare--called { border: 2px solid var(--accent); color: var(--accent); }
.spare--new { animation: drop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
@keyframes drop { from { transform: translateY(-36px) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tray__clue { margin: 0; text-align: center; font-size: 0.97rem; }
.tray__form { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- ClueLoop ---------- */
.timer { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.ring { width: min(210px, 62%); margin: 0 auto; }
.ring svg { display: block; width: 100%; height: auto; overflow: visible; }
.ring__arc { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-dasharray: 3 7; stroke-linecap: round; transition: stroke 0.3s ease; }
.ring__arc--half { stroke: var(--accent); stroke-dasharray: 8 6; }
.ring__arc--full { stroke: var(--accent); stroke-width: 5; stroke-dasharray: none; }
.ring text { text-anchor: middle; font-family: var(--font-display); fill: var(--ink); }
.ring__node circle { fill: var(--surface); stroke: var(--line-strong); stroke-width: 2; }
.ring__node text { font-size: 14px; font-weight: 700; fill: var(--muted); }
.ring__node--now circle { stroke: var(--accent); stroke-width: 3; }
.ring__node--now text { fill: var(--accent); }
.ring__node--done circle { fill: var(--accent); stroke: var(--accent); }
.ring__node--done text { fill: var(--on-accent); }
.ring__link circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.ring__link text { font-size: 13px; font-weight: 800; fill: var(--accent); }
.ring__count { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.ring__sub { font-size: 12px; fill: var(--muted) !important; font-family: var(--font-body) !important; }
.ring__big { font-size: 22px; font-weight: 800; letter-spacing: 1px; fill: var(--accent) !important; }
.ring--closed svg { animation: close 0.7s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes close { from { transform: scale(0.9) rotate(-18deg); opacity: 0.5; } to { transform: none; opacity: 1; } }
.loop { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.loop__item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.loop__item--active { border: 2px solid var(--accent); padding: var(--s3) var(--s3) var(--s4); display: grid; gap: var(--s3); }
.loop__item--done { padding: var(--s3); display: grid; gap: var(--s2); background: var(--accent-soft); border-color: transparent; }
.loop__item--done .tile { flex-basis: 34px; border-radius: 7px; font-size: clamp(0.85rem, 4.4cqi, 1.1rem); }
.loop__head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; width: 100%; text-align: left; font: inherit; color: inherit; }
.loop__head--btn { background: none; border: 0; padding: 12px; min-height: 56px; cursor: pointer; border-radius: var(--radius); }
.loop__head--btn:hover { background: var(--sunken); }
.loop__num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font: 700 0.85rem var(--font-display); color: var(--muted); }
.loop__item--active .loop__num { border-color: var(--accent); color: var(--accent); }
.loop__item--done .loop__num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.loop__clue { font-weight: 550; line-height: 1.35; }
.loop__item--active .loop__clue { font: 600 1.15rem/1.3 var(--font-display); }
.loop__len { grid-column: 2 / -1; font-size: 0.84rem; color: var(--muted); }
.loop__state { color: var(--accent); display: inline-flex; }

/* ---------- Archive ---------- */
#archive { max-width: 760px; padding-bottom: var(--s7); }
.arc-tools { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.arc-search__input { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 400 1rem var(--font-body); }
.arc-search__input::placeholder { color: var(--muted); }
.arc-tools__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.arc-summary { margin: 0 0 var(--s5); color: var(--muted); font-size: 0.93rem; }
.arc-chev { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
[aria-expanded='true'] > .arc-chev { transform: rotate(180deg); }

/* Year: a section heading, not a list item */
.arc-year + .arc-year { margin-top: var(--s5); }
.arc-year__head { margin: 0; font: inherit; letter-spacing: 0; }
.arc-year__btn { display: flex; align-items: baseline; gap: var(--s3); width: 100%; min-height: 56px; padding: 8px 4px 10px; background: none; border: 0; border-bottom: 2px solid var(--ink); color: var(--ink); text-align: left; cursor: pointer; }
.arc-year__btn[aria-expanded='false'] { border-bottom-color: var(--line-strong); }
.arc-year__name { font: 800 1.9rem/1 var(--font-display); letter-spacing: -0.03em; }
.arc-year__count { margin-left: auto; color: var(--muted); font: 500 0.93rem var(--font-body); font-variant-numeric: tabular-nums; }
.arc-year__btn .arc-chev { align-self: center; color: var(--muted); }
.arc-year__btn:hover .arc-year__name { color: var(--accent); }

/* Month: subordinate, one consistent row height */
.arc-month { border-bottom: 1px solid var(--line); }
.arc-month__head { margin: 0; font: inherit; letter-spacing: 0; }
.arc-month__btn { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: 0 4px 0 12px; background: none; border: 0; color: var(--ink); text-align: left; cursor: pointer; border-radius: 8px; }
.arc-month__btn:hover { background: var(--sunken); }
.arc-month__name { font: 650 1.08rem var(--font-display); }
.arc-month__progress { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.arc-month__count { margin-left: auto; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.arc-month__btn .arc-chev { color: var(--muted); }
.arc-month__btn[aria-expanded='true'] .arc-month__name { color: var(--accent); }

/* Puzzle rows */
.arc-month__rows { list-style: none; margin: 0; padding: 0 0 var(--s3) 12px; }
.arc--results .arc-month__rows { padding: 0; border-top: 1px solid var(--line); }
.arc-row + .arc-row, .arc--results .arc-row { border-top: 1px solid var(--line); }
.arc--results .arc-row:first-child { border-top: 0; }
.arc-row__link { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s3); min-height: 60px; padding: 8px 8px 8px 0; color: var(--ink); text-decoration: none; border-radius: 8px; }
.arc-row__link:hover { background: var(--accent-soft); }
.arc-row__num { padding-left: 8px; font: 750 1.05rem var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.arc-row__main { display: grid; min-width: 0; }
.arc-row__date { font-weight: 600; line-height: 1.3; }
.arc-row__meta { color: var(--muted); font-size: 0.88rem; line-height: 1.35; overflow-wrap: anywhere; }
.arc-row__status { color: var(--muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.arc-row__link--done .arc-row__status { color: var(--good); }
.arc-row__link--done .arc-row__status::before { content: '✓ '; }
.arc-row__link--missed .arc-row__status::before { content: '✕ '; }
.arc-row__link--started .arc-row__status { color: var(--accent); }
.arc-row__link--started .arc-row__status::before { content: '… '; }
.arc-more { margin-top: var(--s4); }
.arc-empty { padding: var(--s6) 0; display: grid; gap: var(--s3); justify-items: start; color: var(--muted); }
.arc-empty p { margin: 0; }
@media (max-width: 480px) {
  .arc-year__name { font-size: 1.6rem; }
  .arc-month__btn { padding-left: 4px; gap: var(--s2); }
  .arc-month__rows { padding-left: 0; }
  .arc-row__link { grid-template-columns: 52px minmax(0, 1fr); row-gap: 2px; padding: 10px 4px 10px 0; }
  .arc-row__num { padding-left: 4px; align-self: start; padding-top: 1px; }
  .arc-row__status { grid-column: 2; }
  .arc-tools__row .btn { flex: 1 1 100%; }
}

/* ---------- Article / prose ---------- */
.page-head { padding: var(--s6) 0 var(--s4); }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: var(--s4); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted); display: inline-block; padding: 10px 0; }
.prose { max-width: var(--read); padding-bottom: var(--s7); }
.prose h2 { margin-top: var(--s6); }
.prose h3 { margin-top: var(--s5); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.table-scroll { overflow-x: auto; margin-bottom: var(--s4); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prose .note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s4); margin-bottom: var(--s4); }
.prose .note p:last-child { margin: 0; }
.updated { color: var(--muted); font-size: 0.92rem; }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0 !important; }
.wordlist li { margin: 0; padding: 5px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font: 650 0.92rem var(--font-display); letter-spacing: 0.06em; }
.example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); overflow-x: auto; }
.example__row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.example__row:last-child { margin-bottom: 0; }
.example__note { color: var(--muted); font-size: 0.92rem; margin-left: 6px; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: var(--s3); }
.steps li { counter-increment: s; position: relative; padding-left: 46px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 0.95rem var(--font-display); }
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; padding: var(--s4) 28px var(--s4) 0; font: 650 1.1rem/1.3 var(--font-display); list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; position: absolute; right: 4px; top: 50%; translate: 0 -50%; font-size: 1.4rem; color: var(--accent); }
details.faq[open] summary::after { content: '−'; }
details.faq > div { padding-bottom: var(--s4); color: var(--muted); }
details.faq > div p:last-child { margin: 0; }

/* ---------- Monetization containers ---------- */
/* Ad slots are hidden until AdSense is enabled in config.js — no empty boxes. */
.ad-slot { margin: var(--s6) auto; max-width: var(--read); min-height: 100px; padding: var(--s3) 0; border-block: 1px solid var(--line); text-align: center; clear: both; }
.ad-slot__label { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot--below-game { margin-top: var(--s8); } /* kept far from Submit / Hint / Share */
.picks { max-width: var(--read); margin: var(--s6) 0; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.picks__title { font-size: 1.2rem; margin-bottom: var(--s2); }
.picks__intro, .picks__note { color: var(--muted); font-size: 0.95rem; }
.picks__note { margin: 0; font-size: 0.85rem; }
.picks__list { margin: 0 0 var(--s3); padding-left: 1.2em; }
.picks__list li { margin-bottom: 6px; }
.picks__disclosure { font-size: 0.9rem; margin-bottom: var(--s3); }
.picks__list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.picks__list { list-style: none; padding-left: 0; }
.picks__name { font-weight: 600; }
.picks__cta { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; white-space: nowrap; }
.consent { position: fixed; inset: auto 12px 12px 12px; z-index: 40; max-width: 560px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s4); display: grid; gap: var(--s3); font-size: 0.95rem; }
.consent p { margin: 0; }
.consent__actions { display: flex; gap: var(--s2); justify-content: flex-end; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s7) 0 var(--s5); margin-top: var(--s6); font-size: 0.96rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s5); }
.site-footer h2 { font: 650 0.8rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; }
.site-footer__legal { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; display: grid; gap: 6px; }
.site-footer__legal p { margin: 0; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__about { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
