.story-reader {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
  position: relative;
}
.story-reader-question,
.story-reader-voices,
.story-reader-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.6rem;
  width: 100%;
  max-width: 600px;
}
.story-reader-question {
  justify-content: center;
}
.story-reader-voices .story-reader-back,
.story-reader-player .story-reader-back {
  margin-left: auto;
}
.voice-options {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .voice-options {
    flex-wrap: nowrap;
    gap: 0.1rem;
  }
  .story-reader-voices .story-reader-back {
    margin-left: 0.1rem;
  }
}
.story-reader-btn {
  margin: 0 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.3rem;
  background-color: var(--bg-pill);
  color: var(--text-pill);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.story-reader-btn:hover {
  background-color: var(--bg-pill-hover);
}
.story-reader-back {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: 0.5rem;
  color: var(--text-pill);
}
.audio-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-top: 0;
}
.audio-controls-row1,
.audio-controls-row2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.audio-controls-row2 {
  margin-left: auto;
}
@media (max-width: 600px) {
  .audio-controls {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }
  .audio-controls-row1,
  .audio-controls-row2 {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}
.audio-controls .audio-play,
.audio-controls .audio-stop,
.audio-controls .audio-mute {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
}
.audio-controls .audio-time {
  margin: 0 0.3rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.audio-controls input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background-color: var(--bg-pill);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 600px) {
  .audio-controls input[type='range'] {
    height: 4px;
  }
}
.audio-controls input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text-pill);
  cursor: pointer;
}
.audio-controls input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text-pill);
  border: none;
  cursor: pointer;
}
.audio-controls input[type='range']::-ms-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text-pill);
  border: none;
  cursor: pointer;
}
.audio-progress .progress-range,
.audio-volume .volume-range {
  width: 80px;
  cursor: pointer;
  transition: width 0.25s ease;
}
.audio-progress.expanded .progress-range {
  width: 200px;
}
.audio-volume.expanded .volume-range {
  width: 120px;
}
@media (max-width: 600px) {
  .audio-progress .progress-range,
  .audio-volume .volume-range {
    width: 60px;
  }
  .audio-progress.expanded .progress-range {
    width: 100px;
  }
  .audio-volume.expanded .volume-range {
    width: 100px;
  }
}
.audio-progress,
.audio-volume {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.audio-volume {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.audio-progress:not(.expanded) .progress-range,
.audio-volume:not(.expanded) .volume-range {
  pointer-events: none;
}
.volume-value {
  margin-left: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.audio-progress .progress-range::-webkit-slider-thumb,
.audio-volume .volume-range::-webkit-slider-thumb {
  opacity: 0;
}
.audio-progress.expanded .progress-range::-webkit-slider-thumb,
.audio-volume.expanded .volume-range::-webkit-slider-thumb {
  opacity: 1;
}
.audio-progress .progress-range::-moz-range-thumb,
.audio-volume .volume-range::-moz-range-thumb {
  opacity: 0;
}
.audio-progress.expanded .progress-range::-moz-range-thumb,
.audio-volume.expanded .volume-range::-moz-range-thumb {
  opacity: 1;
}
.audio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  padding: 20px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 1000;
}
.audio-overlay.hidden {
  display: none;
}
.audio-overlay .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
