:root {
  --bg: #0f1220;
  --surface: #181c30;
  --surface-2: #232845;
  --border: #2a3050;
  --text: #eef0f7;
  --muted: #a3aac4;
  --accent: #ffb703;
  --accent-2: #5b9bff;
  --good: #4cd964;
  --bad: #ff5d73;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent-2); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 28px 0 10px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 20px; padding-bottom: 40px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #111; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: #141414; border-color: var(--accent); }
.btn:hover { filter: brightness(1.08); }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { color: var(--text); font-weight: 800; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.logo-mark { color: var(--accent); margin-right: 6px; }
.search { flex: 1; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--border); border-right: 0; border-radius: 999px 0 0 999px; background: var(--bg); color: var(--text); font-size: 1rem; }
.search button { display: flex; align-items: center; padding: 0 14px; border: 0; border-radius: 0 999px 999px 0; background: var(--accent); color: #141414; cursor: pointer; }
.menu-toggle { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 6px 12px; font-size: 1.1rem; cursor: pointer; }
.cat-nav { display: none; border-top: 1px solid var(--border); }
.cat-nav.open { display: block; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.cat-row a { color: var(--text); text-decoration: none; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); font-size: .92rem; white-space: nowrap; }
.cat-row a:hover, .cat-row a[aria-current] { background: var(--accent-2); color: #fff; }
@media (min-width: 800px) {
  .menu-toggle { display: none; }
  .cat-nav { display: block; }
  .cat-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .search { max-width: 440px; margin-left: auto; }
}

/* Flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--surface-2); border-left: 4px solid var(--accent-2); }
.flash-success { border-color: var(--good); }
.flash-error, .flash-danger { border-color: var(--bad); }

/* Hero */
.hero { display: grid; gap: 16px; background: linear-gradient(135deg, #232845, #1b2a4f); border-radius: var(--radius); padding: 16px; margin-bottom: 8px; align-items: center; }
.hero-media img { width: 100%; border-radius: 10px; display: block; aspect-ratio: 16 / 10; object-fit: cover; }
.hero-text h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: 4px 0 8px; }
.hero-text p { color: var(--muted); margin: 0 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--accent); font-weight: 700; }
@media (min-width: 700px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 24px; gap: 28px; } }

/* Rows + grids */
.row { margin-top: 28px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row-head h2 { margin: 0; }
.see-all { white-space: nowrap; font-weight: 600; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { main .grid:not(.grid-side) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid > .ad-slot { grid-column: 1 / -1; }

/* Cards */
.card { display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); border: 1px solid var(--border); transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, .35); border-color: var(--accent-2); }
.card:active { transform: scale(.97); }
.card-thumb { display: block; aspect-ratio: 16 / 10; background: var(--surface-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: block; padding: 8px 10px 10px; }
.card-title { display: block; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cat { display: block; color: var(--muted); font-size: .8rem; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a, .chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .9rem; }
.empty { color: var(--muted); padding: 24px 0; }

/* Page head, breadcrumbs, pager */
.page-head { margin-bottom: 18px; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 12px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin: 0 6px; }
.breadcrumbs a { color: var(--muted); }
.sort { display: flex; gap: 8px; }
.sort a { padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: .9rem; }
.sort a[aria-current] { background: var(--surface-2); color: var(--text); }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a, .pager span { padding: 8px 14px; border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--text); }
.pager .current { background: var(--accent); color: #141414; font-weight: 700; }
.pager .gap { background: none; }

/* Game page */
.game-layout { display: grid; gap: 24px; }
@media (min-width: 1000px) { .game-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.player { position: relative; width: min(100%, calc(76vh * var(--ratio, 4 / 3))); aspect-ratio: var(--ratio, 4 / 3); border: 1px solid var(--border); background: #000; border-radius: var(--radius); overflow: hidden; margin: 0 auto; }
.player-portrait { max-width: min(100%, 460px); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.play-overlay { position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: #000; color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.play-overlay img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(6px) brightness(.45); transform: scale(1.08); }
.play-icon { position: relative; width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: #141414; display: flex; align-items: center; justify-content: center; font-size: 2rem; padding-left: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); transition: transform .15s; }
.play-overlay:hover .play-icon { transform: scale(1.08); }
.play-label { position: relative; font-weight: 800; font-size: 1.2rem; text-shadow: 0 2px 8px #000; padding: 0 12px; text-align: center; }
.player.playing .play-overlay { display: none; }
.player:fullscreen { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; border: 0; }
.game-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.game-toolbar h1 { margin: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer; }
.tool:hover { border-color: var(--accent-2); }
.tool[aria-pressed="true"] { background: var(--accent-2); border-color: var(--accent-2); }
.tool-quiet { color: var(--muted); }
.tool:disabled { opacity: .6; cursor: default; }
.note { background: var(--surface); padding: 10px 14px; border-radius: 10px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--muted); font-size: .92rem; }
.game-info { max-width: 820px; }
.game-info ul { padding-left: 22px; }
.game-info li { margin-bottom: 4px; }
.tags { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags a { color: var(--muted); text-decoration: none; background: var(--surface); padding: 4px 10px; border-radius: 8px; font-size: .88rem; }
.game-side h2 { margin-top: 0; }
.grid-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) and (max-width: 999px) { .grid-side { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Collections */
.collection-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.collection-list a { display: block; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.collection-list a:hover { border-color: var(--accent-2); }
.collection-list strong { display: block; font-size: 1.1rem; }
.collection-list span { color: var(--muted); }

/* Prose pages + forms */
.prose { max-width: 760px; }
.prose li { margin-bottom: 6px; }
.form { display: grid; gap: 14px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.field .error { color: var(--bad); margin: 0; font-size: .9rem; }
.hp { position: absolute; left: -5000px; }
.error-page { text-align: center; padding: 30px 0 10px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 18px; }
.footer-row p { margin: 0; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-row a { color: var(--muted); }
@media (max-width: 600px) { .footer-row a { padding: 6px 0; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-2); color: var(--text); padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); z-index: 50; }

@media (prefers-reduced-motion: reduce) { .card, .play-icon { transition: none; } .card:hover { transform: none; } }

/* Ads (only present when a slot has code in Settings) */
.ad-slot { margin: 20px auto; text-align: center; min-height: 0; }
.ad-slot.ad-on { min-height: 100px; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot:not(.ad-on) .ad-label { display: none; }
.ad-sidebar { margin-top: 0; }
@media (max-width: 999px) { .ad-sidebar { display: none; } }

/* Cookie consent */
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 720px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 280px; font-size: .95rem; }
.consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Category guide text */
.category-guide { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); }
.category-guide h2 { color: var(--text); }

/* Share buttons */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; }
.share-label { color: var(--muted); font-size: .9rem; margin-right: 2px; }
.share-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: .88rem; text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--accent-2); }
.share-native { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
