/* Layout: one narrow column like a puzzle app; hub = list of puzzle cards, game = board + keyboard pinned near the bottom. */

/* Self-hosted fonts (Latin subset from Google Fonts, SIL Open Font License). Figtree is variable: one file covers 400 to 800. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/figtree-latin.woff2") format("woff2"); }
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/gloock-latin.woff2") format("woff2"); }

:root {
  --paper: #f2f5f3;
  --ink: #17201d;
  --muted: #66726d;
  --line: #d3dbd7;
  --tile: #ffffff;
  --pine: #1f5a48;
  --pine-soft: #cfe3da;
  --cran: #b3304a;
  --cran-soft: #f3d5da;
  --gold: #d8a32a;
  --gold-soft: #f6e6b9;
  --slate: #3d5f8f;
  --slate-soft: #d5e0f0;
  --on-accent: #ffffff;
  --key: #dfe5e2;
  --absent: #8b9692;
  --shadow: 0 1px 0 rgba(23, 32, 29, 0.08);
  --display: "Gloock", "Georgia", "Times New Roman", serif;
  --ui: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111715; --ink: #e8eeeb; --muted: #95a29d; --line: #2a3531; --tile: #1a2320;
    --pine: #4fa587; --pine-soft: #1f3d33; --cran: #e0627b; --cran-soft: #4a2229;
    --gold: #e8bc4f; --gold-soft: #4a3b14; --slate: #7fa3d6; --slate-soft: #22324a;
    --on-accent: #0f1513; --key: #2a3531; --absent: #48534f; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111715; --ink: #e8eeeb; --muted: #95a29d; --line: #2a3531; --tile: #1a2320;
  --pine: #4fa587; --pine-soft: #1f3d33; --cran: #e0627b; --cran-soft: #4a2229;
  --gold: #e8bc4f; --gold-soft: #4a3b14; --slate: #7fa3d6; --slate-soft: #22324a;
  --on-accent: #0f1513; --key: #2a3531; --absent: #48534f; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: var(--ui); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, .cell:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap {
  max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 40px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; letter-spacing: 0.005em; }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ---------- Hub ---------- */
.masthead { display: grid; gap: 10px; padding-block: 8px 20px; border-bottom: 2px solid var(--ink); margin-bottom: 20px; }
.masthead h1 { font-size: clamp(38px, 10vw, 56px); line-height: 0.98; }
.masthead h1 em { font-style: normal; color: var(--cran); }
.masthead p { margin: 0; max-width: 40ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.progress { display: flex; gap: 4px; }
.progress span { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.progress span.on { background: var(--pine); }

.player { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.player label { font-weight: 600; font-size: 14px; }
.player input { flex: 1 1 180px; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--tile); color: var(--ink); font: inherit; }

.games { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.game-card {
  width: 100%; display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  text-align: left; background: var(--tile); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); transition: transform 0.12s ease, border-color 0.12s ease;
}
.game-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.game-card .title { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.game-card .sub { font-size: 13px; color: var(--muted); }
.game-card .status { font-size: 13px; text-align: right; color: var(--muted); white-space: nowrap; }
.game-card .status .stars { color: var(--gold); font-size: 15px; letter-spacing: 1px; }
.game-card.done { border-color: var(--pine); }
.icon { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; }
.icon svg { width: 34px; height: 34px; }
.finale-card { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.finale-card .sub, .finale-card .status { color: var(--paper); opacity: 0.8; }
.finale-card.locked { background: var(--tile); color: var(--muted); border-style: dashed; border-color: var(--line); cursor: default; }
.finale-card.locked:hover { transform: none; }
.finale-card.locked .title { color: var(--ink); }
.finale-card.locked .sub, .finale-card.locked .status { color: var(--muted); opacity: 1; }
.counter { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Game shell ---------- */
.game-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.back { background: none; border: 0; padding: 6px 8px 6px 0; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--ink); }
.game-head h2 { font-size: 26px; text-align: center; }
.timer { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.instructions { font-size: 14px; color: var(--muted); margin: 0 0 14px; text-align: center; }
.toolbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.btn { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.4; cursor: default; }
.restart { display: block; margin: 22px auto 0; background: none; border: 0; padding: 8px; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.restart:hover { color: var(--ink); }

/* ---------- Language switch ---------- */
.lang { justify-self: end; display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: -4px; }
.lang button { background: none; border: 0; padding: 4px 11px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Sign-in ---------- */
.linkish { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.account { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.account:empty { display: none; }
.acct-dialog { width: min(400px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 26px 24px 22px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.acct-dialog::backdrop { background: rgba(10, 14, 13, 0.55); }
.acct-dialog h2 { font-size: 28px; margin: 0 0 6px; }
.acct-dialog > p { margin: 0 0 18px; font-size: 14px; }
.acct-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.acct-google { width: 100%; padding: 11px 16px; }
.acct-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.acct-form { display: grid; gap: 6px; }
.acct-form label { font-weight: 600; font-size: 13px; margin-top: 4px; }
.acct-form input { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--tile); color: var(--ink); font: inherit; }
.acct-form .btn.primary { margin-top: 10px; padding: 11px 16px; }
.acct-err { min-height: 1.2em; margin: 4px 0 0; font-size: 13px; color: var(--cran); }
.acct-err:empty { min-height: 0; }
.acct-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.acct-links [hidden] { display: none; }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; z-index: 50; pointer-events: none; }
.toast:empty { padding: 0; }

/* ---------- Keyboard ---------- */
.kb { display: grid; gap: 6px; margin-top: 16px; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key { flex: 1 1 0; max-width: 44px; height: 54px; border: 0; border-radius: 6px; background: var(--key); font-weight: 700; font-size: 15px; padding: 0; }
.key.wide { flex: 1.6 1 0; max-width: 72px; font-size: 12px; }
.key.correct { background: var(--pine); color: var(--on-accent); }
.key.present { background: var(--gold); color: #1d1606; }
.key.absent { background: var(--absent); color: var(--on-accent); }

/* ---------- Crossword ---------- */
.cw-board { overflow-x: auto; display: flex; justify-content: center; }
.cw-grid { display: grid; gap: 0; border: 2px solid var(--ink); background: var(--ink); }
.cell { position: relative; width: var(--cs); height: var(--cs); background: var(--tile); border: 0; outline: 1px solid var(--line); outline-offset: -0.5px; padding: 0; font-weight: 700; font-size: calc(var(--cs) * 0.52); text-transform: uppercase; display: grid; place-items: center; }
.cell.block { background: var(--paper); outline: none; cursor: default; }
.cell .num { position: absolute; top: 1px; left: 3px; font-size: calc(var(--cs) * 0.26); font-weight: 600; color: var(--muted); line-height: 1; }
.cell.inword { background: var(--slate-soft); }
.cell.active { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.cell.wrong { color: var(--cran); }
.cell.revealed::after { content: ""; position: absolute; right: 2px; top: 2px; width: 0; height: 0; border-left: 7px solid transparent; border-top: 7px solid var(--cran); }
.cell.ok { color: var(--pine); }
.cluebar { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; background: var(--slate-soft); border-radius: 8px; padding: 8px; margin-top: 14px; min-height: 52px; }
.cluebar button { background: none; border: 0; font-size: 20px; padding: 4px 8px; color: var(--ink); }
.cluebar .cl { font-size: 15px; font-weight: 600; text-align: center; }
.cluelists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; font-size: 14px; }
.cluelists h3 { font-family: var(--ui); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.cluelists ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cluelists li { padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.cluelists li b { display: inline-block; min-width: 1.6em; }
.cluelists li.cur { background: var(--slate-soft); }
.cluelists li.solved { color: var(--muted); text-decoration: line-through; }
@media (max-width: 480px) { .cluelists { grid-template-columns: 1fr; } }

/* ---------- Word guess ---------- */
.wg-hint { text-align: center; font-weight: 600; margin-bottom: 12px; }
.wg-board { display: grid; gap: 6px; justify-content: center; }
.wg-row { display: grid; gap: 6px; }
.wg-tile { width: min(58px, 15vw); aspect-ratio: 1; max-width: 100%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 28px; text-transform: uppercase; background: var(--tile); }
.wg-tile.filled { border-color: var(--muted); }
.wg-tile.correct { background: var(--pine); border-color: var(--pine); color: var(--on-accent); }
.wg-tile.present { background: var(--gold); border-color: var(--gold); color: #1d1606; }
.wg-tile.absent { background: var(--absent); border-color: var(--absent); color: var(--on-accent); }
.wg-row.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.wg-tile.flip { animation: flip 0.4s ease both; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

/* ---------- Groups ---------- */
.gr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gr-tile { aspect-ratio: 1.15; border: 0; border-radius: 8px; background: var(--key); font-weight: 800; font-size: clamp(11px, 3.3vw, 16px); text-transform: uppercase; padding: 2px; word-break: break-word; line-height: 1.1; }
.gr-tile.long { font-size: clamp(9px, 2.7vw, 14px); letter-spacing: -0.01em; }
.gr-tile.sel { background: var(--ink); color: var(--paper); }
.gr-solved { grid-column: 1 / -1; border-radius: 8px; padding: 12px; text-align: center; }
.gr-solved b { display: block; text-transform: uppercase; letter-spacing: 0.06em; font-size: 15px; }
.gr-solved span { font-size: 14px; text-transform: uppercase; }
.lvl0 { background: var(--gold-soft); } .lvl1 { background: var(--pine-soft); } .lvl2 { background: var(--slate-soft); } .lvl3 { background: var(--cran-soft); }
.dots { display: flex; gap: 6px; justify-content: center; align-items: center; font-size: 14px; color: var(--muted); margin-top: 14px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); display: inline-block; }
.dots i.used { background: var(--line); }

/* ---------- Ladder ---------- */
.ld { display: grid; gap: 8px; justify-items: center; }
.ld-rung { display: flex; gap: 6px; padding: 4px; border-radius: 10px; border: 2px solid transparent; background: none; }
.ld-rung.cur { border-color: var(--gold); background: var(--gold-soft); }
.ld-rung.shake { animation: shake 0.35s; }
.ld-l { width: min(50px, 13vw); aspect-ratio: 1; display: grid; place-items: center; font-weight: 800; font-size: 24px; border: 2px solid var(--line); background: var(--tile); border-radius: 6px; }
.ld-rung.fixed .ld-l { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ld-rung.done .ld-l { background: var(--pine); color: var(--on-accent); border-color: var(--pine); }
.ld-l.changed { box-shadow: inset 0 -4px 0 var(--gold); }
.ld-clue { text-align: center; font-weight: 600; min-height: 1.5em; margin-top: 12px; }

/* ---------- Word path ---------- */
.wp-theme { text-align: center; margin-bottom: 10px; }
.wp-theme b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.wp-current { text-align: center; font-weight: 800; letter-spacing: 0.12em; font-size: 22px; min-height: 1.6em; }
.wp-grid { display: grid; gap: 6px; justify-content: center; position: relative; touch-action: none; margin: 0 auto; }
.wp-cell { width: min(50px, 13vw); aspect-ratio: 1; border-radius: 50%; border: 0; background: transparent; font-weight: 800; font-size: 22px; position: relative; z-index: 1; padding: 0; }
.wp-cell.sel { background: var(--slate-soft); }
.wp-cell.found { background: var(--pine-soft); }
.wp-cell.theme { background: var(--gold); color: #1d1606; }
.wp-cell.hinted { box-shadow: inset 0 0 0 2px var(--slate); }
.wp-svg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.wp-count { text-align: center; font-size: 14px; color: var(--muted); margin-top: 10px; }

/* ---------- Memory ---------- */
.mm-hud { display: flex; justify-content: center; gap: 18px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.mm-hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mm-sizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: fit-content; max-width: 100%; margin: 0 auto 12px; padding: 4px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--tile); }
.mm-size { border: 0; background: none; border-radius: 999px; padding: 6px 11px; font-weight: 700; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm-size:hover { color: var(--ink); }
.mm-size[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.mm-grid { display: grid; gap: clamp(5px, 1.6vw, 10px); margin: 0 auto; }
.mm-slot { position: relative; aspect-ratio: 1; perspective: 900px; }
.mm-card { position: absolute; inset: 0; border: 0; padding: 0; background: none; border-radius: 10px; transform-style: preserve-3d; transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.25, 1); }
.mm-card.up { transform: rotateY(180deg); cursor: default; }
.mm-face { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mm-back { color: var(--on-accent); font-size: clamp(20px, 6vw, 30px); }
.mm-card:not(.up):hover .mm-back { filter: brightness(1.1); }
.mm-front { transform: rotateY(180deg); background: var(--tile); border: 2px solid var(--line); }
.mm-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-word { font-family: var(--display); font-size: clamp(14px, 4.2vw, 20px); line-height: 1.1; padding: 4px; text-align: center; overflow-wrap: anywhere; }
.mm-slot.matched .mm-front { border-color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine); animation: mm-pop 0.4s ease; }
.mm-slot.gone .mm-card { opacity: 0; transform: rotateY(180deg) scale(0.7); transition: transform 0.42s ease, opacity 0.45s ease; }
.mm-slot.gone::after { content: ""; position: absolute; inset: 0; border-radius: 10px; border: 2px dashed var(--line); pointer-events: none; }
@keyframes mm-pop { 0% { transform: rotateY(180deg) scale(0.86); } 60% { transform: rotateY(180deg) scale(1.06); } 100% { transform: rotateY(180deg) scale(1); } }

/* ---------- Reveal / finale ---------- */
.reveal { display: grid; gap: 14px; text-align: center; padding-block: 8px; }
.reveal .stars { color: var(--gold); font-size: 28px; letter-spacing: 4px; }
.reveal h2 { font-size: 34px; }
.reveal p { margin: 0 auto; max-width: 42ch; }
.photo { border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); }
.photo img { display: block; width: 100%; height: auto; }
.photo figcaption { font-size: 13px; color: var(--muted); padding: 8px; }
.score-line { display: flex; justify-content: center; gap: 18px; font-size: 15px; flex-wrap: wrap; }
.lb { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; }
.lb th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px; border-bottom: 1.5px solid var(--ink); }
.lb td { padding: 7px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lb tr.me td { background: var(--gold-soft); font-weight: 700; }
.submit-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.submit-row input { flex: 1 1 180px; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--tile); color: var(--ink); font: inherit; }
.sig { font-family: var(--display); font-size: 22px; }

/* ---------- Our year: month tiles on the hub ---------- */
.year { display: grid; gap: 10px; margin-top: 28px; }
.year h2 { font-size: 26px; }
.year p { margin: 0; font-size: 14px; }
.year > .btn { justify-self: center; margin-top: 4px; }
.months { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.month { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--key); color: #fff; text-align: left; }
.month img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
button.month:hover img { transform: scale(1.06); }
.month::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 65%); }
.m-name, .m-year, .month .lock { position: absolute; z-index: 1; }
.m-name { left: 8px; bottom: 19px; font-family: var(--display); font-size: 20px; line-height: 1; }
.m-year { left: 8px; bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.9; }
.month.locked img { filter: blur(9px) grayscale(1); transform: scale(1.25); }
.month .lock { top: 8px; right: 8px; width: 18px; height: 18px; }

/* ---------- Zoom out ---------- */
.zm-head { text-align: center; font-weight: 600; margin-bottom: 10px; }
.zm-frame { width: fit-content; max-width: 100%; margin: 0 auto; overflow: hidden; border-radius: 12px; border: 1.5px solid var(--line); background: var(--key); }
.zm-img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(56vh, 520px); transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.25, 1); }
.zm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.zm-choice { min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--tile); font-weight: 700; }
.zm-choice:hover:not(:disabled) { border-color: var(--ink); }
.zm-choice:disabled { cursor: default; }
.zm-choice.wrong { background: var(--key); color: var(--muted); text-decoration: line-through; }
.zm-choice.right { background: var(--pine); border-color: var(--pine); color: var(--on-accent); }

/* ---------- When was this? ---------- */
.tl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tl-card { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: var(--key); transition: transform 0.15s ease; }
.tl-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tl-card[aria-pressed="true"] { border-color: var(--gold); transform: scale(0.94); }
.tl-card.locked { border-color: var(--pine); cursor: default; }
.tl-pos { position: absolute; top: 6px; left: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.tl-card.locked .tl-pos { background: var(--pine); color: var(--on-accent); }
.tl-video { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 11px; display: grid; place-items: center; }
.tl-date { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; background: rgba(0, 0, 0, 0.65); color: #fff; font-weight: 700; font-size: 13px; text-align: center; }

/* ---------- Our year: full-screen reel ---------- */
.reel { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; overflow: hidden; }
.reel-stage { position: absolute; inset: 0; cursor: pointer; }
.reel-layer { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; opacity: 0; transition: opacity 0.8s ease; }
.reel-layer.in { opacity: 1; }
.reel-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(30px) brightness(0.5); }
.reel-fg { position: relative; width: 100%; height: 100%; object-fit: contain; }
.reel-fg.kb { transform-origin: var(--kb-x) var(--kb-y); animation: reel-kb 5s linear both; }
.reel-stage.paused .kb { animation-play-state: paused; }
@keyframes reel-kb { from { transform: scale(var(--kb-a)); } to { transform: scale(var(--kb-b)); } }
.reel-title { text-align: center; }
.reel-title span { display: block; font-family: var(--display); font-size: clamp(56px, 16vw, 140px); line-height: 0.95; }
.reel-title small { display: block; margin-top: 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.4em; color: var(--gold); }
.reel-end { position: relative; display: grid; gap: 14px; max-width: 30rem; padding: 24px; text-align: center; cursor: default; }
.reel-end h2 { font-size: clamp(32px, 8vw, 48px); }
.reel-end p { margin: 0; }
.reel-end .btn { border-color: #fff; color: #fff; }
.reel-end .btn.primary { background: #fff; color: #111; }
.reel-bar { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, 0.2); }
.reel-bar i { display: block; width: 0; height: 100%; background: var(--gold); transition: width 0.4s ease; }
.reel-month { position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.reel-btn { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff; display: grid; place-items: center; }
.reel-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.75); }
.reel-btn:disabled { opacity: 0.35; cursor: default; }
.reel-btn svg { width: 24px; height: 24px; }
.reel-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); }
.reel-controls { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 12px; }
.reel-controls[hidden], .reel-month[hidden] { display: none; }
/* Photo pop: the little print that cheers a right answer (photo-pop.js moves it) */
.pop { position: fixed; left: 0; top: 0; z-index: 45; width: min(46vw, 230px); padding: 8px 8px 0; background: #fffdf8; border-radius: 3px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2); pointer-events: none; will-change: transform; }
.pop-img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 1px; background: #e9e4da; }
.pop-cap { display: block; padding: 7px 2px 9px; font-family: var(--display); font-size: 15px; line-height: 1.1; color: #3a3530; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-tape { position: absolute; top: -11px; left: 50%; width: 42%; height: 22px; transform: translateX(-50%) rotate(-4deg); background: rgba(232, 188, 79, 0.75); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.pop-spark { position: absolute; left: 50%; top: 45%; font-size: 24px; line-height: 1; opacity: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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