/* Tokens from docs/ux-spec.md (Se Ux Ui Designer, values from cuorerosso.nl). Swap here only. */
:root {
  --bg: #0d0d0d;
  --panel: #1a1a1a;
  --panel-2: #242424;
  --text: #f5f0eb;
  --muted: #b7b0a8;
  --accent: #c8102e;          /* fills only */
  --accent-hover: #d91e3a;
  --accent-text: #ff4d5e;     /* red text and links */
  --line: rgba(245, 240, 235, .12);
  --line-strong: rgba(245, 240, 235, .25);
  --input-line: #6e6862;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --container: 1152px;
  --pad: 16px;
  --gutter: 16px;
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-btn: 2px;
  --ease: 180ms ease;

  --fs-hero: clamp(2.6rem, 9vw, 6rem);
  --fs-h1: 36px;
  --fs-h2: 28px;
  --fs-h3: 18px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-meta: 14px;
}
@media (min-width: 640px) { :root { --pad: 24px; } }
@media (min-width: 768px) { :root { --fs-h1: 48px; --fs-h2: 36px; --fs-h3: 20px; --fs-lead: 20px; } }
@media (min-width: 1024px) { :root { --pad: 32px; --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.skip { position: absolute; left: var(--s4); top: -100px; z-index: 10; background: var(--text); color: var(--bg); padding: var(--s3) var(--s4); font-weight: 600; }
.skip:focus { top: var(--s4); }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, .display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.1; }
h3 { font: 600 var(--fs-h3)/1.25 var(--font-body); margin: 0; }
p { margin: 0 0 var(--s4); max-width: 65ch; }
.lead { font-size: var(--fs-lead); line-height: 1.45; max-width: 40ch; }
.eyebrow { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; margin: 0 0 var(--s3); }
.eyebrow.red { color: var(--accent-text); }
.meta { font-size: var(--fs-meta); color: var(--muted); }
.legal { font-size: 13px; color: var(--muted); }

/* Header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--s4); }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: .04em; text-transform: uppercase; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; }
.wordmark span { color: var(--accent-text); }
.nav { display: flex; gap: var(--s2); }
.nav a { color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 20px; text-transform: uppercase; letter-spacing: .08em; padding: 0 var(--s3); min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
@media (max-width: 479px) { .nav a.opt { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 20px; border-radius: var(--radius-btn);
  font: 600 20px/1 var(--font-display); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--text); border: 1px solid var(--accent); transition: background var(--ease), border-color var(--ease); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: transparent; border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--text); background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .wrap { position: relative; z-index: 1; padding-top: var(--s7); padding-bottom: 40px; }
.hero-title { font-size: var(--fs-hero); line-height: 1; margin: 0 0 var(--s5); }
.hero-title span { display: block; white-space: nowrap; }
.hero .lead { margin-bottom: var(--s5); }
.hero-visual { position: absolute; inset: 0; z-index: 0; }
.hero-visual svg { position: absolute; right: -10%; top: 50%; transform: translateY(-50%); height: 120%; width: auto; opacity: .9; }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,13,13,.85) 0%, rgba(13,13,13,.78) 45%, rgba(13,13,13,.70) 100%); }
@media (min-width: 1024px) {
  .hero { min-height: 80svh; display: flex; align-items: center; }
  .hero .wrap { width: 100%; padding-top: var(--s9); padding-bottom: var(--s8); }
}

/* Sections */
.section { padding: var(--s8) 0; }
@media (min-width: 1024px) { .section { padding: var(--s9) 0; } }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }

/* Filters */
.filters { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 44px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font: 500 var(--fs-meta)/1 var(--font-body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.select { min-height: 48px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gutter); list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: block; min-height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden;
  color: var(--text); text-decoration: none; transition: transform var(--ease), border-color var(--ease); }
.card:hover, .card:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.thumb { aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--ease); }
.card:hover .thumb img { transform: scale(1.03); }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font: 700 var(--fs-h2)/1 var(--font-display); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.card-body { padding: var(--s4); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); margin-bottom: var(--s1); }
.card-head h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.by { font-size: var(--fs-meta); color: var(--muted); font-weight: 500; }
.tags { display: flex; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
.tag { font-size: var(--fs-meta); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 var(--s2); }
.badge { position: absolute; top: var(--s3); left: var(--s3); z-index: 1; height: 24px; display: inline-flex; align-items: center; padding: 0 var(--s2);
  background: var(--accent); color: var(--text); font: 600 12px/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em; border-radius: 2px; }
.card.skeleton { pointer-events: none; }
.card.skeleton .thumb, .sk-line { background: var(--panel-2); }
.sk-line { height: 14px; border-radius: 4px; margin-bottom: var(--s2); }
.sk-line.short { width: 50%; }
.featured-card { max-width: 760px; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-card); padding: var(--s6) var(--s5); color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: var(--s2); font-weight: 600; }
.more { margin-top: var(--s6); display: flex; justify-content: center; }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s5); }
label, .label { font-size: 16px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="search"], select { min-height: 48px; font: 400 16px var(--font-body); color: var(--text); background: var(--panel); border: 1px solid var(--input-line); border-radius: var(--radius-input); padding: 0 var(--s3); }
.drop { border: 2px dashed var(--input-line); border-radius: var(--radius-card); padding: var(--s7) var(--s5); text-align: center; background: var(--panel); transition: border-color var(--ease); }
.drop.over { border-color: var(--accent-text); }
.drop p { margin: 0 auto var(--s4); }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--accent); }
.error { color: var(--accent-text); display: flex; gap: var(--s2); align-items: flex-start; }
.error::before { content: "!"; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-weight: 600; font-size: 14px; line-height: 1; }
.notice { border: 1px solid var(--line-strong); border-radius: var(--radius-card); padding: var(--s5); background: var(--panel); }
.rules { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s2); }
.rules li { padding-left: var(--s5); position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: .6em; width: 10px; height: 10px; background: var(--accent); }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
pre { max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-input); padding: var(--s4); overflow-x: auto; }
.cols { display: grid; gap: var(--s6); }
@media (min-width: 1024px) { .cols { grid-template-columns: 7fr 5fr; } }

/* Player */
.player-top { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; padding: var(--s4) 0; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage .poster { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--s5); }
.stage .poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.stage .poster > div { position: relative; }
.stage:fullscreen { border: 0; border-radius: 0; aspect-ratio: auto; }
@media (max-width: 767px) { .stage { aspect-ratio: 3 / 4; } }
.game-info { padding: var(--s6) 0 var(--s8); }
.game-info h1 { margin-bottom: var(--s3); }

/* Prose pages */
.prose { padding: var(--s7) 0 var(--s8); }
.prose h1 { margin-bottom: var(--s5); }
.prose h2 { margin: var(--s7) 0 var(--s3); }
.prose ul { max-width: 65ch; padding-left: var(--s5); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: var(--s6) 0; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); }
.site-foot a { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .card:focus-visible { transform: none; }
  .card:hover .thumb img { transform: none; }
}

/* Utilities (CSP blocks inline styles) */
.pt-0 { padding-top: 0 !important; }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.mb-3 { margin-bottom: var(--s3); }
.btn-row.center { justify-content: center; }
.field-sort { margin: 0; max-width: 260px; }

/* Mobile overflow + touch targets (UX review 28 Nov) */
.cols > * { min-width: 0; }
@media (min-width: 768px) { .wordmark { font-size: var(--fs-h2); } }
.section-head a, .site-foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* Arcade + New/Popular side rail */
.arcade { display: grid; gap: var(--s6); }
.arcade-main { min-width: 0; }
.rail { min-width: 0; }
.rail section + section { margin-top: var(--s6); }
.rail-list { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.rail-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); min-height: 44px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.rail-item:last-child { border-bottom: 0; }
.rail-item:hover, .rail-item:focus-visible { color: var(--accent-text); }
.rail-title { font-weight: 600; }
.rail .empty { margin-top: var(--s3); padding: var(--s4); }
@media (min-width: 1024px) {
  .arcade { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: var(--gutter); }
  .rail { position: sticky; top: var(--s5); }
}

.field-search { margin: 0; max-width: 28rem; }
.field-search input { width: 100%; }
