:root {
  --bg: #fff7e8;
  --paper: #ffffff;
  --ink: #2a2140;
  --muted: #6d6485;
  --line: #2a2140;
  --tomato: #ff6b4a;
  --sun: #ffc23d;
  --mint: #34c98b;
  --sky: #4aa8ff;
  --grape: #8a5cf6;
  --pink: #ff7eb6;
  --cast: var(--line);
  --field-line: var(--line);
  --headline-edge: none;
  --soft: #4a4262;
  --on-accent: #2a2140;
  --on-ink: #fff;
  --on-ink-soft: #ffffffb0;
  --dot: #00000010;
  --hover: #0000000a;
  --dash: #2a214030;
  --dash-faint: #2a214020;
  --thumb: #eee;
  --pick: #f3efe6;
  --glass: #ffffffe6;
  --field: #fffdf8;
  --field-focus: #fff;
  --tag: #f2ecff;
  --tag-line: #d9ccff;
  --tag-age: #fff1c9;
  --tag-age-line: #ffd96b;
  --tag-feat: #e2f8ee;
  --tag-feat-line: #9ee6c4;
  --heart: #d6336c;
  --ok: #148a5a;
  --warn: #b8471f;
  --err: #ffe3dc;
  --err-ink: #8f2c12;
  --snippet: #2a2140;
  --backdrop: #2a2140a6;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--cast);
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Varela Round', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* theme.js sets data-theme. the accent colors stay the same in both */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1530;
  --paper: #262040;
  --ink: #f5f0ff;
  --muted: #b1a7cc;
  --line: #453a6b;
  --cast: #00000090;
  --field-line: #7468a3;
  /* keeps light letters readable where they dip into the yellow highlight below */
  --headline-edge: .04em .04em 0 #0f0b20, -.02em .02em 0 #0f0b20, .02em -.02em 0 #0f0b20, -.02em -.02em 0 #0f0b20;
  --soft: #d3cbe8;
  --on-ink: #1a1530;
  --on-ink-soft: #1a1530b0;
  --dot: #ffffff12;
  --hover: #ffffff14;
  --dash: #ffffff30;
  --dash-faint: #ffffff20;
  --thumb: #3a3358;
  --pick: #3a3358;
  --glass: #262040e6;
  --field: #1f1936;
  --field-focus: #2c2549;
  --tag: #3a2f63;
  --tag-line: #6a58a8;
  --tag-age: #4a3a12;
  --tag-age-line: #92742a;
  --tag-feat: #143f30;
  --tag-feat-line: #2f8263;
  --heart: #ff7eb6;
  --ok: #5fdcaa;
  --warn: #ffa585;
  --err: #4a1f1c;
  --err-ink: #ffc9bb;
  --snippet: #120e22;
  --backdrop: #000000b0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 22px 22px;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; font-size: 1.45rem; letter-spacing: -0.02em; }
.logo .mark { width: 40px; height: 40px; }
.top nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.top nav a.plain { text-decoration: none; font-weight: 700; padding: 8px 10px; border-radius: 10px; }
.top nav a.plain:hover { background: var(--hover); }
.theme-toggle { flex: none; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; font-size: 1.15rem; cursor: pointer; }
.theme-toggle:hover { background: var(--hover); }
.theme-toggle::before { content: '🌙'; }
:root[data-theme="dark"] .theme-toggle::before { content: '☀️'; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2.5px solid var(--line); border-radius: 14px; background: var(--paper);
  padding: 10px 16px; font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--cast); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--cast); }
.btn.go { background: var(--sun); color: var(--on-accent); }
.btn.mint { background: var(--mint); color: #fff; }
.btn.big { font-size: 1.15rem; padding: 14px 22px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* hero */
.hero { padding: 26px 0 8px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.02; margin: 0 0 14px; letter-spacing: -0.03em; font-weight: 900; }
/* the highlight paints behind the text, so the g's and commas of the line above stay on top */
.hero h1 { isolation: isolate; text-shadow: var(--headline-edge); }
.hero h1 .hl { position: relative; z-index: -1; background: var(--sun); color: var(--on-accent); text-shadow: none; padding: 0 .18em; border-radius: 10px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero p { font-size: 1.15rem; color: var(--muted); margin: 0 0 18px; max-width: 34em; }
.promises { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.promises li { border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .9rem; background: var(--paper); }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(100%, 400px); height: auto; transform: rotate(-5deg); } /* 400 is 4px per art pixel */
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* filters */
.filters { margin: 22px 0 14px; display: grid; gap: 10px; }
.row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.row .label { font-weight: 900; align-self: center; min-width: 64px; color: var(--muted); font-size: .85rem; text-transform: lowercase; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 2.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 7px 14px; font-weight: 800; cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform .08s;
}
.chip:hover { transform: translateY(-1px); }
.chip small { font-weight: 700; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chip[aria-pressed="true"] small { color: var(--on-ink-soft); }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.searchbar input {
  flex: 1 1 180px; border: 2.5px solid var(--field-line); border-radius: 14px; padding: 11px 14px; background: var(--paper);
  font-weight: 700; outline: none; min-width: 0;
}
.searchbar input:focus { box-shadow: var(--shadow); }
.searchbar select { border: 2.5px solid var(--field-line); border-radius: 14px; padding: 11px 10px; background: var(--paper); font-weight: 800; }

/* grid */
.count { color: var(--muted); font-weight: 800; margin: 4px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; padding-bottom: 60px; }
.card {
  position: relative; background: var(--paper); border: 2.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translate(-2px, -3px) rotate(-.4deg); box-shadow: 7px 8px 0 var(--cast); }
.card a.cover { text-decoration: none; display: block; }
.thumb { aspect-ratio: 1.91 / 1; border-bottom: 2.5px solid var(--line); background: var(--thumb); position: relative; overflow: hidden; }
.thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.4rem; }
.badge-featured { position: absolute; top: 10px; left: 10px; background: var(--sun); color: var(--on-accent); border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: .78rem; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 1.12rem; line-height: 1.2; font-weight: 900; }
.card .by { color: var(--muted); font-weight: 700; font-size: .9rem; }
.card .by a { text-decoration: none; border-bottom: 1.5px dotted; }
.card .desc { margin: 0; font-size: .92rem; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.tag { font-size: .78rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--tag); border: 1.5px solid var(--tag-line); }
.tag.age { background: var(--tag-age); border-color: var(--tag-age-line); }
.tag.feat { background: var(--tag-feat); border-color: var(--tag-feat-line); }
.card .more { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line); background: var(--glass); cursor: pointer; font-weight: 900; opacity: 0; transition: opacity .15s; z-index: 4; }
.card:hover .more, .card .more:focus { opacity: 1; }
@media (hover: none) { .card .more { opacity: 1; } }
.card .more.fav { right: 46px; font-size: 1.05rem; color: var(--heart); }
.card .more.fav[aria-pressed="true"] { opacity: 1; }
.card .more.edit { right: 84px; opacity: 1; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: .9rem; }
.menu { position: absolute; top: 44px; right: 8px; background: var(--paper); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; z-index: 5; display: grid; }
.menu button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.menu button:hover { background: var(--hover); }

.empty { text-align: center; padding: 50px 10px; color: var(--muted); font-weight: 800; grid-column: 1 / -1; }
.empty .big { font-size: 3rem; }

footer { border-top: 2.5px dashed var(--dash); padding: 26px 0 50px; color: var(--muted); font-weight: 700; font-size: .92rem; }
footer a { font-weight: 800; }

/* forms */
.panel { background: var(--paper); border: 2.5px solid var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--cast); padding: 24px; margin: 10px 0 30px; }
.narrow { max-width: 760px; margin: 0 auto; }
.step { margin: 0 0 26px; }
.step h2 { font-size: 1.25rem; margin: 0 0 4px; font-weight: 900; display: flex; gap: 10px; align-items: center; }
.step h2 .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grape); color: #fff; font-size: .95rem; flex: none; }
.step .hint { color: var(--muted); margin: 0 0 12px; font-weight: 600; font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field { width: 100%; border: 2.5px solid var(--field-line); border-radius: 14px; padding: 12px 14px; background: var(--field); font-weight: 700; outline: none; }
.field:focus { box-shadow: var(--shadow); background: var(--field-focus); }
textarea.field { resize: vertical; min-height: 80px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .pair { grid-template-columns: 1fr; } .panel { padding: 18px; } }
.linkrow { display: flex; gap: 10px; }
.linkrow .field { flex: 1; min-width: 0; }
.preview { margin-top: 14px; display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.preview .thumb { border: 2.5px solid var(--line); border-radius: 14px; }
.preview .ok { color: var(--ok); font-weight: 900; }
.preview .warn { color: var(--warn); font-weight: 800; }
@media (max-width: 600px) { .preview { grid-template-columns: 1fr; } }
pre.snippet { background: var(--snippet); color: #ffe9a8; padding: 12px; border-radius: 12px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; word-break: break-all; }
.err { background: var(--err); border: 2px solid var(--tomato); color: var(--err-ink); border-radius: 12px; padding: 10px 14px; font-weight: 800; margin: 10px 0; }
.success { text-align: center; }
.success .big { font-size: 4rem; }
.keybox { display: flex; gap: 8px; margin: 12px 0; }
.keybox input { flex: 1; min-width: 0; font-size: .85rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

.prose { font-size: 1.08rem; }
.prose h2 { margin-top: 1.6em; }
.prose code { background: var(--tag); padding: 1px 6px; border-radius: 6px; }
.mine { margin-top: 10px; }
.mine a { font-weight: 800; }
.logo { white-space: nowrap; flex: none; }
/* the toggle takes up the room these words had beside the logo on a phone */
@media (max-width: 640px) { .top .cta-more { display: none; } }
@media (max-width: 560px) {
  .logo { font-size: 1.2rem; } .logo .mark { width: 32px; height: 32px; }
  .top nav a.btn { padding: 8px 12px; font-size: .9rem; white-space: nowrap; }
  .top nav a.plain { display: none; }
  /* a person icon here: the words don't fit beside the logo. screen readers still get the words */
  .top nav a#nav-account { display: block; padding: 6px 2px; font-size: 0; }
  .top nav a#nav-account::before { content: '👤'; font-size: 1.15rem; }
  .top nav { gap: 4px; }
}
@media (max-width: 350px) {
  .logo { font-size: 1.05rem; gap: 4px; } .logo .mark { width: 26px; height: 26px; }
  .top nav a.btn { padding: 7px 8px; font-size: .78rem; }
}

/* thumbnail picker (submit) */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pick {
  position: relative; aspect-ratio: 1.91 / 1; border: 2.5px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--pick); cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 1.6rem;
  transition: transform .08s;
}
.pick:hover { transform: translateY(-1px); }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick .ph { font-size: 1.8rem; }
.pick-label { position: absolute; left: 4px; bottom: 4px; background: var(--glass); border-radius: 999px; padding: 0 7px; font-size: .72rem; font-weight: 800; }
.pick.action { background: var(--paper); border-style: dashed; align-content: center; gap: 2px; }
.pick.action .pick-label { position: static; background: none; }
.pick[aria-pressed="true"] { outline: 4px solid var(--grape); outline-offset: 2px; }
details.hint summary { cursor: pointer; font-weight: 800; }

/* sponsor cards (shelf) */
.card.sponsor .thumb { background: var(--pick); }
.badge-sponsor { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: .74rem; }
.card.sponsor .buy { font-size: .78rem; font-weight: 800; color: var(--muted); text-decoration: none; margin-top: auto; padding-top: 6px; }
.card.sponsor .buy:hover { text-decoration: underline; }
.adbuild { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.adbuild .pick { width: 100%; }
@media (max-width: 680px) { .adbuild { grid-template-columns: 1fr; } }

/* headings are Title Case in the html (for search engines and screen readers) and shown lowercase */
h1, h2, h3, .logo { text-transform: lowercase; }
/* a game's or sponsor's own name keeps the capitals its maker gave it */
.card h3 { text-transform: none; }

/* "wait, i can make my own?" */
.pitch { max-width: 860px; margin: 10px auto 0; padding: 40px 0 10px; border-top: 2.5px dashed var(--dash); }
.chat { display: flex; flex-direction: column; gap: 14px; }
.say { max-width: 82%; border: 2.5px solid var(--line); border-radius: 22px; padding: 14px 20px; box-shadow: var(--shadow); }
.say p { margin: 0; font-size: 1.15rem; }
.say h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.1; font-weight: 900; letter-spacing: -.02em; }
.say.them { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 6px; }
.say.us { align-self: flex-end; background: var(--sun); color: var(--on-accent); border-bottom-right-radius: 6px; }
.steps { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { background: var(--paper); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.steps .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grape); color: #fff; font-weight: 900; }
.steps h3 { margin: 10px 0 4px; font-size: 1.25rem; font-weight: 900; }
.steps p { margin: 0; color: var(--soft); }
.rules { text-align: center; font-size: 1.15rem; font-weight: 700; margin: 30px auto 16px; max-width: 34em; }
.cta { text-align: center; margin: 0; }
/* drawn, not typed: the ＋ character falls back to a stray glyph in fonts that don't have it */
.plus { display: inline-block; width: .72em; height: .72em; margin-right: .38em; vertical-align: -.04em; background: linear-gradient(currentColor, currentColor) center / 100% .22em no-repeat, linear-gradient(currentColor, currentColor) center / .22em 100% no-repeat; }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } .say { max-width: 94%; } }

.faq { max-width: 860px; margin: 0 auto; padding: 46px 0 60px; }
.faq > h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 900; letter-spacing: -.02em; margin: 0 0 16px; }
.faq details { background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px; margin: 0 0 12px; }
.faq summary { cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; margin-left: auto; font-weight: 900; }
.faq details[open] summary::after { content: '\2212'; }
.faq summary h3 { margin: 0; font-size: 1.12rem; font-weight: 900; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--soft); font-size: 1.05rem; }

/* promises are facts, not buttons: plain text with no outline */
.promises { gap: 4px 20px; }
.promises li { border: 0; background: none; padding: 0; border-radius: 0; font-size: 1rem; color: var(--ink); }

/* chip rows fade out at the edge while there's more to scroll to (browse.js sets the classes) */
.row { --l: 0px; --r: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--l), #000 calc(100% - var(--r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--l), #000 calc(100% - var(--r)), transparent 100%); }
.row.more-l { --l: 48px; }
.row.more-r { --r: 72px; }

/* small on purpose: for actions nobody should tap by accident */
.textlink { background: none; border: 0; padding: 6px 2px; color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.textlink:hover { color: var(--ink, #2a2140); }
.quiet-end { margin: 28px 0 0; text-align: center; }
.delete-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 16px; }

/* a game's own page (/games/<slug>), also shown in the shelf's dialog */
.gp-sheet { background: var(--paper); border: 2.5px solid var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--cast); margin: 10px 0 40px; }
.game-page { padding: 24px; }
.gp-crumbs { color: var(--muted); font-weight: 700; font-size: .9rem; margin: 0 0 14px; }
.gp-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.gp-hero { display: block; }
.gp-hero .thumb { border: 2.5px solid var(--line); border-radius: var(--radius); }
.game-page h1 { text-transform: none; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.02em; font-weight: 900; margin: 0 0 6px; }
.gp-by { color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.gp-lede { font-size: 1.1rem; margin: 0 0 14px; color: var(--soft); }
.gp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gp-actions .gp-play { flex: 1 1 100%; }
.gp-actions .btn:not(.gp-play) { flex: 1 1 0; white-space: nowrap; padding: 8px 12px; font-size: .95rem; }
.gp-fav[aria-pressed="true"] { color: var(--heart); }
.gp-main { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; margin-top: 26px; }
.gp-main.only-facts { grid-template-columns: 1fr; }
.gp-text { font-size: 1.05rem; min-width: 0; }
.gp-text section + section { margin-top: 22px; }
.gp-text h2, .gp-related h2 { font-size: 1.4rem; font-weight: 900; margin: 0 0 8px; }
.gp-text p { margin: 0 0 12px; }
.gp-text ul { margin: 0; padding-left: 1.2em; display: grid; gap: 7px; }
.gp-facts { margin: 0; border: 2.5px solid var(--line); border-radius: 16px; background: var(--field); padding: 6px 16px; }
.gp-facts div { padding: 9px 0; border-bottom: 2px dashed var(--dash-faint); }
.gp-facts div:last-child { border-bottom: 0; }
.gp-facts dt { font-weight: 900; font-size: .8rem; color: var(--muted); }
.gp-facts dd { margin: 0; font-weight: 700; font-size: .95rem; }
.gp-faq { padding: 30px 0 6px; max-width: none; }
.gp-faq > h2 { font-size: 1.4rem; }
.gp-again { margin: 16px 0 6px; }
.gp-related { margin-top: 30px; }
.gp-related-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gp-rel { text-decoration: none; font-weight: 800; display: grid; gap: 6px; line-height: 1.2; }
.gp-rel .thumb { display: block; border: 2.5px solid var(--line); border-radius: 12px; }
.gp-rel:hover b { text-decoration: underline; }
@media (max-width: 760px) {
  .game-page { padding: 16px; }
  .gp-top, .gp-main { grid-template-columns: 1fr; }
  .gp-related-list { grid-template-columns: repeat(2, 1fr); }
}

/* the dialog over the shelf. it pops open; on a phone it takes the whole screen */
html:has(.game-modal[open]) { overflow: hidden; }
.game-modal { width: min(980px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; color: inherit; background: var(--paper); border: 2.5px solid var(--line); border-radius: 22px; box-shadow: 8px 8px 0 var(--cast); overflow-y: auto; overscroll-behavior: contain; }
.game-modal::backdrop { background: var(--backdrop); }
.game-modal[open] { animation: gm-pop .18s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes gm-pop { from { transform: scale(.94) translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .game-modal[open] { animation: none; } }
/* takes up no room in the flow (the negative margin), so the page under it keeps its full width */
.gm-close { position: sticky; top: 8px; display: block; margin: 8px 8px -48px auto; z-index: 3; width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--paper); font-weight: 900; cursor: pointer; }
.gm-close:hover { background: var(--sun); color: var(--on-accent); }
.gm-wait { min-height: 50vh; display: grid; place-items: center; }
.game-modal .gp-crumbs { padding-right: 52px; }
@media (max-width: 600px) {
  .game-modal { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* "want to make a game?" */
.make-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; text-decoration: none; font-weight: 700; color: var(--muted); }
.make-card b { color: var(--ink); font-size: 1.25rem; font-weight: 900; text-transform: lowercase; }
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.bubble { max-width: 85%; padding: 10px 14px; border: 2.5px solid var(--line); border-radius: 16px; font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.ai { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--sun); color: #2a2140; border-bottom-right-radius: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea.field { flex: 1; min-width: 0; min-height: 52px; height: 52px; resize: none; }
.composer .btn { min-height: 52px; flex: none; }
.mic { width: 56px; padding: 0; font-size: 1.4rem; }
.mic.on { background: var(--tomato); animation: mic-pulse 1s infinite; }
@keyframes mic-pulse { 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.mic-status { min-height: 1.4em; margin: 8px 0 0; color: var(--muted); font-weight: 700; font-size: .95rem; }
.brief { border: 2.5px solid var(--line); border-radius: 16px; background: var(--paper); padding: 16px; margin: 0 0 16px; }
.brief h2 { margin: 0 0 8px; font-weight: 900; text-transform: none; }
.brief p { margin: 8px 0 0; overflow-wrap: anywhere; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; margin: 14px 0; }
.agree input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--grape); }
.idea-row { padding: 16px 0; border-top: 2px dashed var(--dash); }
.idea-row p { margin: 6px 0; }
.idea-row .meta { color: var(--muted); font-weight: 700; font-size: .9rem; }
.idea-row .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* the about page: the game-page layout, plus a picture collage and the learning loop */
.about-hero { position: relative; aspect-ratio: 1200 / 700; }
.about-hero img { position: absolute; width: 62%; height: auto; border: 2.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.about-hero .one { left: 0; top: 4%; transform: rotate(-4deg); }
.about-hero .two { right: 0; top: 0; transform: rotate(3deg); }
.about-hero .three { left: 19%; bottom: 0; transform: rotate(-1deg); }
.about-learn, .about-made { margin-top: 30px; }
.about-learn h2, .about-made h2 { font-size: 1.4rem; font-weight: 900; margin: 0 0 4px; }
.about-sub { color: var(--soft); font-size: 1.05rem; margin: 0 0 16px; }
.about-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.about-steps li { border: 2.5px solid var(--line); border-radius: 16px; background: var(--field); overflow: hidden; }
.about-steps .art { display: grid; place-items: center; padding: 16px; border-bottom: 2.5px solid var(--line); }
.about-steps .art svg { width: 72px; height: 72px; display: block; }
.about-steps .sun { background: var(--sun); }
.about-steps .sky { background: var(--sky); }
.about-steps .mint { background: var(--mint); }
.about-steps .pink { background: var(--pink); }
.about-steps h3 { font-size: 1.05rem; font-weight: 900; margin: 12px 14px 4px; }
.about-steps p { margin: 0 14px 14px; font-size: .97rem; }
.about-note { color: var(--muted); font-weight: 700; font-size: .95rem; margin: 14px 0 0; }
.about-games { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.about-games .gp-rel { align-content: start; }
.about-games small { color: var(--muted); font-weight: 700; font-size: .88rem; }
@media (max-width: 900px) {
  .about-steps { grid-template-columns: repeat(2, 1fr); }
  .about-games { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .about-steps { grid-template-columns: 1fr; }
  .about-games { grid-template-columns: repeat(2, 1fr); }
}

/* the hidden attribute always wins, even over .btn and friends */
[hidden] { display: none !important; }

/* plain links to every game, under the shelf */
.all-games { margin-top: 32px; margin-bottom: 24px; }
.all-games h2 { font-size: 20px; margin: 0 0 8px; }
.all-games ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

.all-games h2 + ul { margin-bottom: 14px; }
/* a page for each subject and age */
.gp-sheet > h1 { margin: 0 0 8px; text-transform: none; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.02em; font-weight: 900; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.cat-card { align-content: start; }
.cat-by { color: var(--muted); font-weight: 700; font-size: .9rem; }
.cat-desc { color: var(--soft); font-weight: 400; font-size: .95rem; line-height: 1.35; }
.cat-more { margin-top: 30px; }
.cat-more h2 { font-size: 1.1rem; margin: 14px 0 6px; }
.cat-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
/* traffic on the admin page */
.tr { display: grid; gap: 4px; }
.tr-row { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 3px 8px; font-size: .9rem; }
.tr-bar { position: absolute; inset: 0 auto 0 0; background: var(--thumb); border-radius: 4px; z-index: 0; }
.tr-name, .tr-row b { position: relative; z-index: 1; }
main.gp-sheet:has(> .cat-grid) { padding: clamp(18px, 3vw, 32px); }
