:root {
  --bg-primary: #1a332a;
  --bg-secondary: #2d4a3e;
  --bg-tertiary: #1e3d35;
  --accent-gold: #c9a227;
  --accent-orange: #b8652f;
  --accent-warm: #d4a574;
  --text-primary: #f5f0e6;
  --text-secondary: #e6d5a8;
  --text-dim: #8a9a8f;
  --shadow-dark: #0d1a15;
  
  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-serif);
  overflow-x: hidden;
}

#root {
  min-height: 100%;
}

.game-wrapper {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Scene Background */
.scene-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
}

.scene-base {
  position: absolute;
  inset: 0;
  transition: background 1.5s ease;
}

.scene-lighting {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-lighting-neon {
  background: 
    radial-gradient(ellipse 40% 50% at 20% 60%, rgba(201, 162, 39, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 80% 40%, rgba(184, 101, 47, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 100%, rgba(42, 74, 92, 0.2) 0%, transparent 50%);
}

.scene-lighting-amber {
  background: 
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(201, 162, 39, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(184, 101, 47, 0.15) 0%, transparent 50%);
}

.scene-lighting-single {
  background: 
    radial-gradient(ellipse 30% 40% at 30% 30%, rgba(212, 165, 116, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 100% 60% at 50% 100%, rgba(13, 26, 21, 0.5) 0%, transparent 50%);
}

.scene-lighting-green {
  background: 
    radial-gradient(ellipse 50% 40% at 50% 40%, rgba(42, 74, 60, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 70% 70%, rgba(201, 162, 39, 0.15) 0%, transparent 50%);
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 30%, rgba(13, 26, 21, 0.7) 100%);
  pointer-events: none;
}

.scene-texture {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.scene-fade-in {
  animation: sceneFadeIn 1.5s ease forwards;
}

.scene-fade-out {
  animation: sceneFadeOut 0.8s ease forwards;
}

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

@keyframes sceneFadeOut {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

/* Game Container */
.game-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  margin-bottom: 1.5rem;
}

.location-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent-gold);
  font-style: italic;
}

/* Progress Indicator */
.progress-indicator {
  display: flex;
  gap: 0.5rem;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.2);
  border: 1px solid rgba(201, 162, 39, 0.4);
  transition: all 0.3s ease;
}

.progress-dot.visited {
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.5);
}

/* Story Container */
.story-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

/* Narrative Text */
.narrative-container {
  flex: 1;
  cursor: pointer;
}

.narrative-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.narrative-text p {
  margin-bottom: 1.5rem;
  text-indent: 0;
}

.narrative-text p.first-paragraph::first-letter {
  font-size: 3.5rem;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  animation: blink 0.8s infinite;
  color: var(--accent-gold);
  margin-left: 2px;
}

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

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

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

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

/* Choices */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
}

.choice-button {
  position: relative;
  background: rgba(26, 51, 42, 0.8);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 4px;
  padding: 1rem 1.5rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  overflow: hidden;
}

.choice-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.choice-button:hover {
  border-color: var(--accent-gold);
  background: rgba(42, 74, 62, 0.9);
  transform: translateY(0) scale(1.02);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.2);
}

.choice-button:hover::before {
  opacity: 1;
}

.choice-button:hover .choice-text {
  color: var(--text-primary);
}

.choice-visible {
  animation: choiceFadeIn 0.6s ease forwards;
}

.choice-hidden {
  opacity: 0;
  pointer-events: none;
}

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

.choice-text {
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

/* Footer */
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  margin-top: 2rem;
}

.restart-button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0.5rem;
}

.restart-button:hover {
  color: var(--text-primary);
}

.footer-title {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.remix-link {
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.remix-link:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* Title Screen */
.title-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 1s ease;
}

.title-visible {
  opacity: 1;
}

.title-container {
  text-align: center;
  position: relative;
}

.title-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(13, 26, 21, 0.8) 0%, transparent 70%);
  pointer-events: none;
}

.title-main {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  position: relative;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
}

.title-shuffle {
  color: var(--accent-gold);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.title-subtitle {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.title-tagline {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 3rem;
}

.start-button {
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 1rem 3rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.start-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gold);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.start-button:hover {
  color: var(--bg-primary);
}

.start-button:hover::before {
  transform: translateY(0);
}

.title-credits {
  position: absolute;
  bottom: 2rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
  .game-container {
    padding: 1rem;
  }

  .narrative-text {
    font-size: 1.125rem;
    line-height: 1.7;
  }

  .narrative-text p.first-paragraph::first-letter {
    font-size: 2.5rem;
  }

  .location-title {
    font-size: 1.25rem;
  }

  .choice-button {
    padding: 1rem;
  }

  .game-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .footer-title {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 480px) {
  .narrative-text {
    font-size: 1rem;
  }

  .title-main {
    font-size: 2rem;
  }

  .progress-indicator {
    display: none;
  }
}

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