/* Discover + Games — the site's own tokens (index.html :root), one modern layer
   on top: big type, full-bleed pictures, snap-scrolling decks, soft depth. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #f5ead8; --surface: #ebddc5; --paper: #f9f4ed;
  --ink: #201e1d; --ink-soft: #474238; --ink-mute: #645c50;
  --accent: #c67139; --accent-600: #b2622d; --accent-700: #8c491a; --accent-100: #fff2eb; --accent-200: #ffe1d0;
  --sage: #7a8a5e; --sage-100: #f0fae1; --sage-700: #56633f;
  --rule: color-mix(in srgb, #201e1d 16%, transparent);
  --heading: "Caprasimo", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-lg: 0 18px 40px -12px color-mix(in srgb, #2e2b25 30%, transparent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shell: clamp(16px, 4vw, 44px);
  --line: 3px solid var(--ink);
  --r: 16px;
}
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
::selection { background: var(--accent-200); color: var(--ink); }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
html { scrollbar-color: color-mix(in srgb, var(--ink) 35%, transparent) transparent; }

/* ── Header, dock and footer: the home page's own (index.html) ─────────────
   Owner, 2026-10-10: "the footer and header has to be the same on all the
   pages". Markup is copied from index.html; these rules are its rules, mapped
   onto this sheet's tokens. On a phone the nav folds into the bottom dock,
   exactly as it does on the home page. */
.jm-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: var(--line); }
.jm-bar { max-width: 1400px; margin: 0 auto; padding: 10px var(--shell); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.jm-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.jm-mark { width: 38px; height: 38px; flex: none; border-radius: 999px; background: var(--accent); border: var(--line); display: grid; place-items: center; }
.jm-mark svg { width: 24px; height: 24px; overflow: visible; }
.jm-mark svg path { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; }
.jm-mark svg circle { fill: #ccdbb2; }
.jm-word { font-family: var(--heading); font-size: 22px; letter-spacing: -.02em; }
.jm-strap { font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); padding-left: 4px; }
.jm-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.jm-nav { display: flex; gap: 4px; }
.jm-nav a { color: var(--ink); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; text-decoration: none; }
.jm-nav a:hover { background: var(--accent-200); }
.jm-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.jm-dock { display: none; position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 50;
  gap: 6px; padding: 8px; border: var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.jm-dock::-webkit-scrollbar { display: none; }
.dock-btn { white-space: nowrap; flex: 0 0 auto; border-radius: 999px; padding: 0 18px; min-height: 46px; font-weight: 900; font-size: 14px;
  color: var(--ink); display: inline-flex; align-items: center; text-decoration: none; }
.dock-btn:hover { background: var(--accent-200); }
.dock-btn.on { background: var(--ink); color: var(--paper); }
footer { border-top: var(--line); margin-top: clamp(34px, 5vw, 60px); background: var(--surface); }
.foot { max-width: 1400px; margin: 0 auto; padding: clamp(24px, 4vw, 42px) var(--shell); display: flex; flex-wrap: wrap; gap: 28px; }
.foot-brand { flex: 1 1 260px; }
.foot-word { font-family: var(--heading); font-size: 26px; }
.foot-brand p { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-mute); }
.foot-col { flex: 1 1 180px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 700; }
.foot-col h2 { font-family: var(--body); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.foot-col a { color: var(--ink); text-decoration: none; }
.foot-col a:hover { color: var(--accent-700); }
@media (max-width: 720px) {
  .jm-strap, .jm-nav { display: none; }
  .jm-bar { flex-wrap: nowrap; gap: 10px; padding: 8px var(--shell); }
  .jm-word { font-size: 20px; }
  .jm-dock { display: flex; }
  .dock-btn { padding: 0 14px; }
  footer { padding-bottom: 92px; }   /* clear the dock */
}

main { flex: 1 0 auto; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--shell) 96px; }

/* ── Page intro ─────────────────────────────────────────────────────────── */
.intro { padding: clamp(28px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); display: grid; gap: 14px; }
.intro h1 { font: 400 clamp(44px, 9vw, 104px)/0.92 var(--heading); letter-spacing: -0.025em; text-wrap: balance; }
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p { max-width: 58ch; font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-soft); }
.meter { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.meter-track { flex: 0 0 180px; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s var(--ease); }

/* ── Discover deck ──────────────────────────────────────────────────────── */
.deck { display: grid; gap: clamp(16px, 2vw, 22px); grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; }
.dcard { grid-column: span 3; position: relative; background: var(--paper); border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; isolation: isolate;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.dcard:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -16px color-mix(in srgb, #2e2b25 38%, transparent); }
.dcard.lead { grid-column: span 6; display: grid; grid-template-columns: 1.25fr 1fr; min-height: 520px; }
.dcard.wide { grid-column: span 4; }
.dcard.narrow { grid-column: span 2; }
.dfig { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
/* Paired cards share a row height; the photo takes the slack, not empty paper. */
.dcard:not(.lead) .dfig { flex: 1 0 auto; }
.dcard.wide .dfig { aspect-ratio: 16 / 10; }
.dcard.lead .dfig { aspect-ratio: auto; min-height: 100%; }
.dfig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.2s var(--ease); }
.dcard:hover .dfig img { transform: scale(1.06); }
.dtag { position: absolute; left: 14px; top: 14px; z-index: 2; display: inline-flex; gap: 8px; align-items: center;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 12.5px; letter-spacing: 0.02em; padding: 7px 12px; border-radius: 999px; }
.dtag b { color: var(--accent-200); font-weight: 800; }
.dcredit { position: absolute; right: 10px; bottom: 10px; z-index: 2; max-width: 75%; font-size: 11px; line-height: 1.3;
  color: #fff; background: rgba(20, 18, 15, .62); padding: 4px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcredit a { color: #fff; }
.dbody { padding: clamp(18px, 2.4vw, 30px); display: grid; gap: 12px; align-content: start; }
.dcard h2 { font: 400 clamp(24px, 2.6vw, 34px)/1.05 var(--heading); letter-spacing: -0.015em; text-wrap: balance; }
.dcard.lead h2 { font-size: clamp(30px, 4vw, 52px); }
.dcard p.body { color: var(--ink-soft); font-size: 16px; line-height: 1.6; max-width: 62ch; }
.facts { list-style: none; display: grid; gap: 8px; counter-reset: f; }
.facts li { counter-increment: f; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 15px; line-height: 1.5; }
.facts li::before { content: counter(f); width: 24px; height: 24px; border-radius: 50%; background: var(--accent-100); color: var(--accent-700);
  font-weight: 800; font-size: 12.5px; display: grid; place-items: center; margin-top: 1px; }
.take { font: 400 19px/1.3 var(--heading); color: var(--accent-700); }
.dlink { font-weight: 800; font-size: 14px; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; width: fit-content; border-bottom: 2px solid var(--accent); padding-bottom: 1px; }
.dlink:hover { color: var(--accent-700); }
.dcard.read::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--sage); pointer-events: none; }
@media (max-width: 900px) {
  .deck { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 calc(var(--shell) * -1); padding: 6px var(--shell) 22px; scrollbar-width: none; }
  .deck::-webkit-scrollbar { display: none; }
  .dcard, .dcard.lead, .dcard.wide, .dcard.narrow { flex: 0 0 86%; scroll-snap-align: center; display: flex; min-height: 0; }
  .dcard.lead .dfig { aspect-ratio: 4 / 3; min-height: 0; flex: 0 0 auto; }
  .dcard:hover { transform: none; }
}
.swipe-hint { display: none; font-weight: 700; font-size: 13.5px; color: var(--ink-mute); margin: -6px 0 10px; }
@media (max-width: 900px) { .swipe-hint { display: block; } }

/* ── Quiz + panels ──────────────────────────────────────────────────────── */
.panel { margin-top: clamp(28px, 4vw, 48px); background: var(--ink); color: var(--paper); border-radius: 28px; padding: clamp(22px, 4vw, 44px); }
.panel h2 { font: 400 clamp(30px, 4.4vw, 54px)/1 var(--heading); letter-spacing: -0.02em; }
.panel > p { color: color-mix(in srgb, var(--paper) 78%, transparent); margin-top: 8px; max-width: 60ch; }
.qlist { display: grid; gap: 22px; margin-top: 26px; }
.q h3 { font: 700 19px/1.35 var(--body); margin-bottom: 12px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; } }
.opt { text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--paper) 22%, transparent);
  background: color-mix(in srgb, var(--paper) 6%, transparent); color: var(--paper); font-weight: 700; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s; }
.opt:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt:disabled { cursor: default; }
.opt.right { background: var(--sage); border-color: var(--sage); color: #fff; }
.opt.wrong { background: color-mix(in srgb, #c0392b 55%, transparent); border-color: #c0392b; }
.score-big { font: 400 clamp(56px, 9vw, 96px)/1 var(--heading); color: var(--accent); }
.done { display: grid; gap: 14px; justify-items: start; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #1b120b; font-weight: 800; font-size: 15.5px; text-decoration: none; transition: background .2s, transform .15s; }
.btn:hover { background: var(--accent-200); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Games hub ──────────────────────────────────────────────────────────── */
.ghub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .ghub { grid-template-columns: 1fr; } }
.gtile { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 26px; overflow: hidden; text-decoration: none;
  background: var(--paper); box-shadow: var(--shadow-lg); transition: transform .5s var(--ease); min-height: 360px; }
.gtile:hover { transform: translateY(-5px) rotate(-.4deg); }
.gtile .art { height: 190px; display: grid; place-items: center; position: relative; overflow: hidden; }
.gtile .art svg { width: 108px; height: 108px; }
.gtile.t1 .art { background: var(--ink); color: var(--accent); }
.gtile.t2 .art { background: var(--accent); color: var(--ink); }
.gtile.t3 .art { background: var(--sage); color: var(--paper); }
.gtile .gbody { padding: 22px 24px 26px; display: grid; gap: 8px; align-content: start; }
.gtile h2 { font: 400 32px/1 var(--heading); letter-spacing: -0.015em; }
.gtile p { color: var(--ink-soft); }
.gtile .theme { font-weight: 800; font-size: 14px; color: var(--accent-700); }

/* ── Riddle games (Who Am I / Picture Quiz) ─────────────────────────────── */
.game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); align-items: start; }
.stage { position: relative; border-radius: 26px; overflow: hidden; background: var(--ink); aspect-ratio: 4 / 5; box-shadow: var(--shadow-lg); }
.stage img { width: 100%; height: 100%; object-fit: cover; transition: filter .9s var(--ease), transform .9s var(--ease); }
.stage .veil { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 28px; color: var(--paper);
  background: radial-gradient(120% 90% at 50% 40%, #2e2b25 0%, #14120f 100%); }
.stage .veil b { font: 400 clamp(90px, 16vw, 170px)/.8 var(--heading); color: var(--accent); }
.stage .veil span { display: block; margin-top: 14px; font-weight: 700; color: color-mix(in srgb, var(--paper) 75%, transparent); }
@media (max-width: 900px) {
  .game { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 4 / 3; }
  /* Before the reveal Who Am I's stage is only a question mark: keep it short so the clues sit on screen. */
  body[data-game="who_am_i"] .stage:has(.veil) { aspect-ratio: 16 / 7; }
  body[data-game="who_am_i"] .stage .veil b { font-size: 84px; }
}
.roundbar { display: flex; gap: 6px; margin-bottom: 18px; }
.roundbar i { flex: 1; height: 7px; border-radius: 99px; background: var(--surface); }
.roundbar i.on { background: var(--accent); }
.roundbar i.done { background: var(--sage); }
.side { display: grid; gap: 16px; align-content: start; }
.side .theme { font-weight: 800; color: var(--accent-700); font-size: 14.5px; }
.side h1 { font: 400 clamp(38px, 5vw, 60px)/.95 var(--heading); letter-spacing: -0.02em; }
.clues { list-style: none; display: grid; gap: 10px; }
.clues li { background: var(--paper); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-md); font-size: 16.5px; line-height: 1.45;
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; animation: rise .55s var(--ease) both; }
.clues li b { font: 400 22px/1 var(--heading); color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.pts { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.pts .now { font: 400 40px/1 var(--heading); color: var(--accent-700); }
.guess { display: flex; gap: 10px; }
.guess input { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--rule); background: var(--paper); font: 600 17px var(--body); color: var(--ink); }
.guess input:focus { outline: none; border-color: var(--accent); }
.guess input::placeholder { color: var(--ink-mute); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.dark:hover { background: var(--ink-soft); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { padding: 14px; border-radius: 14px; border: 2px solid var(--rule); background: var(--paper); font-weight: 800; cursor: pointer; text-align: left; transition: border-color .2s, background .2s, transform .15s; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:active:not(:disabled) { transform: scale(.98); }
.choice.right { background: var(--sage); border-color: var(--sage); color: #fff; }
.choice.wrong { background: #f6d5cf; border-color: #c0392b; color: #7b1d12; }
.toast { min-height: 24px; font-weight: 700; color: var(--accent-700); }
.reveal { background: var(--paper); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-md); display: grid; gap: 12px; animation: rise .6s var(--ease) both; }
.reveal h2 { font: 400 34px/1 var(--heading); }
.reveal .desc { color: var(--ink-soft); font-weight: 600; }
.reveal .credit { font-size: 12px; color: var(--ink-mute); }
.final { text-align: left; }

/* ── Sudoku ─────────────────────────────────────────────────────────────── */
.sdk-wrap { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: start; }
@media (max-width: 900px) { .sdk-wrap { grid-template-columns: 1fr; } }
.sdk { display: grid; grid-template-columns: repeat(9, 1fr); background: var(--ink); gap: 1px; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow-lg); user-select: none; }
.sdk button { border: 0; background: var(--paper); font: 700 clamp(18px, 4.2vw, 26px)/1 var(--body); color: var(--ink); cursor: pointer; aspect-ratio: 1; font-variant-numeric: tabular-nums; }
.sdk button.given { background: var(--surface); }
.sdk button.user { color: var(--accent-700); }
.sdk button.peer { background: var(--accent-100); }
.sdk button.same { background: var(--accent-200); }
.sdk button.sel { background: var(--accent); color: #1b120b; }
.sdk button.bad { color: #c0392b; background: #f6d5cf; }
/* Box lines: a wider ink gap after columns 3 and 6 and rows 3 and 6. */
.sdk button:nth-child(9n+3), .sdk button:nth-child(9n+6) { margin-right: 2px; }
.sdk button:nth-child(n+19):nth-child(-n+27), .sdk button:nth-child(n+46):nth-child(-n+54) { margin-bottom: 2px; }
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.pad button { padding: 14px 0; border-radius: 12px; border: 2px solid var(--rule); background: var(--paper); font: 800 20px var(--body); cursor: pointer; }
.pad button:hover { border-color: var(--accent); }
.stats { display: flex; gap: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-mute); font-weight: 700; display: block; font-size: 13px; }
.loading { padding: 60px 0; font-weight: 700; color: var(--ink-mute); }
.err { padding: 40px 0; font-weight: 700; color: #7b1d12; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
