:root {
  color-scheme: light;
  font-family:
    "Inter",
    "SF Pro Text",
    system-ui,
    -apple-system,
    sans-serif;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1e1f26;
  --muted: #62657a;
  --accent: #4c6fff;
  --accent-soft: rgba(76, 111, 255, 0.12);
  --shadow: 0 18px 30px rgba(30, 31, 38, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px; /* Offset for sticky navbar + some spacing */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 60px; /* Account for sticky navbar */
}

/* Sticky Navbar */
.sticky-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 1000;
  height: 60px;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 5vw;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.navbar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.navbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.navbar-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.navbar-hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.navbar-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-link {
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.navbar-link:hover {
  color: var(--accent);
}

.navbar-link--active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-section {
  min-height: 100vh;
  padding: 2rem 6vw 3rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h1 {
  margin: 0 0 0.5rem 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.section-content {
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Timeline Info Bar */
.timeline-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-instruction {
  margin: 0;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-button {
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 0;
  font-size: 1.125rem;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(76, 111, 255, 0.2);
}

.control-button:hover {
  background: #3d5de6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(76, 111, 255, 0.3);
}

.control-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(76, 111, 255, 0.2);
}

.control-range {
  width: 100px;
  height: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
}

/* Range track styling */
.control-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 999px;
}

.control-range::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 999px;
}

/* Range thumb styling */
.control-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.control-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.control-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.control-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.control-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.8125rem;
  min-width: 36px;
  text-align: center;
  background: var(--accent-soft);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.timeline-shell {
  padding: 0;
}

.timeline {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  padding: 1rem 1rem 2rem 0;
  scroll-snap-type: x mandatory;
  --scale: 1;
  border-radius: 10px;
}

.timeline::-webkit-scrollbar {
  height: 5px;
}

.timeline::-webkit-scrollbar-thumb {
  background: rgba(30, 31, 38, 0.12);
  border-radius: 999px;
}

.timeline-card {
  min-width: calc(min(320px, 80vw) * var(--scale));
  max-width: calc(380px * var(--scale));
  max-height: 70vh;
  background: var(--card);
  border-radius: var(--radius);
  padding: calc(1.2rem * var(--scale));
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Scroll indicator - subtle gradient fade at bottom */
.timeline-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 0 var(--radius) var(--radius);
}

.timeline-card.has-scroll-indicator::after {
  opacity: 0.5;
}

.timeline-card.has-scroll-indicator:hover::after {
  opacity: 1;
}

.timeline-card::-webkit-scrollbar {
  width: 3px;
}

.timeline-card::-webkit-scrollbar-thumb {
  background: rgba(30, 31, 38, 0.12);
  border-radius: 999px;
}

.timeline-card__era {
  font-size: calc(0.75rem * var(--scale));
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: calc(0.2rem * var(--scale));
}

.timeline-card__sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-bottom: calc(0.6rem * var(--scale));
  margin-bottom: calc(0.6rem * var(--scale));
}

.timeline-card__content {
  display: flex;
  flex-direction: column;
  gap: calc(0.6rem * var(--scale));
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.timeline-card__content::-webkit-scrollbar {
  width: 3px;
}

.timeline-card__content::-webkit-scrollbar-thumb {
  background: rgba(30, 31, 38, 0.12);
  border-radius: 999px;
}

.timeline-section {
  min-width: calc(min(260px, 70vw) * var(--scale));
  max-width: calc(320px * var(--scale));
  border-radius: var(--radius);
  padding: calc(1rem * var(--scale));
  background: linear-gradient(120deg, rgba(76, 111, 255, 0.2), transparent);
  border: 1px solid rgba(76, 111, 255, 0.2);
  box-shadow: none;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: calc(0.4rem * var(--scale));
}

.timeline-section__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: calc(0.7rem * var(--scale));
  color: var(--accent);
  font-weight: 700;
}

.timeline-section__title {
  margin: 0;
  font-size: calc(1.05rem * var(--scale));
  color: var(--ink);
}

.timeline-card__date {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: calc(0.8rem * var(--scale));
}

.timeline-card__title {
  font-size: calc(1.25rem * var(--scale));
  margin: 0;
}

.timeline-card__context {
  margin: 0;
  font-size: calc(0.85rem * var(--scale));
  color: var(--muted);
}

.timeline-card__section {
  margin: 0;
  font-size: calc(0.95rem * var(--scale));
  color: var(--muted);
}

.timeline-card__facts {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink);
  font-size: calc(0.92rem * var(--scale));
  display: grid;
  gap: 0.35rem;
}

.timeline-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timeline-tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: calc(0.25rem * var(--scale)) calc(0.6rem * var(--scale));
  border-radius: 999px;
  font-size: calc(0.78rem * var(--scale));
  font-weight: 600;
}

.timeline__loading,
.timeline__error {
  font-size: 1rem;
  color: var(--muted);
}

.timeline-overview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.overview-title {
  font-weight: 600;
  color: var(--ink);
}

.overview-track {
  position: relative;
  height: 40px;
  background: transparent;
  overflow: visible;
  display: flex;
}

.overview-era {
  position: absolute;
  height: 100%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.25rem;
}

.overview-era:hover {
  opacity: 0.8;
}

.overview-era__label {
  font-size: 0.65rem;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  padding: 0 0.25rem;
  max-width: 100%;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.overview-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  left: 0;
  opacity: 0;
  display: none;
}

.site-footer {
  background: var(--card);
  border-top: 1px solid rgba(30, 31, 38, 0.08);
  padding: 3rem 6vw 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}

.footer-text {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.footer-disclaimer {
  font-size: 0.8125rem;
  font-style: italic;
}

.footer-license {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: #3d5de6;
  transform: translateX(4px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(30, 31, 38, 0.08);
  text-align: center;
}

.footer-copyright {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(30, 31, 38, 0.15);
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cookie-banner__content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner__text {
  flex: 1;
}

.cookie-banner__title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.cookie-banner__description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

.cookie-banner__link {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-banner__link:hover {
  color: #3d5de6;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.cookie-btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 111, 255, 0.3);
}

.cookie-btn--primary:hover {
  background: #3d5de6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 111, 255, 0.4);
}

.cookie-btn--secondary {
  background: var(--bg);
  color: var(--ink);
  border: 2px solid rgba(30, 31, 38, 0.12);
}

.cookie-btn--secondary:hover {
  background: rgba(30, 31, 38, 0.04);
  border-color: rgba(30, 31, 38, 0.2);
}

/* Modal enhancements for legal content */
.modal--large {
  max-width: 700px;
}

.modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: rgba(30, 31, 38, 0.06);
  color: var(--ink);
}

.modal__body--scrollable {
  max-height: 60vh;
  overflow-y: auto;
}

.modal__body--scrollable h4 {
  margin: 1.5rem 0 0.75rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
}

.modal__body--scrollable h4:first-of-type {
  margin-top: 1rem;
}

.modal__body--scrollable p {
  margin: 0.5rem 0;
  line-height: 1.7;
}

.modal__body--scrollable ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.modal__body--scrollable li {
  margin: 0.375rem 0;
  line-height: 1.6;
}

.site-footer code {
  background: rgba(30, 31, 38, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cookie-banner__content {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
  }

  .cookie-banner__actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }

  .modal--large {
    max-width: 100%;
    margin: 1rem;
  }

  .modal__body--scrollable {
    max-height: 50vh;
  }
}

@media (max-width: 700px) {
  .navbar-container {
    padding: 0 1.5vw;
  }

  .navbar-brand {
    gap: 0.35rem;
  }

  .navbar-logo-img {
    width: 50px;
    height: 50px;
  }

  .navbar-title {
    font-size: 0.9rem;
  }

  .navbar-hamburger {
    display: flex;
  }

  .navbar-links {
    position: fixed;
    top: 60px;
    right: 0;
    flex-direction: column;
    background: var(--card);
    box-shadow: var(--shadow);
    width: 250px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    gap: 0;
    padding: 1rem 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .navbar-links.active {
    transform: translateX(0);
  }

  .navbar-link {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .navbar-link:hover {
    background: var(--accent-soft);
  }

  .navbar-link--active {
    border-left-color: var(--accent);
    background: var(--accent-soft);
  }

  .timeline {
    gap: 1rem;
    padding-right: 0;
  }

  .timeline-card {
    min-width: 85vw;
  }

  .overview-track {
    height: 50px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .overview-track::-webkit-scrollbar {
    height: 2px;
  }

  .overview-track::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 2px;
  }

  .overview-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
  }

  .overview-era {
    position: relative !important;
    min-width: 200px !important; /* Increased from 120px */
    width: auto !important;
    left: auto !important;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .overview-era__label {
    font-size: 0.55rem;
    line-height: 1.2;
    padding: 0 0.5rem;
  }

  .timeline-controls {
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
  }

  .control-range {
    width: 60px;
  }

  .control-button {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .navbar-brand {
    gap: 0.4rem;
  }

  .navbar-logo-img {
    width: 60px;
    height: 60px;
  }

  .navbar-title {
    font-size: 1rem;
  }

  .navbar-hamburger {
    display: flex;
  }

  .navbar-links {
    position: fixed;
    top: 60px;
    right: 0;
    flex-direction: column;
    background: var(--card);
    box-shadow: var(--shadow);
    width: 280px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    gap: 0;
    padding: 1rem 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .navbar-links.active {
    transform: translateX(0);
  }

  .navbar-link {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    text-align: left;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .navbar-link:hover {
    background: var(--accent-soft);
  }

  .navbar-link--active {
    border-left-color: var(--accent);
    background: var(--accent-soft);
  }

  .overview-track {
    height: 45px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .overview-track::-webkit-scrollbar {
    height: 2px;
  }

  .overview-track::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 2px;
  }

  .overview-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
  }

  .overview-era {
    position: relative !important;
    min-width: 180px !important; /* Increased from 100px */
    width: auto !important;
    left: auto !important;
    flex-shrink: 0;
  }

  .overview-era__label {
    font-size: 0.6rem;
  }
}

/* ==================== QUIZ STYLES ==================== */

.quiz-menu {
  margin-top: 1.5rem;
  max-width: 800px;
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.quiz-menu__controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.quiz-menu__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

@media (max-width: 768px) {
  .quiz-menu__group {
    min-width: 100%;
  }
}

.quiz-menu__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.quiz-menu__select {
  padding: 0.875rem 3rem 0.875rem 1.25rem;
  border: 2px solid rgba(76, 111, 255, 0.15);
  border-radius: 12px;
  font-size: 0.9375rem;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%234c6fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 20px;
  box-shadow: 0 2px 4px rgba(30, 31, 38, 0.04);
}

.quiz-menu__select:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  box-shadow: 0 4px 8px rgba(30, 31, 38, 0.08);
  transform: translateY(-1px);
}

.quiz-menu__select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--card);
  box-shadow: 0 0 0 4px rgba(76, 111, 255, 0.12);
  transform: translateY(0);
}

.quiz-menu__select:active {
  transform: translateY(0);
}

/* Enhanced option styling (limited by browser, but we can try) */
.quiz-menu__select option {
  padding: 1rem;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

.quiz-menu__select option:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.quiz-menu__select option:checked {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.quiz-menu__info {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.quiz-menu__description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.quiz-progress {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 800px;
}

.quiz-progress__bar {
  height: 8px;
  background: rgba(76, 111, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quiz-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}

.quiz-progress__text {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.quiz-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

/* Ensure quiz section is responsive on all screen sizes */
@media (max-width: 1024px) {
  .quiz-container {
    max-width: 100%;
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .quiz-container {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }
}

.quiz-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.quiz-card__loading,
.quiz-card__error {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.quiz-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.quiz-card__prompt {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-card__topic {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--accent-soft);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.quiz-card__question {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.quiz-card__answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-answer {
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 500;
}

.quiz-answer:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-answer--selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-answer--correct {
  border-color: #4caf50 !important;
  background: #e8f5e9 !important;
  color: #2e7d32;
}

.quiz-answer--wrong {
  border-color: #f44336 !important;
  background: #ffebee !important;
  color: #c62828;
}

.quiz-answer:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.quiz-answer__icon {
  font-size: 1.25rem;
  font-weight: bold;
}

.quiz-card__feedback {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid;
}

.quiz-card__feedback--correct {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.quiz-card__feedback--wrong {
  background: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.quiz-card__feedback-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.quiz-card__explanation {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.quiz-card__reference {
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

.quiz-navigation {
  display: none;
  justify-content: space-between;
  gap: 1rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  flex-wrap: wrap;
}

.quiz-btn {
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.quiz-btn--primary {
  background: var(--accent);
  color: white;
}

.quiz-btn--primary:hover:not(:disabled) {
  background: #3d5de6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 111, 255, 0.3);
}

.quiz-btn--secondary {
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--accent-soft);
}

.quiz-btn--secondary:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.quiz-btn--danger {
  background: var(--bg);
  color: #dc2626;
  border: 2px solid #fecaca;
}

.quiz-btn--danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.quiz-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.quiz-results {
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 2rem auto;
}

.quiz-results__title {
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.quiz-results__score {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.quiz-results__score-number {
  color: var(--accent);
}

.quiz-results__score-total {
  color: var(--muted);
  font-size: 2.5rem;
}

.quiz-results__message {
  font-size: 1.125rem;
  color: var(--ink);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.quiz-results__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Quiz Styles */
@media (max-width: 1024px) {
  .quiz-card {
    padding: 1.75rem;
  }

  .quiz-card__question {
    font-size: 1.0625rem;
  }

  .quiz-menu {
    padding: 1.75rem;
  }

  .quiz-results {
    padding: 2.5rem 1.75rem;
  }
}

@media (max-width: 768px) {
  .quiz-menu__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-menu__group {
    min-width: 100%;
  }

  .quiz-menu__select {
    padding: 1rem 3rem 1rem 1.25rem;
    font-size: 1rem;
  }

  .quiz-card {
    padding: 1.5rem;
  }

  .quiz-card__question {
    font-size: 1rem;
  }

  .quiz-answer {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .quiz-navigation {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quiz-btn {
    width: 100%;
  }

  .quiz-results {
    padding: 2rem 1.5rem;
  }

  .quiz-results__score {
    font-size: 3rem;
  }

  .quiz-results__actions {
    flex-direction: column;
    width: 100%;
  }

  .quiz-results__actions .quiz-btn {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .quiz-menu {
    padding: 1.5rem;
  }

  .quiz-card {
    padding: 1.25rem;
  }

  .quiz-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-results {
    padding: 2rem 1rem;
  }
}

/* ==================== TOPICS SECTION ==================== */
/* Topics section uses the same timeline card styles with a single color */

/* Topics overview track - scrollable on all screen sizes */
#topics-overview-track {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

#topics-overview-track::-webkit-scrollbar {
  height: 3px;
}

#topics-overview-track::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 2px;
}

#topics-overview-track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

#topics-overview-track .overview-era {
  position: relative !important;
  min-width: 180px;
  width: auto !important;
  left: auto !important;
  flex-shrink: 0;
  scroll-snap-align: start;
}

#topics-overview-track .overview-era__label {
  font-size: 0.65rem;
  white-space: normal;
  padding: 0 0.75rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 31, 38, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(30, 31, 38, 0.16);
  max-width: 480px;
  width: 100%;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal__header {
  position: relative;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(30, 31, 38, 0.08);
}

.modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  padding-right: 2.5rem;
}

.modal__body {
  padding: 1.5rem;
}

.modal__message {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

.modal__footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal__btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.modal__btn--secondary {
  background: var(--bg);
  color: var(--ink);
  border: 2px solid rgba(30, 31, 38, 0.12);
}

.modal__btn--secondary:hover {
  background: rgba(30, 31, 38, 0.04);
  border-color: rgba(30, 31, 38, 0.2);
}

.modal__btn--danger {
  background: #dc2626;
  color: white;
  border: 2px solid #dc2626;
}

.modal__btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

@media (max-width: 700px) {
  .modal {
    max-width: 100%;
    margin: 1rem;
  }

  .modal__footer {
    flex-direction: column;
  }

  .modal__btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
  }
}
