/* NovaVoro Mod Analytics — matches the palette and chrome defined inline in
   index.html (--bg, --cyan, --blue, --pink, --purple, --green, --gold). */

:root {
  --bg: #050814;
  --bg-soft: #09101f;
  --panel: rgba(11, 16, 32, 0.88);
  --panel-strong: #0b1020;
  --text: #f5f7ff;
  --muted: #aeb8d1;
  --cyan: #00e5ff;
  --blue: #3b82f6;
  --pink: #ff4081;
  --purple: #8b5cf6;
  --green: #8ad03a;
  --gold: #f4c85a;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --max: 1180px;

  /* Platform accents: ModHub reads warm (gold/pink), Steam reads cool (blue/cyan) */
  --modhub-a: var(--gold);
  --modhub-b: var(--pink);
  --steam-a: var(--blue);
  --steam-b: var(--cyan);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 229, 255, 0.13), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(255, 64, 129, 0.14), transparent 30%),
    linear-gradient(180deg, #090b1b 0%, #050814 38%, #02040a 100%);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

/* ---------- Header (mirrors index.html) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 20, 0.82);
  backdrop-filter: blur(16px);
}
.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: .95rem; }
.brand-copy span { font-size: .78rem; color: var(--muted); }
nav.main-nav { display: flex; align-items: center; gap: 1.5rem; }
nav.main-nav a { font-size: .9rem; color: var(--muted); }
nav.main-nav a:hover { color: var(--cyan); }

/* ---------- Page head ---------- */
.page-head { padding: 3rem 0 1.5rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  color: var(--cyan);
  margin-bottom: .6rem;
}
.page-head h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0 0 .5rem;
  background: linear-gradient(120deg, #ffffff, #e0e7ff, #ffb6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p.lead { color: var(--muted); max-width: 640px; margin: 0; }
.as-of { color: var(--muted); font-size: .85rem; }
.as-of-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
}
.subhead { margin: 2rem 0 .75rem; font-size: 1rem; color: var(--muted); font-weight: 600; }

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--cyan);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}
.btn-view:hover { border-color: var(--cyan); background: rgba(0,229,255,0.08); }
.btn-view-small { font-size: .78rem; padding: .35rem .8rem; color: var(--muted); }
.btn-view-small:hover { color: var(--cyan); }

/* ---------- Tabs ---------- */
.mod-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0 2rem;
}
.mod-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--muted);
  padding: .55rem 1.1rem;
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.mod-tab:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.mod-tab.active {
  color: var(--bg);
  background: linear-gradient(120deg, var(--cyan), var(--blue));
  border-color: transparent;
  font-weight: 600;
}
.mod-tab .status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: .4rem;
  background: var(--green);
}
.mod-tab.pending .status-dot { background: var(--gold); }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
}
.stat-card .stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .35rem;
}
.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-sub { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.stat-card .stat-delta { color: var(--green); font-weight: 600; }
.stat-card .stat-unit { font-size: .85rem; font-weight: 500; color: var(--muted); }

.platform-heading {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 2.5rem 0 1rem;
  font-size: 1.15rem;
}
.platform-swatch {
  width: 10px; height: 10px; border-radius: 3px;
}
.platform-swatch.modhub { background: linear-gradient(135deg, var(--modhub-a), var(--modhub-b)); }
.platform-swatch.steam { background: linear-gradient(135deg, var(--steam-a), var(--steam-b)); }

/* ---------- Mod detail view ---------- */
.mod-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.5rem;
}
.mod-header h2 { margin: 0; font-size: 1.5rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge.released { background: rgba(138, 208, 58, 0.15); color: var(--green); border: 1px solid rgba(138,208,58,.35); }
.badge.pending { background: rgba(244, 200, 90, 0.15); color: var(--gold); border: 1px solid rgba(244,200,90,.35); }
.mod-meta { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }

.pending-note {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}
.pending-note .stat-value,
.pending-note .stat-sub {
  font-style: normal;
}

/* ---------- Milestones ---------- */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.milestone {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
}
.milestone .m-label { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.milestone .m-figures {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .5rem;
}
.milestone .m-figures strong { color: var(--text); }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.milestone .m-note { font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.milestone .m-note.on-track { color: var(--green); }
.milestone .m-history { font-size: .74rem; color: var(--muted); margin-top: .45rem; padding-top: .45rem; border-top: 1px dashed var(--border); }
.milestone .m-history-date { color: var(--muted); }

.methodology-note {
  margin: -.25rem 0 1.5rem;
  font-size: .8rem;
  color: var(--muted);
}
.methodology-note summary { cursor: pointer; color: var(--cyan); }
.methodology-note p { margin: .6rem 0 0; max-width: 720px; line-height: 1.55; }

/* ---------- Charts ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem .6rem;
}
.chart-card h3 { margin: 0 0 .2rem; font-size: .95rem; font-weight: 600; }
.chart-card .chart-sub { font-size: .75rem; color: var(--muted); margin-bottom: .4rem; }
.chart-empty {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .85rem;
  font-style: italic;
}
.chart-svg-wrap { position: relative; }
.chart-svg-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .4rem;
}
.chart-legend .legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-swatch { width: 10px; height: 3px; border-radius: 2px; }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .7rem;
  font-size: .75rem;
  box-shadow: var(--shadow);
  transform: translate(-50%, -110%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .1s ease;
  z-index: 5;
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip .tt-date { color: var(--muted); margin-bottom: .2rem; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: .4rem; }
.chart-tooltip .tt-swatch { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Data tables (fallback / raw) ---------- */
details.raw-details {
  margin-top: .5rem;
  margin-bottom: 1.5rem;
}
details.raw-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .8rem;
}
table.raw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin-top: .6rem;
}
table.raw-table th, table.raw-table td {
  text-align: left;
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
table.raw-table th { color: var(--muted); font-weight: 600; }

.section-note {
  color: var(--muted);
  font-size: .82rem;
  margin: -.5rem 0 1.2rem;
}

.earnings-note {
  padding: 1rem 1.2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ---------- Footer (mirrors index.html) ---------- */
.footer {
  padding: 3rem 0;
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: .85rem;
}
.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a:hover { color: var(--cyan); }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .nav-wrap { flex-wrap: wrap; gap: .75rem; }
}

.social-rail {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.social-rail a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  transition: color .15s, background .15s;
}

.social-rail a:hover {
  color: var(--cyan);
  background: rgba(255,255,255,.08);
}

@media (max-width: 1300px) {
  .social-rail { display: none; }
}
