:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #34150f;
  color: #fff4d4;
}

* { box-sizing: border-box; }

body { margin: 0; }

.story-page {
  min-height: 100svh;
  overflow-x: hidden;
  padding: max(22px, env(safe-area-inset-top)) 18px max(30px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 55%, transparent 0 24%, rgba(49, 15, 9, 0.18) 66%, rgba(34, 10, 7, 0.52) 100%),
    linear-gradient(180deg, rgba(67, 18, 12, 0.14), rgba(64, 17, 10, 0.36)),
    url("/dino/assets/stories/volcano_story_background_v1.png") center / cover fixed;
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 14px;
  align-items: center;
  border-radius: 999px;
  color: #fff4d4;
  background: rgba(55, 20, 12, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(43, 62, 35, 0.14);
}

.story-intro {
  width: min(100%, 520px);
  margin: 5vh auto 0;
  padding: 20px 20px 16px;
  border: 1px solid rgba(255, 210, 111, 0.24);
  border-radius: 26px;
  background: rgba(55, 20, 12, 0.58);
  color: #fff4d4;
  box-shadow: 0 18px 60px rgba(28, 7, 4, 0.3);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #ffd86e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.08;
}

.summary {
  margin: 18px 0 22px;
  color: rgba(255, 244, 212, 0.82);
  font-size: 15px;
  line-height: 1.75;
}

.player-stage {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1;
  margin: 28px auto 12px;
  display: grid;
  place-items: center;
}

.progress-dial {
  --progress: 0deg;
  width: 68%;
  aspect-ratio: 1;
  padding: 9px;
  border-radius: 50%;
  background: conic-gradient(#ffd86e var(--progress), rgba(255, 216, 110, 0.18) 0);
  box-shadow: 0 0 36px rgba(255, 174, 45, 0.24);
}

.player-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  grid-template-columns: 44px auto auto auto;
  grid-template-rows: 52px 44px;
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: 5px;
  color: #fff4d4;
  background: radial-gradient(circle at 45% 36%, #724126, #34150f 72%);
  border: 1px solid rgba(255, 218, 126, 0.38);
}

.play-button { grid-column: 1; grid-row: 1; }
.player-core output,
.duration-separator { grid-row: 1; }

.energy-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 213, 102, 0.58);
  pointer-events: none;
}

.energy-ring::before,
.energy-ring::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd86e;
  box-shadow: 0 0 12px rgba(255, 189, 54, 0.8);
}

.energy-ring::before { top: -4px; left: 28%; }
.energy-ring::after { right: 9%; bottom: 17%; width: 4px; height: 4px; }
.ring-one { inset: 4%; animation: ring-spin 26s linear infinite; }
.ring-two { inset: 11%; animation: ring-spin-reverse 34s linear infinite; border-right-color: transparent; }
.ring-three { inset: 18%; animation: ring-spin 42s linear infinite; border-bottom-color: transparent; }

@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes ring-spin-reverse { to { transform: rotate(-360deg); } }

.play-button,
.player-actions button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 218, 126, 0.45);
  color: #fff4d4;
  background: rgba(95, 40, 22, 0.84);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.play-button { border-radius: 50%; font-size: 20px; }
.player-actions { display: flex; justify-content: center; gap: 12px; }
.player-actions button { padding: 10px 16px; border-radius: 999px; }
.progress-input {
  grid-column: 1 / -1;
  grid-row: 2;
  width: min(100%, 156px);
  min-width: 0;
  height: 44px;
  margin: 0 auto;
  accent-color: #ffd86e;
  cursor: pointer;
}

.progress-input:focus-visible {
  outline: 3px solid #fff4a8;
  outline-offset: 2px;
  border-radius: 8px;
}
.player-status, .note { text-align: center; }
.player-status { margin: 14px auto 0; font-size: 12px; font-weight: 800; }

:focus-visible {
  outline: 3px solid #fff4a8;
  outline-offset: 4px;
}

.note {
  margin: 16px 2px 0;
  color: rgba(255, 244, 212, 0.72);
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 430px) {
  .story-intro { margin-top: 2vh; }
  .player-stage { width: min(82vw, 310px); margin-top: 20px; }
}

@media (max-width: 360px) {
  .story-page { padding-inline: 14px; }
  .story-intro { padding: 16px; }
  .summary { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .energy-ring,
  .story-page.is-playing .progress-dial { animation: none !important; }
}
