/* Hocus Games · layout "C · Shelves". One dark, screen-first world: media carries the colour, chrome stays quiet. */
:root {
  --ink: #0d0f1a;
  --panel: #171a2b;
  --panel-2: #20243a;
  --line: #2a2f4a;
  --text: #eef0fb;
  --muted: #9aa0c3;
  --accent: #ff7a45;
  --accent-ink: #1a0d06;
  --tested: #4fd1a5;
  --declared: #7ab8ff;
  --inferred: #d9b45a;
  --warn: #ffb4a2;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--ink); color: var(--text); font: 16px/1.5 var(--body); }
a { color: inherit; }
img, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--text); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.url { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.code { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; user-select: all; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* ---------- shared controls ---------- */
.brand { font: 800 20px var(--display); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gutter) 6px; max-width: 1200px; margin: 0 auto; }
.icon-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 14px; background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; }
.icon-link svg { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font: 800 15px var(--body); border-radius: 999px; padding: 11px 20px; cursor: pointer; text-decoration: none; }
.btn svg { width: 20px; height: 20px; }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(13,15,26,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; color: var(--text); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(13,15,26,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); white-space: nowrap; color: var(--text); }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.tested i { background: var(--tested); }
.chip.declared i { border: 1.5px solid var(--declared); }
.chip.inferred i { border: 1.5px dashed var(--inferred); }
.demo-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); background: var(--inferred); border-radius: 4px; padding: 1px 6px; vertical-align: middle; }
.empty { padding: 40px var(--gutter); text-align: center; color: var(--muted); }

/* ---------- media ---------- */
.media { position: absolute; inset: 0; overflow: hidden; background: var(--panel); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.gen {
  background:
    radial-gradient(120% 80% at 20% 10%, hsl(var(--h1) 80% 62%), transparent 60%),
    radial-gradient(100% 90% at 90% 90%, hsl(var(--h2) 75% 45%), transparent 60%),
    hsl(var(--h3) 45% 14%);
  display: grid; place-items: center; text-align: center; padding: 20px;
}
.media.gen .glyph { position: absolute; font: 800 clamp(70px, 22vw, 170px)/1 var(--display); opacity: .18; letter-spacing: -.04em; white-space: nowrap; }
.media.gen .gt { position: relative; font: 800 30px/1.05 var(--display); text-shadow: 0 2px 20px rgba(0,0,0,.35); text-wrap: balance; }
.media.gen .gt small { display: block; margin-top: 8px; font: 600 12px var(--body); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

/* ---------- home: stories + shelves ---------- */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 12px var(--gutter) 8px; scrollbar-width: none; max-width: 1200px; margin: 0 auto; }
.stories::-webkit-scrollbar, .row::-webkit-scrollbar, .filterbar::-webkit-scrollbar { display: none; }
.story { flex: none; width: 78px; display: grid; gap: 6px; justify-items: center; text-decoration: none; }
.story .ring { width: 70px; height: 70px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--accent), #ffd166, var(--declared), var(--accent)); }
.story .dot { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--ink); background-size: cover; background-position: center top; }
.story .dot.gen { background: radial-gradient(circle at 30% 30%, hsl(var(--h1) 80% 62%), hsl(var(--h3) 45% 20%)); }
.story-label { font-size: 12px; line-height: 1.2; text-align: center; color: #dfe2f5; }
.shelf { padding: 14px 0 6px; max-width: 1200px; margin: 0 auto; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 var(--gutter); }
.shelf-head h2 { font-size: 21px; }
.shelf-head a { font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.shelf-head a:hover { color: var(--text); }
.shelf .sub { margin: 2px var(--gutter) 10px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; overflow-x: auto; padding: 0 var(--gutter) 8px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.card { flex: none; width: min(62vw, 240px); aspect-ratio: 2 / 3; position: relative; border-radius: 18px; overflow: hidden; scroll-snap-align: start; text-decoration: none; background: var(--panel); transition: transform .15s ease; }
.card:hover { transform: translateY(-3px); }
.card .media.gen .gt { display: none; }
.card .media.gen .glyph { opacity: .3; }
.card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 12px 12px; background: linear-gradient(to top, rgba(0,0,0,.88), transparent); display: grid; gap: 7px; justify-items: start; }
.card .cap b { font: 800 19px/1.1 var(--display); }
.explain { max-width: 1200px; margin: 18px auto 40px; padding: 18px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.explain h2 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.explain p { max-width: 70ch; margin: 8px 0; }
.explain .chip { background: var(--panel); }

/* ---------- feed ---------- */
.feed-page { height: 100%; overflow: hidden; }
body.feed-page { height: 100dvh; }
.feed-layout { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.feed-side { display: none; }
.feed-col { position: relative; height: 100dvh; background: #000; }
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.feed:focus { outline: none; }
.feed-top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 10px 18px; background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent); }
.feed-title { font: 800 17px var(--display); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.filterbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.fchip { flex: none; text-decoration: none; border: 1px solid rgba(255,255,255,.24); background: rgba(13,15,26,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.fchip[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.slide .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 42%, rgba(0,0,0,0) 60%, rgba(0,0,0,.35) 100%); pointer-events: none; }
.slide .info { position: absolute; left: 14px; right: 78px; bottom: max(20px, env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: start; }
.slide .who { font-size: 14px; font-weight: 700; color: #dfe2f5; }
.slide .verified { color: var(--tested); }
.slide h2 { font-size: 30px; }
.slide .desc { margin: 0; font-size: 15px; color: #e3e5f4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.slide .unverified { margin: 0; font-size: 13px; color: var(--warn); }
.slide .rail { position: absolute; right: 10px; bottom: max(24px, env(safe-area-inset-bottom)); display: grid; gap: 14px; justify-items: center; }
.slide .rail > div { display: grid; justify-items: center; gap: 3px; }
.rail-label { font-size: 11px; color: #dfe2f5; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.play-big { width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 24px rgba(255,122,69,.45); }
.play-big svg { width: 26px; height: 26px; margin-left: 3px; }
.slide.end, .slide.divider { display: grid; place-items: center; background: var(--ink); padding: 24px; }
.end-box { max-width: 420px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.end-box h2 { font-size: 26px; }
.end-box p { margin: 0; color: var(--muted); }
.end-actions { display: grid; gap: 10px; width: 100%; }
.count { font-size: 13px; color: var(--muted); margin: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 200; }

/* filters panel (desktop side + mobile via /feed) */
.filters summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 8px 0; }
.filters summary svg { width: 18px; height: 18px; }
.filter-form { display: grid; gap: 12px; margin-top: 8px; }
.filter-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.filter-form legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.cb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.field { display: grid; gap: 4px; font-size: 14px; }
.field span { color: var(--muted); font-size: 13px; }
input[type="search"], input[type="email"], input[type="text"], input[type="url"], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
.form-actions { display: flex; gap: 14px; align-items: center; }

@media (min-width: 900px) {
  .feed-layout { grid-template-columns: minmax(260px, 1fr) min(440px, 100%) minmax(260px, 1fr); }
  .feed-side { display: block; padding: 22px 26px; overflow-y: auto; height: 100dvh; }
  .feed-side h1 { font-size: 28px; margin: 18px 0 4px; }
  .feed-side h2 { font-size: 18px; margin-bottom: 8px; }
  .feed-side .sub { color: var(--muted); margin: 0 0 6px; }
  .feed-side.right p { font-size: 14px; }
  .feed-side.right .chip { background: var(--panel); }
  .feed-col { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .feed-top .filterbar { display: none; }
  .card { width: 230px; }
}

/* ---------- detail ---------- */
.detail { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter) 48px; display: grid; gap: 16px; }
.detail-media { position: relative; aspect-ratio: 3 / 4; max-height: 70vh; border-radius: 20px; overflow: hidden; }
.gallery { display: flex; gap: 10px; overflow-x: auto; }
.gallery img, .gallery video { height: 160px; width: auto; border-radius: 12px; flex: none; }
.detail-body { display: grid; gap: 12px; align-content: start; justify-items: start; }
.detail-body h1 { font-size: clamp(30px, 5vw, 44px); }
.detail-body h2 { font-size: 20px; margin-top: 10px; }
.who { color: var(--muted); font-size: 14px; margin: 0; }
.link-state { color: var(--muted); font-size: 13px; margin: 0; }
.warn { color: var(--warn); }
.detail .desc { margin: 0; max-width: 65ch; }
.facts { border-collapse: collapse; width: 100%; font-size: 15px; }
.facts th, .facts td { text-align: left; padding: 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.facts th { color: var(--muted); font-weight: 600; width: 38%; padding-right: 12px; }
.ev { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 6px; white-space: nowrap; }
.ev.tested { color: var(--tested); border: 1px solid var(--tested); }
.ev.declared { color: var(--declared); border: 1px solid var(--declared); }
.ev.inferred { color: var(--inferred); border: 1px dashed var(--inferred); }
.ev-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ev-meta a { color: var(--muted); }
.unknowns { color: var(--muted); font-size: 14px; margin: 0; max-width: 65ch; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; margin-top: 8px; }
.detail-actions a { color: var(--muted); }
.sources { font-size: 13px; color: var(--muted); }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; padding-top: 10px; }
  .detail-media { grid-column: 1; grid-row: 1; }
  .gallery { grid-column: 1; grid-row: 2; }
  .detail-body { grid-column: 2; grid-row: 1 / span 3; }
}

/* ---------- simple pages & forms ---------- */
.prose { max-width: 680px; margin: 0 auto; padding: 8px var(--gutter) 60px; }
.prose h1 { font-size: 32px; margin: 16px 0 12px; }
.prose h2 { font-size: 20px; margin: 22px 0 8px; }
.prose p, .prose li { color: #d7daee; }
.form { display: grid; gap: 14px; margin-top: 14px; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; padding: 10px 14px; }
.hp { position: absolute; left: -9999px; }
.error { color: var(--warn); }
.ok { color: var(--tested); }

/* ---------- admin ---------- */
.admin { font-size: 15px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); background: var(--panel); }
.admin-nav a { text-decoration: none; font-weight: 600; }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter) 60px; display: grid; gap: 14px; }
.admin-main h1 { font-size: 26px; }
.admin-main h2 { font-size: 18px; margin-top: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tile-n { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--muted); font-size: 14px; }
.tile-n b { display: block; font: 800 30px var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.admin-table th, .admin-table td { text-align: left; padding: 7px 10px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table td:nth-child(n+2) { font-variant-numeric: tabular-nums; }
.admin-table tr.superseded { opacity: .45; }
.admin pre { white-space: pre-wrap; font-size: 12px; margin: 0; }
.cand { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.cand h2 { font-size: 18px; margin: 0; }
.cand small { color: var(--muted); font: 600 12px var(--body); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; align-items: end; }
.grid-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.grid-form .wide { grid-column: 1 / -1; }
.admin button { font: 700 14px var(--body); background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.admin button.ghost { background: var(--panel-2); color: var(--text); }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* In-site player */
body.playing { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.play-bar { display: flex; align-items: center; gap: 10px; padding: 8px var(--gutter); flex: none; }
.play-bar h1 { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-bar .icon-link { white-space: nowrap; }
.play-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.play-stage iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #000; display: block; }
.play-note { flex: none; margin: 0; padding: 6px var(--gutter); text-align: center; }
@media (max-width: 600px) { .play-bar .open-site { display: none; } }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; }
.prose form.form .btn { margin: 0 8px 10px 0; }
