/* Arcade.now design system - Dark CrazyGames-inspired theme. */

:root {
  --bg: #0e0f1c;
  --bg-deep: #0a0b14;
  --surface: #171929;
  --surface-2: #1e2136;
  --surface-3: #262a45;
  --border: #262a42;
  --border-light: #323753;
  --purple: #6842ff;
  --purple-hover: #7c5cff;
  --purple-soft: rgba(104, 66, 255, 0.16);
  --pink: #f472b6;
  --orange: #fb923c;
  --yellow: #facc15;
  --green: #4ade80;
  --blue: #38bdf8;
  --red: #f43f5e;
  --text: #f2f3f8;
  --text-muted: #a3a8c3;
  --text-faint: #6d7292;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 2px var(--purple), 0 8px 28px rgba(104, 66, 255, 0.35);
  --nav-h: 62px;
  --rail-w: 62px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--purple-hover); text-decoration: none; }
a:hover { color: #9d86ff; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
::selection { background: var(--purple); color: #fff; }

/* ---------- Top nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(14, 15, 28, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--text); }
.nav-logo .logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(104, 66, 255, 0.45);
}
.nav-logo .logo-now { color: var(--purple-hover); }

.nav-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.nav-search input {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 44px 0 18px;
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}
.nav-search input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.nav-search .search-ico {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: 48px; left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: none;
  z-index: 120;
}
.search-results.open { display: block; }
.search-results a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  color: var(--text);
}
.search-results a:hover, .search-results a.active { background: var(--purple-soft); }
.search-results img { width: 56px; height: 32px; object-fit: cover; border-radius: 6px; }
.search-results .sr-cat { margin-left: auto; color: var(--text-faint); font-size: 0.78rem; }

.nav-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-user { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 10px 22px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 4px 16px rgba(104, 66, 255, 0.4); }
.btn-primary:hover { background: var(--purple-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border-light); }
.btn-outline:hover { border-color: var(--purple); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: #fff; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-sm { padding: 7px 15px; font-size: 0.85rem; }
.btn-google {
  background: #fff; color: #1f2937;
  display: inline-flex; gap: 10px;
}
.btn-google:hover { background: #f1f3ff; color: #111; }
.btn-block { width: 100%; }

/* ---------- SVG icons ---------- */
.ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.rail a .ico,
.nav-logo .logo-mark .ico,
.promo-card .promo-ico .ico { display: block; }
.nav-search .search-ico { display: grid; place-items: center; }
.nav-user { display: inline-flex; align-items: center; gap: 7px; }
.mobile-panel a .ico { vertical-align: -4px; margin-right: 8px; }
.footer-bottom .ico { vertical-align: -2px; }
.tip-top .tag .ico { vertical-align: -2px; margin-right: 3px; }

/* ---------- Share bar ---------- */
.share-bar {
  margin: 26px 0 6px;
  padding: 20px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}
.share-lead .share-title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.share-lead p { margin: 0 0 14px; color: var(--text-muted); font-size: 0.92rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.share-btn:hover { color: #fff; filter: brightness(1.12); }
.share-btn:active { transform: scale(0.96); }
.sb-facebook { background: #1877f2; }
.sb-x { background: #0f1419; border: 1px solid #3a3f4d; }
.sb-reddit { background: #ff4500; }
.sb-whatsapp { background: #1faa53; }
.sb-telegram { background: #2599d2; }
.sb-email { background: #64748b; }
.sb-copy { background: var(--purple); }
.sb-native { background: var(--surface-3); }

/* ---------- Heritage (game history) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.heritage {
  margin: 26px 0 8px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.heritage-head h2 { margin: 0 0 4px; }
.heritage-origin { margin: 0 0 18px; color: var(--text-muted); font-size: 1rem; }
.heritage-origin strong { color: var(--purple-hover); }
.heritage-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}
.heritage-lede { margin-top: 0; color: var(--text); font-size: 1.03rem; line-height: 1.62; }
.heritage-facts { width: 100%; border-collapse: collapse; margin-top: 16px; }
.heritage-facts th, .heritage-facts td {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem; vertical-align: top;
}
.heritage-facts tr:last-child th, .heritage-facts tr:last-child td { border-bottom: none; }
.heritage-facts th { color: var(--text-faint); font-weight: 700; width: 42%; white-space: nowrap; }
.heritage-facts td { color: var(--text); font-weight: 600; }
.heritage-media { margin: 0; }
.heritage-media img {
  width: 100%; border-radius: var(--radius); display: block;
  border: 1px solid var(--border-light);
}
.heritage-media figcaption { margin-top: 10px; color: var(--text-faint); font-size: 0.8rem; text-align: center; }
.heritage-board {
  margin-top: 14px; display: flex; flex-direction: column; gap: 3px;
  border-radius: var(--radius-sm); overflow: hidden;
}
.hb-row { padding: 8px 12px; font-size: 0.76rem; font-weight: 700; color: #fff; line-height: 1.2; }
.hb-home  { background: linear-gradient(90deg, #15803d, #22c55e); }
.hb-river { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.hb-safe  { background: #15803d; }
.hb-road  { background: linear-gradient(90deg, #334155, #475569); }
.hb-start { background: #166534; }
.heritage-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 4px; }
.hstat {
  flex: 1; min-width: 130px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; text-align: center;
}
.hstat-n { display: block; font-size: 1.75rem; font-weight: 800; color: var(--purple-hover); line-height: 1.1; }
.hstat-l { display: block; color: var(--text-muted); font-size: 0.84rem; margin-top: 4px; }
.heritage-highlights { margin: 20px 0; padding-left: 1.25em; }
.heritage-highlights li { color: var(--text-muted); margin-bottom: 0.55em; line-height: 1.5; }
.heritage-highlights li::marker { color: var(--purple-hover); }
.heritage-subhead { margin: 20px 0 8px; font-size: 1.15rem; }
.heritage-table-wrap { overflow-x: auto; }
.heritage-timeline { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.heritage-timeline th, .heritage-timeline td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.heritage-timeline thead th {
  color: var(--text-faint); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.07em;
}
.heritage-timeline td:first-child { color: var(--purple-hover); font-weight: 800; white-space: nowrap; width: 72px; }
.heritage-timeline td { color: var(--text-muted); }
.heritage-closing { color: var(--text-muted); margin-bottom: 0; line-height: 1.6; }
@media (max-width: 760px) {
  .heritage-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Sidebar rail ---------- */
.rail {
  position: fixed;
  top: var(--nav-h); bottom: 0; left: 0;
  width: var(--rail-w);
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  z-index: 90;
}
.rail a {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 1.2rem;
  position: relative;
}
.rail a:hover, .rail a.active { background: var(--purple-soft); color: #fff; }
.rail a .tip {
  position: absolute;
  left: 54px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  box-shadow: var(--shadow-md);
  z-index: 95;
}
.rail a:hover .tip { opacity: 1; }
.rail-sep { width: 32px; height: 1px; background: var(--border); margin: 8px 0; }

/* ---------- Layout ---------- */
.page {
  margin-top: var(--nav-h);
  margin-left: var(--rail-w);
  padding: 26px 28px 60px;
  min-height: calc(100vh - var(--nav-h));
}
.wrap { max-width: 1400px; margin: 0 auto; }
.prose-wrap { max-width: 900px; }

/* First paragraphs on root & subpages intentionally have NO width cap. */
.page-lead { max-width: none; width: 100%; }
.page-lead p { max-width: none; color: var(--text-muted); font-size: 1.02rem; }
.page-lead p strong, .page-lead p a { color: var(--text); }
.page-lead p a { text-decoration: underline; text-decoration-color: var(--purple); text-underline-offset: 3px; }

/* ---------- Game tiles ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}
.tile-grid.tile-grid-lg { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16/9;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 18, 0.88) 0%, transparent 46%);
}
.tile .tile-name {
  position: absolute;
  left: 12px; right: 12px; bottom: 9px;
  z-index: 2;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.tile:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-glow); z-index: 2; }
.tile .badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
}
.badge-hot { background: linear-gradient(90deg, #f97316, #ef4444); }
.badge-new { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.badge-top { background: linear-gradient(90deg, #f59e0b, #facc15); color: #422006; }

/* ---------- Section headers ---------- */
.section { margin: 34px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head .see-all {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--purple-hover);
}
.section-sub { color: var(--text-muted); margin-top: -8px; margin-bottom: 14px; }

/* ---------- Breadcrumbs ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: #fff; }
.crumbs .sep { color: var(--text-faint); }
.crumbs .here { color: var(--text); font-weight: 600; }

/* ---------- Content prose ---------- */
.content { max-width: none; }
.content h2 { margin-top: 2em; padding-top: 0.4em; }
.content h3 { margin-top: 1.4em; }
.content p, .content li { color: var(--text-muted); }
.content strong { color: var(--text); }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: 0.45em; }

/* Facts table */
.facts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.94rem;
}
.facts-table th, .facts-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.facts-table tr:last-child th, .facts-table tr:last-child td { border-bottom: none; }
.facts-table th { color: var(--text-faint); font-weight: 600; width: 34%; white-space: nowrap; }
.facts-table td { color: var(--text); }

/* How-to cards */
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.howto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.howto-card .step-n {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.howto-card h3 { font-size: 1rem; margin-bottom: 6px; }
.howto-card p { font-size: 0.92rem; margin: 0; color: var(--text-muted); }

/* Strategy list */
.tip-top {
  background: linear-gradient(135deg, rgba(104, 66, 255, 0.22), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(124, 92, 255, 0.45);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.tip-top .tag { color: var(--yellow); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tip-top p { margin: 4px 0 0; color: var(--text); }
.tips-list { list-style: none; padding: 0; counter-reset: tip; }
.tips-list li {
  counter-increment: tip;
  position: relative;
  padding: 12px 16px 12px 54px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.tips-list li::before {
  content: counter(tip);
  position: absolute;
  left: 14px; top: 12px;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--purple-hover);
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

/* FAQ accordion */
.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 46px 15px 18px;
  font-weight: 700;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--purple-hover);
  font-size: 1.3rem;
  font-weight: 700;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list .faq-a { padding: 0 18px 16px; color: var(--text-muted); }

/* Variant cards */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.variant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
}
.variant-card h3 { font-size: 0.98rem; margin-bottom: 5px; }
.variant-card p { font-size: 0.9rem; margin: 0; color: var(--text-muted); }

/* Promo cards */
.promo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.promo-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.promo-card:hover { border-color: var(--purple); transform: translateY(-3px); color: var(--text); }
.promo-card .promo-ico { font-size: 1.7rem; margin-bottom: 8px; }
.promo-card h3 { margin-bottom: 5px; }
.promo-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* Category hero cards */
.cat-band {
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  background:
    radial-gradient(1000px 300px at 10% -20%, rgba(104, 66, 255, 0.35), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

/* ---------- Tables (leaderboards) ---------- */
.lb-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.lb-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:nth-child(1) td:first-child { color: var(--yellow); font-weight: 800; }
.lb-table tr:nth-child(2) td:first-child { color: #cbd5e1; font-weight: 800; }
.lb-table tr:nth-child(3) td:first-child { color: var(--orange); font-weight: 800; }
.lb-score { font-weight: 800; color: var(--green); }

/* Tab pills */
.pill-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.pill-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.pill-tabs a:hover { color: #fff; }
.pill-tabs a.active { background: var(--purple); color: #fff; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}
.form-control:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
textarea.form-control { min-height: 140px; resize: vertical; }

/* Alerts / flashes */
.flashes { position: fixed; top: calc(var(--nav-h) + 12px); right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  max-width: 340px;
}
.alert-info { background: #1e3a5f; color: #bae6fd; }
.alert-success { background: #14532d; color: #bbf7d0; }
.alert-danger { background: #7f1d1d; color: #fecaca; }

/* ---------- Footer ---------- */
.footer {
  margin-left: var(--rail-w);
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 44px 28px 30px;
}
.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer .foot-h { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text-muted); font-size: 0.92rem; }
.footer a:hover { color: #fff; }
.footer-brand p { color: var(--text-faint); font-size: 0.9rem; max-width: 320px; }
.footer-bottom {
  max-width: 1400px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}

/* ---------- Auth card ---------- */
.auth-card {
  max-width: 420px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  text-align: center;
}
.auth-card .auth-benefits { text-align: left; margin: 22px 0; padding: 0; list-style: none; }
.auth-card .auth-benefits li { padding-left: 28px; position: relative; margin-bottom: 10px; color: var(--text-muted); font-size: 0.94rem; }
.auth-card .auth-benefits li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 800; }

/* ---------- Error pages ---------- */
.err-hero { text-align: center; padding: 70px 20px; }
.err-hero .err-code {
  font-size: 5.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}
.err-hero p { color: var(--text-muted); max-width: 460px; margin: 10px auto 24px; }

/* ---------- Glossary ---------- */
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.gloss-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.gloss-item dt { font-weight: 800; margin-bottom: 4px; }
.gloss-item dt a { color: var(--purple-hover); }
.gloss-item dt a:hover { text-decoration: underline; }
.gloss-item dd { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.gloss-more { white-space: nowrap; font-size: 0.85rem; font-weight: 700; }
.gloss-usage {
  margin: 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 4px solid var(--purple);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-style: italic;
  font-size: 1.05rem;
}
.gloss-related { display: flex; flex-wrap: wrap; gap: 10px; }
.gloss-chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}
.gloss-chip:hover { background: var(--purple-soft); border-color: var(--purple); color: #fff; }
.gloss-chip-all { color: var(--purple-hover); }

/* ---------- Countdown pill ---------- */
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

/* ---------- Rating widget ---------- */
.rating-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rating-stars { display: inline-flex; gap: 3px; }
.rating-star {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--text-faint);
  padding: 2px; transition: transform 0.1s;
}
.rating-star:hover { transform: scale(1.2); }
.rating-star.lit { color: var(--yellow); }
.rating-meta { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Mobile ---------- */
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; padding: 6px; }
.mobile-panel {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 99;
  padding: 20px;
  overflow-y: auto;
}
.mobile-panel.open { display: block; }
.mobile-panel a {
  display: block;
  padding: 13px 10px;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 900px) {
  .rail { display: none; }
  .page, .footer { margin-left: 0; }
  .hamburger { display: block; }
  .nav-search { max-width: none; }
  .nav .btn { padding: 8px 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.5rem; }
  .page { padding: 18px 14px 50px; }
  .nav-user { display: none; }
}
@media (max-width: 560px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  /* The machine owns the small screen: tight page gutters, compact title. */
  .page { padding: 10px 6px 40px; }
  h1 { font-size: 1.2rem; margin-bottom: 0.4em; }
  .crumbs { font-size: 0.75rem; margin-bottom: 4px; }
  .share-btn span { display: none; }
  .share-btn { padding: 11px 13px; }
  .share-lead p { display: none; }
  .heritage { padding: 16px 14px; }
  .heritage-facts th { width: 46%; }
}

/* ---------- Category compare table ---------- */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.compare-table thead th {
  color: var(--text-faint); text-transform: uppercase;
  font-size: 0.7rem; letter-spacing: 0.07em;
}
.compare-table td { color: var(--text-muted); }
.compare-table td:first-child a { font-weight: 700; }

/* H1 subtitle on game pages */
.h1-sub { color: var(--text-muted); font-size: 1.05rem; margin: -4px 0 14px; font-weight: 600; }

/* Search results page */
.search-page-form { display: flex; gap: 10px; max-width: 560px; margin: 0 0 22px; }
.search-page-form input {
  flex: 1; height: 44px; border-radius: 999px;
  border: 1px solid var(--border-light); background: var(--surface-2);
  color: var(--text); padding: 0 18px; font-family: var(--font); outline: none;
}
.search-page-form input:focus { border-color: var(--purple); }

.heritage-more { margin: 14px 0 0; font-weight: 700; }

/* Picker forms on daily/leaderboard + canonical spotlight lists */
.picker-form {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 18px;
}
.picker-form label { color: var(--text-faint); font-size: 0.85rem; font-weight: 700; }
.picker-form select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-light); border-radius: 999px;
  padding: 9px 14px; font-family: var(--font); font-size: 0.92rem; outline: none;
}
.picker-form select:focus { border-color: var(--purple); }
.canon-links { list-style: none; padding: 0; margin: 0; }
.canon-links li { padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.canon-links li:last-child { border-bottom: none; }
.canon-links a { font-weight: 700; }

/* ---------- Mobile "action-first" ordering ----------
   On desktop the wrapper is transparent (display:contents) so document flow -
   and every uniqueness/SEO audit that reads it - is byte-identical to before.
   On phones it becomes a flex column and floats the actionable stuff (game
   picker, the machine/board, game links) above the intro prose, so a visitor
   landing on a page sees something to DO before a wall of text. Text stays in
   the DOM (just lower), so nothing is hidden from crawlers. */
.action-first { display: contents; }
@media (max-width: 560px) {
  .action-first { display: flex; flex-direction: column; }
  /* Default: any block that isn't a lifted role sinks into the "deep content"
     zone (order 6), so long-form sections on content-heavy pages (e.g. category
     pages) land below the action without each needing a class. h1 always leads. */
  .action-first > *             { order: 6; }
  .action-first > h1            { order: 0; }
  .action-first > .af-control   { order: 1; }  /* machine/window picker */
  .action-first > .af-primary   { order: 2; }  /* the board, machine, or game tiles */
  .action-first > .af-secondary { order: 3; }  /* e.g. today's top-20 */
  .action-first > .af-browse    { order: 4; }  /* spotlight game links */
  .action-first > .page-lead    { order: 5; }  /* intro prose sinks below the action */
  .action-first > .af-detail    { order: 6; }  /* "how it works" explainer sinks last */
  /* Category hero: on phones dissolve the gradient band so the H1 can stay on
     top while its lead paragraphs sink below the tiles. Desktop keeps the band
     intact (display:contents only applies inside this media query). */
  .action-first > .cat-band              { display: contents; }
  .action-first > .cat-band > h1         { order: 0; }
  .action-first > .cat-band > .page-lead { order: 5; }
  /* Fat, thumb-friendly picker controls when they lead the page. */
  .picker-form.af-control { gap: 8px 10px; }
  .picker-form.af-control select { flex: 1 1 42%; min-width: 0; padding: 12px 14px; font-size: 1rem; }
  .canon-links li { padding: 10px 0; }
}

/* TL;DR / quick-take callouts */
.tldr {
  background: var(--purple-soft);
  border-left: 4px solid var(--purple);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.98rem;
}
.tldr strong { color: var(--purple-hover); }
