/* =========================================================
   Play Mottle — Nocturnal Botanical Camo Field Theme
   Strictly 11 hex colors in :root, zero raw hex elsewhere.
   ========================================================= */
:root {
  --bg: #0E1713;
  --surface: #16231D;
  --surface-alt: #203229;
  --ink: #F2F5EE;
  --muted: #A4B5AA;
  --border: #2E4539;
  --primary: #E0A82E;
  --primary-dark: #F4C95D;
  --accent: #FF785A;
  --accent-soft: #2A1D1B;
  --mint-soft: #1B3328;

  --font-heading: 'Syne', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --pill: 999px;
  --shadow-hard: 0 4px 0 var(--border);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.36);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 18% 8%, var(--mint-soft), transparent 46%),
    radial-gradient(circle at 86% 14%, var(--accent-soft), transparent 40%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 12px;
}

h1 {
  font-size: 48px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 22px;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

a:hover {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

/* ---------------- Header ---------------- */
.topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
}

.brand:hover {
  color: var(--primary);
}

.brand-tiles {
  display: inline-flex;
  flex-shrink: 0;
}

.brand-tiles img,
.brand-tiles svg {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 8px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.topnav a:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--primary);
}

/* ---------------- Main & Hero Stage ---------------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

.hero {
  text-align: center;
  padding-bottom: 16px;
}

.hero-head {
  margin-bottom: 16px;
}

.hero-head h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.kicker,
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--primary);
  background: var(--mint-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  margin: 0 auto;
  max-width: 64ch;
  color: var(--muted);
  font-size: 16px;
}

.stage {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.cover,
.loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cover {
  background: var(--bg);
  cursor: pointer;
  z-index: 3;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  opacity: 0.45;
}

.cover-grid i {
  display: block;
}

.cover-grid i:nth-child(5n+1) { background: var(--mint-soft); }
.cover-grid i:nth-child(5n+2) { background: var(--surface-alt); }
.cover-grid i:nth-child(5n+3) { background: var(--accent-soft); }
.cover-grid i:nth-child(5n+4) { background: var(--surface); }
.cover-grid i:nth-child(5n+5) { background: var(--border); }

.cover-inner {
  position: relative;
  z-index: 2;
  padding: 24px 32px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.cover-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.cover-tag {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.play-btn {
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  min-height: 48px;
  padding: 12px 32px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--bg);
  background: var(--primary);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.14s ease;
}

.play-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.loader {
  display: none;
  background: var(--bg);
  z-index: 4;
}

[data-gf-state="loading"] .loader {
  display: flex;
}

[data-gf-err] [data-gf-loading] {
  display: none !important;
}

.loader-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.loader-bars i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.25;
  animation: firefly 1.1s infinite ease-in-out;
}

.loader-bars i:nth-child(2n) {
  background: var(--accent);
}

.loader-bars i:nth-child(2) { animation-delay: 0.1s; }
.loader-bars i:nth-child(3) { animation-delay: 0.2s; }
.loader-bars i:nth-child(4) { animation-delay: 0.3s; }
.loader-bars i:nth-child(5) { animation-delay: 0.4s; }
.loader-bars i:nth-child(6) { animation-delay: 0.5s; }
.loader-bars i:nth-child(7) { animation-delay: 0.6s; }
.loader-bars i:nth-child(8) { animation-delay: 0.7s; }
.loader-bars i:nth-child(9) { animation-delay: 0.8s; }

@keyframes firefly {
  0%, 100% { opacity: 0.22; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.06); }
}

.loader-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

[data-gf-playing] .cover {
  display: none;
}

.stage-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  padding: 24px;
  text-align: center;
}

.stage-error-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--ink);
}

.stage-error-hint {
  margin: 0 0 12px;
  max-width: 48ch;
  font-size: 14px;
  color: var(--muted);
}

.stage-error-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.stage-error-actions .btn,
.lost .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: var(--pill);
  border: 2px solid var(--primary);
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.stage-error-actions .btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

/* ---------------- Engagement Bar ---------------- */
.engage {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px auto 0;
  max-width: 940px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-2px);
}

.pill[aria-pressed="true"],
.pill[data-gf-liked] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.num {
  color: var(--primary);
  font-weight: 700;
}

.engage-msg {
  font-size: 14px;
  color: var(--primary);
  align-self: center;
}

.original-link {
  margin: 12px 0 0;
}

/* ---------------- Post-Run Score Card & Second-Hop Retention ---------------- */
.retention-band {
  max-width: 900px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.runlog {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.runlog[data-rank="dusk"] {
  border-color: var(--primary);
}

.runlog[data-rank="phantom"],
.runlog[data-rank="master"] {
  border-color: var(--accent);
}

.runlog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.runlog-head h2 {
  margin: 0;
  font-size: 22px;
}

.daily-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--primary);
  background: var(--mint-soft);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.daily-pill strong {
  color: var(--primary);
}

.daily-pill:hover {
  background: var(--surface-alt);
  color: var(--primary-dark);
}

.runlog-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.runlog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}

.runlog-chip strong {
  color: var(--ink);
}

.runlog-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.runlog-form .cinput {
  min-width: 0;
  min-height: 44px;
}

.btn-save {
  min-height: 44px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--pill);
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-save:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.runlog-msg {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--primary);
}

.daily-banner {
  max-width: 900px;
  margin: 0 auto 16px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.daily-banner[data-done="1"] {
  border-color: var(--primary);
  background: var(--mint-soft);
}

.daily-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.daily-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.daily-status {
  padding: 4px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.daily-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.daily-goal {
  margin: 0 0 12px;
  color: var(--muted);
}

.daily-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.next-card {
  display: block;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.16s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.next-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.next-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--primary);
}

.next-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.guide-lede {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 16px;
}

.guide-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}

.guide-play {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.next-strip {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.next-strip h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ---------------- Adsterra Slots ---------------- */
.ad-slot {
  max-width: 780px;
  margin: 32px auto;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
}

.ad-slot .ad-label {
  margin: 0 0 8px;
  max-width: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-frame-banner,
.ad-frame-rect,
.ad-frame-native {
  margin: 0 auto;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.ad-frame-banner { width: 320px; min-height: 50px; }
.ad-frame-rect { width: 300px; min-height: 250px; }
.ad-frame-native { width: 100%; min-height: 120px; }
.ad-slot iframe { border: 0; display: block; margin: 0 auto; max-width: 100%; }

/* ---------------- Editorial Prose & Tables ---------------- */
.prose {
  max-width: 780px;
  margin: 48px auto 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.prose h1 {
  font-size: 36px;
  margin-bottom: 16px;
}

.prose h2 {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.prose h3 {
  margin-top: 24px;
  color: var(--primary);
}

.prose p,
.prose li {
  color: var(--ink);
  max-width: 70ch;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 24px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.prose th {
  background: var(--surface-alt);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.faq {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.faq h3 {
  color: var(--ink);
  font-size: 18px;
}

.faq-link,
.faq-more,
.faq-cta,
.back {
  margin: 16px 0;
  font-size: 14px;
}

/* ---------------- Comments Ledger ---------------- */
.talk {
  max-width: 780px;
  margin: 48px auto 0;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.talk-sub {
  color: var(--muted);
  margin-bottom: 16px;
}

.cform {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cinput {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

.cinput:focus {
  border-color: var(--primary);
}

.cform-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.send {
  min-height: 44px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--pill);
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.send:hover {
  background: var(--primary-dark);
}

.clink {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 8px 4px;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cmsg {
  font-size: 14px;
  color: var(--primary);
}

.creply {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
}

.cwrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cempty {
  display: none;
  margin: 0;
  color: var(--muted);
}

.cwrap[data-gf-empty] .cempty {
  display: block;
}

.cmt {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.cmt-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 14px;
}

.cmt-head time {
  color: var(--muted);
  font-size: 12px;
}

.cmt-text {
  margin: 8px 0;
  white-space: pre-wrap;
}

.cmt-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmt-reply {
  background: var(--surface-alt);
}

.lost {
  max-width: 640px;
  margin: 48px auto;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

/* ---------------- Footer ---------------- */
.foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 14px;
}

.foot-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.foot-brand {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.foot-note {
  max-width: 68ch;
  margin: 0 0 16px;
}

.foot-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.foot-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--primary);
}

.foot-copy {
  margin: 0;
  font-size: 12px;
}

/* ---------------- Responsive & Reduced Motion ---------------- */
@media (max-width: 640px) {
  h1,
  .hero-head h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 22px;
  }

  .topbar,
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topnav {
    gap: 4px;
  }

  .topnav a {
    padding: 8px 12px;
  }

  .stage {
    aspect-ratio: 4 / 3;
    min-height: 280px;
  }

  html[data-gf-playing] .stage {
    aspect-ratio: auto;
    height: clamp(420px, 68svh, 560px);
  }

  .runlog,
  .daily-banner,
  .next-card,
  .prose,
  .talk {
    padding: 16px;
  }

  .prose,
  .talk {
    margin-top: 32px;
  }

  .runlog-form,
  .next-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cover-inner {
    padding: 16px;
  }

  .cover-title {
    font-size: 22px;
  }

  .play-btn {
    padding: 12px 24px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
