/* ============================================================
   The birthday episode: cake, candles, and the memory lane
   ============================================================ */

.birthday-page {
  background: var(--plum-950);
}

.bday {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--plum-900);
  background-image:
    radial-gradient(ellipse at 50% 15%, rgba(242, 193, 78, 0.2), transparent 48%),
    radial-gradient(ellipse at 50% 115%, rgba(0, 0, 0, 0.55), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 82px, rgba(255, 255, 255, 0.025) 82px 84px),
    repeating-linear-gradient(90deg, transparent 0 108px, rgba(255, 255, 255, 0.02) 108px 110px),
    linear-gradient(165deg, #402757, #1e122b 74%);
}

.bday-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 40px);
  padding-top: calc(18px + env(safe-area-inset-top));
}

.bday-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bday-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 237, 219, 0.55);
}
.bday-back:hover {
  color: var(--gold-2);
}

.bday-wordmark {
  font-size: 0.85rem;
  opacity: 0.65;
}
.bday-wordmark i {
  width: 4px;
  height: 4px;
}

.bday-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bunting {
  position: absolute;
  top: 0;
  left: -2%;
  z-index: 1;
  width: 104%;
  height: auto;
  pointer-events: none;
}
.bunting .flag {
  transform-box: fill-box;
  transform-origin: top center;
  animation: flagSway 5s ease-in-out infinite alternate;
}
.bunting .flag:nth-child(2n) {
  animation-delay: 0.7s;
}
.bunting .flag:nth-child(3n) {
  animation-delay: 1.4s;
}
@keyframes flagSway {
  from { transform: rotate(-2deg); }
  to { transform: rotate(2deg); }
}

.bday-main {
  position: relative;
  z-index: 2;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ============================== GATE ============================== */

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(18px, 4vw, 40px) 0 clamp(50px, 8vw, 90px);
  text-align: center;
}

.gate__eyebrow {
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.gate h1 {
  margin-top: 12px;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  color: var(--cream);
}
.gate h1 .script {
  display: block;
  margin-top: 4px;
  font-size: 1.12em;
  line-height: 0.8;
  color: var(--gold-2);
  transform: rotate(-1.4deg);
}

.gate__sub {
  max-width: 520px;
  margin-top: 16px;
  color: rgba(247, 237, 219, 0.65);
  font-size: 0.94rem;
  line-height: 1.6;
}

.cake-scene {
  position: relative;
  width: min(480px, 94vw);
  margin-top: clamp(20px, 4vw, 38px);
  padding-top: 10px;
}

.cake {
  position: relative;
  width: min(360px, 80%);
  height: 270px;
  margin: 0 auto;
}

.cake__stand {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 76%;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(#f7eddb, #c9ad85);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}
.cake__stand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 36%;
  height: 32px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(#e4d4ba, #b79870);
  transform: translateX(-50%);
  clip-path: polygon(6% 0, 94% 0, 72% 100%, 28% 100%);
}

.cake__layer {
  position: absolute;
  left: 50%;
  border-radius: 14px 14px 8px 8px;
  transform: translateX(-50%);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.2), inset 0 -12px 18px rgba(0, 0, 0, 0.14);
}
.cake__layer--bottom {
  bottom: 36px;
  width: 88%;
  height: 84px;
  background:
    radial-gradient(circle at 18% 28%, #f4d7b2 0 3px, transparent 4px),
    radial-gradient(circle at 72% 62%, #f4d7b2 0 3px, transparent 4px),
    radial-gradient(circle at 48% 80%, #f4d7b2 0 2px, transparent 3px),
    linear-gradient(#b86743, #9f5132);
}
.cake__layer--middle {
  bottom: 112px;
  width: 72%;
  height: 62px;
  background:
    radial-gradient(circle at 30% 40%, #fbe8c4 0 3px, transparent 4px),
    radial-gradient(circle at 70% 30%, #fbe8c4 0 2px, transparent 3px),
    linear-gradient(#d28c5a, #b96d42);
}
.cake__layer--top {
  bottom: 166px;
  width: 56%;
  height: 44px;
  background: linear-gradient(#e2a66f, #c98650);
}
.cake__frosting {
  position: absolute;
  left: 50%;
  z-index: 2;
  width: 90%;
  height: 30px;
  border-radius: 50%;
  background: #f7e8ce;
  transform: translateX(-50%);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}
.cake__frosting--bottom {
  bottom: 110px;
}
.cake__frosting--middle {
  bottom: 166px;
  width: 74%;
}
.cake__frosting--top {
  bottom: 204px;
  width: 58%;
  height: 26px;
}
.cake__drip {
  position: absolute;
  z-index: 3;
  width: 13px;
  border-radius: 0 0 8px 8px;
  background: #f7e8ce;
}
.cake__drip--1 { left: 25%; bottom: 88px; height: 26px; }
.cake__drip--2 { left: 42%; bottom: 84px; height: 34px; }
.cake__drip--3 { left: 61%; bottom: 90px; height: 22px; }
.cake__drip--4 { left: 76%; bottom: 86px; height: 30px; }
.cake__drip--5 { left: 49%; bottom: 148px; height: 22px; }
.cake__drip--6 { left: 66%; bottom: 150px; height: 17px; }

.cake__sprinkles {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.cake__sprinkles i {
  position: absolute;
  width: 7px;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
  transform: rotate(var(--r, 20deg));
}
.cake__sprinkles i:nth-child(1) { left: 20%; bottom: 76px; background: var(--red); }
.cake__sprinkles i:nth-child(2) { left: 33%; bottom: 56px; background: var(--blue); --r: -30deg; }
.cake__sprinkles i:nth-child(3) { left: 58%; bottom: 66px; background: var(--gold); --r: 60deg; }
.cake__sprinkles i:nth-child(4) { left: 74%; bottom: 50px; background: var(--teal); --r: -15deg; }
.cake__sprinkles i:nth-child(5) { left: 42%; bottom: 96px; background: var(--cream); --r: 10deg; }
.cake__sprinkles i:nth-child(6) { left: 66%; bottom: 92px; background: var(--red); --r: 40deg; }
.cake__sprinkles i:nth-child(7) { left: 28%; bottom: 126px; background: var(--gold); --r: -45deg; }
.cake__sprinkles i:nth-child(8) { left: 55%; bottom: 132px; background: var(--blue); }

.candles {
  position: absolute;
  left: 50%;
  bottom: 224px;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  width: 62%;
  transform: translateX(-50%);
}
.candle {
  position: relative;
  width: 10px;
  height: 62px;
  padding: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(-45deg, #f7eddb 0 5px, #c94b4b 5px 10px);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.12), 0 2px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.candle:nth-child(2n) {
  background: repeating-linear-gradient(45deg, #f7eddb 0 5px, #4e7aa8 5px 10px);
  height: 72px;
}
.candle:nth-child(3n) {
  background: repeating-linear-gradient(-45deg, #f7eddb 0 5px, #3d7d75 5px 10px);
  height: 56px;
}
.candle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 2px;
  height: 9px;
  background: #3b2a20;
  transform: translateX(-50%);
}
.candle__flame {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 18px;
  height: 28px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background:
    radial-gradient(circle at 50% 72%, #fff8d6 0 18%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, #ffd76a 0 42%, #f29b32 62%, rgba(201, 75, 75, 0.7) 100%);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: flameDance 0.75s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255, 203, 90, 0.8));
  transition: opacity 0.18s, transform 0.3s;
}
.candle:nth-child(2n) .candle__flame {
  animation-delay: 0.18s;
}
.candle:nth-child(3n) .candle__flame {
  animation-delay: 0.34s;
}
.candle__flame::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  width: 6px;
  height: 11px;
  border-radius: 50%;
  background: #fffdf2;
  transform: translateX(-50%);
  opacity: 0.9;
}
@keyframes flameDance {
  0% { transform: translateX(-50%) rotate(-4deg) scaleY(0.94) scaleX(1.02); }
  50% { transform: translateX(-52%) rotate(3deg) scaleY(1.06) scaleX(0.94); }
  100% { transform: translateX(-48%) rotate(-1deg) scaleY(1) scaleX(1); }
}
.candle__smoke {
  position: absolute;
  left: 50%;
  top: -26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(240, 235, 225, 0.5);
  opacity: 0;
  transform: translateX(-50%);
  filter: blur(3px);
}
.candle.is-out {
  cursor: default;
}
.candle.is-out .candle__flame {
  opacity: 0;
  transform: translateX(-50%) scale(0.2);
  animation: none;
}
.candle.is-out .candle__smoke {
  animation: smokeUp 1.4s ease-out forwards;
}
@keyframes smokeUp {
  0% { opacity: 0.65; transform: translate(-50%, 0) scale(0.5); }
  100% { opacity: 0; transform: translate(-30%, -54px) scale(2.1); }
}
.candle:focus-visible {
  outline-offset: 6px;
}

.cake__plaque {
  position: absolute;
  left: 50%;
  bottom: 54px;
  z-index: 6;
  padding: 5px 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  background: #f7e8ce;
  color: #8d4a2d;
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-1.5deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.gate-controls {
  position: relative;
  z-index: 10;
  width: min(480px, 100%);
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid rgba(242, 193, 78, 0.24);
  border-radius: 18px;
  background: rgba(19, 10, 29, 0.6);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.gate-controls__row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.gate-status {
  min-height: 1.5em;
  margin-top: 10px;
  font-family: var(--font-hand);
  font-size: 1.18rem;
  line-height: 1.2;
  color: rgba(247, 237, 219, 0.66);
}
.gate-status.is-listening {
  color: var(--gold-2);
}
.gate-status.is-done {
  color: #bce3b0;
}
.blow-meter {
  width: min(300px, 84%);
  height: 12px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(247, 237, 219, 0.1);
  overflow: hidden;
}
.blow-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--brick));
  transition: width 0.08s linear;
}
.gate-fallback {
  margin-top: 8px;
  color: rgba(247, 237, 219, 0.5);
  font-size: 0.72rem;
}
.gate-fallback button {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wish {
  position: relative;
  z-index: 12;
  width: min(560px, 100%);
  margin: 26px auto 0;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 18px;
  background: rgba(19, 10, 29, 0.82);
  border: 1px solid rgba(242, 193, 78, 0.3);
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.6s var(--ease-spring) both;
  text-align: center;
}
.wish__script {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--gold-2);
}
.wish p {
  max-width: 400px;
  margin: 10px auto 0;
  color: rgba(247, 237, 219, 0.62);
  font-size: 0.86rem;
}
.wish .btn {
  margin-top: 18px;
}
.birthday-connections:has(.connections-game) .challenge-card {
  position: static;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.birthday-connections:has(.connections-game) .challenge-card::after,
.birthday-connections:has(.connections-game) .challenge-card__prompt {
  display: none;
}

/* early / locked gate */

.early {
  position: relative;
  z-index: 5;
  width: min(520px, 100%);
  margin: 40px auto;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 20px;
  background: rgba(19, 10, 29, 0.65);
  border: 1px solid rgba(242, 193, 78, 0.22);
  text-align: center;
  backdrop-filter: blur(10px);
}
.early h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--cream);
}
.early p {
  margin-top: 12px;
  color: rgba(247, 237, 219, 0.6);
}
.early .countdown {
  margin-top: 24px;
  transform: scale(0.85);
}
.early .btn {
  margin-top: 22px;
}

/* ============================== LANE ============================== */

.lane {
  position: relative;
  z-index: 5;
  padding: clamp(40px, 7vw, 80px) 0 60px;
  animation: viewIn 0.7s var(--ease-out) both;
}

.lane-head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(247, 237, 219, 0.14);
}

.lane-head__left h1 {
  margin-top: 9px;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  color: var(--cream);
}
.lane-head__left h1 .script {
  color: var(--gold-2);
}
.lane-head__left p {
  max-width: 520px;
  margin-top: 10px;
  color: rgba(247, 237, 219, 0.58);
  font-size: 0.88rem;
}

.lane-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 94px;
  height: 94px;
  padding: 14px 8px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.25;
  text-align: center;
  transform: rotate(7deg);
  opacity: 0.8;
  box-shadow: inset 0 0 0 4px rgba(242, 193, 78, 0.1);
}
.lane-badge b {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  letter-spacing: 0;
  line-height: 0.9;
  text-transform: none;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 30px);
  margin-top: clamp(26px, 4vw, 40px);
}

.episode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px 10px 16px;
  border: 0;
  border-radius: 4px;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--paper);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.62' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)' opacity='.05'/%3E%3C/svg%3E");
  color: var(--ink);
  text-align: left;
  box-shadow: 0 16px 32px rgba(8, 4, 14, 0.3);
  transform: rotate(var(--tilt, -0.7deg));
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  cursor: pointer;
}
.episode-card:nth-child(2n) { --tilt: 0.8deg; }
.episode-card:nth-child(3n) { --tilt: -0.3deg; }
.episode-card:hover {
  transform: rotate(0) translateY(-5px);
  box-shadow: 0 24px 44px rgba(8, 4, 14, 0.4);
  z-index: 2;
}
.episode-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 17px;
  background: rgba(242, 193, 78, 0.65);
  transform: translateX(-50%) rotate(-2deg);
  mix-blend-mode: multiply;
}
.episode-card__still {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--plum-600), var(--plum-900));
}
.episode-card__still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.episode-card:hover .episode-card__still img {
  transform: scale(1.04);
}
.episode-card__still::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 11, 30, 0.4), transparent 46%);
}
.episode-card__num {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(20, 11, 30, 0.72);
  color: var(--gold-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}
.episode-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(247, 237, 219, 0.8);
  border-radius: 50%;
  background: rgba(20, 11, 30, 0.32);
  color: var(--cream);
  font-size: 1rem;
  transform: translate(-50%, -50%);
  transition: background 0.25s, transform 0.3s;
  backdrop-filter: blur(4px);
}
.episode-card:hover .episode-card__play {
  background: var(--gold);
  color: var(--plum-900);
  border-color: var(--gold);
  transform: translate(-50%, -50%) scale(1.08);
}
.episode-card__meta {
  display: block;
  padding: 13px 8px 0;
}
.episode-card__meta h2 {
  font-family: var(--font-hand);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.04;
  color: var(--plum-800);
}
.episode-card__meta p {
  margin-top: 5px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
}
.episode-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(59, 42, 32, 0.1);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(59, 42, 32, 0.5);
}
.episode-card__foot b {
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brick);
}

.lane-foot {
  position: relative;
  margin-top: clamp(36px, 6vw, 64px);
  padding: clamp(26px, 4vw, 46px);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(242, 193, 78, 0.12), transparent 46%),
    rgba(19, 10, 29, 0.66);
  border: 1px solid rgba(242, 193, 78, 0.2);
  text-align: center;
}
.lane-foot h2 {
  font-family: var(--font-hand);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.95;
  color: var(--gold-2);
}
.lane-foot p {
  max-width: 500px;
  margin: 14px auto 0;
  color: rgba(247, 237, 219, 0.6);
  font-size: 0.88rem;
  line-height: 1.65;
}
.lane-foot .signature {
  margin-top: 18px;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--cream);
}
.lane-foot__wink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 10px 16px;
  border: 1px dashed rgba(247, 237, 219, 0.2);
  border-radius: 10px;
  color: rgba(247, 237, 219, 0.46);
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: left;
}
.lane-foot__wink b {
  color: var(--gold-2);
  font-weight: 700;
}
.lane-foot__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.credits {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(247, 237, 219, 0.1);
  color: rgba(247, 237, 219, 0.3);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.8;
}

/* ============================== EPISODE MODAL ============================== */

.ep-modal {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: flex;
  flex-direction: column;
  background: rgba(10, 5, 17, 0.96);
  animation: fadeIn 0.3s ease both;
}
.ep-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 4vw, 40px);
  padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom: 1px solid rgba(247, 237, 219, 0.1);
}
.ep-modal__title {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-modal__title span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold-2);
}
.ep-modal__close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(247, 237, 219, 0.25);
  border-radius: 50%;
  color: var(--cream);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.ep-modal__close:hover {
  border-color: var(--gold);
  color: var(--gold-2);
}

.ep-modal__body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px clamp(14px, 4vw, 40px);
  min-height: 0;
}
.ep-slide {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(980px, 100%);
  max-height: 100%;
}
.ep-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: min(46vh, 440px);
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(247, 237, 219, 0.08) 0 10px, transparent 10px 24px) top left / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(247, 237, 219, 0.08) 0 10px, transparent 10px 24px) bottom left / 100% 12px no-repeat,
    #120a1c;
  border: 1px solid rgba(247, 237, 219, 0.12);
}
.ep-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.36));
  pointer-events: none;
  border-radius: 8px;
}
.ep-photo {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  max-height: calc(100dvh - 260px);
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: photoIn 0.4s var(--ease-out) both;
}
@keyframes photoIn {
  from { opacity: 0; transform: scale(0.975); }
}
.ep-photo.is-portrait {
  max-width: min(520px, 100%);
}
.ep-caption {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 12px 4px 0;
  font-family: var(--font-hand);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  line-height: 1.2;
  color: rgba(247, 237, 219, 0.78);
  text-align: center;
}
.ep-caption span {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(247, 237, 219, 0.36);
}

.ep-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(247, 237, 219, 0.22);
  border-radius: 50%;
  background: rgba(27, 17, 39, 0.66);
  color: var(--cream);
  font-size: 1.3rem;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
}
.ep-nav:hover {
  border-color: var(--gold);
  color: var(--gold-2);
}
.ep-nav--prev { left: clamp(4px, 1.5vw, 18px); }
.ep-nav--next { right: clamp(4px, 1.5vw, 18px); }
.ep-nav[disabled] {
  opacity: 0.2;
  pointer-events: none;
}

.ep-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 0 0;
  min-height: 24px;
}
.ep-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 237, 219, 0.22);
  transition: width 0.25s, background 0.25s;
}
.ep-dots button.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--gold);
}

.ep-modal__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px) calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(247, 237, 219, 0.1);
}
.ep-modal__hint {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: rgba(247, 237, 219, 0.32);
}
.ep-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(480px, 100%);
  padding: 30px;
  text-align: center;
}
.ep-end h3 {
  font-family: var(--font-hand);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  color: var(--gold-2);
}
.ep-end p {
  color: rgba(247, 237, 219, 0.55);
  font-size: 0.82rem;
}
.ep-end .btn {
  margin-top: 10px;
}

/* ============================== RESPONSIVE ============================== */

@media (max-width: 760px) {
  .bday-header {
    padding: 14px;
  }
  .bday-wordmark {
    display: none;
  }
  .gate h1 {
    margin-top: 9px;
  }
  .gate__sub {
    font-size: 0.86rem;
  }
  .cake-scene {
    width: 100%;
    margin-top: 14px;
  }
  .cake {
    width: min(320px, 88%);
    height: 240px;
  }
  .cake__layer--bottom { height: 74px; bottom: 32px; }
  .cake__layer--middle { height: 54px; bottom: 100px; }
  .cake__layer--top { height: 38px; bottom: 148px; }
  .cake__frosting--bottom { bottom: 98px; }
  .cake__frosting--middle { bottom: 148px; }
  .cake__frosting--top { bottom: 180px; height: 22px; }
  .candles { bottom: 196px; gap: 12px; width: 66%; }
  .candle { height: 52px; width: 9px; }
  .candle:nth-child(2n) { height: 60px; }
  .candle:nth-child(3n) { height: 46px; }
  .cake__plaque { bottom: 46px; font-size: 0.42rem; }
  .gate-controls {
    margin-top: 20px;
    padding: 15px;
  }
  .lane-head {
    grid-template-columns: 1fr;
  }
  .lane-badge {
    display: none;
  }
  .episode-grid {
    grid-template-columns: 1fr;
  }
  .ep-photo {
    max-height: calc(100vh - 240px);
    max-height: calc(100dvh - 240px);
  }
  .ep-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .ep-modal__bottom {
    justify-content: center;
  }
  .ep-modal__hint {
    display: none;
  }
  .ep-caption {
    padding-top: 8px;
  }
}

@media (max-width: 400px) {
  .candles { gap: 8px; }
  .candle { width: 8px; }
  .cake { height: 220px; }
  .cake__layer--bottom { bottom: 28px; }
  .cake__layer--middle { bottom: 90px; }
  .cake__layer--top { bottom: 132px; }
  .cake__frosting--bottom { bottom: 88px; }
  .cake__frosting--middle { bottom: 132px; }
  .cake__frosting--top { bottom: 162px; }
  .candles { bottom: 178px; }
  .cake__plaque { bottom: 42px; }
}
