/* Victorian Steampunk / Otome Visual Novel Styles for Audrey Interactive Story */
:root {
  --bg-dark: #121815;
  --panel-bg: rgba(14, 19, 16, 0.94);
  --border-gold: rgba(176, 141, 87, 0.4);
  --border-gold-bright: #c9a054;
  --text-gold: #f5e6c8;
  --text-sub: #a38f67;
  --text-muted: #e0d5c1;
  --crimson-accent: #5A1616;
  --crimson-hover: #7a1d1d;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-mono: 'Special Elite', monospace;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* Container limits */
.story-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
}

/* Header & Intro */
.story-header {
  text-align: center;
  margin-bottom: 20px;
}

.story-header h1 {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--text-gold);
  margin: 8px 0;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.story-intro {
  font-size: 1.1rem;
  color: var(--text-sub);
  max-width: 720px;
  margin: 0 auto 16px auto;
  font-style: italic;
}

/* Visual Novel Game Viewport */
.game-viewport {
  position: relative;
  width: 100%;
  height: 540px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease-in-out;
}

/* Atmosphere gradient overlay */
.game-viewport::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(10,14,12,0.7) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Audrey Character Sprite Overlay - Floating prominently behind dialogue bar */
.character-sprite {
  position: absolute;
  bottom: 0;
  right: 8%;
  height: 92%;
  max-width: 48%;
  object-fit: contain;
  object-position: bottom right;
  z-index: 2;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.7));
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Single Unified Bottom Dialogue & Interaction Panel (Option 1: Ultra-Compact Low Profile Bar) */
.unified-dialogue-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--panel-bg);
  border-top: 2px solid rgba(176, 141, 87, 0.6);
  padding: 12px 20px 14px 20px;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 155px;
}

.speaker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speaker-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--border-gold-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scene-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-gold);
  margin: 0;
  line-height: 1.4;
  min-height: 38px;
}

/* Options Group: Horizontal Inline Row for choices */
.options-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.story-choice-btn {
  flex: 1 1 0;
  background: rgba(90, 22, 22, 0.88);
  color: var(--text-gold);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 7px 14px;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.story-choice-btn:hover, .story-choice-btn:focus {
  background: var(--crimson-hover);
  border-color: var(--border-gold-bright);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(176,141,87,0.3);
  outline: none;
}

/* Ending Badge inside bottom container */
.ending-badge {
  flex: 1 1 auto;
  padding: 6px 12px;
  background: rgba(40, 30, 22, 0.9);
  border: 1px solid var(--border-gold-bright);
  border-radius: 4px;
  box-sizing: border-box;
  animation: fadeIn 0.4s ease-in-out;
}

.ending-badge h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-gold);
  margin: 0 0 2px 0;
}

.ending-badge p {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin: 0;
}

/* Blinking Next Step Indicator Arrow (▼) */
.click-advance-arrow {
  position: absolute;
  right: 16px;
  bottom: 10px;
  font-size: 0.85rem;
  color: var(--border-gold-bright);
  animation: pulseBlink 1.2s infinite ease-in-out;
  cursor: pointer;
  user-select: none;
  pointer-events: none;
}

.unified-dialogue-panel.clickable {
  cursor: pointer;
}

@keyframes pulseBlink {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(3px); }
}

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

/* Static Crawler Text (SEO Fallback) */
.seo-crawler-content {
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid var(--border-gold);
}

.seo-section {
  margin-bottom: 25px;
}

.seo-section h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--text-gold);
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.seo-section p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Links back to site */
.back-link-box {
  margin-top: 25px;
  text-align: center;
}

.back-link {
  display: inline-block;
  color: var(--border-gold-bright);
  text-decoration: underline;
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-gold);
}

/* Responsive Scaling for Mobile & iPad */
@media (max-width: 768px) {
  .story-container {
    padding: 10px;
  }

  .story-header h1 {
    font-size: 2rem;
  }

  .game-viewport {
    height: 480px;
  }

  .character-sprite {
    height: 75%;
    right: 2%;
    opacity: 0.9;
  }

  .unified-dialogue-panel {
    padding: 14px 16px 16px 16px;
  }

  .scene-text {
    font-size: 1.1rem;
    min-height: 44px;
  }

  .options-group {
    flex-direction: column;
    gap: 8px;
  }

  .story-choice-btn {
    flex: 1 1 100%;
    width: 100%;
    padding: 10px 14px;
    font-size: 1.05rem;
    box-sizing: border-box;
  }
}
