/* ==========================================================================
   P999 Game — shared stylesheet
   Dark theme matching the app's own black/gold visual identity.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Design tokens ---------- */
:root {
  --bg: #0f0c0a;
  --bg-soft: #14100c;
  --surface: #1c1611;
  --surface-2: #221a13;
  --border: rgba(242, 167, 27, 0.16);
  --border-strong: rgba(242, 167, 27, 0.38);
  --text: #f3ead9;
  --text-muted: #b3a690;
  --text-faint: #8a7d6a;
  --gold: #f2a71b;
  --gold-deep: #c47a0c;
  --gold-tint: rgba(242, 167, 27, 0.12);
  --green: #35b975;
  --red: #e0503a;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --header-h: 74px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --container: 1160px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { display: block; }

::selection { background: var(--gold); color: #000000; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--gold);
  color: #000000;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Links (editorial body) ---------- */
.prose a:not(.btn) { color: var(--gold); text-decoration: underline; text-decoration-color: rgba(242,167,27,0.4); text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 12, 10, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-header.is-stuck {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-bottom-color: var(--border);
}
.header-bar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo svg { display: block; width: 150px; height: auto; }

/* Nav panel: flex at desktop — required so CTA stays on one row (see build spec) */
.nav-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #000000; box-shadow: 0 10px 24px rgba(242, 167, 27, 0.25); }
.btn-primary:hover { background: #ffb733; color: #000000; }
.btn-secondary { background: #f3ead9; color: #14100c; border-color: var(--gold-deep); }
.btn-secondary:hover { background: #ffffff; border-color: var(--gold); color: #000000; }
.btn-block { width: 100%; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px 22px;
    gap: 6px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-panel.is-open { display: flex; }
  .site-nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 13px 14px; }
  .nav-panel .btn-primary { width: 100%; margin-top: 8px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Eyebrow / Hero / Article head ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-tint);
  color: var(--gold);
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}

.article-head { padding-block: 34px 8px; }
.article-head .wrap > * + * { margin-top: 16px; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 780px;
  margin-inline: auto;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.cta-row__note { font-size: 0.85rem; color: var(--text-faint); width: 100%; margin-top: 2px; }

.h1 {
  font-size: clamp(2rem, 5.2vw, 3.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 780px;
  margin-inline: auto;
}

.lede {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: var(--text-muted);
  max-width: 780px;
  margin-inline: auto;
}

/* ---------- Table of contents ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  max-width: 780px;
  margin-inline: auto;
}
.toc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 10px; }
.toc ol { columns: 1; counter-reset: toc; display: grid; grid-template-columns: 1fr; gap: 6px 24px; }
@media (min-width: 620px) { .toc ol { grid-template-columns: 1fr 1fr; } }
.toc li { break-inside: avoid; }
.toc a { display: block; padding: 6px 4px; border-radius: 6px; color: var(--text-muted); font-size: 0.95rem; }
.toc a:hover { color: var(--gold); background: var(--gold-tint); }

/* ---------- Article body layout ---------- */
.article-body { padding-block: 40px 20px; }
.prose { max-width: 780px; margin-inline: auto; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 2.4em;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1.8em;
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose p { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; color: var(--text-muted); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 1em;
  color: var(--text-muted);
  font-style: italic;
}

/* Wide sections that break out of the 780px reading column */
.prose .full-bleed { max-width: var(--container); margin-inline: auto; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; padding: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.steps li::before {
  content: counter(step);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: #000000;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.steps li p, .steps li { color: var(--text); margin: 0; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.chips li {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
}

/* ---------- Grid / cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 680px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.card h3 { margin-top: 0; margin-bottom: 10px; }
.card.card--cons { border-top-color: var(--red); }
.card.card--pros { border-top-color: var(--green); }
.card ul { margin: 0; padding-left: 1.2em; color: var(--text-muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table-wrap table { min-width: 560px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.table-wrap th { background: var(--surface-2); color: var(--gold); font-weight: 700; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td { color: var(--text-muted); }

/* ---------- Callout ---------- */
.callout {
  border-left: 4px solid var(--gold);
  background: var(--gold-tint);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  color: var(--text);
}
.callout p { color: var(--text); margin: 0; }
.callout strong { color: var(--gold); }

/* ---------- Disclaimer ---------- */
.disclaimer {
  border: 1px solid rgba(224, 80, 58, 0.4);
  background: rgba(224, 80, 58, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.disclaimer strong { color: var(--red); }

/* ---------- Screenshot figure ---------- */
.shot { max-width: 300px; margin: 0 auto; text-align: center; }
.shot img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.shot figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Review / testimonial ---------- */
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.review + .review { margin-top: 12px; }
.review p { color: var(--text); font-style: italic; margin: 0 0 8px; }
.review cite { color: var(--gold); font-weight: 700; font-style: normal; font-size: 0.9rem; }

/* ---------- FAQ accordion ---------- */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .faq-a { padding: 0 20px 18px; color: var(--text-muted); }
.faq .faq-a > * + * { margin-top: 0.8em; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, #241a0d, #171210 60%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-band h2 { margin-top: 0 !important; }
.cta-band p { color: var(--text-muted); max-width: 560px; margin-inline: auto; }
.cta-band .btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---------- Post nav ---------- */
.post-nav { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color 0.15s ease;
}
.post-nav a:hover { border-color: var(--gold); }
.post-nav .post-nav__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.post-nav .post-nav__title { color: var(--text); font-weight: 700; margin-top: 4px; }
.post-nav .post-nav__next { text-align: right; }

/* ---------- App detail table icon row / stat tiles (index page) ---------- */
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.stat-tile strong { display: block; color: var(--gold); font-size: 1.3rem; }
.stat-tile span { color: var(--text-faint); font-size: 0.8rem; }

/* ---------- Blog card grid ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 680px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.blog-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.blog-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card__body h2 { font-size: 1.15rem; font-weight: 800; }
.blog-card__body p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.blog-card__link { color: var(--gold); font-weight: 700; font-size: 0.9rem; }

/* ---------- Page header (non-article pages: blog/faqs/about/privacy) ---------- */
.page-head { padding-block: 44px 30px; text-align: center; }
.page-head .h1 { max-width: 760px; }
.page-head .lede { margin-top: 14px; }
.page-head .cta-row { justify-content: center; }

/* ---------- About page methodology list ---------- */
.method-list { display: grid; gap: 14px; }
.method-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 20px; color: var(--text-muted); }
.method-list strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-grid {
  padding-block: 46px 26px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }
.footer-brand .logo svg { width: 130px; }
.footer-tagline { color: var(--gold); font-weight: 700; margin-top: 10px; font-size: 0.95rem; }
.footer-desc { color: var(--text-faint); font-size: 0.9rem; margin-top: 12px; max-width: 420px; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 460px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 12px; }
.footer-col ul { display: grid; gap: 8px; }
.footer-col a { color: var(--text-muted); font-size: 0.92rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-faint);
  font-size: 0.82rem;
}
.badge-18 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  color: var(--gold);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold);
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 90;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- 404 ---------- */
.not-found { padding-block: 90px; text-align: center; }
.not-found .code { font-family: var(--font-display); font-size: clamp(4rem, 14vw, 7rem); color: var(--gold); font-weight: 700; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.section-gap { padding-block: 10px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Print ---------- */
@media print {
  .site-header, .back-to-top, .nav-toggle, .cta-row, .cta-band, .site-footer .footer-bottom + *, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a[href^="http"]::after,
  .prose a[href^="/"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  .shot img { box-shadow: none; border: 1px solid #ccc; }
}
