﻿:root {
  /* GHSTWRK Design System - Dark Mode Colors */
  /* Base colors aligned with GHSTWRK design system */
  --bg: #1a1a1a; /* GHSTWRK earth-dark - Deep charcoal background */
  --fg: #f8f8f2; /* Off-white foreground text */
  --accent: #00ced1; /* GHSTWRK spectral-dark - Spectral teal primary accent */
  --muted: #c5c6c7; /* Muted gray for secondary text */
  --highlight: #00ced1; /* GHSTWRK spectral-dark - Spectral teal highlight */
  --incorrect: #ff6b6b; /* Error state - red */
  --incorrect-bg: rgba(255, 107, 107, 0.18); /* Error background */

  /* GHSTWRK Design System Semantic Colors */
  --ghstwrk-void: #0a0a0a; /* Pure black - Primary text */
  --ghstwrk-earth: #1a1a1a; /* Deep charcoal - Secondary */
  --ghstwrk-dust: #2a2a2a; /* Rich charcoal - Dark background */
  --ghstwrk-spectral: #00ced1; /* Spectral teal - Primary accent */
  --ghstwrk-accent: #4a90e2; /* Electric blue - Secondary accent */
  --ghstwrk-text: #f8f8f2; /* Off-white - Primary text */
  --ghstwrk-text-secondary: #c5c6c7; /* Muted gray - Secondary text */
}

/* Scene-specific color schemes */
/* Scene 1: The Unlit Vestibule - Deep red-orange fire/ember tones */
body[data-scene='scene-1'] {
  --scene-accent: #dc2626;
  --scene-highlight: #f87171;
  --scene-bg-glow: rgba(220, 38, 38, 0.08);
  --scene-border: rgba(248, 113, 113, 0.2);
  --scene-highlight-rgba-16: rgba(248, 113, 113, 0.16);
  --scene-highlight-rgba-20: rgba(248, 113, 113, 0.2);
  --scene-highlight-rgba-28: rgba(248, 113, 113, 0.28);
  --scene-highlight-rgba-40: rgba(248, 113, 113, 0.4);
  --scene-highlight-rgba-10: rgba(248, 113, 113, 0.1);
  --scene-highlight-rgba-5: rgba(248, 113, 113, 0.05);
  --scene-highlight-rgba-30: rgba(248, 113, 113, 0.3);
  --scene-highlight-rgba-60: rgba(248, 113, 113, 0.6);
  --scene-highlight-rgba-50: rgba(248, 113, 113, 0.5);
  --scene-highlight-rgba-15: rgba(248, 113, 113, 0.15);
  --scene-highlight-rgba-8: rgba(248, 113, 113, 0.08);
}

/* Scene 2: The Threefold Threshold - Teal/sea-green navigation tones */
body[data-scene='scene-2'] {
  --scene-accent: #0d9488;
  --scene-highlight: #5eead4;
  --scene-bg-glow: rgba(13, 148, 136, 0.08);
  --scene-border: rgba(94, 234, 212, 0.2);
  --scene-highlight-rgba-16: rgba(94, 234, 212, 0.16);
  --scene-highlight-rgba-20: rgba(94, 234, 212, 0.2);
  --scene-highlight-rgba-28: rgba(94, 234, 212, 0.28);
  --scene-highlight-rgba-40: rgba(94, 234, 212, 0.4);
  --scene-highlight-rgba-10: rgba(94, 234, 212, 0.1);
  --scene-highlight-rgba-5: rgba(94, 234, 212, 0.05);
  --scene-highlight-rgba-30: rgba(94, 234, 212, 0.3);
  --scene-highlight-rgba-60: rgba(94, 234, 212, 0.6);
  --scene-highlight-rgba-50: rgba(94, 234, 212, 0.5);
  --scene-highlight-rgba-15: rgba(94, 234, 212, 0.15);
  --scene-highlight-rgba-8: rgba(94, 234, 212, 0.08);
}

/* Scene 3: The Cartographer's Table - Bright gold/yellow structure tones */
body[data-scene='scene-3'] {
  --scene-accent: #ca8a04;
  --scene-highlight: #fde047;
  --scene-bg-glow: rgba(202, 138, 4, 0.08);
  --scene-border: rgba(253, 224, 71, 0.2);
  --scene-highlight-rgba-16: rgba(253, 224, 71, 0.16);
  --scene-highlight-rgba-20: rgba(253, 224, 71, 0.2);
  --scene-highlight-rgba-28: rgba(253, 224, 71, 0.28);
  --scene-highlight-rgba-40: rgba(253, 224, 71, 0.4);
  --scene-highlight-rgba-10: rgba(253, 224, 71, 0.1);
  --scene-highlight-rgba-5: rgba(253, 224, 71, 0.05);
  --scene-highlight-rgba-30: rgba(253, 224, 71, 0.3);
  --scene-highlight-rgba-60: rgba(253, 224, 71, 0.6);
  --scene-highlight-rgba-50: rgba(253, 224, 71, 0.5);
  --scene-highlight-rgba-15: rgba(253, 224, 71, 0.15);
  --scene-highlight-rgba-8: rgba(253, 224, 71, 0.08);
}

/* Scene 4: Workshop of Echoes - Magenta/pink resonance tones */
body[data-scene='scene-4'] {
  --scene-accent: #c026d3;
  --scene-highlight: #f0abfc;
  --scene-bg-glow: rgba(192, 38, 211, 0.08);
  --scene-border: rgba(240, 171, 252, 0.2);
  --scene-highlight-rgba-16: rgba(240, 171, 252, 0.16);
  --scene-highlight-rgba-20: rgba(240, 171, 252, 0.2);
  --scene-highlight-rgba-28: rgba(240, 171, 252, 0.28);
  --scene-highlight-rgba-40: rgba(240, 171, 252, 0.4);
  --scene-highlight-rgba-10: rgba(240, 171, 252, 0.1);
  --scene-highlight-rgba-5: rgba(240, 171, 252, 0.05);
  --scene-highlight-rgba-30: rgba(240, 171, 252, 0.3);
  --scene-highlight-rgba-60: rgba(240, 171, 252, 0.6);
  --scene-highlight-rgba-50: rgba(240, 171, 252, 0.5);
  --scene-highlight-rgba-15: rgba(240, 171, 252, 0.15);
  --scene-highlight-rgba-8: rgba(240, 171, 252, 0.08);
}

/* Scene 5: The Constellation Vault - Electric blue/indigo star tones */
body[data-scene='scene-5'] {
  --scene-accent: #2563eb;
  --scene-highlight: #60a5fa;
  --scene-bg-glow: rgba(37, 99, 235, 0.08);
  --scene-border: rgba(96, 165, 250, 0.2);
  --scene-highlight-rgba-16: rgba(96, 165, 250, 0.16);
  --scene-highlight-rgba-20: rgba(96, 165, 250, 0.2);
  --scene-highlight-rgba-28: rgba(96, 165, 250, 0.28);
  --scene-highlight-rgba-40: rgba(96, 165, 250, 0.4);
  --scene-highlight-rgba-10: rgba(96, 165, 250, 0.1);
  --scene-highlight-rgba-5: rgba(96, 165, 250, 0.05);
  --scene-highlight-rgba-30: rgba(96, 165, 250, 0.3);
  --scene-highlight-rgba-60: rgba(96, 165, 250, 0.6);
  --scene-highlight-rgba-50: rgba(96, 165, 250, 0.5);
  --scene-highlight-rgba-15: rgba(96, 165, 250, 0.15);
  --scene-highlight-rgba-8: rgba(96, 165, 250, 0.08);
}

/* Opening Page - Mysterious dark purple/indigo tones */
body[data-page='opening'] {
  --scene-accent: #6b21a8;
  --scene-highlight: #a78bfa;
  --scene-bg-glow: rgba(107, 33, 168, 0.08);
  --scene-border: rgba(167, 139, 250, 0.2);
  --scene-highlight-rgba-16: rgba(167, 139, 250, 0.16);
  --scene-highlight-rgba-20: rgba(167, 139, 250, 0.2);
  --scene-highlight-rgba-28: rgba(167, 139, 250, 0.28);
  --scene-highlight-rgba-40: rgba(167, 139, 250, 0.4);
  --scene-highlight-rgba-10: rgba(167, 139, 250, 0.1);
  --scene-highlight-rgba-5: rgba(167, 139, 250, 0.05);
  --scene-highlight-rgba-30: rgba(167, 139, 250, 0.3);
  --scene-highlight-rgba-60: rgba(167, 139, 250, 0.6);
  --scene-highlight-rgba-50: rgba(167, 139, 250, 0.5);
  --scene-highlight-rgba-15: rgba(167, 139, 250, 0.15);
  --scene-highlight-rgba-8: rgba(167, 139, 250, 0.08);
}

/* Vault Cleared Page - Celestial green/emerald tones */
body[data-page='vault-cleared'] {
  --scene-accent: #059669;
  --scene-highlight: #34d399;
  --scene-bg-glow: rgba(5, 150, 105, 0.08);
  --scene-border: rgba(52, 211, 153, 0.2);
  --scene-highlight-rgba-16: rgba(52, 211, 153, 0.16);
  --scene-highlight-rgba-20: rgba(52, 211, 153, 0.2);
  --scene-highlight-rgba-28: rgba(52, 211, 153, 0.28);
  --scene-highlight-rgba-40: rgba(52, 211, 153, 0.4);
  --scene-highlight-rgba-10: rgba(52, 211, 153, 0.1);
  --scene-highlight-rgba-5: rgba(52, 211, 153, 0.05);
  --scene-highlight-rgba-30: rgba(52, 211, 153, 0.3);
  --scene-highlight-rgba-60: rgba(52, 211, 153, 0.6);
  --scene-highlight-rgba-50: rgba(52, 211, 153, 0.5);
  --scene-highlight-rgba-15: rgba(52, 211, 153, 0.15);
  --scene-highlight-rgba-8: rgba(52, 211, 153, 0.08);
}

/* Framework Page - Deep indigo/royal blue tones */
body[data-page='framework'] {
  --scene-accent: #1e40af;
  --scene-highlight: #818cf8;
  --scene-bg-glow: rgba(30, 64, 175, 0.08);
  --scene-border: rgba(129, 140, 248, 0.2);
  --scene-highlight-rgba-16: rgba(129, 140, 248, 0.16);
  --scene-highlight-rgba-20: rgba(129, 140, 248, 0.2);
  --scene-highlight-rgba-28: rgba(129, 140, 248, 0.28);
  --scene-highlight-rgba-40: rgba(129, 140, 248, 0.4);
  --scene-highlight-rgba-10: rgba(129, 140, 248, 0.1);
  --scene-highlight-rgba-5: rgba(129, 140, 248, 0.05);
  --scene-highlight-rgba-30: rgba(129, 140, 248, 0.3);
  --scene-highlight-rgba-60: rgba(129, 140, 248, 0.6);
  --scene-highlight-rgba-50: rgba(129, 140, 248, 0.5);
  --scene-highlight-rgba-15: rgba(129, 140, 248, 0.15);
  --scene-highlight-rgba-8: rgba(129, 140, 248, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background:
    radial-gradient(
      circle at top,
      var(--scene-bg-glow, rgba(69, 162, 158, 0.1)),
      transparent 60%
    ),
    var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding: 0;
  transition: background 0.6s ease;
}

main {
  background: rgba(12, 12, 16, 0.8);
  border: 1px solid var(--scene-border, rgba(102, 252, 241, 0.15));
  border-radius: 16px;
  width: min(850px, calc(100% - 4rem));
  max-width: 850px;
  min-width: 0;
  padding: 2.5rem 2rem;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.2)),
    inset 0 0 60px var(--scene-bg-glow, rgba(102, 252, 241, 0.03));
  backdrop-filter: blur(10px);
  position: relative;
  transition:
    border-color 0.6s ease,
    box-shadow 0.6s ease;
  margin: 3rem auto;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Ensure body doesn't interfere with scrolling */
html {
  scroll-behavior: smooth;
}

@keyframes borderGlow {
  0%,
  100% {
    opacity: 0.3;
    box-shadow:
      0 0 20px var(--scene-border, rgba(102, 252, 241, 0.2)),
      inset 0 0 20px var(--scene-border, rgba(102, 252, 241, 0.1));
  }
  50% {
    opacity: 0.8;
    box-shadow:
      0 0 40px var(--scene-border, rgba(102, 252, 241, 0.4)),
      inset 0 0 40px var(--scene-border, rgba(102, 252, 241, 0.2));
  }
}

main::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    var(--scene-border, rgba(102, 252, 241, 0.1)),
    transparent,
    var(--scene-border, rgba(102, 252, 241, 0.1))
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: borderGlow 4s ease-in-out infinite;
}

main:hover::before {
  opacity: 1;
}

main article {
  animation: sceneFadeIn 0.5s ease-out forwards;
  opacity: 0;
}

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

h1 {
  margin-top: 0;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--scene-highlight, var(--highlight));
  text-shadow:
    0 0 20px var(--scene-highlight-rgba-30, rgba(102, 252, 241, 0.3)),
    0 2px 4px rgba(0, 0, 0, 0.5);
  transition:
    color 0.6s ease,
    text-shadow 0.6s ease;
}

.scene-title {
  margin: 0;
  font-size: clamp(1.4rem, 1.8vw, 1.9rem);
  text-shadow:
    0 0 15px var(--scene-highlight-rgba-20, rgba(102, 252, 241, 0.2)),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition:
    text-shadow 0.6s ease,
    letter-spacing 0.3s ease;
}

.scene-title:hover {
  letter-spacing: 0.25em;
}

.scene-situation {
  margin: 0.75rem 0 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.scene-situation p {
  animation: textReveal 0.8s ease-out forwards;
  opacity: 0;
}

.scene-situation p:nth-child(1) {
  animation-delay: 0.15s;
}

.scene-situation p:nth-child(2) {
  animation-delay: 0.3s;
}

.scene-situation p:nth-child(3) {
  animation-delay: 0.45s;
}

.scene-title {
  animation: textGlowPulse 3s ease-in-out infinite;
}

.text-glow-pulse {
  animation: textGlowPulse 3s ease-in-out infinite;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(15px);
    line-height: 1.2;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    line-height: 1.6;
  }
}

@keyframes textGlowPulse {
  0%,
  100% {
    text-shadow:
      0 0 15px var(--scene-highlight-rgba-30, rgba(102, 252, 241, 0.3)),
      0 1px 2px rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow:
      0 0 30px var(--scene-highlight-rgba-60, rgba(102, 252, 241, 0.6)),
      0 2px 4px rgba(0, 0, 0, 0.5);
  }
}

@keyframes typewriterCursor {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--scene-highlight, var(--highlight));
  margin-left: 2px;
  animation: typewriterCursor 1s infinite;
  vertical-align: baseline;
}

@keyframes panelLift {
  from {
    transform: translateY(0);
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.3),
      0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.1)),
      inset 0 1px 0 var(--scene-border, rgba(102, 252, 241, 0.05));
  }
  to {
    transform: translateY(-4px);
    box-shadow:
      0 8px 30px rgba(0, 0, 0, 0.4),
      0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.2)),
      inset 0 1px 0 var(--scene-border, rgba(102, 252, 241, 0.1));
  }
}

@keyframes borderShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel {
  border: 1px solid var(--scene-border, rgba(102, 252, 241, 0.12));
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(12, 12, 16, 0.7);
  backdrop-filter: blur(8px);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.1)),
    inset 0 1px 0 var(--scene-border, rgba(102, 252, 241, 0.05));
  position: relative;
  will-change: transform;
  transform: translateZ(0);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.6s ease;
  overflow: hidden;
}

.panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--scene-border, rgba(102, 252, 241, 0.3)),
    transparent
  );
  transition: left 0.5s ease;
}

.panel:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.2)),
    inset 0 1px 0 var(--scene-border, rgba(102, 252, 241, 0.1));
}

.panel:hover::after {
  left: 100%;
}

.panel:focus-within {
  border-color: var(--scene-highlight, var(--highlight));
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 0 2px var(--scene-highlight, var(--highlight)),
    inset 0 1px 0 var(--scene-border, rgba(102, 252, 241, 0.05));
}

.panel > * {
  animation: contentReveal 0.6s ease-out forwards;
  opacity: 0;
}

.panel > *:nth-child(1) {
  animation-delay: 0.1s;
}
.panel > *:nth-child(2) {
  animation-delay: 0.2s;
}
.panel > *:nth-child(3) {
  animation-delay: 0.3s;
}
.panel > *:nth-child(4) {
  animation-delay: 0.4s;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 252, 241, 0.3),
    transparent
  );
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
}

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

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

.action-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(102, 252, 241, 0.08);
  border: 1px solid rgba(102, 252, 241, 0.25);
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border 0.2s ease;
  font: inherit;
  text-align: left;
  animation: buttonSlideIn 0.4s ease-out forwards;
  opacity: 0;
  will-change: transform;
  transform: translateZ(0);
  position: relative;
  overflow: hidden;
}

.action-button:nth-child(1) {
  animation-delay: 0.1s;
}
.action-button:nth-child(2) {
  animation-delay: 0.2s;
}
.action-button:nth-child(3) {
  animation-delay: 0.3s;
}
.action-button:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes buttonSlideIn {
  from {
    opacity: 0;
    transform: translateX(-15px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateZ(0);
  }
}

@keyframes buttonClick {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes buttonRipple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes focusRing {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

.action-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--scene-highlight-rgba-40, rgba(102, 252, 241, 0.4));
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-button.ripple::after {
  animation: buttonRipple 0.6s ease-out;
  opacity: 1;
}

.action-button:active {
  animation: buttonClick 0.3s ease-out;
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-3px) scale(1.02);
  background: var(--scene-highlight-rgba-16, rgba(102, 252, 241, 0.16));
  border-color: var(--scene-highlight, var(--highlight));
  outline: none;
  box-shadow:
    0 6px 20px var(--scene-highlight-rgba-30, rgba(102, 252, 241, 0.3)),
    0 0 30px var(--scene-highlight-rgba-15, rgba(102, 252, 241, 0.15)),
    inset 0 0 25px var(--scene-highlight-rgba-8, rgba(102, 252, 241, 0.08));
  transition:
    background 0.6s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease,
    transform 0.3s ease;
}

.action-button:focus-visible::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--scene-highlight, var(--highlight));
  border-radius: 12px;
  animation: focusRing 2s ease-in-out infinite;
  pointer-events: none;
}

.action-button:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(102, 252, 241, 0.15),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
  animation: actionButtonRipple 0.6s ease-out;
  animation-fill-mode: forwards;
}

/* Phase 1: Grey choice de-emphasis for non-canonical buttons - only for specifically attempted wrong choices */
.action-button[data-canonical='false'][data-attempted='true'] {
  opacity: 0.5;
  color: var(--muted);
  border-color: rgba(102, 252, 241, 0.15);
  background: rgba(102, 252, 241, 0.03);
}

.action-button[data-canonical='false'][data-attempted='true']:hover,
.action-button[data-canonical='false'][data-attempted='true']:focus-visible {
  opacity: 0.65;
  color: var(--muted);
  border-color: rgba(102, 252, 241, 0.25);
  background: rgba(102, 252, 241, 0.06);
}

/* Phase 1: Button pulse/ripple effect on click - Generic ripple animation */
@keyframes buttonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0.7),
      var(--button-shadow, 0 4px 15px rgba(102, 252, 241, 0.2));
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(102, 252, 241, 0),
      var(--button-shadow, 0 4px 15px rgba(102, 252, 241, 0.3));
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0),
      var(--button-shadow, 0 4px 15px rgba(102, 252, 241, 0.2));
  }
}

/* Action button ripple (preserves existing box-shadow) */
@keyframes actionButtonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0.7),
      0 4px 15px rgba(102, 252, 241, 0.2),
      0 0 20px rgba(102, 252, 241, 0.1),
      inset 0 0 20px rgba(102, 252, 241, 0.05);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(102, 252, 241, 0),
      0 4px 15px rgba(102, 252, 241, 0.3),
      0 0 25px rgba(102, 252, 241, 0.15),
      inset 0 0 25px rgba(102, 252, 241, 0.08);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0),
      0 4px 15px rgba(102, 252, 241, 0.2),
      0 0 20px rgba(102, 252, 241, 0.1),
      inset 0 0 20px rgba(102, 252, 241, 0.05);
  }
}

/* Treasure button ripple (click animation) */
@keyframes treasureButtonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0.8),
      0 0 0 1px rgba(102, 252, 241, 0.3),
      inset 0 0 35px rgba(102, 252, 241, 0.2),
      0 0 40px rgba(102, 252, 241, 0.4),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 15px rgba(102, 252, 241, 0),
      0 0 0 2px rgba(102, 252, 241, 0.5),
      inset 0 0 45px rgba(102, 252, 241, 0.3),
      0 0 55px rgba(102, 252, 241, 0.6),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0),
      0 0 0 1px rgba(102, 252, 241, 0.3),
      inset 0 0 35px rgba(102, 252, 241, 0.2),
      0 0 40px rgba(102, 252, 241, 0.4),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
}

/* Traverse button ripple */
@keyframes traverseButtonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0.7),
      0 0 0 1px rgba(102, 252, 241, 0.1),
      inset 0 0 0 1px rgba(102, 252, 241, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(102, 252, 241, 0),
      0 0 0 1px rgba(102, 252, 241, 0.2),
      inset 0 0 0 1px rgba(102, 252, 241, 0.2);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0),
      0 0 0 1px rgba(102, 252, 241, 0.1),
      inset 0 0 0 1px rgba(102, 252, 241, 0.1);
  }
}

/* End screen button ripple */
@keyframes endScreenButtonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0.7),
      0 15px 40px rgba(102, 252, 241, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(102, 252, 241, 0),
      0 15px 40px rgba(102, 252, 241, 0.4);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(102, 252, 241, 0),
      0 15px 40px rgba(102, 252, 241, 0.35);
  }
}

/* Canonical button styling only in debug mode */
body[data-debug-mode='true'] .action-button[data-canonical='true'] {
  border-color: rgba(102, 252, 241, 0.4);
  background: rgba(102, 252, 241, 0.12);
  position: relative;
}

body[data-debug-mode='true'] .action-button[data-canonical='true']::before {
  content: 'âœ“';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: var(--scene-highlight, var(--highlight));
  font-size: 0.75rem;
  transition: color 0.6s ease;
  font-weight: bold;
}

body[data-debug-mode='true'] .action-button[data-canonical='false']::before {
  content: 'âœ—';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: rgba(255, 107, 107, 0.7);
  font-size: 0.75rem;
  font-weight: bold;
}

@keyframes successCheckmark {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(45deg);
    opacity: 1;
  }
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(8px);
  }
}

.action-button[data-selected='true'][data-correct='true'] {
  background: var(--scene-highlight-rgba-28, rgba(102, 252, 241, 0.28));
  border-color: var(--scene-highlight, var(--highlight));
  color: var(--bg);
  font-weight: 600;
  box-shadow:
    0 0 35px var(--scene-highlight-rgba-50, rgba(102, 252, 241, 0.5)),
    0 6px 25px var(--scene-highlight-rgba-30, rgba(102, 252, 241, 0.3)),
    inset 0 0 40px var(--scene-highlight-rgba-15, rgba(102, 252, 241, 0.15));
  animation: correctPulse 2s ease-in-out infinite;
  transition:
    background 0.6s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
  position: relative;
}

.action-button[data-selected='true'][data-correct='true']::after {
  content: 'âœ“';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: var(--scene-highlight, var(--highlight));
  font-size: 1.2rem;
  font-weight: bold;
  animation: successCheckmark 0.5s ease-out;
  transform: rotate(45deg);
}

.action-button[data-selected='true'][data-correct='false'] {
  animation: errorShake 0.5s ease-out;
}

/* Container Breathing Animation */
@keyframes breathe {
  0%,
  100% {
    padding: 2.5rem 2rem;
  }
  50% {
    padding: 2.6rem 2.1rem;
  }
}

/* Disable breathing animation to prevent layout shifts during scroll */
/* main {
      animation: breathe 8s ease-in-out infinite;
    } */

/* Animate In Class for Intersection Observer */
@keyframes animateIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-in {
  animation: animateIn 0.6s ease-out forwards;
}

/* Letter Spacing Animation */
@keyframes letterSpacing {
  from {
    letter-spacing: 0.1em;
  }
  to {
    letter-spacing: 0.25em;
  }
}

h1:hover {
  animation: letterSpacing 0.3s ease-out forwards;
}

/* Improved Font Rendering */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes correctPulse {
  0%,
  100% {
    box-shadow:
      0 0 25px rgba(102, 252, 241, 0.4),
      0 4px 20px rgba(102, 252, 241, 0.2),
      inset 0 0 30px rgba(102, 252, 241, 0.1);
  }
  50% {
    box-shadow:
      0 0 35px rgba(102, 252, 241, 0.5),
      0 4px 25px rgba(102, 252, 241, 0.3),
      inset 0 0 35px rgba(102, 252, 241, 0.15);
  }
}

.action-button[data-selected='true'][data-correct='false'] {
  background: var(--incorrect-bg);
  border-color: rgba(255, 107, 107, 0.7);
  color: var(--incorrect);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35);
}

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

.panel p {
  margin: 0.4rem 0;
  line-height: 1.6;
}

.meta-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.meta-item h3 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}

.controls button {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  background: var(--scene-highlight, var(--highlight));
  color: #041920;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.6s ease;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.controls button:not(:disabled):hover,
.controls button:not(:disabled):focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(102, 252, 241, 0.3);
}

.controls button:not(:disabled):active {
  animation: endScreenButtonRipple 0.6s ease-out;
  animation-fill-mode: forwards;
}

/* Typographic Style System - Phase 1: Enhanced Hierarchy */
.text-atmosphere {
  font-weight: 300;
  font-style: italic;
  font-size: 0.92em;
  color: var(--muted);
  opacity: 0.8;
  letter-spacing: 0.025em;
  line-height: 1.75;
  animation: textGlowPulse 4s ease-in-out infinite;
}

.text-action {
  font-weight: 400;
  font-style: normal;
  font-size: 1em;
  color: var(--fg);
  line-height: 1.65;
}

.text-reflection {
  font-weight: 300;
  font-style: italic;
  font-size: 0.98em;
  color: var(--muted);
  opacity: 0.9;
  line-height: 1.7;
}

.text-choices {
  font-weight: 500;
  font-style: normal;
  font-size: 1.02em;
  color: var(--fg);
  letter-spacing: 0.015em;
  line-height: 1.65;
}

.text-consequence {
  font-weight: 600;
  font-style: normal;
  font-size: 1.08em;
  color: var(--fg);
  text-shadow: 0 0 10px rgba(102, 252, 241, 0.15);
  position: relative;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(102, 252, 241, 0.35);
  line-height: 1.7;
}

.text-takeaway {
  font-weight: 500;
  font-style: normal;
  font-size: 1.02em;
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
  line-height: 1.65;
}

.text-transition {
  font-weight: 300;
  font-style: italic;
  font-size: 0.93em;
  color: var(--muted);
  opacity: 0.85;
  line-height: 1.7;
}

.text-quote {
  font-weight: 400;
  font-style: italic;
  font-size: 1.05em;
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
  line-height: 1.7;
}

.hint {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.end-screen {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.end-screen h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--highlight);
}

.end-screen p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.treasure-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-width: 100%;
  text-align: center;
  justify-items: center;
}

@media (min-width: 768px) {
  .treasure-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .treasure-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Phase 2: Treasure card animations */
@keyframes treasureCardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

.treasure-card {
  border-radius: 14px;
  padding: 1.5rem;
  background: rgba(12, 12, 16, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--scene-border, rgba(102, 252, 241, 0.18));
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.35),
    0 0 0 1px var(--scene-border, rgba(102, 252, 241, 0.1));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  text-align: center;
  transition:
    all 0.3s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
  animation:
    treasureCardSlideIn 0.5s ease-out forwards,
    float 6s ease-in-out infinite;
  animation-delay: 0s, 1s;
  opacity: 0;
  will-change: transform, opacity;
}

.treasure-card:nth-child(1) {
  animation-delay: 0.1s;
}
.treasure-card:nth-child(2) {
  animation-delay: 0.2s;
}
.treasure-card:nth-child(3) {
  animation-delay: 0.3s;
}
.treasure-card:nth-child(4) {
  animation-delay: 0.4s;
}
.treasure-card:nth-child(5) {
  animation-delay: 0.5s;
}

.treasure-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow:
    0 10px 30px rgba(102, 252, 241, 0.2),
    0 0 40px rgba(102, 252, 241, 0.1);
}

/* Phase 2: Wisdom fragments styling (lower hierarchy than treasures) */
.wisdom-fragments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(102, 252, 241, 0.1);
}

.fragment-heading {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.fragments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fragment-item {
  padding: 0.75rem 1rem;
  background: rgba(12, 12, 16, 0.4);
  border-left: 2px solid rgba(69, 162, 158, 0.15);
  border-radius: 4px;
  will-change: transform, opacity;
}

.fragment-item p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
  opacity: 0.85;
}

@keyframes fragmentFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateZ(0);
  }
}

.treasure-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--highlight);
}

.treasure-card span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
}

.end-screen button {
  align-self: center;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2.4rem;
  background: var(--highlight);
  color: #041920;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.end-screen button:hover,
.end-screen button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 15px 40px rgba(102, 252, 241, 0.35);
}

.end-screen button:active {
  animation: endScreenButtonRipple 0.6s ease-out;
  animation-fill-mode: forwards;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .action-button,
  .controls button,
  .end-screen button {
    transition: none;
    transform: none !important;
    box-shadow: none !important;
  }
}

.end-screen.death h2 {
  color: var(--incorrect);
}

.end-screen.death {
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 14px;
  padding: 2rem;
}

.death-context {
  margin-top: 1rem;
}

/* Hide controls during death lock */
body[data-locked='true'] .controls,
body[data-locked='true'] .hint {
  display: none !important;
}

/* ASCII Art Styles */
.ascii-art {
  font-family: 'Courier New', Courier, monospace;
  white-space: pre;
  line-height: 1.2;
  text-align: center;
  margin: 0;
  color: var(--fg);
}

.plinth-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.plinth-wrapper {
  width: 100%;
  max-width: 200px;
  display: flex;
  justify-content: center;
}

.treasure-emoji {
  cursor: pointer;
  font-size: 2rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 100px;
  background: rgba(12, 12, 16, 0.8);
  border: 1px solid rgba(102, 252, 241, 0.3);
  border-radius: 0;
  position: relative;
  padding: 0.5rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--fg);
  box-shadow:
    0 0 0 1px rgba(102, 252, 241, 0.1),
    inset 0 0 0 1px rgba(102, 252, 241, 0.1);
}

/* Plinth shape using pseudo-elements */
.treasure-emoji::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 8px;
  background: rgba(102, 252, 241, 0.2);
  border: 1px solid rgba(102, 252, 241, 0.3);
  clip-path: polygon(0 0, 15% 100%, 85% 100%, 100% 0);
}

.treasure-emoji::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: -2px;
  right: -2px;
  height: 8px;
  background: rgba(102, 252, 241, 0.2);
  border: 1px solid rgba(102, 252, 241, 0.3);
  clip-path: polygon(0 100%, 15% 0, 85% 0, 100% 100%);
}

.treasure-emoji:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(102, 252, 241, 0.2),
    0 0 0 1px rgba(102, 252, 241, 0.4),
    inset 0 0 0 1px rgba(102, 252, 241, 0.2);
  border-color: rgba(102, 252, 241, 0.5);
}

.treasure-emoji:active {
  transform: translateY(0);
}

.treasure-emoji-placed {
  opacity: 0.5;
  pointer-events: none;
}

.boon-reveal {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(102, 252, 241, 0.05);
  border: 1px solid rgba(102, 252, 241, 0.15);
  animation: fadeIn 0.5s ease;
  font-style: italic;
  color: var(--muted);
}

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

.sparkle-reveal {
  font-size: 3rem;
  cursor: pointer;
  animation: sparklePulse 2s ease infinite;
  text-align: center;
  margin: 2rem 0;
  min-width: 60px;
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 10px rgba(102, 252, 241, 0.5));
}

.sparkle-reveal:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 20px rgba(102, 252, 241, 0.7));
}

@keyframes sparklePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.framework-screen {
  padding: 2rem;
}

.framework-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(12, 12, 16, 0.65);
  border: 1px solid rgba(102, 252, 241, 0.12);
}

.framework-section h3 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.framework-section p {
  margin: 0.75rem 0;
  line-height: 1.7;
  color: var(--muted);
}

.framework-section strong {
  color: var(--scene-accent, var(--accent));
  transition: color 0.6s ease;
}

.treasure-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(12, 12, 16, 0.5);
  border: 1px solid rgba(102, 252, 241, 0.1);
}

.treasure-button {
  cursor: pointer;
  font-size: 1.5rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  min-height: 70px;
  height: 70px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(102, 252, 241, 0.3),
    rgba(12, 12, 16, 0.95) 70%
  );
  border: 2px solid rgba(102, 252, 241, 0.5);
  border-radius: 50%;
  position: relative;
  padding: 0.5rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--fg);
  box-shadow:
    0 0 0 1px rgba(102, 252, 241, 0.3),
    inset 0 0 35px rgba(102, 252, 241, 0.2),
    0 0 40px rgba(102, 252, 241, 0.4),
    inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  gap: 0.5rem;
  animation: orbPulse 3s ease-in-out infinite;
  will-change: box-shadow, transform;
}

/* Orb pulsing glow animation */
@keyframes orbPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(102, 252, 241, 0.3),
      inset 0 0 35px rgba(102, 252, 241, 0.2),
      0 0 40px rgba(102, 252, 241, 0.4),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(102, 252, 241, 0.35),
      inset 0 0 40px rgba(102, 252, 241, 0.25),
      0 0 50px rgba(102, 252, 241, 0.5),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
}

.treasure-button .emoji {
  font-size: 2.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px rgba(102, 252, 241, 0.6));
  will-change: filter;
}

.treasure-button:hover:not(:disabled) .emoji {
  filter: drop-shadow(0 0 14px rgba(102, 252, 241, 0.8));
}

/* Treasure button wrapper for button + text */
.treasure-button-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.treasure-button-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(69, 162, 158, 0.9);
  text-align: center;
  line-height: 1.3;
  max-width: 140px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow:
    0 0 4px rgba(69, 162, 158, 0.3),
    0 0 6px rgba(69, 162, 158, 0.15);
  margin-top: 0.25rem;
}

.treasure-button:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  animation: orbPulseHover 1.5s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(102, 252, 241, 0.3),
    inset 0 0 35px rgba(102, 252, 241, 0.2),
    0 0 40px rgba(102, 252, 241, 0.4),
    0 6px 25px rgba(102, 252, 241, 0.25),
    inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  border-color: rgba(102, 252, 241, 0.6);
}

/* Amplified pulse on hover */
@keyframes orbPulseHover {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(102, 252, 241, 0.3),
      inset 0 0 35px rgba(102, 252, 241, 0.2),
      0 0 40px rgba(102, 252, 241, 0.4),
      0 6px 25px rgba(102, 252, 241, 0.25),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(102, 252, 241, 0.4),
      inset 0 0 45px rgba(102, 252, 241, 0.3),
      0 0 55px rgba(102, 252, 241, 0.5),
      0 6px 30px rgba(102, 252, 241, 0.35),
      inset -2px -2px 10px rgba(0, 0, 0, 0.3);
  }
}

.treasure-button:hover:not(:disabled) .emoji {
  filter: drop-shadow(0 0 6px rgba(102, 252, 241, 0.5));
}

.treasure-button:active:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  animation: treasureButtonRipple 0.6s ease-out;
  animation-fill-mode: forwards;
}

.treasure-button-placed {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(102, 252, 241, 0.05);
}

/* Debug mode overlay */
.debug-overlay {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(11, 12, 16, 0.95);
  border: 2px solid var(--highlight);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: var(--fg);
  z-index: 10000;
  max-width: 300px;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body[data-debug-mode='true'] .debug-overlay {
  display: block;
}

.debug-overlay h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.debug-overlay .debug-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(102, 252, 241, 0.2);
}

.debug-overlay .debug-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.debug-overlay .debug-label {
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.debug-overlay .debug-value {
  color: var(--fg);
  font-weight: 500;
}

.debug-overlay .debug-canonical {
  color: var(--highlight);
}

.debug-overlay .debug-noncanonical {
  color: rgba(255, 107, 107, 0.8);
}

.traverse-button {
  cursor: pointer;
  font-size: 1rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 80px;
  background: rgba(12, 12, 16, 0.8);
  border: 1px solid rgba(102, 252, 241, 0.3);
  border-radius: 0;
  position: relative;
  padding: 0.75rem 1.5rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--fg);
  box-shadow:
    0 0 0 1px rgba(102, 252, 241, 0.1),
    inset 0 0 0 1px rgba(102, 252, 241, 0.1);
  gap: 0.5rem;
}

.traverse-button::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: rgba(102, 252, 241, 0.2);
  border: 1px solid rgba(102, 252, 241, 0.3);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
}

.traverse-button::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: rgba(102, 252, 241, 0.2);
  border: 1px solid rgba(102, 252, 241, 0.3);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.traverse-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(102, 252, 241, 0.2),
    0 0 0 1px rgba(102, 252, 241, 0.4),
    inset 0 0 0 1px rgba(102, 252, 241, 0.2);
  border-color: rgba(102, 252, 241, 0.5);
}

.traverse-button:active {
  transform: translateY(0);
  animation: traverseButtonRipple 0.6s ease-out;
  animation-fill-mode: forwards;
}

.traverse-button .label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(69, 162, 158, 0.85);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 767px) {
  .plinth-container {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .plinth-wrapper {
    max-width: 100%;
  }

  .ascii-art {
    font-size: 0.8rem;
  }

  .treasure-emoji {
    font-size: 2.5rem;
    min-width: 44px;
    min-height: 44px;
  }

  .sparkle-reveal {
    font-size: 2.5rem;
    min-width: 44px;
    min-height: 44px;
  }

  .framework-screen {
    padding: 1rem;
  }

  .treasure-inventory {
    padding: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .plinth-container {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
    gap: 1.5rem;
  }

  .plinth-wrapper {
    max-width: 100%;
  }

  .ascii-art {
    font-size: 0.9rem;
  }
}

@media (min-width: 1025px) {
  .plinth-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
  }

  .plinth-wrapper {
    max-width: 100%;
  }
}
