/* staydank.com — one stylesheet, light and dark, phone first.
   The look: sticker tiles on warm paper. Every emoji clue sits on its own chunky,
   slightly tilted tile with an ink outline and a hard shadow, like game pieces
   tipped onto a table. Motion only ever answers the player (a wrong guess wobbles,
   a solve makes the tiles hop) and switches off under prefers-reduced-motion.
   Fonts are self-hosted from /fonts/ (SIL OFL 1.1, licences alongside). */

@font-face {
  font-family: "SD Display";
  src: url(/fonts/fredoka.woff2) format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SD Text";
  src: url(/fonts/nunito.woff2) format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fff3e2;
  --dot: #f3dcc0;
  --paper: #ffffff;
  --tile: #ffffff;
  --soft: #fbecd9;
  --ink: #26123c;
  --muted: #6c5a7f;
  --edge: #26123c;
  --shadow: #26123c;
  --accent: #ff5d38;
  --accent-ink: #26123c;
  --grape: #7440e0;
  --grape-ink: #ffffff;
  --sun: #ffd23f;
  --sun-soft: #fff1b8;
  --hint-bg: #fff1b8;
  --hint-edge: #26123c;
  --good: #1f9d5b;
  --good-bg: #cff3dd;
  --good-ink: #0d5230;
  --bad: #e03b3e;
  --bad-bg: #ffdcd6;
  --bad-ink: #93171b;
  --link: #6a32d8;
  --r: 18px;
  --r-sm: 12px;
  --display: "SD Display", "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "SD Text", "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #150c21;
    --dot: #22163a;
    --paper: #221634;
    --tile: #312249;
    --soft: #2b1d40;
    --ink: #fbf3ff;
    --muted: #bba9d2;
    --edge: #05020a;
    --shadow: #05020a;
    --accent: #ff7a4f;
    --accent-ink: #1c0c2b;
    --grape: #9c74ff;
    --grape-ink: #150c21;
    --sun: #ffd23f;
    --sun-soft: #3a2d17;
    --hint-bg: #2b1d40;
    --hint-edge: #8a7331;
    --good: #4bd98b;
    --good-bg: #133524;
    --good-ink: #8ff0b8;
    --bad: #ff6b6b;
    --bad-bg: #3b1620;
    --bad-ink: #ffb3b3;
    --link: #c3a6ff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 17px/1.55 var(--text);
  font-weight: 500;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }
strong, b { font-weight: 800; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -.005em; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--sun); color: #26123c; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0 .1rem; }
.top h1 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.top h1 a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.top h1 small { display: block; font: 600 .74rem/1.2 var(--text); color: var(--muted); letter-spacing: .01em; margin: .2rem 0 0 2.6rem; }
.logo { width: 2.1rem; height: 2.1rem; flex: none; transform: rotate(-6deg); filter: drop-shadow(2px 2px 0 var(--shadow)); }
.meta { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.25; text-align: right; }
.meta strong { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1rem; }
.meta a { text-decoration: none; }
.meta a strong, .pill {
  display: inline-block; font: 600 .95rem/1 var(--display); color: var(--accent-ink); background: var(--accent);
  border: 2px solid var(--edge); border-radius: 999px; padding: .55rem .9rem; box-shadow: 2px 2px 0 var(--shadow);
}
.topnav { display: none; }

/* ---------- buttons and fields ---------- */
button, .btn {
  font: 600 1.05rem/1.1 var(--display); letter-spacing: .01em; cursor: pointer;
  border: 2.5px solid var(--edge); border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink);
  padding: .8rem 1.2rem; min-height: 3rem;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease;
}
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover, .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
button:active, .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
button[disabled], input[disabled] { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.ghost, a.btn.ghost, button.ghost { background: var(--paper); color: var(--ink); }
input[type="text"], textarea {
  font: 600 1.1rem/1.3 var(--text); color: var(--ink); background: var(--paper);
  border: 2.5px solid var(--edge); border-radius: var(--r-sm); padding: .75rem .9rem;
  min-height: 3rem; box-shadow: inset 0 3px 0 rgba(0,0,0,.06);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; font-weight: 500; }
input[type="text"]:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--grape) 35%, transparent); border-color: var(--grape); }

/* ---------- the Daily phrase | Film night switch (and practice themes) ---------- */
.modes, .themes {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem;
  background: var(--paper); border: 2.5px solid var(--edge); border-radius: calc(var(--r) - 2px);
  padding: .3rem; margin: .55rem 0 0; box-shadow: 3px 3px 0 var(--shadow);
}
.modes button, .themes button {
  background: transparent; color: var(--ink); border: 0; box-shadow: none; border-radius: var(--r-sm);
  padding: .5rem .5rem; min-height: 2.9rem; font-size: 1.02rem; line-height: 1.15; transform: none;
}
.modes button:hover, .themes button:hover { background: var(--soft); transform: none; box-shadow: none; }
.modes button small, .themes button small { display: block; font: 700 .74rem/1.2 var(--text); color: var(--muted); margin-top: .1rem; }
.modes button small span { font-variant-numeric: tabular-nums; }
.modes button[aria-pressed="true"], .themes button[aria-pressed="true"] { background: var(--grape); color: var(--grape-ink); }
.modes button[aria-pressed="true"] small, .themes button[aria-pressed="true"] small { color: var(--grape-ink); opacity: .9; }
.modes button[aria-pressed="true"] small::before { content: "🔥 "; }

/* ---------- cards ---------- */
.card {
  background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r);
  padding: .9rem; margin: .7rem 0 1rem; box-shadow: 5px 5px 0 var(--shadow);
}
#game { position: relative; }
#game[data-mode="film"] { background-image: linear-gradient(var(--grape), var(--grape)); background-size: 100% 6px; background-repeat: no-repeat; }
#game[data-mode="film"] .tile { background: color-mix(in srgb, var(--grape) 14%, var(--tile)); }

/* ---------- the emoji clue: tiles ---------- */
.emojis {
  container-type: inline-size;
  display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; gap: .55rem;
  font-family: var(--emoji); font-size: clamp(2.3rem, 11vw, 3.4rem); line-height: 1;
  text-align: center; margin: .35rem 0 .9rem; min-height: 4.2rem;
}
.emojis[data-tiled] { font-size: 0; }
.tile {
  --rot: -3deg;
  flex: 0 1 auto; display: grid; place-items: center;
  width: calc((100% - (var(--n, 3) - 1) * .55rem) / var(--n, 3)); max-width: 5rem; aspect-ratio: 1;
  font-size: min(2.7rem, calc(52cqi / var(--n, 3)));
  background: var(--tile); border: 2.5px solid var(--edge); border-radius: 16px;
  box-shadow: 3px 4px 0 var(--shadow);
  transform: rotate(var(--rot));
}
.tile:nth-child(2n) { --rot: 2.5deg; }
.tile:nth-child(3n) { --rot: -1deg; }
.tile:nth-child(5n) { --rot: 3.5deg; }
.card.yay .tile { animation: hop .55s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i, 0) * 70ms); background: var(--good-bg); }
.card.won .tile { background: var(--good-bg); }
.card.lost .tile { background: var(--soft); }
.card.nope { animation: wobble .42s ease both; }
.card.nope .guess input { border-color: var(--bad); }
@keyframes hop {
  0% { transform: rotate(var(--rot)); }
  40% { transform: translateY(-22px) rotate(calc(var(--rot) * -3)) scale(1.08); }
  70% { transform: translateY(2px) rotate(var(--rot)) scale(.97); }
  100% { transform: rotate(var(--rot)); }
}
@keyframes wobble {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px) rotate(-.6deg); }
  40% { transform: translateX(7px) rotate(.5deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* ---------- hints ---------- */
.hints { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .45rem; }
.hints li {
  background: var(--hint-bg); border: 2px solid var(--hint-edge); border-radius: var(--r-sm);
  padding: .5rem .7rem; font-size: .96rem; line-height: 1.4; font-weight: 600;
}
.hints li b {
  display: inline-block; font: 700 .72rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  background: var(--sun); color: #26123c; border: 1.5px solid var(--edge); border-radius: 999px;
  padding: .22rem .45rem .18rem; margin-right: .45rem; vertical-align: .12em;
}
.hints li.new { animation: pop .38s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pop { from { transform: scale(.9) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the guess row ---------- */
form.guess { display: flex; gap: .5rem; }
form.guess input { flex: 1; min-width: 0; min-height: 3.35rem; }
form.guess button { min-height: 3.35rem; padding: .7rem 1.15rem; }
.statusrow { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .55rem 0 0; }
.status { min-height: 1.4em; margin: .55rem 0 0; font-size: .92rem; font-weight: 700; color: var(--muted); }
.statusrow .status { margin: 0; }
.pips { display: flex; gap: .3rem; flex: none; }
.pips i { width: .95rem; height: .95rem; border-radius: 5px; border: 2px solid var(--edge); background: var(--paper); }
.pips i.wrong { background: var(--bad); }
.pips i.right { background: var(--good); }
.card.nope .status { color: var(--bad-ink); }
.guesses { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.guesses:empty { margin: 0; }
.guesses li { border-radius: 999px; padding: .3rem .8rem; font-size: .92rem; font-weight: 700; border: 2px solid currentColor; max-width: 100%; overflow-wrap: anywhere; }
.guesses li.wrong { background: var(--bad-bg); color: var(--bad-ink); text-decoration: line-through; text-decoration-thickness: 2px; }
.guesses li.right { background: var(--good-bg); color: var(--good-ink); }

/* ---------- the result ---------- */
.result { position: relative; }
.result.reveal { animation: rise .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes rise { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.result h2 { margin: 0 0 .3rem; font-size: 1.9rem; font-weight: 700; color: var(--good); }
.result.lost-result h2 { color: var(--accent); }
.answer { font-size: 1.05rem; margin: .1rem 0 .8rem; color: var(--muted); font-weight: 700; }
.answer strong {
  display: block; font: 700 1.55rem/1.15 var(--display); color: var(--ink); margin-top: .15rem;
}
.explain { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.explain li {
  display: inline-flex; gap: .45rem; align-items: center; background: var(--soft); border: 2px solid var(--edge);
  border-radius: 999px; padding: .15rem .8rem .15rem .2rem; font-weight: 700; font-size: .95rem;
}
.explain .e { font-family: var(--emoji); font-size: 1.35rem; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; background: var(--tile); border-radius: 999px; flex: none; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
#share-btn { font-size: 1.15rem; padding: .85rem 1.5rem; }
#share-btn::before { content: "↗ "; }
#share-status { font-weight: 700; color: var(--good-ink); }
.share-text {
  position: relative; background: var(--grape); color: var(--grape-ink);
  border: 2.5px solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--shadow);
  padding: .9rem 1.1rem; margin: .8rem 0; font: 600 1.05rem/1.55 var(--display);
  white-space: pre-wrap; overflow-wrap: anywhere;
  background-image: radial-gradient(circle at 0 50%, var(--paper) 9px, transparent 10px), radial-gradient(circle at 100% 50%, var(--paper) 9px, transparent 10px);
}
.share-text::first-line { font-size: 1.2rem; font-weight: 700; }
.prose .share-text { background-image: radial-gradient(circle at 0 50%, var(--bg) 9px, transparent 10px), radial-gradient(circle at 100% 50%, var(--bg) 9px, transparent 10px); }
.make-own, .play-more, .archive-done { background: var(--soft); border: 2px dashed color-mix(in srgb, var(--edge) 45%, transparent); border-radius: var(--r-sm); padding: .65rem .85rem; font-size: .95rem; }
.play-more a, .make-own a { font-weight: 800; }
.countdown { font: 700 1.25rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }
#reset-local { color: var(--muted); font-size: .88rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .6rem 0; text-align: center; }
.stats div { background: var(--soft); border: 2px solid var(--edge); border-radius: var(--r-sm); padding: .5rem .2rem .4rem; }
.stats b { display: block; font: 700 1.6rem/1.1 var(--display); }
.stats span { font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.1; display: block; }
.dist { display: grid; gap: .3rem; margin: .4rem 0 .2rem; }
.dist div { display: flex; align-items: center; gap: .5rem; font: 600 .9rem/1 var(--display); }
.dist div > span { width: .8rem; text-align: center; color: var(--muted); }
.dist i { font-style: normal; background: var(--muted); color: var(--paper); border-radius: 7px; padding: .2rem .5rem; min-width: 1.8rem; text-align: right; font-weight: 700; }
.dist i.today { background: var(--good); color: #fff; }
.result h3 { font-size: 1.15rem; margin: 1.2rem 0 .3rem; }

/* ---------- how-to-play card on the front page, prose pages ---------- */
.how { margin: .7rem 0 1rem; }
.side .how { background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r); padding: .9rem 1.1rem; box-shadow: 5px 5px 0 var(--shadow); font-size: .95rem; }
.how h2, .prose h2 { font-size: 1.45rem; margin: 1.6rem 0 .5rem; }
.side .how h2 { margin-top: .2rem; }
.how ul, .prose ul, .prose ol { padding-left: 1.2rem; }
.how li, .prose li { margin: .3rem 0; }
.how li::marker, .prose li::marker { color: var(--accent); }
.prose h3 { font-size: 1.15rem; margin: 1rem 0 .35rem; }
.prose code { background: var(--soft); border: 1.5px solid color-mix(in srgb, var(--edge) 30%, transparent); border-radius: 7px; padding: .03rem .35rem; font-size: .92em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.prose > p, .prose > ul { max-width: 68ch; }
.lede { font-size: 1.12rem; font-weight: 600; }
.prose h2.page-title, h2.page-title, .page-title { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 700; margin: .9rem 0 .5rem; line-height: 1.05; }
.page-title .mark { display: inline-block; background: var(--sun); color: #26123c; border: 2.5px solid var(--edge); border-radius: 14px; padding: 0 .3em; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--shadow); }
.tablewrap { overflow-x: auto; background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r); box-shadow: 4px 4px 0 var(--shadow); margin: .6rem 0; }
table.rules { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.rules th, table.rules td { text-align: left; padding: .5rem .65rem; border-bottom: 1.5px solid var(--soft); vertical-align: top; }
table.rules tr:last-child td { border-bottom: 0; }
table.rules th { color: var(--muted); font: 600 .82rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .05em; background: var(--soft); }
table.rules td:nth-child(2), table.rules td:nth-child(3) { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; }
.steps { list-style: none; padding: 0 !important; display: grid; gap: .45rem; }
.steps li { background: var(--soft); border-radius: var(--r-sm); padding: .55rem .75rem; }
.verdict-no { color: var(--bad); font-weight: 800; }
.verdict-yes { color: var(--good); font-weight: 800; }
#try-result { min-height: 1.4em; margin: .55rem 0 0; font-size: .95rem; font-weight: 700; }
.doc .card .emojis { margin: .6rem 0; }

/* table of contents on /how-to-play/ */
.toc { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a { display: block; padding: .35rem .7rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .93rem; }
.toc a:hover { background: var(--soft); }
.toc p { font: 600 .78rem/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .5rem .7rem; }

/* ---------- archive ---------- */
.banner {
  background: var(--hint-bg); border: 2px solid var(--hint-edge); border-radius: var(--r-sm);
  padding: .55rem .8rem; margin: .6rem 0 0; font-size: .9rem; line-height: 1.4;
}
.banner strong { display: block; }
.jump { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.jump a { text-decoration: none; }
.archive-list, .prose .archive-list { list-style: none; padding: 0; margin: .6rem 0 1.2rem; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.archive-list a {
  display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r-sm); padding: .6rem .75rem;
  box-shadow: 3px 3px 0 var(--shadow); transition: transform .08s ease, box-shadow .08s ease; height: 100%;
}
.archive-list a:hover, .archive-list a:focus-visible { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--shadow); }
.archive-list .e { font-family: var(--emoji); font-size: 1.45rem; flex: none; min-width: 5rem; letter-spacing: .04em; }
.archive-list .d { flex: 1; min-width: 0; line-height: 1.25; font: 600 1.05rem/1.2 var(--display); }
.archive-list .d small { display: block; color: var(--muted); font: 600 .8rem/1.3 var(--text); margin-top: .15rem; }
.archive-list .s { flex: none; font: 600 .78rem/1 var(--display); border-radius: 999px; padding: .35rem .6rem; background: var(--soft); color: var(--muted); border: 1.5px solid currentColor; }
.archive-list .s.won { background: var(--good-bg); color: var(--good-ink); }
.archive-list .s.lost { background: var(--bad-bg); color: var(--bad-ink); }
#archive-summary, #film-summary { font-weight: 700; color: var(--muted); }

/* ---------- /make/ ---------- */
.maker label { display: block; margin: 1.05rem 0 .35rem; }
.maker label b { font: 600 1.08rem/1.2 var(--display); }
.maker label small { color: var(--muted); font-weight: 600; }
.maker input[type="text"], .maker textarea { width: 100%; }
.maker textarea { resize: vertical; min-height: 3.4rem; }
.maker .row { display: flex; gap: .5rem; }
.maker .row input { flex: 1; min-width: 0; }
.maker .row button { flex: none; width: 3.4rem; padding: 0; font-size: 1.3rem; }
.maker #m-make { width: 100%; margin-top: .5rem; font-size: 1.2rem; min-height: 3.5rem; }
.maker #m-out { margin-top: .8rem; background: var(--good-bg); border: 2.5px solid var(--edge); border-radius: var(--r); padding: .2rem .9rem .8rem; }
.maker #m-out label { margin-top: .7rem; }
.maker #m-link { font: 600 .85rem/1.3 ui-monospace, Menlo, Consolas, monospace; }
.maker .share-row { margin-top: .6rem; }
.maker #m-preview { min-height: 4.2rem; margin-bottom: .3rem; }
#m-count { text-align: center; margin-top: 0; }
.picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: .3rem; margin: .6rem 0 0; }
.picker button {
  background: var(--soft); color: var(--ink); padding: 0; min-height: 2.7rem; border-radius: 10px; border-width: 2px;
  box-shadow: 2px 2px 0 var(--shadow); font: 400 1.4rem/1 var(--emoji);
}
.error { min-height: 1.2em; margin: .6rem 0 .2rem; color: var(--bad); font-weight: 800; font-size: .95rem; }
.error:empty { margin: 0; }
.small-print { color: var(--muted); font-size: .88rem; }
html.has-hash #maker { display: none; }

/* ---------- /practice/ ---------- */
.themes { display: flex; flex-wrap: wrap; gap: .3rem; }
.themes button { flex: 0 0 auto; min-height: 2.75rem; padding: .35rem .75rem; font-size: .95rem; white-space: nowrap; }
@media (max-width: 559px) {
  .themes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding: .3rem; }
  .themes::-webkit-scrollbar { display: none; }
}
.themes button small { display: inline; margin: 0 0 0 .3rem; font-size: .72rem; }

/* ---------- 404 ---------- */
.lost-page { text-align: center; padding: 3rem 0 2rem; }
.lost-page .emojis { max-width: 22rem; margin: 0 auto 1.4rem; }
.lost-page h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); margin: 0 0 .5rem; }
.lost-page p { font-size: 1.1rem; }
.lost-page .btn { margin-top: .6rem; }

/* ---------- footer ---------- */
footer { color: var(--muted); font-size: .9rem; padding: 1.2rem 0 2.5rem; border-top: 2px dashed color-mix(in srgb, var(--edge) 25%, transparent); margin-top: 1.5rem; }
footer p { margin: .5rem 0 0; }
.links { font-weight: 700; }
.links a { white-space: nowrap; color: var(--ink); text-decoration: none; display: inline-block; padding: .35rem 0; }
.links a:hover { color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- bigger screens ---------- */
@media (min-width: 560px) {
  .card { padding: 1.2rem 1.4rem; }
  .picker { grid-template-columns: repeat(12, 1fr); }
}
@media (min-width: 760px) {
  .wrap { padding: 0 1.5rem; }
  .top { padding: 1.1rem 0 .4rem; }
  .top h1 { font-size: 1.75rem; }
  .top h1 small { margin-left: 3.1rem; font-size: .8rem; }
  .logo { width: 2.6rem; height: 2.6rem; }
  .topnav { display: flex; gap: .2rem; margin-left: auto; margin-right: .4rem; }
  .topnav a { font: 600 1rem/1 var(--display); color: var(--ink); text-decoration: none; padding: .6rem .75rem; border-radius: 999px; }
  .topnav a:hover { background: var(--paper); box-shadow: inset 0 0 0 2px var(--edge); }
  .topnav a[aria-current="page"] { background: var(--paper); box-shadow: inset 0 0 0 2px var(--edge); }
  .emojis { gap: .8rem; }
  .tile { max-width: 7.4rem; border-radius: 22px; border-width: 3px; box-shadow: 5px 6px 0 var(--shadow); font-size: min(4.3rem, calc(52cqi / var(--n, 3))); }
}
@media (min-width: 980px) {
  /* game pages: the board on the left, the result and the rules beside it */
  .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); gap: 2rem; align-items: start; margin-top: .6rem; }
  .stage .card, .stage .how { margin-top: 0; }
  .play .card { margin-top: 1rem; padding: 1.6rem 2rem 1.8rem; }
  .play .emojis { margin: .8rem 0 1.4rem; min-height: 6.5rem; }
  .play .modes { margin-top: 0; }
  .side { display: grid; gap: 1.2rem; }
  .side .card { margin: 0; }
  .doc { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .toc { display: block; position: sticky; top: 1rem; margin-top: 1.4rem; background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r); padding: .9rem .5rem; box-shadow: 4px 4px 0 var(--shadow); }
  .make-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
  .make-stage .how { background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r); padding: .6rem 1.3rem 1rem; box-shadow: 5px 5px 0 var(--shadow); font-size: .95rem; }
  .make-stage .how h2 { font-size: 1.25rem; margin-top: 1.1rem; }
}

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

/* small fixes */
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
#try-form { margin-top: .8rem; }
.more { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.more a {
  display: grid; justify-items: start; gap: .1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r-sm); padding: .6rem .65rem;
  box-shadow: 3px 3px 0 var(--shadow); transition: transform .08s ease, box-shadow .08s ease;
}
.more a:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--shadow); }
.more-e { font: 1.5rem/1 var(--emoji); }
@media (max-width: 559px) { .more a { justify-items: center; text-align: center; padding: .55rem .3rem; } .more b { font-size: .9rem; } .more small { display: none; } }
.more b { font: 600 .98rem/1.15 var(--display); margin-top: .25rem; }
.more small { color: var(--muted); font-size: .78rem; font-weight: 700; line-height: 1.2; }
@media (min-width: 980px) { .more { gap: 1rem; } .more a { padding: 1rem 1.1rem; } .more b { font-size: 1.15rem; } .more small { font-size: .88rem; } .more-e { font-size: 2rem; } }

/* archive: the two lists side by side on wide screens */
.archive-cols { display: grid; gap: 0 2rem; }
.archive-cols h2 { margin-top: 1.2rem; }
.archive-cols .archive-list { grid-template-columns: 1fr; }
@media (min-width: 980px) {
  .archive-cols { grid-template-columns: 1fr 1fr; }
  .archive-cols > section { background: var(--paper); border: 2.5px solid var(--edge); border-radius: var(--r); padding: .2rem 1.3rem 1rem; box-shadow: 5px 5px 0 var(--shadow); }
  .archive-cols .archive-list a { background: var(--bg); }
  .archive-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
}
@media (max-width: 559px) {
  .themes { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
