/* Pixel Rivals chrome — StrongMocha Foundry register (night surfaces). The art keeps its own palettes. */
@font-face { font-family: 'Fraunces'; font-weight: 900; font-style: normal; font-display: swap; src: url(/fonts/Fraunces-900.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/Fraunces-400i.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexMono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/fonts/IBMPlexMono-500.woff2) format('woff2'); }

.reg-foundry {
  --paper: #17130e; --card: #1f1a13; --panel: #241e16; --ink: #f2ede0; --muted: #a79c87; --line: #383024;
  --brass: #c9a24b; --ember: #b4552d;
  --display: 'Fraunces', Georgia, serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 3vw, 32px);
  background: var(--paper); color: var(--ink); font-family: var(--mono);
}
* { box-sizing: border-box; }
/* the hidden attribute must beat every display rule below (.player, .gallery, .field, …) */
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(90% 60% at 50% -10%, #2a2114 0%, var(--paper) 60%); }
a { color: var(--ink); }
button, select, input { font: inherit; color: inherit; }

.top { display: flex; align-items: center; gap: 16px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 900; font-size: clamp(20px, 3vw, 26px); letter-spacing: .02em; text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: .25em; }
.brand em { font-style: italic; font-weight: 400; color: var(--brass); }
.scenes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; flex: 1; min-width: 0; padding-bottom: 2px; }
.scenes a { flex: none; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--line); color: var(--muted); }
.scenes a[aria-current="page"] { color: var(--paper); background: var(--brass); border-color: var(--brass); }
.scenes a.wip { opacity: .55; }

.player { flex: 1; width: 100%; max-width: 1960px; margin: 0 auto; padding: 18px var(--gutter) 8px; display: grid; gap: 14px; align-content: start; }
.meta { display: grid; gap: 4px; }
.kicker { margin: 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass); }
.meta h1 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(28px, 5vw, 52px); line-height: 1.02; }
.lede { margin: 0; color: var(--muted); font-size: 14px; max-width: 66ch; }

.stage { position: relative; width: 100%; overflow: hidden; background: #000; border: 1px solid var(--line); display: flex; justify-content: center; }
.stage canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.btn { min-height: 44px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brass); color: var(--paper); border-color: var(--brass); font-weight: 500; }
.btn[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); }
.btn.recording { background: var(--ember); border-color: var(--ember); color: var(--ink); }
.field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 0 0 10px; background: var(--card); border: 1px solid var(--line); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field select { background: var(--panel); border: 1px solid var(--line); min-height: 44px; padding: 0 8px; }
.field.grow { flex: 1 1 220px; }
.field input[type=range] { flex: 1; accent-color: var(--brass); min-width: 80px; }
.field output { font-variant-numeric: tabular-nums; min-width: 5ch; color: var(--ink); }

.drawer { border: 1px solid var(--line); background: var(--card); padding: 16px; font-size: 13px; line-height: 1.55; }
.drawer h2 { font-family: var(--display); font-weight: 900; margin: 0 0 8px; font-size: 22px; }
.drawer h3 { font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--brass); margin: 14px 0 6px; font-weight: 500; }
.drawer ul { margin: 0; padding-left: 1.2em; }
.drawer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.drawer a { word-break: break-word; }

.foot { padding: 14px var(--gutter) 20px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.fine { margin: 0; font-size: 11px; color: var(--muted); max-width: 90ch; }
.attribution { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.attribution a { color: var(--brass); }

.gallery { flex: 1; width: 100%; max-width: 1960px; margin: 0 auto; padding: 24px var(--gutter) 12px; display: grid; gap: 22px; }
.hero { display: grid; gap: 6px; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(40px, 8vw, 96px); line-height: .95; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--brass); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.card { display: grid; gap: 8px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--card); padding: 10px 10px 14px; min-height: 44px; }
.card:hover, .card:focus-visible { border-color: var(--brass); outline: none; }
.card canvas { width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; display: block; }
.card .k { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--brass); }
.card h2 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.05; }
.card p { margin: 0; font-size: 12px; color: var(--muted); }
.card .wip { justify-self: start; font-size: 10px; letter-spacing: .2em; padding: 2px 6px; border: 1px solid var(--line); color: var(--muted); }

/* Site pages (pixelrivals.com): scene notes, legal footer, prose pages. */
.scene-about { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; display: grid; gap: 10px; font-size: 13px; line-height: 1.6; max-width: 90ch; }
.scene-about h2 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 24px; }
.scene-about h3 { margin: 6px 0 0; font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
.scene-about p { margin: 0; }
.scene-about .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scene-about .actions .btn { display: inline-flex; align-items: center; text-decoration: none; }
.sources { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.sources a { color: var(--brass); word-break: break-word; }
.sources .date { color: var(--muted); }
.foot .legal { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; }
.foot .legal a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot .legal a:hover { color: var(--ink); }
.prose { flex: 1; width: 100%; max-width: 76ch; margin: 0 auto; padding: 28px var(--gutter) 24px; font-size: 14px; line-height: 1.7; }
.prose h1 { margin: 4px 0 12px; font-family: var(--display); font-weight: 900; font-size: clamp(30px, 6vw, 52px); line-height: 1.02; }
.prose h2 { margin: 26px 0 6px; font-family: var(--display); font-weight: 900; font-size: 22px; }
.prose .lede { font-size: 15px; color: var(--ink); max-width: none; }
.prose a { color: var(--brass); }
.prose ul { padding-left: 1.2em; }

/* Wallpaper mode: just the art. */
body.wallpaper { background: #000; cursor: none; }
body.wallpaper .top, body.wallpaper .meta, body.wallpaper .controls, body.wallpaper .foot, body.wallpaper .drawer { display: none; }
body.wallpaper .player { padding: 0; max-width: none; height: 100vh; }
body.wallpaper .stage { border: 0; height: 100vh; align-items: center; }

@media (max-width: 640px) {
  .controls .btn, .controls .field { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .field.grow { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
