/* Game-specific overrides and additions.
   Base styles (variables, fonts, reset, animations) come from marketing.css. */

:root {
  /* Game uses slightly more muted accent tones than the marketing page */
  --accent: #4a6670;
  --accent-warm: #8a7060;
}

/* --- FULLSCREEN OVERRIDE --- */
html, body {
  height: 100%;
  overflow: hidden;
}

/* --- AMBIENT LAYER --- */
#ambient-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.85;
}

/* --- GAME CONTAINER --- */
#game {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 9rem 0 12vh 0;
  overflow: hidden;
}

#game::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 55%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

#narrative, #choices, .scene-label {
  position: relative;
  z-index: 1;
}

/* --- TEXT AREA --- */
#narrative {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  max-height: calc(100vh - 9rem - 12vh - 5rem);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#narrative::-webkit-scrollbar { display: none; }

.passage {
  margin-bottom: 1.8rem;
  line-height: 1.85;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeIn 1.2s ease forwards;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7), 0 2px 12px rgba(0,0,0,0.4);
}

.passage.dim {
  color: var(--text-dim);
  transition: color 2s ease;
}

.passage em {
  font-style: italic;
  color: var(--text-bright);
}

.passage.whisper {
  font-size: 1.2rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.passage.spoken {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--accent);
  padding-left: 1.5rem;
  border-left: 1px solid var(--accent);
  opacity: 0.85;
}

.passage.feeling {
  color: var(--accent-warm);
  font-style: italic;
}

/* --- CONTINUE GLYPH --- */

.continue-glyph {
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.8rem;
  letter-spacing: 0.4em;
  color: var(--text);
  padding-top: 0.5rem;
}

.continue-glyph span {
  display: inline-block;
  opacity: 0;
  animation: dotwave 2.4s ease-in-out infinite;
}

@keyframes dotwave {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* --- CHOICES --- */
#choices {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.5s forwards;
}

.choice {
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  font-weight: 300;
  padding: 0.8rem 1.2rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.03em;
  border-radius: 2px;
}

.choice:hover {
  border-color: var(--text);
  color: var(--text);
  padding-left: 1.6rem;
  background: rgba(200, 196, 188, 0.03);
}

.choice:active {
  background: rgba(200, 196, 188, 0.06);
}

.choice.unchosen {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.choice.chosen {
  color: var(--text-bright);
  border-color: var(--text-bright);
  pointer-events: none;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.choice.chosen-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}


/* --- SCENE TRANSITIONS --- */
#scene-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

#scene-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* --- TITLE SCREEN --- */
#title-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
}

#title-screen h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 3.5rem;
  letter-spacing: 0.15em;
  color: var(--text-bright);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeIn 2s ease 0.5s forwards;
}

#title-screen .subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  padding: 0 2rem;
  opacity: 0;
  animation: fadeIn 2s ease 1.5s forwards;
}

#title-screen .headphones-note {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.9rem;
  opacity: 0;
  animation: fadeIn 2s ease 2.8s both;
}

#title-screen .start-prompt {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text);
  text-transform: uppercase;
  position: absolute;
  bottom: 10vh;
  opacity: 0;
  animation: fadeIn 2s ease 4s forwards, pulse 5s ease 6s infinite;
}

#title-screen.hiding {
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

/* --- SOUND INDICATOR --- */
#sound-hint {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 5;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.3s;
  color: var(--text-dim);
}

#sound-hint:hover { opacity: 0.8; }

#sound-hint .speaker-off { display: none; }
#sound-hint.muted .speaker-on { display: none; }
#sound-hint.muted .speaker-off { display: block; }

/* --- SCENE LABEL --- */
.scene-label {
  position: fixed;
  top: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  opacity: 0;
  z-index: 2;
  animation: fadeIn 1.5s ease 0.3s forwards;
}

/* --- END SCREEN --- */
.end-text {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 2;
}

.replay-link {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  cursor: pointer;
  transition: color 0.4s, opacity 0.4s;
  border: none;
  background: none;
  padding: 0.5rem 0;
  animation: fadeIn 2s ease forwards;
}

.replay-link:hover {
  color: var(--text-bright);
}

.replay-link-delayed {
  animation-delay: 0.8s;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  .passage { font-size: 1.2rem; line-height: 1.75; }
  .passage.spoken { font-size: 0.95rem; }
  .choice { font-size: 0.9rem; padding: 1rem 1.2rem; min-height: 48px; }
  #title-screen h1 { font-size: 2rem; }
  #game { padding-top: 6rem; }
  #narrative {
    padding: 0 1.5rem;
    max-height: calc(100vh - 6rem - 12vh - 14rem);
  }
  #choices { padding: 0 1.5rem; }
}

@media (orientation: landscape) and (max-height: 500px) {
  #game { padding-top: 4rem; padding-bottom: 6vh; }
  #narrative {
    padding: 0 1.5rem;
    max-height: calc(100vh - 4rem - 6vh - 9rem);
  }
  .passage { font-size: 1rem; line-height: 1.6; margin-bottom: 1.2rem; }
  .choice { font-size: 0.85rem; padding: 0.6rem 1rem; min-height: 40px; }
  #choices { padding: 0 1.5rem; }
  #title-screen h1 { font-size: 1.8rem; }
}
