
*, *::before, *::after{ box-sizing: border-box; }
html, body{ margin: 0; padding: 0; }

:root{
  --bg:          #141414;
  --bg-elevated: #1f1f1f;
  --bg-card:     #262626;
  --red:         #E4002B;
  --red-deep:    #a5001f;
  --text:        #ffffff;
  --text-dim:    #b3b3b3;
  --text-faint:  #757575;

  --font-display: 'Bebas Neue', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
}

body{
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }
h1,h2,h3,p,figure{ margin: 0; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.page{
  position: relative;
  width: 100%;
  min-height: 100svh;
  padding: clamp(4rem, 9vh, 5.5rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.page-inner{
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

#intro{
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#intro.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
.intro-mark{
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 60px;
}
.bar{
  width: 12px;
  background: var(--red);
  border-radius: 3px;
  animation: bar-pulse 1.1s ease-in-out infinite;
}
.bar-1{ height: 28px; animation-delay: 0s; }
.bar-2{ height: 52px; animation-delay: 0.15s; }
.bar-3{ height: 38px; animation-delay: 0.3s; }
@keyframes bar-pulse{
  0%,100%{ transform: scaleY(0.6); opacity: 0.7; }
  50%{ transform: scaleY(1); opacity: 1; }
}
.intro-label{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

#cover{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#cover.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
#cover::before,
#page-episode::before,
.teaser-page::before{
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--collage-bg);
  background-size: cover;
  background-position: center;
  filter: blur(36px) brightness(0.4) saturate(1.2);
  z-index: 0;
  pointer-events: none;
}
#page-episode, .teaser-page{ position: relative; overflow: hidden; }
.profile-wrap{ position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; align-items: center; }
.profile-eyebrow{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  color: var(--text);
  margin-bottom: 2.6rem;
}
.profile-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 5vw, 2rem);
}
.profile-slot{
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.35;
}
.profile-slot-icon{
  width: clamp(72px, 20vw, 96px);
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--text-faint);
}
.profile-avatar-btn{
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0;
}
.profile-avatar{
  width: clamp(120px, 34vw, 168px);
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid transparent;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.profile-avatar img,
.profile-avatar .placeholder{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-btn:hover .profile-avatar,
.profile-avatar-btn:focus-visible .profile-avatar{
  border-color: var(--text);
  transform: scale(1.05);
}
.profile-name{
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-dim);
}
.profile-avatar-btn:hover .profile-name,
.profile-avatar-btn:focus-visible .profile-name{ color: var(--text); }
.profile-enter-hint{
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg-card);
  padding: 0.7em 1.8em;
  border-radius: 999px;
  transition: background 0.25s ease;
}
.profile-avatar-btn:hover .profile-enter-hint,
.profile-avatar-btn:focus-visible .profile-enter-hint{ background: var(--red); }

@media (max-width: 480px){
  .profile-slot-icon{ width: 60px; }
}

.hero-page{ padding: 0; justify-content: flex-end; min-height: 100vh; }
.hero-backdrop{
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-backdrop img,
.hero-backdrop video,
.hero-backdrop .placeholder{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.backdrop-slideshow{
  position: absolute;
  inset: 0;
}
.backdrop-slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.backdrop-slide.active{ opacity: 1; }
.backdrop-slide img,
.backdrop-slide video,
.backdrop-slide .placeholder{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-fade{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,20,20,0.15) 0%, rgba(20,20,20,0.4) 55%, var(--bg) 96%),
    linear-gradient(90deg, rgba(20,20,20,0.85) 0%, rgba(20,20,20,0.15) 55%);
}
.hero-inner{
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) clamp(3rem, 10vh, 4.5rem);
  max-width: 640px;
  text-align: left;
  margin: 0;
}
.hero-title{
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 0.4rem;
}
.hero-meta{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.hero-tagline{
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  color: var(--text);
  max-width: 420px;
  margin-top: 0.7rem;
  white-space: pre-line;
}
.hero-actions{
  display: flex;
  gap: 0.8rem;
  margin-top: 1.4rem;
}
.scroll-cue{
  position: absolute;
  bottom: 1rem; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  z-index: 2;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(6px); } }

.pill-badge{
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text);
  background: var(--bg-card);
  padding: 0.4em 0.9em;
  border-radius: 4px;
}
.pill-badge-red{ background: var(--red); }
.pill-badge-outline{ background: transparent; border: 1px solid var(--text-faint); }

.btn-play, .btn-info{
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75em 1.5em;
  border-radius: 6px;
  border: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.btn-play{ background: var(--text); color: #111; }
.btn-info{ background: rgba(255,255,255,0.18); color: var(--text); backdrop-filter: blur(6px); }
.btn-play:hover, .btn-info:hover{ opacity: 0.85; }
.btn-play:active, .btn-info:active{ transform: scale(0.96); }
.play-icon{ font-size: 0.85em; }

.row-page{
  min-height: auto;
  padding-top: clamp(2rem, 5vh, 2.6rem);
  padding-bottom: clamp(2rem, 5vh, 2.6rem);
  padding-left: 0;
  padding-right: 0;
  align-items: stretch;
  justify-content: flex-start;
}
.row-head{ padding: 0 var(--gutter); margin-bottom: 1.2rem; }
.row-title{
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  letter-spacing: 0.01em;
}
.row-scroll{
  display: flex;
  gap: clamp(0.6rem, 3vw, 1rem);
  overflow-x: auto;
  padding: 0.5rem var(--gutter) 1rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.row-scroll::-webkit-scrollbar{ height: 6px; }
.row-scroll::-webkit-scrollbar-thumb{ background: var(--bg-card); border-radius: 3px; }

.trend-card{
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  width: clamp(150px, 40vw, 200px);
}
.trend-visual{
  position: relative;
  height: clamp(180px, 46vw, 240px);
}
.trend-rank{
  position: absolute;
  left: 0;
  bottom: -0.15em;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 20vw, 6.5rem);
  line-height: 0.75;
  color: var(--text-faint);
  z-index: 1;
  transition: color 0.3s ease, -webkit-text-stroke-color 0.3s ease;
}
@supports (-webkit-text-stroke: 1px black){
  .trend-rank{
    -webkit-text-stroke: 2px var(--text-faint);
    color: transparent;
  }
}
.trend-card:hover .trend-rank{ color: var(--red); -webkit-text-stroke-color: var(--red); }
.trend-poster{
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 68%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.5);
  transition: transform 0.25s ease;
}
.trend-card:hover .trend-poster{ transform: scale(1.05); }
.trend-poster img,
.trend-poster video,
.trend-poster .placeholder{
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.trend-caption{
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  white-space: pre-line;
}

#page-episode{
  min-height: auto;
  padding-top: clamp(2.5rem, 6vh, 3.5rem);
  padding-bottom: clamp(2.5rem, 6vh, 3.5rem);
}
.episode-card{
  background: var(--bg-elevated);
  border-radius: 14px;
  padding: clamp(1.8rem, 6vw, 2.6rem);
  border-left: 4px solid var(--red);
}
.episode-title{
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  margin: 0.6rem 0 1.1rem;
}
.episode-body{
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.98rem, 3vw, 1.08rem);
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-line;
}
.episode-sign{
  margin-top: 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-faint);
}
.episode-sign strong{ color: var(--text); }

.poster-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.5rem, 2vw, 0.8rem);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--gutter);
}
.poster-card{
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
  position: relative;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  transition: transform 0.25s ease;
}
.poster-card:hover{ transform: scale(1.06); z-index: 3; }
.poster-card img,
.poster-card video,
.poster-card .placeholder{
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.poster-card figcaption{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.4rem;
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--text);
  text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
  white-space: pre-line;
}

.teaser-page{
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, #241414 0%, var(--bg) 65%);
}
.teaser-title{
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  margin-top: 0.7rem;
}
.teaser-subtitle{
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  white-space: pre-line;
}
.teaser-play{
  margin: 2.2rem auto 0;
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 3px solid var(--red);
  background: rgba(228,0,43,0.1);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  animation: ring-pulse 2.4s ease-in-out infinite;
}
.teaser-play:hover{ background: rgba(228,0,43,0.22); transform: scale(1.05); }
.teaser-play:active{ transform: scale(0.95); }
.play-icon-lg{ font-size: 1.8rem; margin-left: 4px; }
@keyframes ring-pulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(228,0,43,0.3); }
  50%{ box-shadow: 0 0 0 14px rgba(228,0,43,0); }
}
.teaser-btn-label{
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.wish-message{
  margin-top: 2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  color: var(--text);
  max-width: 420px;
  margin-inline: auto;
  opacity: 0;
  transition: opacity 0.8s ease;
  white-space: pre-line;
}
.wish-message.show{ opacity: 1; margin-top: 1.4rem; }

.confetti-piece{
  position: fixed; top: -10px;
  width: 8px; height: 8px;
  z-index: 300;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall{ to{ transform: translateY(110vh) rotate(360deg); opacity: 0.8; } }

.credits-page{
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.credits-page::before{
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--collage-bg);
  background-size: cover;
  background-position: center;
  filter: blur(36px) brightness(0.32) saturate(1.2);
  z-index: 0;
  pointer-events: none;
}
.recap-strip{
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.recap-thumb{
  display: block;
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}
.recap-thumb img,
.recap-thumb video,
.recap-thumb .placeholder{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  font-size: 0.4rem;
  padding: 0.2rem;
}
.credits-title{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  color: var(--text-dim);
  margin-top: 0.7rem;
}
.credits-name{
  font-family: var(--font-display);
  font-size: clamp(3rem, 13vw, 4.6rem);
  margin: 0.2rem 0;
}
.credits-message{
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 400px;
  margin: 0.8rem auto 0;
  white-space: pre-line;
}
.credits-note{
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-faint);
  white-space: pre-line;
}
.restart-btn{
  margin-top: 2.2rem;
  border: 1px solid var(--text-faint);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.8em 2em;
  border-radius: 6px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.restart-btn:hover{ background: var(--bg-card); border-color: var(--text); }

#music-control{
  position: fixed;
  right: clamp(0.9rem, 3vw, 1.6rem);
  bottom: clamp(0.9rem, 3vw, 1.6rem);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#music-control.active{ opacity: 1; visibility: visible; }
#music-toggle{
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.music-status{
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.music-bars{ display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.music-bars span{ width: 2px; background: var(--text); animation: eq 0.9s ease-in-out infinite; }
.music-bars span:nth-child(1){ height: 40%; }
.music-bars span:nth-child(2){ height: 100%; animation-delay: 0.15s; }
.music-bars span:nth-child(3){ height: 65%; animation-delay: 0.3s; }
#music-control.paused .music-bars span{ animation-play-state: paused; height: 30%; }
@keyframes eq{ 0%,100%{ height: 30%; } 50%{ height: 100%; } }

.reveal{ opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible{ opacity: 1; transform: translateY(0); }

.placeholder{
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: repeating-linear-gradient(45deg, #1a1a1a, #1a1a1a 10px, #222 10px, #222 20px);
  padding: 0.4rem;
}

.profile-eyebrow, .profile-name, .hero-meta, .row-title, .episode-sign,
.credits-title, .hero-title, .episode-title, .teaser-title, .pill-badge,
.profile-enter-hint, .restart-btn, .credits-name{ white-space: pre-line; }

@media (max-width: 480px){
  .poster-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .hero-actions{ flex-wrap: wrap; }
  .trend-rank{ font-size: clamp(3.6rem, 18vw, 5rem); }
}

@media (min-width: 700px){
  .poster-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1000px){
  .poster-grid{ grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
