/* ═══════════════════════════════════════════════════════════════════════
   Red Planet Reapers — NosGalaxy UFE Guide Stylesheet
   ═══════════════════════════════════════════════════════════════════════ */

.guide-main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) clamp(1.25rem, 4vw, 2.5rem) 5rem;
}

/* ── Header active link ──────────────────────────────────────────────── */
.header-nav {
  gap: .5rem;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .06em;
  padding: .5rem .85rem;
  border-radius: 8px;
  transition: color .25s var(--ease-out), background .25s var(--ease-out);
}

.header-link:hover,
.header-link:focus-visible,
.header-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
}

.header-link.is-active {
  color: var(--primary);
}

/* ── Guide Hero / Intro ──────────────────────────────────────────────── */
.guide-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.guide-eyebrow {
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .32em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.guide-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4.8vw, 3.25rem);
  letter-spacing: .1em;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #FFFFFF 35%, rgba(255, 255, 255, .68) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guide-subtitle {
  font-size: clamp(.95rem, 1.3vw, 1.08rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Quick Jump Bar ──────────────────────────────────────────────────── */
.guide-toc {
  position: sticky;
  top: calc(var(--header-h) + .75rem);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .75rem;
  margin-bottom: 3rem;
  background: rgba(17, 17, 17, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
}

.toc-link {
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .42rem .8rem;
  border-radius: 8px;
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}

.toc-link:hover,
.toc-link:focus-visible,
.toc-link.is-active {
  color: var(--text);
  background: rgba(255, 23, 40, .14);
}

/* ── Sections ────────────────────────────────────────────────────────── */
.guide-section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-h) + 5rem);
}

.section-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  gap: .65rem;
}

.section-heading::before {
  content: '';
  width: 4px;
  height: 1.1em;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.subsection-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 1.75rem 0 .85rem;
}

/* ── Cards & Grids ───────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(17, 17, 17, .85);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 1.35rem 1.4rem;
  transition: border-color .25s var(--ease-out);
}

.stat-card:hover {
  border-color: rgba(255, 23, 40, .32);
}

.stat-label {
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .4rem;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  margin-bottom: .25rem;
}

.stat-meta {
  font-size: .84rem;
  color: var(--text-muted);
}

/* ── Rules List ──────────────────────────────────────────────────────── */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.rule-card {
  background: rgba(17, 17, 17, .78);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.rule-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  color: var(--text);
}

.rule-card p,
.rule-card li {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.rule-card ul {
  padding-left: 1.1rem;
  margin-top: .35rem;
}

.rule-card strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: rgba(17, 17, 17, .82);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  margin: 1rem 0 1.5rem;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  text-align: left;
}

.guide-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .02);
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}

.guide-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--text-muted);
  vertical-align: top;
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-table td:first-child,
.guide-table strong {
  color: var(--text);
  font-weight: 500;
}

.guide-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  color: #ffd6d9;
  background: rgba(255, 23, 40, .1);
  padding: .12rem .38rem;
  border-radius: 4px;
}

/* ── Phase Timeline Cards ────────────────────────────────────────────── */
.phase-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.phase-card {
  background: rgba(17, 17, 17, .82);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 1.35rem 1.5rem;
}

.phase-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .85rem;
}

.phase-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}

.phase-meta {
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--primary);
  text-transform: uppercase;
}

.phase-card ol,
.phase-card ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.7;
}

.phase-card li + li {
  margin-top: .25rem;
}

.phase-card strong {
  color: var(--text);
  font-weight: 500;
}

.checkpoint-box {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(255, 23, 40, .06);
  border-radius: 0 8px 8px 0;
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.checkpoint-box strong {
  color: var(--text);
}

.tip-box {
  margin: 1rem 0;
  padding: .85rem 1.1rem;
  border-left: 3px solid var(--primary);
  background: rgba(153, 0, 17, .12);
  border-radius: 0 8px 8px 0;
  font-size: .88rem;
  color: var(--text-muted);
}

.tip-box strong {
  color: var(--text);
}

/* ── Quest Level Tabs ────────────────────────────────────────────────── */
.quest-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1.25rem 0 1rem;
}

.quest-tab {
  font-family: var(--font-heading);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-muted);
  background: rgba(17, 17, 17, .9);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: .45rem .85rem;
  cursor: pointer;
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out), background .2s var(--ease-out);
}

.quest-tab:hover,
.quest-tab:focus-visible {
  color: var(--text);
  border-color: rgba(255, 23, 40, .4);
}

.quest-tab.is-active {
  color: var(--text);
  background: linear-gradient(135deg, var(--crimson) 0%, var(--primary) 100%);
  border-color: transparent;
}

.quest-panel {
  display: none;
}

.quest-panel.is-active {
  display: block;
}

.quest-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  font-size: .86rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.quest-summary strong {
  color: var(--text);
}

.guide-note {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .guide-toc {
    position: static;
  }

  .phase-card {
    padding: 1.1rem 1.15rem;
  }
}
