/* Public storefront layout — loaded only from base.html, not admin/shell.
   Colors come from app.css :root / [data-theme] so light/dark both work.
   Poster cards keep the original 3:4 look from app.css. */

body.site {
  --sans: "Inter", "Space Grotesk", system-ui, sans-serif;
  --serif: "Inter", "Space Grotesk", system-ui, sans-serif;
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

body.site .wrap { width: min(1240px, calc(100% - 32px)); }
body.site .site-main { width: 100%; margin: 0; }

body.site .topbar {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}
body.site .topbar-inner { min-height: 64px; gap: 16px; }
body.site .brand { color: var(--ink); }
body.site .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
body.site .nav { gap: 4px 16px; }
body.site .nav > a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}
body.site .nav > a:hover { color: var(--ink); }
body.site .nav a.nav-pin {
  color: var(--ink-on-accent);
  background: var(--accent);
  border: 0;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 14px;
  box-shadow: 0 8px 18px var(--glow);
}
body.site .nav a.nav-pin:hover {
  color: var(--ink-on-accent);
  filter: brightness(1.06);
}
body.site .nav-search { margin-left: auto; }
body.site .nav-search input {
  width: min(220px, 32vw);
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 0.82rem;
}
body.site .nav-tools {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  margin-left: 0;
}
body.site .theme-toggle {
  color: var(--muted);
  font-size: 0.84rem;
}
html[data-theme="dark"] body.site .nav a.btn-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}
html[data-theme="dark"] body.site .nav a.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  filter: none;
}

/* Hero stays cinematic dark in both themes */
.nfa-hero {
  position: relative;
  isolation: isolate;
  min-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 0 8px;
  padding: 72px 16px 56px;
  color: #fafafa;
  background: #121018;
}
.nfa-mosaic {
  position: absolute;
  inset: -12% -6% -22% -6%;
  z-index: 0;
  display: flex;
  gap: 12px;
  opacity: 0.72;
  transform: rotate(-3deg) scale(1.12);
  pointer-events: none;
}
.nfa-mosaic-col {
  flex: 1 1 0;
  min-width: 0;
  will-change: transform;
}
.nfa-mosaic-col.is-up {
  animation: nfa-drift-up 80s linear infinite;
}
.nfa-mosaic-col.is-down {
  animation: nfa-drift-down 94s linear infinite;
}
@keyframes nfa-drift-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
@keyframes nfa-drift-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}
.nfa-mosaic-col img,
.nfa-mosaic-col span {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 0 12px;
  display: block;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
@media (prefers-reduced-motion: reduce) {
  .nfa-mosaic-col { animation: none; }
}
.nfa-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(640px 420px at 18% 42%, rgba(88, 28, 135, 0.28), transparent 62%),
    radial-gradient(560px 380px at 82% 36%, rgba(190, 24, 93, 0.18), transparent 60%);
  pointer-events: none;
}
.nfa-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 68% 52% at 50% 40%, rgba(12, 10, 18, 0.22), rgba(12, 10, 18, 0.38) 100%);
  pointer-events: none;
}
.nfa-hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 760px;
}
.nfa-hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  margin: 0 0 16px;
  font-weight: 800;
  color: #fff;
}
.nfa-hero-copy h1 em {
  font-style: normal;
  color: #a1a1aa;
  display: block;
}
.nfa-hero-copy .lede {
  margin: 0 auto 28px;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.62);
  font-size: 1.02rem;
}
.nfa-hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.nfa-hero-actions .btn {
  min-width: 168px;
  min-height: 46px;
  background: #fff;
  color: #0a0a0a;
}
.nfa-hero-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.nfa-chips {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0 0 36px;
}
.nfa-chips span::before {
  content: "✓";
  color: #4ade80;
  margin-right: 6px;
  font-weight: 700;
}
.nfa-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(860px, 100%);
}
.nfa-stats article {
  background: rgba(18, 18, 18, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 12px 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  color: #fff;
}
.nfa-stats strong {
  display: block;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}
.nfa-stats span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 600;
}

/* Catalog marketplace */
.nfa-catalog { padding: 48px 0 12px; }
.nfa-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}
.nfa-section-head h2 { margin: 0 0 6px; }
.nfa-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.nfa-catalog h2,
.nfa-how h2,
.nfa-why h2,
.nfa-faq h2 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}
.catalog-lead { margin: 0 0 22px; }
.nfa-market {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 8px 0 32px;
}
.nfa-filters {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px 20px;
  position: sticky;
  top: 84px;
}
.nfa-filters h2 { font-size: 0.95rem; margin: 0 0 16px; }
.nfa-filters h3 {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 10px;
}
.nfa-side-search {
  min-height: 40px;
  border-radius: 12px;
  font-size: 0.84rem;
}
.nfa-game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
}
.nfa-game-list li { margin: 0; }
.nfa-game-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.84rem;
  cursor: pointer;
}
.nfa-game-list label:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nfa-game-list img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--input);
}
.nfa-pills,
.nfa-sort { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nfa-pills button,
.nfa-sort button {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.nfa-pills button.is-on,
.nfa-sort button.is-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.nfa-sort-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-right: 4px;
}
.nfa-market-search { margin-bottom: 12px; }
.nfa-market-search .game-search { margin: 0; }
.nfa-market-search input {
  min-height: 48px;
  border-radius: 14px;
}
.nfa-market-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 16px;
  font-size: 0.88rem;
  font-weight: 600;
}
.nfa-market .poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.nfa-how,
.nfa-why,
.nfa-faq { padding: 48px 0 12px; }
.nfa-steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.nfa-steps li,
.nfa-why-grid article {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px 20px;
}
.nfa-steps span {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 12px;
}
.nfa-steps strong { display: block; margin-bottom: 6px; }
.nfa-steps p,
.nfa-why-grid p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.nfa-why-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.nfa-why-grid strong { display: block; margin: 8px 0 6px; }
.nfa-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

body.site .page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0 18px;
}
body.site .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
body.site .chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Bottom CTA: readable in both themes; dark must not blend into --bg */
body.site .home-cta {
  margin: 20px auto 0;
  background:
    radial-gradient(520px 180px at 94% 12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    var(--hero);
  color: var(--hero-ink);
  border: 1px solid color-mix(in srgb, var(--hero-ink) 16%, transparent);
  box-shadow: var(--shadow);
}
body.site .footer {
  margin-top: 20px;
}
body.site .footer-grid {
  padding-top: 24px;
}
body.site .home-cta .nfa-kicker,
body.site .home-cta .muted {
  color: color-mix(in srgb, var(--hero-ink) 72%, transparent);
}
body.site .home-cta h2 { color: var(--hero-ink); }
body.site .home-cta .btn {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 12px 22px;
  white-space: nowrap;
  background: #fff;
  color: #0a0a0a;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}
body.site .home-cta .btn:hover { filter: brightness(0.96); }
html[data-theme="dark"] body.site .home-cta {
  background:
    radial-gradient(560px 200px at 96% 8%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    #1a2040;
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
}

@media (max-width: 1040px) {
  .nfa-market,
  .nfa-stats,
  .nfa-steps,
  .nfa-why-grid,
  body.site .split { grid-template-columns: 1fr 1fr; }
  .nfa-market { grid-template-columns: 1fr; }
  .nfa-filters { position: static; }
  .nfa-mosaic { inset: -4rem -1rem; }
  .nfa-mosaic-col:nth-child(1),
  .nfa-mosaic-col:nth-child(6) { display: none; }
}
@media (max-width: 840px) {
  body.site .nav-search { width: 100%; margin-left: 0; }
  body.site .nav-search input { width: 100%; }
  body.site .nav-tools { border-left: 0; padding-left: 0; }
  .nfa-hero { min-height: 0; padding: 48px 16px 36px; }
  .nfa-stats,
  .nfa-steps,
  .nfa-why-grid { grid-template-columns: 1fr; }
  .nfa-mosaic-col:nth-child(2),
  .nfa-mosaic-col:nth-child(5) { display: none; }
  .nfa-mosaic { grid-template-columns: none; }
}

.online-desk {
  display: grid;
  gap: 16px;
}
.online-desk .delivery-game {
  padding-bottom: 12px;
  margin-bottom: 0;
}
.online-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--input);
  font-size: 0.9rem;
}
.online-status strong { letter-spacing: -0.03em; }
.online-status span { color: var(--muted); }
.online-status[data-online-state="live"] {
  background: color-mix(in srgb, var(--ok) 14%, var(--input));
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
}
.online-status[data-online-state="soon"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--input));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.online-session {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.online-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--input);
  align-content: start;
}
.online-card h2 { margin: 0; font-size: 1.2rem; }
.online-card .eyebrow { margin: 0; }
.online-card .secret-row { margin-top: 4px; }
.online-guard .guard-code-stage {
  width: 100%;
}
.online-guard .guard-code-stage code {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}
.online-session.is-locked .online-guard {
  opacity: 0.72;
}
.online-kick { margin: 0; }
.online-kick .btn {
  width: 100%;
  min-height: 44px;
}
.online-kick .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.steam-run-wrap {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.steam-run-wrap .muted {
  margin: 0;
  font-size: 0.82rem;
}
body.site .steam-run {
  width: 100%;
  min-height: 44px;
  font-weight: 700;
}
body.site .steam-run[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.online-cal-card { gap: 10px; }
.online-book { display: grid; gap: 12px; max-width: none; }
.online-book-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.play-cal {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.play-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.play-cal-month {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.play-cal-weekdays,
.play-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.play-cal-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}
.play-cal-daybtn {
  appearance: none;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  color: var(--ink);
  border-radius: 12px;
  min-height: 44px;
  padding: 6px 4px 8px;
  display: grid;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
}
.play-cal-daybtn[disabled] {
  opacity: 0.28;
  cursor: default;
}
.play-cal-daybtn small {
  font-size: 0.92rem;
  font-weight: 700;
}
.play-cal-dots {
  display: flex;
  gap: 3px;
  min-height: 6px;
}
.play-cal-daybtn.is-today { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.play-cal-daybtn.is-on {
  background: var(--accent);
  color: var(--ink-on-accent);
  border-color: var(--accent);
}
.play-cal-daybtn.is-busy:not(.is-on) {
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-elev));
}
.play-cal-daybtn.is-mine:not(.is-on) {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev));
}
.play-cal-day {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.play-cal-day-head { font-weight: 700; }
.play-cal-range {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.play-cal-hours {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.play-cal-hour {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 10px;
  min-height: 38px;
  padding: 6px 4px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.play-cal-hour.is-busy,
.play-cal-hour.is-past {
  opacity: 0.38;
  cursor: not-allowed;
  text-decoration: line-through;
}
.play-cal-hour.is-cover {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.play-cal-hour.is-on {
  background: var(--accent);
  color: var(--ink-on-accent);
  border-color: var(--accent);
  opacity: 1;
  text-decoration: none;
}
.play-cal.is-ready .play-cal-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (max-width: 840px) {
  .online-session,
  .online-book-row,
  .play-cal-hours { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .online-session,
  .online-book-row { grid-template-columns: 1fr; }
  .play-cal-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
