/* GameDeals — premium minimal dark design (plan section 1A). No framework, no web fonts. */
:root {
  color-scheme: dark;
  --bg: #0d1018;
  --surface: #171c28;
  --surface-hover: #202636;
  --line: #2b3344;
  --text: #f4f6fb;
  --muted: #a5afc1;
  --accent: #9b86ff;
  --accent-ink: #120d2b;
  --positive: #54d6a0;
  --warn: #e8c46b;
  --radius-card: 16px;
  --radius-control: 10px;
  --layout-width: 1160px;
  --s: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
.analytics-panel {
  position: fixed; z-index: 8; inset: auto 1rem 1rem auto;
  width: min(28rem, calc(100% - 2rem)); max-height: 75vh; overflow: auto;
  padding: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: 0 8px 30px #0007;
}
.analytics-panel h2, .analytics-panel p { margin-bottom: .65rem; }
.analytics-panel p { color: var(--muted); font-size: .9rem; }
.analytics-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.analytics-actions button {
  min-height: 44px; padding: .45rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius-control); background: var(--surface-hover);
  color: var(--text); font: inherit; cursor: pointer;
}
.analytics-actions button:hover { border-color: var(--accent); }
.analytics-settings {
  border: 0; padding: 0; background: none; color: inherit; font: inherit;
  text-decoration: underline; cursor: pointer;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 calc(var(--s) * 2); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0 0 calc(var(--s) * 2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s); top: var(--s); background: var(--surface); padding: var(--s); z-index: 10; }
.wrap { max-width: var(--layout-width); margin: 0 auto; padding: 0 calc(var(--s) * 2.5); }
.narrow { max-width: 780px; }
.section { padding: calc(var(--s) * 5) 0 0; }
.section .wrap, .wrap.section { padding-top: calc(var(--s) * 5); }
.wrap.section { padding-left: calc(var(--s) * 2.5); padding-right: calc(var(--s) * 2.5); } /* .section's shorthand must not remove .wrap side padding */

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(13,16,24,.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.header-row { display: flex; align-items: center; gap: calc(var(--s) * 2); min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .12em; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s); font-size: .95rem; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transform: rotate(45deg) scale(.8); }
.header-search { flex: 1 1 220px; }
.header-search input, .hero-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-control); padding: 10px 14px; font: inherit;
}
.header-search input:focus, .hero-search input:focus { border-color: var(--accent); outline: none; }
.main-nav { display: flex; gap: calc(var(--s) * 2); }
.main-nav a { text-decoration: none; color: var(--muted); }
.main-nav a[aria-current], .main-nav a:hover { color: var(--text); }
.region { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .85rem; }
.region a { padding: 4px 10px; text-decoration: none; color: var(--muted); }
.region a[aria-current] { background: var(--surface-hover); color: var(--text); }
.preview-bar { text-align: center; font-size: .78rem; color: var(--warn); border-top: 1px solid var(--line); padding: 3px var(--s); }

/* Hero */
.hero { padding: calc(var(--s) * 9) 0 calc(var(--s) * 3); text-align: center; }
.hero h1 { margin-bottom: calc(var(--s) * 4); }
.hero-search { display: flex; gap: var(--s); max-width: 620px; margin: 0 auto calc(var(--s) * 2.5); }
.hero-search input { padding: 14px 16px; font-size: 1.05rem; }
button, .button {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-control);
  padding: 12px 18px; font: 600 1rem var(--font); cursor: pointer; text-decoration: none; display: inline-block;
  transition: filter 150ms ease; white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(1.08); }
.explore { color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s); align-items: center; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--s); margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .88rem;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text);
  transition: background 150ms ease, border-color 150ms ease;
}
.chip:hover { background: var(--surface-hover); border-color: #3a4459; }
.chip.on { border-color: var(--accent); background: #241f40; }
.chip .n { color: var(--muted); font-size: .78rem; }
.chip-quiet { color: var(--muted); background: transparent; }

/* Sections & grid */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s); margin-bottom: calc(var(--s) * 2); }
.section-head a { color: var(--muted); font-size: .92rem; }
.grid { display: grid; gap: calc(var(--s) * 2.5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .grid-2 { grid-template-columns: repeat(3, 1fr); } .game-main .grid-2 { grid-template-columns: repeat(2, 1fr); } }

/* Card */
.card { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; border: 1px solid transparent; transition: background 150ms ease, border-color 150ms ease; }
.card:hover { background: var(--surface-hover); border-color: var(--line); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-art { aspect-ratio: 616 / 353; background: #111522; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.art-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #1b2133, #241f40); }
.card-body { padding: calc(var(--s) * 2) calc(var(--s) * 2.25) calc(var(--s) * 2.25); display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.05rem; margin-bottom: 6px; }
.card-hook { color: var(--muted); font-size: .93rem; margin-bottom: calc(var(--s) * 1.5); flex: 1; }
.card-why { font-size: .85rem; color: var(--accent); margin-bottom: var(--s); }
.card-price { display: flex; align-items: baseline; gap: var(--s); min-height: 1.6em; }
.price { font-size: 1.2rem; font-weight: 700; }
.discount { font-weight: 700; color: var(--positive); }
.card-meta { font-size: .8rem; color: var(--muted); margin: 4px 0 0; }
.price-stale .price, .price-none .price { color: var(--muted); font-weight: 600; }
.price-stale .card-meta, .price-ended .card-meta, .price-stale .offer-note { color: var(--warn); }

/* Discover */
.discover-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s); }
.result-count { color: var(--muted); }
.result-count strong { color: var(--text); }
.discover { display: grid; gap: calc(var(--s) * 3); grid-template-columns: 1fr; }
@media (min-width: 900px) { .discover { grid-template-columns: 280px 1fr; } }
.facets { display: flex; flex-direction: column; gap: calc(var(--s) * 2); }
.facet summary { cursor: pointer; font-weight: 600; margin-bottom: var(--s); }
.facet-toggle { font-size: .9rem; color: var(--muted); margin: 0; }
.sort { display: flex; gap: var(--s); align-items: center; justify-content: flex-end; margin-bottom: calc(var(--s) * 2); color: var(--muted); font-size: .9rem; }
.sort select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 8px 10px; font: inherit; }
.sort button { padding: 8px 14px; font-size: .9rem; }
.empty { background: var(--surface); border-radius: var(--radius-card); padding: calc(var(--s) * 3); color: var(--muted); }
.pager { display: flex; gap: var(--s); justify-content: center; margin-top: calc(var(--s) * 3); }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); text-decoration: none; }
.pager a[aria-current] { border-color: var(--accent); }

/* CTA */
.cta { display: flex; justify-content: space-between; align-items: center; gap: calc(var(--s) * 3); background: var(--surface); border-radius: var(--radius-card); padding: calc(var(--s) * 3.5); }
.cta p { color: var(--muted); margin: 0; }
.cta-badge { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: .85rem; white-space: nowrap; }
.coverage { color: var(--muted); font-size: .85rem; margin-top: calc(var(--s) * 2); }

/* Game page */
.game-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.game-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.game-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,16,24,.35), var(--bg)); }
.game-hero-inner { position: relative; z-index: 1; display: grid; gap: calc(var(--s) * 3); padding-top: calc(var(--s) * 6); padding-bottom: calc(var(--s) * 4); }
@media (min-width: 900px) { .game-hero-inner { grid-template-columns: 1fr 360px; align-items: end; } }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: var(--s); }
.game-hook { font-size: 1.2rem; color: #d6dbe7; max-width: 40em; }
.offer { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--line); }
.offer-art { width: 100%; aspect-ratio: 616 / 353; object-fit: cover; }
.offer-body { padding: calc(var(--s) * 2.5); }
.offer-price { display: flex; gap: calc(var(--s) * 1.5); align-items: baseline; margin-bottom: 4px; }
.offer-price .price { font-size: 1.8rem; }
.offer-price .discount { font-size: 1.2rem; }
.offer-list { color: var(--muted); font-size: .9rem; margin-bottom: var(--s); }
.offer-note { font-size: .85rem; color: var(--muted); margin-bottom: var(--s); }
.offer .button { width: 100%; text-align: center; margin: var(--s) 0; }
.offer .offer-example-button:disabled { opacity: .65; cursor: not-allowed; filter: none; font-size: inherit; }
.store-deals, .store-compare { border-top: 1px solid var(--line); margin-top: var(--s); padding-top: var(--s); font-size: .9rem; }
.store-deals h2 { font-size: .9rem; margin: 0; }
.store-compare summary { cursor: pointer; padding: 6px 0; }
.store-price-list { list-style: none; margin: 0; padding: 0; }
.store-price-list li { padding: var(--s) 0; }
.store-price-list li + li { border-top: 1px solid var(--line); }
.store-price-list li > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: var(--s); }
.store-price-list li > span { display: block; color: var(--muted); font-size: .8rem; }
.store-deal-price { display: flex; align-items: baseline; gap: var(--s); }
.offer-other { font-size: .82rem; color: var(--muted); margin: var(--s) 0 0; }
.game-body { display: grid; gap: calc(var(--s) * 5); padding-top: calc(var(--s) * 4); padding-bottom: calc(var(--s) * 4); }
@media (min-width: 900px) { .game-body { grid-template-columns: 1fr 300px; } }
.game-main section, .game-side section { margin-bottom: calc(var(--s) * 4.5); }
.summary { font-size: 1.05rem; max-width: 42em; }
.ai-label { font-size: .8rem; color: var(--muted); }
.traits { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s); }
.traits details summary { list-style: none; cursor: pointer; }
.traits details summary::-webkit-details-marker { display: none; }
.traits details[open] { flex-basis: 100%; }
.evidence { font-size: .88rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: calc(var(--s) * 1.5); margin: var(--s) 0 0; max-width: 46em; }
.shots { display: grid; gap: var(--s); grid-template-columns: repeat(2, 1fr); }
.shots img { border-radius: var(--radius-control); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.plain { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.plain li { padding: 3px 0; }
.data-details { background: var(--surface); border-radius: var(--radius-card); padding: calc(var(--s) * 2); font-size: .9rem; }
.data-details summary { cursor: pointer; font-weight: 600; }
.data-details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px calc(var(--s) * 2); margin: calc(var(--s) * 2) 0; }
.data-details dt { color: var(--muted); }
.data-details dd { margin: 0; overflow-wrap: anywhere; }

/* Prose & footer */
.prose h2 { margin-top: calc(var(--s) * 4); }
.prose p { color: #d6dbe7; }
.site-footer { border-top: 1px solid var(--line); margin-top: calc(var(--s) * 8); padding: calc(var(--s) * 4) 0; }
.disclaimer { font-size: .8rem; color: var(--muted); max-width: 60em; }
.footer-nav a { color: var(--muted); font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 640px) { .site-header { position: static; } .hero { padding-top: calc(var(--s) * 5); } }

/* Landing pages (theme / trait) */
.landing-hero { padding: calc(var(--s) * 7) 0 calc(var(--s) * 1); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #121726, var(--bg)); }
.landing-hero h1 { margin-bottom: calc(var(--s) * 2.5); }
.landing-intro p, .landing-lead { font-size: 1.08rem; color: #d6dbe7; max-width: 44em; }
.landing-intro a { text-decoration-color: var(--accent); }
.landing-meta { color: var(--muted); font-size: .9rem; padding-bottom: calc(var(--s) * 2); }
.landing-meta strong { color: var(--positive); font-weight: 600; }
@media (min-width: 980px) {
  .grid-feature > .card:first-child { grid-column: span 2; grid-row: span 2; }
  .grid-feature > .card:first-child .card-title { font-size: 1.35rem; }
  .grid-feature > .card:first-child .card-hook { font-size: 1.02rem; }
  .grid-feature > .card:first-child .card-art { aspect-ratio: auto; flex: 1 1 auto; min-height: 280px; }
  .grid-feature > .card:first-child .card-hook { flex: 0 0 auto; }
}
.landing-panel { background: var(--surface); border-radius: var(--radius-card); padding: calc(var(--s) * 3); }
.landing-panel .chips { margin-bottom: calc(var(--s) * 1.5); }
.landing-panel p.small { margin: 0; }
.game-side .plain a { color: var(--muted); }
.facet-row { margin-top: calc(var(--s) * 1.5); }

/* Screenshot viewer (native <dialog>, public/assets/js/viewer.js) */
.shots a { display: block; cursor: zoom-in; }
.viewer { border: 0; padding: 0; margin: 0; background: transparent; color: var(--text); width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; overflow: hidden; box-sizing: border-box; }
.viewer[open] { display: flex; align-items: center; justify-content: center; gap: 12px; }
.viewer::backdrop { background: rgba(6, 8, 13, .92); }
.v-fig { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 0; }
.v-fig img { display: block; width: auto; height: auto; max-width: calc(100vw - 150px); max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); object-fit: contain; border-radius: var(--radius-control); background: var(--surface); }
.v-count { color: var(--muted); font-size: .85rem; line-height: 1; }
.viewer button { display: flex; align-items: center; justify-content: center; padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; flex: none; }
.viewer button:hover { background: var(--surface-hover); }
.viewer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
@media (max-width: 640px) {
  .viewer[open] { gap: 0; }
  .v-fig img { max-width: 100vw; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); }
  .v-prev, .v-next { position: absolute; bottom: 12px; z-index: 1; }
  .v-prev { left: 16px; } .v-next { right: 16px; }
}
