/* CSS Variables */
:root {
  --color-realm-deep: #0c4a6e;
  --color-realm-mid: #0284c7;
  --color-realm-light: #38bdf8;
  --color-realm-pale: #e0f2fe;
  --color-realm-gradient: linear-gradient(
    135deg,
    #0ea5e9 0%,
    #38bdf8 50%,
    #7dd3fc 100%
  );
  --color-text-primary: #1c1917;
  --color-text-secondary: #57534e;
  --color-text-muted: #78716c;
  --color-bg-primary: #fafaf9;
  --color-bg-secondary: #ffffff;
  --color-border: #e7e5e4;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, sans-serif;
  --content-width: 740px;
}

/* Dark Mode */
[data-theme='dark'] {
  --color-text-primary: #f5f5f4;
  --color-text-secondary: #d6d3d1;
  --color-text-muted: #a8a29e;
  --color-bg-primary: #1c1917;
  --color-bg-secondary: #292524;
  --color-border: #44403c;
  --color-realm-pale: #0c4a6e;
}

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

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Pseudo-elements for Visual Enhancement */
.realm-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.05;
}

.migration-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 100%
  );
}

.realm-header {
  background: var(--color-realm-gradient);
  color: white;
  padding: 4rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}
.header-content {
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding-top: 8rem;
}
.realm-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}
.realm-number {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.realm-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.realm-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.9;
  max-width: 550px;
}
.realm-specs {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.realm-spec {
  text-align: left;
}
.realm-spec-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}
.realm-spec-label {
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.realm-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}
.intro-text {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.section {
  margin-bottom: 3rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1.25rem;
}
.highlight-box {
  background: var(--color-realm-gradient);
  border-radius: 16px;
  padding: 2rem;
  color: white;
  margin: 2rem 0;
}
.highlight-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.highlight-text {
  opacity: 0.95;
  line-height: 1.8;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}
.highlight {
  border-color: var(--color-realm-mid);
  background: linear-gradient(
    135deg,
    var(--color-realm-pale) 0%,
    var(--color-bg-secondary) 100%
  );
}
.feature-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-realm-mid);
  margin-bottom: 0.5rem;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}
.feature-text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.depth-diagram {
  background: linear-gradient(
    180deg,
    #7dd3fc 0%,
    #38bdf8 30%,
    #0ea5e9 60%,
    #0284c7 100%
  );
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  color: white;
}
.depth-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}
.depth-layers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.depth-layer {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.current {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid white;
}
.depth-name {
  font-weight: 600;
}
.depth-range {
  font-size: 0.85rem;
  opacity: 0.9;
}
.species-showcase {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
}
.species-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}
.species-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.species-item {
  text-align: center;
  padding: 1rem;
  background: var(--color-realm-pale);
  border-radius: 8px;
}
.species-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.species-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.species-role {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}
.key-insight {
  background: linear-gradient(
    135deg,
    #fef3c7 0%,
    var(--color-bg-secondary) 100%
  );
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  padding: 1.5rem;
  margin: 2rem 0;
}
.key-insight-title {
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme='dark'] .key-insight {
  background: linear-gradient(
    135deg,
    #451a03 0%,
    var(--color-bg-secondary) 100%
  );
}

/* Figure/Image Styles */
.figure {
  margin: 2rem 0;
  background: var(--color-bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.figure img {
  width: 100%;
  height: auto;
  display: block;
}
.figure-caption {
  padding: 1rem 1.25rem;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}
.figure-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-realm-mid);
  margin-bottom: 0.25rem;
}
.figure-title {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pullquote {
  border-left: 4px solid var(--color-realm-mid);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  background: linear-gradient(
    135deg,
    var(--color-realm-pale) 0%,
    var(--color-bg-secondary) 100%
  );
  border-radius: 0 12px 12px 0;
}
.migration-visual {
  background: linear-gradient(180deg, #0ea5e9 0%, #1e3a8a 100%);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  color: white;
  position: relative;
  overflow: hidden;
}
.migration-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.migration-layers {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}
.migration-layer {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.migration-zone {
  font-weight: 600;
  font-size: 0.95rem;
}
.migration-activity {
  font-size: 0.85rem;
  opacity: 0.9;
}
.migration-arrow {
  font-size: 1.5rem;
}
.connection-box {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.connection-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-realm-mid);
  margin-bottom: 0.75rem;
}
.connection-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.connection-link {
  background: var(--color-realm-pale);
  /* color: var(--color-realm-deep); */
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  text-decoration: none;
}
.footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.footer-nav-link {
  flex: 1;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
}
.prev {
  text-align: left;
}
.next {
  text-align: right;
}
.footer-nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.footer-nav-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Interactive Learning Elements */
.interactive-break {
  margin: 3rem 0;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

/* Pause & Predict */
.pause-predict {
  background: linear-gradient(135deg, #f0fdfa 0%, white 100%);
  border: 2px solid #14b8a6;
  border-radius: 16px;
  padding: 2rem;
}
.pause-predict-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.pause-predict-icon {
  font-size: 1.5rem;
}
.pause-predict-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f766e;
}
.pause-predict-question {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.pause-predict-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.pause-predict-option {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.selected {
  border-color: #14b8a6;
  background: #ccfbf1;
}
.correct {
  border-color: #10b981;
  background: #d1fae5;
}
.incorrect {
  border-color: #f59e0b;
  background: #fef3c7;
  opacity: 0.6;
}
.option-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #d4d4d8;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.selected .option-checkbox {
  background: #14b8a6;
  border-color: #14b8a6;
}
.correct .option-checkbox {
  background: #10b981;
  border-color: #10b981;
}
.pause-predict-reveal {
  background: var(--color-bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
  display: none;
}

.pause-predict-reveal.show {
  display: block;
  animation: slideDown 0.3s ease;
}
.show {
  display: block;
  animation: slideDown 0.3s ease;
}
.reveal-title {
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.incorrect-reveal .reveal-title {
  color: #d97706;
}
.reveal-text {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.reveal-continue-btn {
  background: var(--color-realm-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

/* Apply It Scenario */
.apply-scenario {
  background: linear-gradient(135deg, #fef3c7 0%, white 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 2rem;
}
.apply-scenario-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.apply-scenario-icon {
  font-size: 1.5rem;
}
.apply-scenario-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #b45309;
}
.scenario-text {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.scenario-options {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.scenario-option {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.scenario-feedback {
  background: var(--color-bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
  display: none;
}

.scenario-feedback.show {
  display: block;
  animation: slideDown 0.3s ease;
}
.feedback-verdict {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.works {
  color: #10b981;
}
.partial {
  color: #f59e0b;
}
.nope {
  color: #ef4444;
}
.feedback-text {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Connection Challenge */
.connection-challenge {
  background: linear-gradient(135deg, #fee2e2 0%, white 100%);
  border: 2px solid #ef4444;
  border-radius: 16px;
  padding: 2rem;
}
.connection-challenge-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.connection-challenge-icon {
  font-size: 1.5rem;
}
.connection-challenge-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: #dc2626;
}
.challenge-text {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.phrase-bank {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.phrase-category {
  background: var(--color-bg-secondary);
  border-radius: 10px;
  padding: 1rem;
}
.category-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.phrase-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.phrase-btn {
  background: #fee2e2;
  border: 2px solid #fecaca;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.used {
  opacity: 0.4;
  cursor: default;
}
.answer-builder {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  min-height: 100px;
}
.builder-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.built-answer {
  font-size: 0.95rem;
  color: var(--color-text-primary);
  line-height: 1.8;
  min-height: 60px;
}
.placeholder-text {
  color: #9ca3af;
  font-style: italic;
}
.built-phrase {
  display: inline-block;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.clear-answer-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
}
.challenge-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.challenge-submit-btn {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}
.secondary {
  background: var(--color-bg-secondary);
  color: #ef4444;
  border: 2px solid #ef4444;
}
.challenge-response {
  background: var(--color-bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
  display: none;
}

.challenge-response.show {
  display: block;
  animation: slideDown 0.3s ease;
}
.response-title {
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.response-text {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Quiz Section */
.quiz-section {
  background: var(--color-bg-secondary);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 2.5rem;
  margin: 3rem 0;
}
.quiz-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f3f4f6;
}
.quiz-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.quiz-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}
.quiz-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
}
.quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.quiz-question {
  background: var(--color-bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
}
.question-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.question-number {
  background: var(--color-text-primary);
  color: #1c1917;
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.question-text {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
}
.select-multiple-hint {
  font-size: 0.85rem;
  color: var(--color-realm-mid);
  font-weight: 600;
  font-style: italic;
}
.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.question-option {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.missed {
  border-color: #f59e0b;
  background: #fffbeb;
}
.missed .option-checkbox {
  background: #fef3c7;
  border-color: #f59e0b;
}
.check-answer-btn {
  background: var(--color-realm-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}
.question-feedback {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--color-bg-secondary);
  border-left: 4px solid #10b981;
  border-radius: 0 8px 8px 0;
  display: none;
}

.question-feedback.show {
  display: block;
  animation: slideDown 0.3s ease;
}
.feedback-title {
  font-weight: 600;
  color: #059669;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.feedback-explanation {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}
.quiz-complete-btn {
  background: var(--color-realm-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  margin: 2rem auto 0;
}
.hidden {
  display: none !important;
}
.pause-predict,
.apply-scenario,
.connection-challenge,
.quiz-section {
  padding: 1.5rem;
}

/* Interactive Elements CSS */
/* Pause & Predict */
/* Apply It Scenario */
.excellent {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, white 100%);
  border-width: 3px;
}
.limited {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, white 100%);
  border-width: 3px;
}

/* Connection Challenge */
.answer-workspace {
  margin: 1.5rem 0;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.workspace-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Quiz Section */

/* Animations */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover Effects */
/* Pause & Predict options (Teal theme) */
.pause-predict-option:hover {
  border-color: #14b8a6; /* teal-500 */
  background-color: #ecfdf5; /* teal-50 */
  transform: translateX(4px);
}

/* Scenario options (Amber theme) */
.scenario-option:hover {
  border-color: #f59e0b; /* amber-500 */
  background-color: #fffbeb; /* amber-50 */
  transform: translateX(4px);
}

/* Phrase buttons (Soft Red theme) */
.phrase-btn:hover {
  background-color: #fee2e2; /* red-100 */
  border-color: #ef4444; /* red-500 */
  color: #991b1b; /* red-800 */
  transform: translateY(-2px);
}

/* Question options (Neutral / Realm theme) */
.question-option:hover {
  border-color: var(--color-realm-mid);
  background-color: #f1f5f9; /* slate-100 */
}

.footer-nav-link:hover {
  border-color: var(--color-realm-mid);
  box-shadow: 0 8px 30px rgba(2, 132, 199, 0.15);
  transform: translateY(-2px);
}

.reveal-continue-btn:hover,
.check-answer-btn:hover,
.quiz-complete-btn:hover,
.challenge-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.challenge-submit-btn.secondary:hover {
  background: #fef2f2;
}

.clear-answer-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.phrase-btn:active {
  transform: scale(0.95);
}

.built-phrase:hover {
  background: #bbf7d0;
  transform: scale(1.05);
}

/* Checkbox Visual Indicators */
.option-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  opacity: 0;
}

/* Checkbox backgrounds for different states */
.question-option.selected .option-checkbox {
  background: #0ea5e9;
  border-color: #0ea5e9;
}

.question-option.correct .option-checkbox {
  background: #10b981;
  border-color: #10b981;
}

.question-option.incorrect .option-checkbox {
  background: #fef2f2;
  border-color: #ef4444;
}

.question-option.missed .option-checkbox {
  background: #fef3c7;
  border-color: #f59e0b;
}

.selected .option-checkbox::after,
.correct .option-checkbox::after {
  opacity: 1;
}

/* Quiz Checkbox Indicators */
.question-option.selected .option-checkbox::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  opacity: 1;
}

.question-option.correct .option-checkbox::after {
  content: '✓';
  color: white;
  font-weight: bold;
  opacity: 1;
}

.question-option.incorrect .option-checkbox::after {
  content: '✗';
  color: #ef4444;
  font-weight: bold;
  font-size: 1.1rem;
  opacity: 1;
}

.question-option.missed .option-checkbox::after {
  content: '!';
  color: #b45309;
  font-weight: bold;
  opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .realm-header {
    padding: 3rem 1.5rem 4rem;
  }

  .realm-title {
    font-size: 2.5rem;
  }

  .realm-content {
    padding: 2rem 1.5rem 3rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .species-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .realm-specs {
    gap: 1.5rem;
  }

  .realm-spec-value {
    font-size: 1.5rem;
  }

  .footer-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-nav-link {
    text-align: center;
  }

  .footer-nav-link.prev,
  .footer-nav-link.next {
    text-align: center;
  }

  /* Interactive Elements Mobile */
  .interactive-break {
    margin: 2rem 0;
  }

  .pause-predict,
  .apply-scenario,
  .connection-challenge,
  .quiz-section {
    padding: 1.5rem;
  }

  .pause-predict-option,
  .scenario-option,
  .question-option {
    padding: 1rem;
  }

  .phrase-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .challenge-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .challenge-submit-btn,
  .clear-answer-btn {
    width: 100%;
  }

  .built-answer {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .realm-title {
    font-size: 2rem;
  }

  .species-grid {
    grid-template-columns: 1fr;
  }

  .realm-specs {
    flex-direction: column;
    gap: 1rem;
  }

  .pause-predict,
  .apply-scenario,
  .connection-challenge,
  .quiz-section {
    padding: 1rem;
    border-radius: 12px;
  }

  .phrase-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
}

/* Learning Objectives */
.learning-objectives {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.objectives-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.objectives-icon {
  font-size: 1.5rem;
}

.objectives-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #92400e;
  margin: 0;
}

.objectives-intro {
  color: #b45309;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.objectives-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.objectives-list li:last-child {
  margin-bottom: 0;
}

.objectives-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #f59e0b;
  font-weight: 700;
  font-size: 1.1rem;
}

/* =====================================================
           DARK MODE OVERRIDES - Must be at end of stylesheet
           ===================================================== */

/* Interactive element text colors */
[data-theme='dark'] .pause-predict-option,
[data-theme='dark'] .scenario-option,
[data-theme='dark'] .question-option {
  color: var(--color-text-primary);
}

/* Selection states */
[data-theme='dark'] .selected {
  background: #134e4a;
  border-color: #14b8a6;
  color: #ccfbf1;
}

[data-theme='dark'] .correct {
  background: #14532d;
  border-color: #10b981;
  color: #d1fae5;
}

[data-theme='dark'] .incorrect {
  background: #451a03;
  border-color: #f59e0b;
  color: #fef3c7;
}

[data-theme='dark'] .missed {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #dbeafe;
}

/* Phrase builder */
[data-theme='dark'] .phrase-btn {
  background: #374151;
  color: #f3f4f6;
  border-color: #4b5563;
}

[data-theme='dark'] .phrase-btn:hover {
  background: #4b5563;
}

[data-theme='dark'] .phrase-btn.used {
  background: #1f2937;
  color: #6b7280;
}

[data-theme='dark'] .category-label {
  color: #fca5a5;
}

[data-theme='dark'] .phrase-category {
  background: #292524;
}

[data-theme='dark'] .built-answer {
  background: #1f2937;
  color: #f3f4f6;
}

[data-theme='dark'] .built-phrase {
  background: #374151;
  color: #f3f4f6;
}

/* Interactive containers - CRITICAL: these override base gradients */
[data-theme='dark'] .pause-predict {
  background: linear-gradient(
    135deg,
    #134e4a 0%,
    var(--color-bg-secondary) 100%
  );
  border-color: #14b8a6;
}

[data-theme='dark'] .pause-predict-title {
  color: #5eead4;
}

[data-theme='dark'] .apply-scenario {
  background: linear-gradient(
    135deg,
    #451a03 0%,
    var(--color-bg-secondary) 100%
  );
  border-color: #f59e0b;
}

[data-theme='dark'] .apply-scenario-title {
  color: #fbbf24;
}

[data-theme='dark'] .connection-challenge {
  background: linear-gradient(
    135deg,
    #450a0a 0%,
    var(--color-bg-secondary) 100%
  );
  border-color: #f87171;
}

[data-theme='dark'] .connection-challenge-title {
  color: #fca5a5;
}

/* Text in interactive containers */
[data-theme='dark'] .challenge-text,
[data-theme='dark'] .scenario-text,
[data-theme='dark'] .pause-predict-question {
  color: var(--color-text-primary);
}

/* Quiz section */
[data-theme='dark'] .quiz-section {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme='dark'] .quiz-title,
[data-theme='dark'] .quiz-subtitle {
  color: var(--color-text-primary);
}

[data-theme='dark'] .question-text {
  color: var(--color-text-primary);
}

/* Reveals and feedback */
[data-theme='dark'] .pause-predict-reveal {
  background: var(--color-bg-secondary);
}

[data-theme='dark'] .reveal-title {
  color: #5eead4;
}

[data-theme='dark'] .incorrect-reveal .reveal-title {
  color: #fbbf24;
}

[data-theme='dark'] .reveal-text {
  color: var(--color-text-secondary);
}

[data-theme='dark'] .feedback-verdict.works {
  color: #34d399;
}

[data-theme='dark'] .feedback-verdict.partial {
  color: #fbbf24;
}

[data-theme='dark'] .feedback-verdict.nope {
  color: #f87171;
}

[data-theme='dark'] .feedback-text {
  color: var(--color-text-secondary);
}

[data-theme='dark'] .scenario-feedback {
  background: var(--color-bg-secondary);
}

[data-theme='dark'] .question-feedback {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

[data-theme='dark'] .feedback-title {
  color: var(--color-text-primary);
}

[data-theme='dark'] .feedback-explanation {
  color: var(--color-text-secondary);
}

/* Key insight box */
[data-theme='dark'] .key-insight {
  background: linear-gradient(
    135deg,
    #451a03 0%,
    var(--color-bg-secondary) 100%
  );
}

[data-theme='dark'] .key-insight p {
  color: var(--color-text-secondary);
}

/* Footer nav */
[data-theme='dark'] .footer-nav-link {
  background: var(--color-bg-secondary);
}

[data-theme='dark'] .footer-nav-label {
  color: var(--color-text-muted);
}

[data-theme='dark'] .footer-nav-title {
  color: var(--color-text-primary);
}

/* Dark mode for learning objectives */
[data-theme='dark'] .learning-objectives {
  background: linear-gradient(135deg, #451a03 0%, #292524 100%);
  border-color: #d97706;
}

[data-theme='dark'] .objectives-title {
  color: #fbbf24;
}

[data-theme='dark'] .objectives-intro {
  color: #fcd34d;
}

[data-theme='dark'] .objectives-list li {
  color: var(--color-text-secondary);
}

[data-theme='dark'] .objectives-list li::before {
  color: #fbbf24;
}

/* ================================
   Scenario Option – Theme Aware
   ================================ */

/* ---------- Base (Light Mode) ---------- */
.scenario-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background-color: #ffffff;
  color: #111827;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.scenario-option span,
.scenario-option label {
  color: inherit;
}

/* Light mode hover */
.scenario-option:hover {
  border-color: #f59e0b;
  background-color: #fffbeb;
  color: #92400e;
  transform: translateX(4px);
}

/* ---------- Dark Mode ---------- */
html[data-theme='dark'] .scenario-option {
  border-color: #334155;
  background-color: #0f172a;
  color: #e5e7eb;
}

/* Dark mode hover */
html[data-theme='dark'] .scenario-option:hover {
  border-color: #f59e0b;
  background-color: #422006;
  color: #fde68a;
}

/* ---------- Active / Selected ---------- */
.scenario-option.active {
  border-color: #f59e0b;
  background-color: #fef3c7;
  color: #78350f;
}

html[data-theme='dark'] .scenario-option.active {
  background-color: #78350f;
  color: #fffbeb;
}

/* ================================
   Pause & Predict Option – Theme Aware
   ================================ */

/* ---------- Base (Light Mode) ---------- */
.pause-predict-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background-color: #ffffff;
  color: #111827;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

/* Inner text safety */
.pause-predict-option span,
.pause-predict-option label {
  color: inherit;
}

/* Checkbox */
.pause-predict-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #14b8a6;
  cursor: pointer;
}

/* Light mode hover */
.pause-predict-option:hover {
  border-color: #14b8a6;
  background-color: #ecfdf5; /* teal-50 */
  color: #065f46; /* dark teal text */
  transform: translateX(4px);
}

/* ---------- Dark Mode ---------- */
html[data-theme='dark'] .pause-predict-option {
  border-color: #334155;
  background-color: #0f172a;
  color: #e5e7eb;
}

/* Dark mode hover */
html[data-theme='dark'] .pause-predict-option:hover {
  border-color: #14b8a6;
  background-color: #022c22; /* dark teal */
  color: #99f6e4; /* mint text */
}

/* ---------- Active / Selected ---------- */
.pause-predict-option.active,
.pause-predict-option:has(input[type='checkbox']:checked) {
  border-color: #14b8a6;
  background-color: #d1fae5;
  color: #064e3b;
}

html[data-theme='dark'] .pause-predict-option.active,
html[data-theme='dark']
  .pause-predict-option:has(input[type='checkbox']:checked) {
  background-color: #064e3b;
  color: #ecfdf5;
}
/* ================================
   Question Option – Theme Aware
   ================================ */

/* ---------- Base (Light Mode) ---------- */
.question-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background-color: #ffffff;
  color: #111827;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

/* Text safety */
.question-option span {
  color: inherit;
  line-height: 1.5;
}

/* Custom checkbox */
.question-option .option-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 2px solid #9ca3af;
  border-radius: 4px;
  background-color: transparent;
  flex-shrink: 0;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

/* Light mode hover */
.question-option:hover {
  border-color: #6366f1; /* indigo */
  background-color: #eef2ff; /* indigo-50 */
  color: #312e81; /* dark indigo text */
  transform: translateX(4px);
}

/* ---------- Selected / Active ---------- */
.question-option.active,
.question-option.selected {
  border-color: #6366f1;
  background-color: #e0e7ff;
  color: #312e81;
}

.question-option.active .option-checkbox,
.question-option.selected .option-checkbox {
  background-color: #6366f1;
  border-color: #6366f1;
}

/* ---------- Focus (Keyboard) ---------- */
.question-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* ---------- Dark Mode ---------- */
html[data-theme='dark'] .question-option {
  border-color: #334155;
  background-color: #0f172a;
  color: #e5e7eb;
}

html[data-theme='dark'] .question-option .option-checkbox {
  border-color: #64748b;
}

/* Dark mode hover */
html[data-theme='dark'] .question-option:hover {
  border-color: #818cf8;
  background-color: #1e1b4b;
  color: #e0e7ff;
}

/* Dark mode selected */
html[data-theme='dark'] .question-option.active,
html[data-theme='dark'] .question-option.selected {
  background-color: #312e81;
  border-color: #818cf8;
  color: #eef2ff;
}

html[data-theme='dark'] .question-option.active .option-checkbox,
html[data-theme='dark'] .question-option.selected .option-checkbox {
  background-color: #818cf8;
  border-color: #818cf8;
}
/* ================================
   Question Number – Theme Aware
   ================================ */

/* ---------- Light Mode ---------- */
.question-number {
  background-color: #e5e7eb; /* light gray */
  color: #1c1917; /* dark text */
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ---------- Dark Mode ---------- */
html[data-theme='dark'] .question-number {
  background-color: var(--color-text-primary); /* your dark theme color */
}
