:root {
  color-scheme: dark;
  --bg: #050611;
  --panel: rgba(10, 14, 31, .88);
  --panel-solid: #0b1023;
  --panel-soft: rgba(17, 23, 48, .72);
  --text: #f5f8ff;
  --muted: #a8b4d1;
  --pink: #ff2bd6;
  --cyan: #22e7ff;
  --violet: #8b5cf6;
  --yellow: #ffd166;
  --line: rgba(129, 170, 255, .22);
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 13% 8%, rgba(255, 43, 214, .18), transparent 34rem),
    radial-gradient(circle at 87% 3%, rgba(34, 231, 255, .14), transparent 34rem),
    linear-gradient(180deg, #090b19 0%, var(--bg) 48%, #03040a 100%);
  line-height: 1.58;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 84%);
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.hero {
  position: relative;
  min-height: min(79vh, 840px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #050611;
}
.hero-art { position: absolute; inset: 0; }
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3,4,12,.88) 0%, rgba(3,4,12,.18) 50%, rgba(3,4,12,.28) 100%),
    linear-gradient(0deg, #050611 0%, transparent 48%);
}
.hero-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: min(79vh, 840px);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  padding: 78px 0 64px;
}
.hero-copy { max-width: 720px; }
.badge, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cyan);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 18px var(--pink);
}
.hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(3rem, 9vw, 7.7rem);
  line-height: .84;
  letter-spacing: -.07em;
  text-transform: uppercase;
  text-shadow: 0 0 36px rgba(255,43,214,.32);
}
.hero-copy > p {
  max-width: 660px;
  margin: 0;
  color: #dbe4f7;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.hero-stats span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  min-width: 130px;
  padding: 9px 13px;
  border: 1px solid rgba(34,231,255,.18);
  border-radius: 999px;
  background: rgba(5,8,22,.66);
  backdrop-filter: blur(10px);
}
.hero-stats strong { color: #fff; font-size: 1.12rem; }
.hero-stats small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 17, .9);
  backdrop-filter: blur(18px);
}
.nav-inner {
  width: min(1180px, calc(100% - 32px));
  min-width: 0;
  margin: auto;
  padding: 11px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  flex: 0 0 auto;
  color: #fff;
  font-weight: 900;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.language-switch { display: flex; gap: 7px; margin-left: auto; }
.lang-btn, .nav-links a {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.lang-btn:hover, .lang-btn.is-active, .nav-links a:hover {
  color: #fff;
  border-color: rgba(34,231,255,.3);
  background: rgba(34,231,255,.08);
}
.nav-links {
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

main > section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 78px 0;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-title.compact { align-items: start; }
.section-title h2, .story-hero h2 {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: .98;
  letter-spacing: -.05em;
}
.section-title p { max-width: 560px; margin: 0; color: var(--muted); }

.mobile-song-nav { display: none; }

.story-section { padding-top: 96px; }
.story-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255,43,214,.10), rgba(34,231,255,.07)),
    var(--panel);
  box-shadow: var(--shadow);
}
.story-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -140px;
  bottom: -220px;
  border-radius: 50%;
  background: rgba(34,231,255,.14);
  filter: blur(60px);
}
.story-lead { max-width: 900px; margin: 20px 0 0; color: #e4eaff; font-size: 1.08rem; }
.story-note {
  max-width: 900px;
  margin: 22px 0 0;
  padding: 15px 18px;
  border-left: 3px solid var(--pink);
  border-radius: 0 14px 14px 0;
  color: #d7def1;
  background: rgba(0,0,0,.18);
}
.story-columns {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 18px;
  margin-top: 18px;
}
.story-card, .story-arc {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 52px rgba(0,0,0,.28);
}
.story-card h3, .story-arc h3, .story-section-title h3 { margin: 0 0 12px; font-size: 1.32rem; }
.story-card p, .story-arc p { color: var(--muted); }
.story-card ul { margin: 0; padding-left: 20px; }
.story-card li { margin: 0 0 10px; color: #dfe6f5; }
.reading-steps { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.reading-steps li {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.reading-steps strong { color: var(--cyan); }
.reading-steps span { color: var(--muted); }
.story-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 42px 0 18px;
}
.story-section-title p { max-width: 600px; margin: 0; color: var(--muted); }
.story-arcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.story-song-links, .related-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.story-song-chip, .related-song-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(34,231,255,.2);
  border-radius: 999px;
  padding: 7px 10px;
  color: #e7fbff;
  background: rgba(34,231,255,.065);
  cursor: pointer;
}
.story-song-chip:hover, .related-song-chip:hover { border-color: rgba(255,43,214,.52); background: rgba(255,43,214,.09); }
.story-song-chip span, .related-song-chip span { color: var(--cyan); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }

.timeline { position: relative; display: grid; gap: 13px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 110px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(var(--pink), var(--cyan), var(--violet), var(--yellow));
  opacity: .48;
}
.chapter-divider {
  position: relative;
  z-index: 1;
  padding: 24px 26px;
  border: 1px solid rgba(34,231,255,.25);
  border-radius: 23px;
  background:
    linear-gradient(135deg, rgba(34,231,255,.09), rgba(255,43,214,.07)),
    rgba(8,11,25,.96);
  box-shadow: 0 18px 52px rgba(0,0,0,.28);
}
.chapter-divider > span { color: var(--cyan); font-size: .74rem; font-weight: 900; letter-spacing: .17em; }
.chapter-divider h3 { margin: 5px 0 6px; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1; }
.chapter-divider p { max-width: 850px; margin: 0; color: var(--muted); }
.chapter-under-neon { border-color: rgba(255,209,102,.28); background: linear-gradient(135deg, rgba(255,209,102,.09), rgba(139,92,246,.08)), rgba(8,11,25,.96); }
.chapter-under-neon > span { color: var(--yellow); }
.time-item {
  position: relative;
  margin-left: 50px;
  width: calc(100% - 50px);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: inherit;
  text-align: left;
  background: var(--panel-soft);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.time-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 24px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 16px rgba(34,231,255,.45);
}
.time-item:hover, .time-item.active { transform: translateX(4px); border-color: rgba(34,231,255,.52); background: rgba(20,28,60,.88); }
.time-item h3 { margin: 2px 0 4px; font-size: 1.18rem; }
.time-item .phase { color: var(--pink); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.time-item p { margin: 7px 0 0; color: var(--muted); }

.song-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.song-grid-chapter { grid-column: 1 / -1; margin-top: 22px; }
.song-grid-chapter:first-child { margin-top: 0; }
.song-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  text-align: left;
  background: var(--panel);
  box-shadow: 0 16px 46px rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.song-card:hover, .song-card.active { transform: translateY(-5px); border-color: rgba(34,231,255,.54); box-shadow: 0 24px 70px rgba(0,229,255,.1); }
.art { aspect-ratio: 16 / 9; overflow: hidden; background: #070a14; }
.art img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.song-card:hover .art img { transform: scale(1.025); }
.card-body { padding: 17px; }
.card-body small { color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.card-body h3 { margin: 7px 0 6px; font-size: 1.22rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .9rem; }

.viewer {
  scroll-margin-top: 88px;
  margin-top: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}
.viewer-top { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 430px; }
.viewer-player { position: relative; min-height: 400px; overflow: hidden; background: #03050d; }
.viewer-art { position: absolute; inset: 0; }
.viewer-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,5,14,.54), transparent 54%); }
.viewer-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.visualizer-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.viewer-info {
  padding: clamp(25px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,43,214,.11), rgba(34,231,255,.07));
}
.viewer-info .phase { color: var(--yellow); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.viewer-info h2 { margin: 10px 0 12px; font-size: clamp(2.5rem, 5vw, 4.6rem); line-height: .9; letter-spacing: -.06em; }
.viewer-info h3 { margin: 0 0 10px; color: var(--cyan); font-size: 1.15rem; }
.viewer-info > p { margin: 0; color: #d4dcef; }
.audio-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.audio-controls { display: flex; align-items: center; gap: 10px; }
.audio-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34,231,255,.28);
  border-radius: 50%;
  background: rgba(4,8,20,.68);
  cursor: pointer;
}
.audio-btn:hover { border-color: var(--pink); box-shadow: 0 0 20px rgba(255,43,214,.17); }
.audio-btn:disabled { opacity: .36; cursor: not-allowed; }
.audio-btn svg { width: 21px; height: 21px; fill: currentColor; }
.seek-wrap { flex: 1 1 auto; min-width: 80px; }
.seek-bar, .volume-bar { width: 100%; accent-color: var(--cyan); cursor: pointer; }
.time-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; }
.volume-wrap { flex: 0 0 105px; display: flex; align-items: center; gap: 6px; }
.volume-icon { color: var(--muted); font-size: .65rem; font-weight: 900; }
.audio-status { min-height: 1.3em; margin: 8px 0 0; color: var(--yellow); font-size: .8rem; }

.song-detail-grid { display: grid; grid-template-columns: .34fr .66fr; gap: 28px; padding: 34px; border-top: 1px solid var(--line); }
.song-explanation { display: grid; align-content: start; gap: 13px; }
.song-explanation section {
  padding: 17px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}
.song-explanation h3, .lyrics-panel > h3 { margin: 0 0 9px; color: var(--cyan); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.song-explanation p { margin: 0; color: var(--muted); }
.related-list { margin-top: 0; }
.related-song-chip { border-radius: 12px; text-align: left; }
.lyrics-panel {
  min-width: 0;
  max-height: 760px;
  overflow-y: auto;
  padding: 22px 24px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 18px;
  background: rgba(2,4,12,.36);
  scrollbar-color: rgba(34,231,255,.42) rgba(255,255,255,.04);
}
.lyrics { font-size: 1rem; line-height: 1.72; }
.stanza { margin: 0 0 1.5em; padding-left: 15px; border-left: 2px solid rgba(255,43,214,.32); }
.stanza-line, .jp-lyric, .romaji-line, .translation-line { display: block; }
.jp-lyric { margin-top: .32em; color: #fff; font-size: 1.04em; }
.romaji-line { color: var(--cyan); font-size: .86em; }
.translation-line { color: var(--muted); font-size: .91em; margin-bottom: .2em; }
.song-pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.song-pager button {
  display: grid;
  gap: 4px;
  padding: 18px 24px;
  border: 0;
  background: rgba(255,255,255,.02);
  cursor: pointer;
}
.song-pager button + button { border-left: 1px solid var(--line); text-align: right; }
.song-pager button:hover { background: rgba(34,231,255,.06); }
.song-pager span { color: var(--cyan); font-size: .72rem; letter-spacing: .09em; }

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 0;
  padding: 30px 0 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}
.footer strong { color: #fff; }
.footer a { color: var(--cyan); }
.fatal-error { padding: 40px; color: #fff; }

@media (max-width: 980px) {
  .story-columns, .viewer-top, .song-detail-grid { grid-template-columns: 1fr; }
  .story-arcs { grid-template-columns: 1fr; }
  .song-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-player { min-height: auto; aspect-ratio: 16 / 9; }
  .lyrics-panel { max-height: none; }
}

@media (max-width: 760px) {
  .hero { min-height: 620px; }
  .hero-content { min-height: 620px; padding-bottom: 38px; }
  .hero-art::after { background: linear-gradient(0deg, #050611 0%, rgba(3,4,12,.55) 58%, rgba(3,4,12,.12) 100%); }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(3.2rem, 18vw, 5.4rem); }
  .nav-inner { gap: 8px; }
  .logo { font-size: .78rem; }
  .nav-links { display: none; }
  .language-switch { margin-left: auto; }
  main > section { width: min(100% - 20px, 1180px); padding: 54px 0; }
  .mobile-song-nav { display: block; padding-top: 42px; }
  .mobile-song-list { display: grid; gap: 7px; }
  .mobile-chapter-label {
    margin-top: 12px;
    padding: 9px 3px 4px;
    color: var(--yellow);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  .mobile-song-link {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: inherit;
    text-align: left;
    background: rgba(12,17,36,.78);
  }
  .mobile-song-link span { color: var(--cyan); font-size: .72rem; font-weight: 900; }
  .mobile-song-link strong { font-size: .92rem; }
  .mobile-song-link.active { border-color: rgba(255,43,214,.52); background: rgba(255,43,214,.08); }
  .section-title, .story-section-title { display: block; }
  .section-title p, .story-section-title p { margin-top: 12px; }
  .story-hero, .story-card, .story-arc { border-radius: 20px; }
  .timeline::before { display: none; }
  .time-item { width: 100%; margin-left: 0; }
  .time-item::before { display: none; }
  .song-grid { grid-template-columns: 1fr; gap: 13px; }
  .song-grid-chapter { margin-top: 14px; }
  .chapter-divider { padding: 20px; }
  .viewer { border-radius: 20px; }
  .viewer-info { padding: 24px 20px; }
  .audio-controls { flex-wrap: wrap; }
  .seek-wrap { order: 3; flex-basis: 100%; }
  .volume-wrap { margin-left: auto; }
  .song-detail-grid { padding: 20px; gap: 18px; }
  .lyrics-panel { padding: 18px 16px; }
  .song-pager button { padding: 15px 12px; }
  .song-pager strong { font-size: .8rem; }
}

@media (max-width: 420px) {
  .hero-stats span { min-width: 0; flex: 1 1 28%; grid-template-columns: 1fr; gap: 0; border-radius: 16px; }
  .lang-btn { padding: 7px 9px; }
}
