/* RBXCodesHQ: a small, warm, paper-like blog. Lists and rules, not cards. */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/fraunces-600.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 500; font-display: swap; src: url(/fonts/fraunces-500-italic.woff2) format('woff2'); }
@font-face {
  font-family: 'Jakarta'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/jakarta-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #faf6ee;
  --raised: #fffdf8;
  --tint: #f2ebde;
  --ink: #231e18;
  --muted: #655b4e;
  --rule: #e2d8c7;
  --line: #8f806b;
  --accent: #b4461a;
  --accent-deep: #8a3312;
  --accent-text: #8a3312;
  --accent-ink: #ffffff;
  --accent-soft: #f6e2d3;
  --ok: #2f6b2a;
  --ok-ink: #ffffff;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Jakarta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1815; --raised: #221e1a; --tint: #2a251f; --ink: #f0e9dc; --muted: #b0a492;
    --rule: #3a332b; --line: #857765; --accent: #f2894a; --accent-deep: #f59e66; --accent-text: #f2894a;
    --accent-ink: #1b1815; --accent-soft: #3b2618; --ok: #7fcf73; --ok-ink: #14210f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1815; --raised: #221e1a; --tint: #2a251f; --ink: #f0e9dc; --muted: #b0a492;
  --rule: #3a332b; --line: #857765; --accent: #f2894a; --accent-deep: #f59e66; --accent-text: #f2894a;
  --accent-ink: #1b1815; --accent-soft: #3b2618; --ok: #7fcf73; --ok-ink: #14210f; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 20px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; overflow-wrap: anywhere; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--sans); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; line-height: 1.3; }
p { margin: 0 0 1rem; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--sans); font-weight: 800; font-size: 1.25rem; line-height: 1; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand { gap: 8px; }
.brand .mark { flex: none; border-radius: 50%; }
.brand b { font-weight: inherit; color: var(--accent); margin-left: .18em; }
.brand:hover { color: inherit; }
.nav { display: flex; align-items: center; margin-right: -8px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); background: var(--tint); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.nav-links { display: flex; align-items: center; }
.menu-toggle { display: none; }
.masthead { position: relative; z-index: 20; }
@media (max-width: 719px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-left: 2px;
    font: 700 .95rem/1 var(--sans); color: var(--ink); background: var(--tint); border: 0; border-radius: 10px; cursor: pointer;
  }
  .menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
  .menu-toggle .bars { position: relative; }
  .menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle .bars::before { top: -5px; }
  .menu-toggle .bars::after { top: 5px; }
  .menu-toggle[aria-expanded="true"] .bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; padding: 6px 16px 14px;
    background: var(--paper); border-bottom: 1px solid var(--rule); box-shadow: 0 12px 24px rgba(0,0,0,.12);
  }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 48px; padding: 0 4px; font-size: 1.08rem; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a[aria-current="page"] { color: var(--accent-text); }
}
@media (max-width: 420px) { .brand { font-size: 1.12rem; gap: 6px; } .brand .mark { width: 28px; height: 28px; } }
@media (max-width: 374px) { .brand { font-size: 1rem; } }

main.wrap { padding-top: 28px; padding-bottom: 8px; }
.sec { margin-top: 48px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.sec-head .aside { font-size: .92rem; color: var(--muted); white-space: nowrap; }
.sec > h2 { margin-bottom: 10px; }
.more-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-weight: 700; }

/* a list with a strong top rule and hairlines between rows */
.ruled { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ruled > li { border-bottom: 1px solid var(--rule); }

/* ---------- home ---------- */
.hello { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; }
.hello img { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--rule); }
.hello p { margin: 0; }
.hello .hi { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.1em; }

.search { margin-top: 24px; }
.search label { display: block; margin-bottom: 8px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.15rem; }
.field { position: relative; }
.field svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input {
  width: 100%; height: 54px; padding: 0 16px 0 46px;
  font: 400 1.1rem/1 var(--sans); color: var(--ink);
  background: var(--raised); border: 1.5px solid var(--line); border-radius: var(--r);
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .count { margin: 8px 0 0; font-size: .92rem; color: var(--muted); min-height: 1.5em; }
.searching #recent, .searching #mine, .searching #guides, .searching #how { display: none; }
.empty { margin: 16px 0 0; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.empty p { margin: 0 0 12px; }

.games a { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; text-decoration: none; }
.games img { flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--tint); }
.games .name { flex: 1; min-width: 0; line-height: 1.3; }
.games .n { flex: none; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.games a:hover .name { text-decoration: underline; text-decoration-color: var(--accent); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .75rem; font-weight: 700; vertical-align: 2px; }

.updates a { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 0; text-decoration: none; }
.updates img { flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--tint); }
.updates .t { flex: 1; min-width: 0; line-height: 1.35; }
.updates b { display: block; font-size: 1.05rem; }
.updates .sub { font-size: .92rem; color: var(--muted); }
.updates .sub strong { color: var(--accent-text); }
.updates a:hover b { text-decoration: underline; text-decoration-color: var(--accent); }
.chev { flex: none; color: var(--muted); }

.mine { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.mine a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 6px; border: 1px solid var(--rule); border-radius: 999px; background: var(--raised); text-decoration: none; font-size: .95rem; }
.mine img { width: 30px; height: 30px; border-radius: 7px; }

.guides a { display: block; padding: 14px 0; text-decoration: none; }
.guides h3 { font-size: 1.15rem; }
.guides p { margin: 4px 0 0; font-size: .95rem; color: var(--muted); }
.guides a:hover h3 { color: var(--accent-text); }

.how ul { padding-left: 1.2em; margin: 0 0 1rem; }
.how li { margin-bottom: .35em; }

/* ---------- game page ---------- */
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: '/'; content: '/' / ''; margin: 0 8px; color: var(--line); }
.crumbs a { color: var(--muted); display: inline-block; padding: 10px 0; margin: -10px 0; }
.post-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.post-head img { flex: none; width: 56px; height: 56px; border-radius: 13px; border: 1px solid var(--rule); margin-top: 4px; }
.dek { margin: 12px 0 0; font-size: 1.15rem; line-height: 1.5; }
.byline { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: .92rem; line-height: 1.4; color: var(--muted); }
.byline img { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--rule); }
.byline a { color: var(--ink); font-weight: 700; }

.codes > li { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.code-main { flex: 1; min-width: 0; }
.code {
  display: inline-block; max-width: 100%; padding: 3px 10px;
  font: 700 1.2rem/1.35 var(--mono); letter-spacing: .02em; overflow-wrap: anywhere;
  color: var(--ink); background: var(--tint); border-radius: 6px; cursor: pointer; user-select: all;
  transition: background-color .2s;
}
.code-meta { margin: 6px 0 0; font-size: .98rem; line-height: 1.4; }
.reward { font-weight: 700; }
.code-meta .added, .code-meta .where { color: var(--muted); font-weight: 400; }
.codes li.done .code { background: var(--accent-soft); }
.copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 116px; height: 48px; padding: 0 16px;
  font: 700 1rem/1 var(--sans); color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: var(--r); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s;
}
.copy:hover { background: var(--accent-deep); }
.copy svg { display: none; }
.copy.done { background: var(--ok); color: var(--ok-ink); }
.copy.done svg { display: block; }
.codes li.was .copy { background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--accent); }
.codes li.was .copy svg { display: block; }
.codes li.was .copy.done { background: var(--ok); color: var(--ok-ink); box-shadow: none; }
.note { margin: 14px 0 0; font-size: .92rem; color: var(--muted); }
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; }
.next-step .jump { font-weight: 700; padding: 12px 2px; }

.steps { list-style: none; margin: 0; padding: 4px 16px; counter-reset: step; background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; }
.steps > li { counter-increment: step; position: relative; padding: 14px 0 14px 44px; border-bottom: 1px solid var(--rule); }
.steps > li:last-child { border-bottom: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font: 800 .95rem/1 var(--sans); background: var(--accent-soft); color: var(--accent-text); }
.tip { margin: 14px 0 0; font-size: .95rem; color: var(--muted); }

.qa { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.qa:first-of-type { border-top: 1px solid var(--rule); }
.qa h3 { margin-bottom: 6px; font-size: 1.1rem; }
.qa p { margin: 0; }

.shot { margin: 0 0 16px; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: var(--tint); }
.shot figcaption { margin-top: 6px; font-size: .82rem; color: var(--muted); }
.facts { margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: .98rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  font: 700 1rem/1 var(--sans); text-decoration: none; color: var(--ink); background: none;
  border: 1.5px solid var(--ink); border-radius: var(--r); cursor: pointer;
}
.btn:hover { background: var(--tint); color: var(--ink); }

.expired { border: 1px solid var(--rule); border-radius: 14px; padding: 0 16px; background: var(--raised); }
.expired summary { display: flex; align-items: center; gap: 12px; min-height: 60px; cursor: pointer; list-style: none; }
.expired summary::-webkit-details-marker { display: none; }
.expired summary h2 { flex: 1; font-size: 1.3rem; }
.expired summary .aside { font-size: .92rem; color: var(--muted); }
.expired summary svg { flex: none; color: var(--muted); transition: transform .2s; }
.expired[open] summary svg { transform: rotate(180deg); }
.expired ul { list-style: none; margin: 0; padding: 0 0 12px; }
.expired li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: .95rem; }
.expired li code { font: 600 1rem var(--mono); color: var(--muted); text-decoration: line-through; }

/* ---------- articles (guides, about, policies) ---------- */
.prose > h1 { margin-bottom: 14px; }
.prose h2 { margin: 1.8em 0 .5em; }
.prose h3 { margin: 1.5em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1rem; }
.prose li { margin-bottom: .4em; }
.prose code { font: 600 .92em var(--mono); background: var(--tint); padding: 1px 6px; border-radius: 5px; }
.lead { font-size: 1.15rem; line-height: 1.5; }
.callout { margin: 0 0 1rem; padding: 12px 16px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; }
.toc { margin: 18px 0 8px; padding: 12px 16px; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r); }
.toc p { margin: 0 0 4px; font-family: var(--serif); font-style: italic; font-weight: 500; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 4px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1rem; border-top: 1px solid var(--rule); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-wrap th { font-weight: 700; }
.author-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.author-head img { flex: none; width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--rule); }
.author-head h1 { margin-bottom: 4px; }
.author-head p { margin: 0; color: var(--muted); }

/* ads: fixed height so nothing below moves; hidden if Google leaves it empty */
.ad-slot { position: relative; margin: 36px 0; min-height: 280px; display: flex; align-items: center; justify-content: center; background: var(--tint); border-radius: var(--r); overflow: hidden; }
.ad-slot::before { content: 'Advertisements'; position: absolute; top: 6px; font-size: .7rem; color: var(--muted); }
.ad-slot ins { position: relative; width: 100%; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

/* ---------- footer ---------- */
.foot { margin-top: 72px; padding: 32px 0 48px; background: var(--tint); border-top: 1px solid var(--rule); font-size: .92rem; color: var(--muted); }
.foot-grid { display: grid; gap: 28px 32px; grid-template-columns: 1fr 1fr; }
.foot-brand { grid-column: 1 / -1; max-width: 420px; }
.foot-brand .brand { color: var(--ink); }
.foot-brand p { margin: 8px 0 0; line-height: 1.6; }
.foot-brand a:not(.brand) { color: var(--ink); }
.foot-tag { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text) !important; }
.foot-social { display: flex; gap: 8px; margin-top: 14px !important; }
.foot-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--raised); border: 1px solid var(--rule); color: var(--ink); }
.foot-social a:hover { border-color: var(--accent); color: var(--accent-text); }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; }
.foot-col h2 { margin: 0 0 6px; font-family: var(--sans); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.foot-col a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .85rem; }
.foot-bar p { margin: 0; }
.foot-bar nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot-bar nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); }
.foot-bar nav a:hover { color: var(--ink); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .foot-brand { grid-column: auto; } }

@media (min-width: 720px) {
  body { font-size: 1.125rem; }
  main.wrap { padding-top: 48px; }
  h2 { font-size: 1.75rem; }
  .masthead .wrap { min-height: 68px; }
  .brand { font-size: 1.6rem; }
  .sec { margin-top: 64px; }
  .games.cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .post-head img { width: 80px; height: 80px; border-radius: 16px; }
  .dek { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- game-hub layout ---------- */
.masthead .wrap { max-width: 1080px; }
main.wrap:has(.hub-head) { max-width: 1080px; }
main.wrap:has(.post-head) { max-width: 760px; }
.hub-head { text-align: center; padding: 8px 0 4px; }
.hub-head h1 { font-size: clamp(2rem, 7vw, 3rem); }
.hub-head .sub { margin: 8px 0 0; color: var(--muted); }
.hub-head .search { max-width: 620px; margin: 20px auto 0; text-align: left; }
.hub-head .count { text-align: center; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 820px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 10px; background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; text-decoration: none; transition: border-color .15s, transform .15s; }
.tile img { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--tint); }
.tile .name { font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .n { margin-top: auto; font-size: .88rem; color: var(--muted); }
.tile:hover { border-color: var(--accent); color: inherit; }
@media (hover: hover) { .tile:hover { transform: translateY(-2px); } }
.tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 820px) { .tiles.small { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles.small .tile { padding: 8px; }
.tiles.small .name { font-size: .88rem; }
.guide-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 700px) { .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; text-decoration: none; }
.guide-cards a:hover { border-color: var(--accent); color: inherit; }
.guide-cards span { font-size: .92rem; color: var(--muted); }
.run-by { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--tint); border-radius: 16px; }
.run-by img { flex: none; width: 56px; height: 56px; border-radius: 50%; }
.run-by p { margin: 0; font-size: .95rem; }
.codes { border: 1px solid var(--rule); border-radius: 16px; padding: 0 16px; background: var(--raised); }
.codes > li:last-child { border-bottom: 0; }
.dek { font-size: 1.05rem; }
@media (min-width: 720px) { .dek { font-size: 1.15rem; } }
@media (max-width: 559px) {
  .tiles.all { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tiles.all .tile { padding: 6px; border-radius: 12px; gap: 4px; }
  .tiles.all .name { font-size: .82rem; }
  .tiles.all .n { font-size: .75rem; }
  .tiles.small .name { font-size: .78rem; }
}

/* newest codes feed on the home page */
.feed > li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "game game" "code copy" "reward copy";
  gap: 4px 12px; align-items: center; border-bottom: 1px solid var(--rule);
}
.feed-game { grid-area: game; display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--muted); }
.feed-game:hover { color: var(--accent-text); }
.feed-game img { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--rule); }
.feed .code { grid-area: code; justify-self: start; font-size: 1.1rem; }
.feed-reward { grid-area: reward; font-size: .95rem; font-weight: 700; }
.feed .copy { grid-area: copy; }
@media (min-width: 760px) {
  .feed > li { grid-template-columns: minmax(0, 15rem) minmax(0, auto) minmax(0, 1fr) auto; grid-template-areas: "game code reward copy"; gap: 16px; }
  .feed-game { color: var(--ink); }
}
@media (max-width: 339px) { .brand .mark { display: none; } .theme-toggle { width: 40px; min-width: 40px; } .menu-toggle { padding: 0 10px; } }
.req { margin: 12px 0 0; padding: 12px 14px; font-size: .95rem; line-height: 1.45; background: var(--accent-soft); border-radius: 12px; }
@media (max-width: 559px) {
  .codes > li { gap: 10px; }
  .code { font-size: 1.02rem; padding: 3px 8px; letter-spacing: 0; }
  .copy { min-width: 84px; padding: 0 12px; }
}
.shot { margin: 24px 0; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; border: 1px solid var(--rule); background: var(--tint); }
.shot figcaption { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.shot.lead { margin: 18px 0 8px; }

/* ---------- article cards (guides, blog) ---------- */
main.wrap:has(.index-head) { max-width: 1080px; }
.index-head .dek { max-width: 42rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { main.wrap:has(.index-head) .cards, main.wrap:has(.hub-head) .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); color: inherit; transform: translateY(-2px); }
.card img, .card-blank { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); }
.card-text { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.card-sum { font-size: .93rem; line-height: 1.45; color: var(--muted); }
.card-meta { margin-top: auto; padding-top: 4px; font-size: .85rem; color: var(--muted); }
.kicker { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
p.kicker { margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.run-by + .cards { margin-top: 20px; }

/* ---------- code updates ---------- */
.updates a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; text-decoration: none; color: inherit; }
.updates a:hover b { color: var(--accent-text); }
.updates img { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--rule); }
.u-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.u-line { font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.u-line code { font: 700 .85rem/1 var(--mono); padding: 2px 6px; background: var(--tint); border-radius: 5px; }
.u-new { font-weight: 700; color: var(--ok-text, var(--ink)); margin-right: 4px; }
.u-old { font-weight: 700; color: var(--muted); margin-right: 4px; }

/* ---------- home: magazine layout ---------- */
main.wrap:has(.hub-head) { max-width: 1200px; }
.mag { display: grid; gap: 28px; margin-top: 8px; }
@media (min-width: 980px) { .mag { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; } }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.post {
  display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; text-decoration: none; color: inherit;
  transition: border-color .15s;
}
.post:hover { border-color: var(--accent); color: inherit; }
.post img, .post .card-blank { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); }
.post-text { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; min-width: 0; }
.post h3 { margin: 0; font-size: 1.18rem; line-height: 1.3; }
.post-sum { font-size: .95rem; line-height: 1.5; color: var(--muted); }
.post-meta { margin-top: auto; padding-top: 4px; font-size: .83rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
@media (min-width: 640px) {
  .post { grid-template-columns: 250px minmax(0, 1fr); }
  .post img, .post .card-blank { aspect-ratio: auto; min-height: 160px; }
  .post-text { padding: 18px 20px; justify-content: center; }
}
.mag-side { display: grid; gap: 16px; }
@media (min-width: 980px) { .mag-side { position: sticky; top: 16px; } }
.side-box { padding: 16px 18px; background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; }
.side-box h2 { margin: 0 0 8px; padding-bottom: 10px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--accent); }
.side-list, .side-pop { list-style: none; margin: 0; padding: 0; }
.side-list li + li, .side-pop li + li { border-top: 1px solid var(--rule); }
.side-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; text-decoration: none; color: inherit; }
.side-list b { font-size: .95rem; line-height: 1.35; }
.side-list a:hover b, .side-pop a:hover b { color: var(--accent-text); }
.side-list span, .side-pop span span { font-size: .82rem; color: var(--muted); }
.side-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; color: inherit; }
.side-pop img { flex: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--rule); }
.side-pop a > span { display: flex; flex-direction: column; min-width: 0; }
.side-pop b { font-size: .93rem; }
.side-more { display: inline-block; margin-top: 8px; font-weight: 700; font-size: .92rem; }
@media (max-width: 639px) {
  .post { grid-template-columns: 118px minmax(0, 1fr); }
  .post img, .post .card-blank { aspect-ratio: auto; height: 100%; min-height: 104px; }
  .post-text { padding: 10px 12px; gap: 3px; }
  .post h3 { font-size: 1rem; }
  .post-sum { display: none; }
  .post .kicker { font-size: .7rem; }
  .post-meta { font-size: .76rem; }
}

/* back to top */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 50;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgb(0 0 0 / .25);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent-deep); }
.to-top:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media print { .to-top { display: none; } }
/* bigger tap area for small "see all" links on touch screens */
@media (pointer: coarse) { a.aside, a.side-more { display: inline-flex; align-items: center; min-height: 44px; } }

/* live search dropdown */
.nav a.nav-search { width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--raised); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .18); padding: 8px; max-height: min(70vh, 480px); overflow-y: auto; overscroll-behavior: contain;
}
.s-head { display: flex; align-items: center; gap: 6px; margin: 6px 8px 10px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.s-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 6px; }
.s-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--tint); color: var(--ink); text-decoration: none; font-size: .95rem; }
.s-chip:hover, .s-chip[aria-selected="true"] { border-color: var(--accent); color: var(--accent-text); }
.s-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.s-row:hover, .s-row[aria-selected="true"] { background: var(--tint); }
.s-row img { width: 40px; height: 40px; border-radius: 10px; flex: none; object-fit: cover; background: var(--tint); }
.s-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.s-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-text b code { font-size: .95em; }
.s-text span { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-kind { flex: none; color: var(--muted); }
.s-none { margin: 10px 8px; color: var(--muted); }
.suggest svg { position: static; transform: none; pointer-events: none; }

/* jump links (Games, All games, How to redeem) glide instead of snapping */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
section[id], h2[id] { scroll-margin-top: 16px; }

/* footer spans the same width as the home page */
.foot .wrap { max-width: 1200px; }
.foot-col a { line-height: 1.35; }

/* home FAQ: centred accordion */
#faq { max-width: 820px; margin-left: auto; margin-right: auto; text-align: center; }
#faq h2 { margin-top: 0; }
.faq-kicker { margin: 0 0 4px; font-size: .78rem; font-weight: 800; letter-spacing: .1em; color: var(--accent-text); }
.faq-sub { margin: 4px 0 20px; color: var(--muted); }
#faq .faq-list { display: grid; gap: 10px; text-align: left; }
.faq { background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; }
.faq[open] { border-color: var(--line); }
.faq summary { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 18px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 14px; }
.faq summary h3 { flex: 1; margin: 0; font-size: 1.05rem; line-height: 1.4; }
.faq-icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); background: var(--tint); }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: var(--accent); transition: transform .2s; }
.faq-icon::after { transform: rotate(90deg); }
.faq[open] .faq-icon::after { transform: rotate(0deg); }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--muted); line-height: 1.65; }
.faq p a { color: var(--ink); }
#faq .qa:first-of-type { border-top: 1px solid var(--rule); }

/* code list: one card per code, quieter Copy buttons, so a long list stays easy to scan */
.codes { border: 0; border-radius: 0; padding: 0; background: none; display: grid; gap: 10px; }
.codes > li, .codes > li:last-child { border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px; background: var(--raised); }
.codes .code { font-size: 1.25rem; color: var(--accent-text); background: var(--tint); border: 1px dashed var(--line); padding: 4px 12px; }
.codes .code-meta { margin-top: 8px; font-size: 1rem; }
.codes .reward { font-weight: 600; color: var(--ink); }
.code-sub { margin: 3px 0 0; font-size: .85rem; color: var(--muted); }
.codes .copy { height: 44px; min-width: 96px; background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--accent); }
.codes .copy:hover { background: var(--accent); color: var(--accent-ink); }
.codes .copy.done, .codes li.was .copy.done { background: var(--ok); color: var(--ok-ink); box-shadow: none; }
.codes li.was .copy { color: var(--muted); box-shadow: inset 0 0 0 2px var(--rule); }
.codes li.was .code { color: var(--muted); }
@media (max-width: 559px) { .codes > li, .codes > li:last-child { padding: 12px; } .codes .code { font-size: 1.05rem; padding: 3px 8px; } .codes .copy { min-width: 76px; } }

.mine-note { margin: -6px 0 10px; font-size: .88rem; color: var(--muted); }
.mine-clear { border: 0; background: none; padding: 0; min-height: 36px; cursor: pointer; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.mine-clear:hover { color: var(--ink); }
