:root {
  --bg-deep: #050507;
  --bg-surface: #0a0a0c;
  --accent-gold: #d4af37;
  --accent-blue: #3498db;
  --text-main: #e0e0e5;
  --text-dim: #90909b;
  --spine-color: rgba(212, 175, 55, 0.2);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 2000;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
  box-shadow: 0 0 10px var(--accent-gold);
}

#app {
  position: relative;
}

/* Hero Section */
#hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at center, #1a1a2e 0%, var(--bg-deep) 100%);
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 60px; /* Space above title */
  z-index: 100;
}

.primary-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.resolution-control {
  display: flex;
  justify-content: center;
  width: 100%;
}


.filter-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.filter-group input[type="range"] {
  width: 100px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

#sig-val {
  font-weight: 800;
  color: #fff;
  min-width: 20px;
}

.action-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--accent-gold);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.action-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  margin-bottom: 0px;
  background: linear-gradient(180deg, #fff 0%, var(--accent-gold) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
  /* Fallback for browsers without background-clip support */
  letter-spacing: -2px;
}

.action-btn.subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  opacity: 0.8;
}

.action-btn.subtle:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  opacity: 1;
}

/* ── Educational Module Modal ── */
.edu-modal-content {
  max-width: 900px;
  width: 95%;
  background: #11141a;
  padding: 60px 40px;
  border-radius: 30px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  color: #fff;
  overflow-y: auto;
  max-height: 85vh;
  position: relative;
}

.edu-overview {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #eee;
  margin-bottom: 50px;
  text-align: center;
  font-weight: 300;
}

.edu-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}

.edu-method-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 25px;
  border-radius: 20px;
  transition: transform 0.2s ease;
}

.edu-method-card:hover {
  transform: translateY(-5px);
  background: rgba(212, 175, 55, 0.05);
}

.edu-method-card h3 {
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edu-method-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ccc;
  margin-bottom: 15px;
}

.edu-method-card .edu-example {
  font-size: 0.85rem;
  font-style: italic;
  color: #888;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.edu-comparison-section {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
  padding: 35px;
  border-radius: 20px;
  border: 1px solid var(--accent-gold);
  margin-bottom: 60px;
  text-align: center;
}

.edu-faq-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.edu-faq-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 12px;
  border-left: 3px solid var(--accent-gold);
}

.edu-faq-item .faq-q {
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.edu-faq-item .faq-a {
  color: #aaa;
  font-size: 0.95rem;
}

.edu-modal-content .close-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 50;
}

.action-btn.accent {
  background: var(--accent-gold);
  color: var(--bg-deep);
  border-color: var(--accent-gold);
}

.action-btn.accent:hover {
  background: #fff;
  border-color: #fff;
  color: var(--bg-deep);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.subtitle {
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 8px;
  color: var(--text-dim);
  font-size: 1.2rem;
}

.scroll-prompt {
  display: none !important;
}

#timeline-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 200vh;
  padding: 0 20px 200px;
}

#timeline-spine {
  position: absolute;
  left: 50%;
  top: 600px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
      transparent 0%,
      var(--spine-color) 5%,
      var(--spine-color) 95%,
      transparent 100%);
  transform: translateX(-50%);
  z-index: 0;
}

#events-container {
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.event-block {
  position: relative;
  width: 100%;
  margin-bottom: 300px;
  /* Space between events */
  display: flex;
  justify-content: flex-start;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.event-block.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Base block alignment */
.event-block:nth-child(odd) {
  justify-content: flex-start;
}

.event-block:nth-child(even) {
  justify-content: flex-end;
}

.event-card {
  width: 45%;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 30px;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.event-card:hover {
  transform: scale(1.02);
  border-color: rgba(212, 175, 55, 0.4);
}

/* The connecting dot - must be exactly on the 50% line */
.event-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--bg-deep);
  border: 3px solid var(--accent-gold);
  border-radius: 50%;
  z-index: 10;
  transform: translateY(-50%);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

/* Explicit alignment classes */
.event-block.align-left {
  justify-content: flex-start;
}

.event-block.align-right {
  justify-content: flex-end;
}

.event-block.align-left .event-dot {
  right: -11.1%;
}

.event-block.align-right .event-dot {
  left: -11.1%;
}

/* Bibliography Bubble */
.source-card {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-card:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent-gold);
  transform: translateY(-50%) scale(1.05);
}

.source-card.to-right {
  left: 60%;
}

.source-card.to-left {
  right: 60%;
}

.source-icon {
  font-size: 1.1rem;
}

.source-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.source-card:hover .source-text {
  color: var(--accent-gold);
}

/* Source List Detail Overlay */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.source-item {
  border-left: 2px solid var(--spine-color);
  padding-left: 20px;
}

.source-item-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.source-item-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 700;
}

.source-item-author {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.source-item-desc {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.6;
}

.source-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.source-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.event-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #fff;
}

.event-meta {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 2px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.approx-tag {
  font-style: italic;
  font-weight: 500;
  opacity: 0.8;
  text-transform: none;
  /* Keep "Around" from being all caps if preferred, or remove this */
  margin-right: 4px;
}

/* Seed Tag inside Meta */
.seed-tag {
  display: inline-block;
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71 !important;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 12px;
  border: 1px solid rgba(46, 204, 113, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.event-preview {
  color: var(--text-dim);
  font-size: 0.95rem;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Range Indicator */
.era-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-deep);
  padding: 5px 20px;
  border: 1px solid var(--spine-color);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--text-dim);
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Detail Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  z-index: 3000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.overlay.visible {
  display: flex !important;
}

.overlay-content {
  background: #000;
  border: 1px solid var(--glass-border);
  max-width: 700px;
  width: 100%;
  border-radius: 30px;
  padding: 50px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

#close-overlay {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 4000;
}

#close-overlay:hover {
  opacity: 1;
  transform: scale(1.1) rotate(90deg);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Mobile Adjustments for Close Button */
@media (max-width: 768px) {
  #close-overlay {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

.date-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 100px;
  font-weight: 700;
  margin-bottom: 20px;
}

#detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  margin-bottom: 30px;
  line-height: 1.1;
  color: #fff;
}

#detail-description {
  font-size: 1.15rem;
  color: var(--text-dim);
  line-height: 1.9;
}

/* Quiz Mode Styles */
#quiz-view {
  min-height: 100vh;
  padding: 100px 20px;
  background: var(--bg-deep);
  position: relative;
  overflow-x: hidden;
}

#quiz-timeline-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.central-axis {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-gold);
  opacity: 0.3;
}

.quiz-row {
  position: relative;
  display: flex;
  margin-bottom: 80px;
  width: 100%;
}

.quiz-row.left {
  justify-content: flex-start;
}

.quiz-row.right {
  justify-content: flex-end;
}

.quiz-card {
  width: 45%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.quiz-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
}

.ping {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent-gold);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-gold);
}

.connector {
  position: absolute;
  height: 1px;
  background: var(--accent-gold);
  top: 50%;
  width: 5%;
  opacity: 0.5;
}

.left .connector {
  right: 50%;
}

.right .connector {
  left: 50%;
}

.quiz-card h4 {
  color: var(--accent-gold);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.quiz-options {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.quiz-option input {
  accent-color: var(--accent-gold);
  width: 18px;
  height: 18px;
}

.quiz-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.submit-footer {
  text-align: center;
  margin-top: 100px;
  padding-bottom: 100px;
}

.results-card {
  max-width: 600px;
  text-align: center;
}

#results-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin: 30px 0;
}

#missed-questions {
  text-align: left;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 30px;
}

.missed-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.missed-item h5 {
  color: #ff4757;
  margin-bottom: 5px;
}

.missed-item p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ── Curation Mode ── */
#curation-view {
  min-height: 100vh;
  padding: 30px 20px 80px;
  background: var(--bg-deep);
}

.curation-header {
  max-width: 1200px;
  margin: 0 auto 30px;
}

.curation-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.curation-title-row h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #fff;
}

.curation-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.curation-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.curation-filter label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.curation-filter select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.curation-filter select:focus {
  border-color: var(--accent-gold);
}

.curation-stats {
  font-size: 0.8rem;
  color: var(--text-dim);
  flex: 1;
}

.curation-stats strong {
  color: var(--accent-gold);
}

.curation-actions {
  display: flex;
  gap: 10px;
}

/* Gap Alerts */
.curation-gaps {
  max-width: 1200px;
  margin: 0 auto 20px;
}

.gap-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 75, 75, 0.08);
  border: 1px solid rgba(255, 75, 75, 0.25);
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.gap-alert .gap-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.gap-alert .gap-text {
  color: var(--text-dim);
}

.gap-alert .gap-text strong {
  color: #ff6b6b;
}

.gap-alert .gap-span {
  color: var(--accent-gold);
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.75rem;
}

/* Curation Table */
.curation-table-container {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
}

.curation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.curation-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-gold);
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  position: sticky;
  top: 0;
  background: var(--bg-deep);
  z-index: 10;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.curation-table thead th:hover {
  color: #fff;
}

.curation-table thead th.sorted::after {
  content: ' ▾';
}

.curation-table thead th.sorted.asc::after {
  content: ' ▴';
}

.curation-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s;
}

.curation-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.curation-table tbody tr.changed {
  background: rgba(212, 175, 55, 0.08);
}

.curation-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--text-dim);
}

.curation-table .col-date {
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-main);
  width: 18%;
}

.curation-table .col-title {
  font-weight: 700;
  color: #fff;
  width: 22%;
}

.curation-table .col-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 400px;
  width: 38%;
}

.curation-table .col-sig {
  width: 12%;
  text-align: center;
}

.curation-table .col-source {
  width: 10%;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  opacity: 0.6;
}

.curation-table .col-actions {
  width: 50px;
  text-align: right;
}

.delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 5px;
  border-radius: 4px;
  transition: transform 0.2s, background 0.2s;
  opacity: 0.6;
}

.delete-btn:hover {
  transform: scale(1.2);
  background: rgba(255, 71, 87, 0.2);
  opacity: 1;
}

/* Significance Select Dropdown */
.sig-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  width: 60px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sig-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.sig-select.level-1 {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
}

.sig-select.level-2 {
  border-color: #e67e22;
  background: rgba(230, 126, 34, 0.12);
}

.sig-select.level-3 {
  border-color: #f39c12;
  background: rgba(243, 156, 18, 0.10);
}

.sig-select.level-4 {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.08);
}

.sig-select.level-5 {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.08);
}

.change-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
}

.curation-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

.accent {
  background: var(--accent-gold);
  color: var(--bg-deep);
}

.accent:hover {
  background: #fff;
  color: var(--bg-deep);
}

.primary-action {
  background: var(--accent-gold);
  color: var(--bg-deep);
  padding: 15px 40px;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
}

.primary-action:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.sig-indicator {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1px solid rgba(212, 175, 55, 0.3);
  pointer-events: none;
}

.quiz-level-banner {
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent-gold);
  margin: 20px auto 40px auto;
  font-size: 0.9rem;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
  padding: 15px 40px;
  border: none;
  width: fit-content;
}

.quiz-level-banner:empty {
  display: none;
}

.progression-unlocked {
  color: #2ecc71;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: 2px;
  animation: celebrate 0.5s ease-out;
}

@keyframes celebrate {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

footer {
  text-align: center;
  padding: 60px 40px;
  border-top: 1px solid var(--glass-border);
}

/* Mobile Adjustments */
/* Live Pulse Card */
.live-pulse-block {
  justify-content: center !important;
  width: 100%;
}

.live-pulse-card {
  width: 80%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(0, 0, 0, 0.8));
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
  padding: 50px;
  border-radius: 30px;
  position: relative;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.live-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-gold);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #ff4b4b;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff4b4b;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(255, 75, 75, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 75, 75, 0);
  }
}

.live-pulse-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: #fff;
}

.live-news-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.live-item {
  border-left: 1px solid rgba(212, 175, 55, 0.2);
  padding-left: 20px;
}

.live-cat {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.live-item h4 {
  font-size: 1.25rem;
  margin: 10px 0;
  color: #fff;
}

.live-item p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.live-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.live-dot {
  top: -1px;
  left: 50% !important;
  transform: translate(-50%, -50%);
  background: var(--accent-gold);
}

@media (max-width: 768px) {

  /* ── Hero Header Actions: Stack for Mobile ── */
  .header-actions {
    position: relative;
    top: 0;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    width: 100%;
    padding: 0 10px;
  }

  .filter-group {
    margin-right: 0;
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  .filter-group label {
    font-size: 0.65rem;
    white-space: nowrap;
  }

  .filter-group input[type="range"] {
    width: 80px;
  }

  /* Action buttons sit side by side underneath the slider */
  .header-actions .action-btn {
    font-size: 0.7rem;
    padding: 10px 14px;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  /* Wrap the two buttons into a row */
  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
    flex-direction: row;
  }

  /* The filter group takes full width (its own row) */
  .filter-group {
    flex: 0 0 100%;
  }

  /* ── Timeline mobile ── */
  #timeline-spine {
    left: 40px;
  }

  .event-block {
    flex-direction: column;
    justify-content: flex-start !important;
    padding-left: 80px;
    margin-bottom: 200px;
  }

  .event-card {
    width: 100%;
    margin-bottom: 20px;
  }

  .event-dot {
    left: -47px !important;
    right: auto !important;
  }

  .source-card {
    position: relative;
    transform: none;
    margin-top: 10px;
    width: fit-content;
    left: 0 !important;
    right: 0 !important;
    padding: 8px 12px;
  }

  .live-pulse-card {
    width: 100%;
    padding: 30px;
  }

  .live-news-container {
    grid-template-columns: 1fr;
  }

  .live-pulse-card h2 {
    font-size: 1.8rem;
  }

  .event-block.synthesis-block,
  .event-block.live-pulse-block {
    padding-left: 0;
    justify-content: center !important;
  }

  /* ── Quiz Mode: Single Column Layout ── */
  #quiz-view {
    padding: 80px 15px 60px;
  }

  /* Move axis to a fixed position on the right, and start BELOW the banner */
  #quiz-timeline-wrapper .central-axis {
    left: auto;
    right: 20px;
    transform: none;
    top: 80px;
    /* Start below the banner */
  }

  .quiz-level-banner {
    position: relative;
    z-index: 2;
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 12px 20px;
    margin-bottom: 30px;
  }

  /* All quiz rows: full width, no alternating */
  .quiz-row {
    justify-content: flex-start !important;
    margin-bottom: 40px;
    padding-right: 40px;
    /* Room for the axis line on the right */
  }

  .quiz-row.left,
  .quiz-row.right {
    justify-content: flex-start !important;
  }

  .quiz-card {
    width: 100%;
    padding: 20px;
  }

  /* Move the "ping" dot to the right edge, aligned with the axis */
  .quiz-row .ping {
    left: auto;
    right: -26px;
    transform: translate(50%, -50%);
  }

  /* Connector extends from the card to the right axis */
  .quiz-row .connector {
    left: auto !important;
    right: -20px !important;
    width: 20px !important;
  }

  .quiz-card h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .quiz-option {
    padding: 8px;
    gap: 10px;
  }

  .quiz-option span {
    font-size: 0.9rem;
  }

  .submit-footer {
    margin-top: 60px;
    padding-bottom: 60px;
  }

  .primary-action {
    padding: 12px 30px;
    font-size: 0.95rem;
  }
}

/* Synthesis & Worldviews Module */
.synthesis-card {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background-color: #0d1015;
  /* Solid opaque dark background */
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  z-index: 10;
  /* Definitely above the spine (z-0) and events-container (z-1) */
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.synthesis-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.synthesis-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #fff;
}

.synthesis-card p {
  color: var(--text-main);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 25px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.synthesis-footer {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lock-notice {
  margin-top: 30px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
  padding: 15px 25px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #ff4757;
  font-size: 0.9rem;
  justify-content: center;
}

.lock-icon {
  font-size: 1.2rem;
}

.progression-unlocked {
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ── Module & Arc Styles ── */
.module-divider {
  width: 100%;
  margin: 120px 0 80px;
  perspective: 1000px;
}

.module-header-card {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 40px;
  border-radius: 25px;
  text-align: center;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.module-tag {
  display: inline-block;
  background: var(--accent-gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.module-header-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: #fff;
}

.module-header-card p {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.logic-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flow-arrow {
  opacity: 0.4;
  font-size: 1.2rem;
}

/* ── Relationship Layer in Detail Overlay ── */
.relationship-layer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.rel-section h4 {
  font-size: 0.7rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.rel-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rel-section li {
  font-size: 0.9rem;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.rel-section li:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateX(5px);
}

.rel-section li span {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .relationship-layer {
    grid-template-columns: 1fr;
  }
}

/* ── Diagnostic Tool & Tabs ── */
.curation-tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.curation-actions {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.select-styled {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 35px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}

.select-styled option {
  background-color: #1a1a1a;
  color: #fff;
  padding: 10px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
}

.tab-btn.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.diagnostic-container {
  margin-top: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  border: 1px solid var(--glass-border);
}

.diagnostic-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.diagnostic-filters .filter-group input {
  width: 120px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px;
  border-radius: 6px;
}

.input-note {
  font-size: 0.65rem;
  color: var(--text-dim);
  opacity: 0.7;
  margin: 0 10px;
}

.diagnostic-legend {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.crit { background: #ff4757; }
.dot.warn { background: #ffa502; }
.dot.ok { background: #2ecc71; }

.gap-chart {
  height: 200px;
  width: 100%;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 20px 10px;
  display: flex;
  align-items: flex-end;
}

.spread-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  width: 100%;
}

.spread-bar-container {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 12px;
}

.spread-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: all 0.3s ease;
}

.spread-bar.ok { background: rgba(46, 204, 113, 0.4); }
.spread-bar.warn { background: rgba(255, 165, 2, 0.6); }
.spread-bar.crit { background: rgba(255, 71, 87, 0.8); }

.spread-bar-container:hover .spread-bar {
  filter: brightness(1.3);
  transform: scaleY(1.05);
}

.spread-label {
  font-size: 0.6rem;
  color: #666;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: top left;
  margin-top: 10px;
}

.gap-alert-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left-width: 4px;
}

.gap-alert-card.crit { border-left-color: #ff4757; }
.gap-alert-card.warn { border-left-color: #ffa502; }

.gap-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-spread {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-gold);
}

.gap-years {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.gap-events {
  font-size: 0.85rem;
  color: #fff;
}

.diag-healthy {
  text-align: center;
  padding: 40px;
  color: #2ecc71;
  font-style: italic;
}

.diag-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}