/* ══════════════════════════════════════════════════════
   Figure and Ground — shared audio prototype styles
   Used by audio-prototype.html and audio-prototype-2.html
   ══════════════════════════════════════════════════════ */

/* ── BODY (audio-specific gradient) ── */
body {
  background: linear-gradient(to right,
    #f4f4f4 0%,
    #e4eaf0 12%,
    #98a8b8 38%,
    #3a4d66 68%,
    #0f1926 100%
  );
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── SCROLL HINT (shown while page overflows) ── */
.scroll-hint {
  position: fixed;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.8;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.scroll-hint span {
  display: inline-block;
  animation: bounce 1.5s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ── TITLE override (tighter spacing in audio views) ── */
.main-title {
  margin-bottom: 1em;
}

/* ── AUDIO STAGE ── */
.audio-stage {
  width: 100%;
  max-width: 900px;
  position: relative;
}

/* ── SPEAKER LABELS ── */
.speaker-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 1em;
  margin-bottom: 1.5em;
}

.speaker-left,
.speaker-right {
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.08em;
}

/* ── CROSSFADE SLIDER ── */
.slider-container {
  position: relative;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2em;
}

.slider-track-bg {
  position: absolute;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right,
    rgba(0,0,0,0.6) 0%,
    rgba(120,140,160,0.4) 50%,
    rgba(255,255,255,0.6) 100%
  );
}

input[type="range"]#crossfade {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

input[type="range"]#crossfade::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #c8d0d8, #5a6a7a);
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 12px rgba(0,0,0,0.4), 0 0 24px rgba(0,0,0,0.15);
  cursor: grab;
  transition: transform 0.15s ease;
}

input[type="range"]#crossfade::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

input[type="range"]#crossfade::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #c8d0d8, #5a6a7a);
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
  cursor: grab;
}

/* ── VOLUME INDICATORS ── */
.volume-indicators {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5em;
  margin-top: -0.5em;
  margin-bottom: 2em;
}

.vol-label {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

/* ── PROGRESS BAR — shared bits only
   (.progress-container and .progress-bar-bg stay inline:
    they differ between the two prototypes)                */
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, rgba(0,0,0,0.5), rgba(255,255,255,0.5));
  border-radius: 2px;
  transition: width 0.1s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.3em 0.2em 0;
}

/* ── STATUS & LOADING ── */
.status {
  text-align: center;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.5);
  font-style: italic;
  min-height: 1.5em;
  margin-bottom: 1em;
}

.loading-bar {
  width: 100%;
  height: 2px;
  background: rgba(120,140,160,0.15);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 1em;
  opacity: 0;
  transition: opacity 0.3s;
}

.loading-bar.visible {
  opacity: 1;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(255,255,255,0.4));
  transition: width 0.3s;
}

/* ── HINT ROW (own line below volume-indicators) ── */
.hint-row {
  text-align: center;
  margin-top: -0.8em;
  margin-bottom: 1.2em;
}

/* ── HINT BOX — soft light pill, gradient-agnostic ── */
.hint {
  display: inline-block;
  padding: 0.4em 0.95em;
  background: rgba(228,234,242,0.5);
  border: none;
  border-radius: 4px;
  color: #1a2838;
  text-shadow: none;
  font-style: italic;
  font-size: 0.88rem;
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   CHIP-STYLE CONTROLS — buttons, transport, language switch
   Proto-specific bits (btn-transport, strophe-bars, play-group grid)
   live in each prototype's inline <style>.
   ══════════════════════════════════════════════════════════════ */

.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8em;
  margin-bottom: 1.5em;
}

.btn {
  padding: 0.6em 1em;
  border: 1px solid rgba(160,180,200,0.45);
  border-radius: 6px;
  background: rgba(80,100,125,0.65);
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover {
  border-color: rgba(200,215,230,0.7);
  background: rgba(105,125,150,0.78);
}
.btn:active {
  transform: scale(0.98);
}

.btn-lang {
  flex: 1;
  /* Pre-reserve the 2 px active border so inactive↔active toggling
     doesn't nudge the layout by 1 px. */
  border-width: 2px;
}
.btn-lang.active {
  border: 2px solid rgba(160,180,200,0.55);
  background: linear-gradient(to right, rgba(40,55,75,0.8), rgba(25,40,60,0.8));
  font-weight: 600;
  letter-spacing: 0.08em;
}
.btn-lang.active:hover {
  border-color: rgba(180,200,220,0.85);
  background: linear-gradient(to right, rgba(55,70,90,0.9), rgba(40,55,75,0.9));
}
.btn-lang:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-play {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.55em 1.2em;
  border: 2px solid rgba(160,180,200,0.55);
  background: linear-gradient(to right, rgba(40,55,75,0.8), rgba(25,40,60,0.8));
  font-weight: 600;
  letter-spacing: 0.08em;
}
.btn-play:hover {
  border-color: rgba(180,200,220,0.85);
  background: linear-gradient(to right, rgba(55,70,90,0.9), rgba(40,55,75,0.9));
}
.btn-play:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.btn-icon svg {
  width: 1.1em;
  height: 1.1em;
  display: block;
}

/* ── TEXT TICKER ── */
.ticker-row {
  width: 100%;
  max-width: 900px;
  margin-top: 1em;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 2.4em;
  padding: 0 0.6em;
  border-radius: 3px;
}

.ticker-odysseus {
  background: linear-gradient(to right,
    rgba(244,244,244,0.5) 0%,
    rgba(228,234,240,0.4) 50%,
    rgba(152,168,184,0.2) 100%
  );
}

.ticker-siren {
  background: linear-gradient(to right,
    rgba(58,77,102,0.2) 0%,
    rgba(58,77,102,0.4) 50%,
    rgba(15,25,38,0.5) 100%
  );
}

.ticker-text {
  position: absolute;
  top: 50%;
  white-space: nowrap;
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
  transform-origin: 0% 50%;
}

/* Ticker text variants: font-weight + glow only.
   Color is driven per-page (via .color-ody / .color-sir in
   figround.css, or an inline override).                   */
.ticker-text-odysseus {
  font-weight: 500;
  text-shadow: 0 0 8px rgba(255,255,255,0.9), 0 0 16px rgba(255,255,255,0.5);
}

.ticker-text-siren {
  font-weight: 400;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 0 16px rgba(0,0,0,0.5);
}

/* Fade edges of ticker */
.ticker-odysseus::before,
.ticker-odysseus::after,
.ticker-siren::before,
.ticker-siren::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}

.ticker-odysseus::before {
  left: 0;
  background: linear-gradient(to right, rgba(244,244,244,0.8), transparent);
}
.ticker-odysseus::after {
  right: 0;
  background: linear-gradient(to left, rgba(180,196,210,0.6), transparent);
}
.ticker-siren::before {
  left: 0;
  background: linear-gradient(to right, rgba(58,77,102,0.6), transparent);
}
.ticker-siren::after {
  right: 0;
  background: linear-gradient(to left, rgba(15,25,38,0.8), transparent);
}

/* ── BACK LINK — chip-style, matches inactive transport buttons ── */
.back-link {
  display: flex;
  justify-content: center;
  gap: 0.8em;
  margin-top: 3em;
}
.back-link a {
  display: inline-block;
  padding: 0.5em 1em;
  border: 1px solid rgba(160,180,200,0.45);
  border-radius: 6px;
  background: rgba(80,100,125,0.65);
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.2s ease;
}
.back-link a:hover {
  background: rgba(105,125,150,0.78);
  border-color: rgba(200,215,230,0.7);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BASE (phones, < 768 px) — 2-row transport grid:
   Row 1: Deutsch | English
   Row 2: Play (full-width)
   Proto-2 extends this with a third "skip" row in its inline style.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .speaker-left,
  .speaker-right { font-size: 1.15rem; }

  .vol-label { font-size: 1rem; }

  .hint { font-size: 0.95rem; }

  .time-row { font-size: 0.9rem; }

  .transport {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "lang-de lang-en"
      "play    play";
    gap: 0.55em;
  }
  #btnDe { grid-area: lang-de; }
  #btnEn { grid-area: lang-en; }
  .btn-play {
    grid-area: play;
    padding: 0.9em 1.2em;
    font-size: 1.1rem;
  }
  .btn-lang {
    padding: 0.75em 0.5em;
    font-size: 1rem;
  }
}
