/* ============================================
   PREMIUM UI — Luxury romantic polish
   ============================================ */

/* Richer background */
.bg-gradient {
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(255, 51, 102, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 90% 90%, rgba(255, 107, 157, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 5% 60%, rgba(201, 24, 74, 0.12) 0%, transparent 45%),
    linear-gradient(165deg, #0f0610 0%, #1a0a14 35%, #251020 65%, #0f0610 100%) !important;
}

/* Premium glass card */
.premium-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.03) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 107, 157, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.glass-card {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Entrance */
.entrance-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.entrance-card {
  padding: 2.25rem 1.75rem 2rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.photo-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 1.5rem;
}

.photo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--pink-neon),
    var(--red-glow),
    #ffd6e0,
    var(--pink-neon)
  );
  animation: ringSpin 4s linear infinite;
  opacity: 0.85;
}

.photo-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #1a0a12;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.entrance-photo-wrap {
  position: relative;
  z-index: 1;
  width: 140px !important;
  height: 140px !important;
  margin: 4px auto 0 !important;
  border: none !important;
  box-shadow: 0 8px 32px rgba(255, 107, 157, 0.35) !important;
}

/* Buttons */
.btn-lg {
  padding: 1.05rem 2.25rem;
  font-size: 1rem;
  font-weight: 600;
  gap: 0.5rem;
  min-width: 220px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff5c8a 0%, #ff3366 50%, #e8195a 100%);
  box-shadow:
    0 4px 24px rgba(255, 51, 102, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.btn-icon {
  font-size: 1.1rem;
}

.btn-primary .btn-glow {
  animation: btnShimmer 2.5s ease-in-out infinite;
}

/* Progress bar */
.progress-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
  box-shadow: 0 0 16px rgba(255, 107, 157, 0.8);
}

.page-counter {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 180, 200, 0.7);
  border: 1px solid rgba(255, 107, 157, 0.15);
}

/* Typography polish */
.title-xl {
  text-shadow: 0 2px 24px rgba(255, 107, 157, 0.25);
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: #ffb3cc;
}

.subtitle {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
}

/* Nav pill bar */
.nav-pill {
  background: rgba(15, 6, 16, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0.4rem 0.75rem;
  gap: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 107, 157, 0.06);
  width: auto;
  min-width: 200px;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 200, 215, 0.6);
  letter-spacing: 0.06em;
  min-width: 64px;
  text-align: center;
}

.nav-pill .nav-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-pill .nav-btn:not(:disabled):active {
  background: rgba(255, 107, 157, 0.2);
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
}

/* Mini player premium */
.mini-player {
  left: 1rem;
  right: 1rem;
  transform: none;
  width: auto;
  max-width: none;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  background: rgba(15, 6, 16, 0.9);
  border: 1px solid rgba(255, 107, 157, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 51, 102, 0.15);
  gap: 0.65rem;
}

.mini-player.hidden {
  transform: translateY(120%);
  opacity: 0;
}

.mini-player-viz {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.mini-player.is-playing .mini-player-viz {
  opacity: 1;
}

.mini-player-viz span {
  width: 3px;
  height: 8px;
  background: var(--pink-neon);
  border-radius: 2px;
  animation: vizBar 0.8s ease-in-out infinite;
}

.mini-player-viz span:nth-child(1) { animation-delay: 0s; }
.mini-player-viz span:nth-child(2) { animation-delay: 0.15s; }
.mini-player-viz span:nth-child(3) { animation-delay: 0.3s; }
.mini-player-viz span:nth-child(4) { animation-delay: 0.45s; }

.mini-player:not(.is-playing) .mini-player-viz span {
  animation: none;
  height: 6px;
}

@keyframes vizBar {
  0%, 100% { height: 6px; }
  50% { height: 18px; }
}

.mini-player-btn {
  width: 40px;
  height: 40px;
}

.mini-player-btn--ghost {
  background: rgba(255, 255, 255, 0.08) !important;
}

.mini-player-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.mini-player-artist {
  font-size: 0.68rem;
  color: rgba(255, 180, 200, 0.65);
}

/* Screen cards on all pages */
.screen-inner .glass-card,
.screen-inner {
  animation: none;
}

.screen--active .premium-card,
.screen--active .screen-inner > .glass-card {
  animation: cardEnter 0.8s var(--ease-out-expo) forwards;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Photo pages */
.photo-hero-overlay {
  backdrop-filter: blur(2px);
}

.photo-hero-overlay .title-lg {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* Carousel premium */
.carousel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* Reason cards */
.reason-item {
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border-color: rgba(255, 107, 157, 0.15);
}

/* Toast */
.toast {
  border-color: rgba(255, 107, 157, 0.35);
  font-weight: 500;
  white-space: normal;
  max-width: 90%;
  text-align: center;
  border-radius: 16px;
}

/* Hint */
.hint {
  font-size: 0.78rem;
  color: rgba(255, 180, 200, 0.55);
  letter-spacing: 0.04em;
}

/* Birthday cake glow */
.cake-emoji {
  filter: drop-shadow(0 0 24px rgba(255, 200, 100, 0.5));
}

/* Forever screen */
.forever-title {
  filter: drop-shadow(0 0 50px rgba(255, 51, 102, 0.6));
}

/* Mobile — phone optimized */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .screen {
    padding: calc(1.25rem + var(--safe-top)) 1rem calc(9rem + var(--safe-bottom));
  }

  .screen--scrollable {
    padding-bottom: calc(10rem + var(--safe-bottom));
  }

  .screen--photo {
    padding-bottom: calc(7rem + var(--safe-bottom));
  }

  .entrance-card {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: 22px;
    max-width: 100%;
  }

  .photo-ring-wrap {
    width: 120px;
    height: 120px;
    margin-bottom: 1.25rem;
  }

  .entrance-photo-wrap {
    width: 112px !important;
    height: 112px !important;
  }

  .title-xl {
    font-size: clamp(1.75rem, 8.5vw, 2.4rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .title-lg {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
    margin-bottom: 1rem;
  }

  .subtitle {
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 1rem;
  }

  .eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    margin-bottom: 0.75rem;
  }

  .btn-lg {
    min-width: 100%;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    min-height: 52px;
  }

  .glass-card {
    padding: 1.5rem 1.2rem;
    border-radius: 18px;
  }

  .letter-body {
    font-size: 1rem !important;
    line-height: 1.75 !important;
  }

  .letter-card {
    max-height: 62dvh;
  }

  /* Nav — full width pill */
  .nav-pill {
    left: 1rem;
    right: 1rem;
    transform: none;
    width: auto;
    min-width: unset;
    justify-content: space-between;
    padding: 0.35rem 0.5rem;
    bottom: calc(0.85rem + var(--safe-bottom));
  }

  .nav-pill .nav-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .nav-label {
    font-size: 0.68rem;
    flex: 1;
  }

  /* Mini player — above nav, full width */
  .mini-player {
    bottom: calc(5rem + var(--safe-bottom));
    left: 0.75rem;
    right: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
  }

  .mini-player-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .mini-player-viz {
    display: none;
  }

  .mini-player-title {
    font-size: 0.8rem;
  }

  .mini-player-artist {
    font-size: 0.65rem;
  }

  /* Progress + counter */
  .page-counter {
    top: calc(0.6rem + var(--safe-top));
    right: 0.75rem;
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .progress-bar-wrap {
    height: 3px;
  }

  /* Photo pages */
  .photo-hero-overlay {
    padding: 1.5rem 1.25rem calc(5.5rem + var(--safe-bottom));
  }

  .photo-hero-overlay .title-lg {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }

  .photo-hero-overlay .subtitle {
    font-size: 0.85rem;
  }

  .carousel-slide {
    height: 52dvh;
  }

  /* Playlist page */
  .music-player {
    padding: 1.15rem;
  }

  .player-btn--main {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.2rem !important;
  }

  .playlist-item {
    padding: 1rem 0.875rem;
    min-height: 56px;
  }

  .reason-item {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  .open-when-header {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  .hint {
    bottom: calc(7.5rem + var(--safe-bottom));
    font-size: 0.72rem;
  }

  .scroll-hint {
    bottom: calc(6.5rem + var(--safe-bottom));
  }

  .toast {
    bottom: calc(7rem + var(--safe-bottom));
    font-size: 0.8rem;
    padding: 0.75rem 1.25rem;
  }

  .final-actions .btn {
    min-height: 50px;
  }

  .forever-title {
    font-size: clamp(1.85rem, 10vw, 2.8rem);
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .title-xl {
    font-size: 1.65rem;
  }

  .photo-ring-wrap {
    width: 108px;
    height: 108px;
  }

  .entrance-photo-wrap {
    width: 100px !important;
    height: 100px !important;
  }
}

/* Notch / tall phones */
@media (min-height: 780px) and (max-width: 480px) {
  .screen {
    padding-bottom: calc(9.5rem + var(--safe-bottom));
  }

  .carousel-slide {
    height: 55dvh;
  }
}

@media (min-width: 768px) {
  .mini-player {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 420px;
    width: 100%;
  }

  .mini-player.hidden {
    transform: translateX(-50%) translateY(120%);
  }
}

/* ── YouTube player mount (body level) ── */
.yt-player-mount {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
  bottom: calc(6rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
}

.yt-player-mount.in-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: auto;
  overflow: hidden;
  transform: none;
  left: 0;
  bottom: auto;
}

.yt-player-mount.floating.is-playing {
  width: 2px;
  height: 2px;
  opacity: 0.01;
}

.yt-video-container {
  position: relative;
}

.yt-video-container #yt-player-mount.in-slot #yt-player,
.yt-video-container #yt-player-mount.in-slot iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Featured YouTube Song (Screen 12) ── */
.screen--music {
  padding-top: calc(0.75rem + var(--safe-top));
  padding-bottom: calc(7.5rem + var(--safe-bottom));
}

.screen-inner--music {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 1rem;
}

.music-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.music-page-title {
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  margin-bottom: 0;
}

.featured-song-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.yt-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.yt-video-container #yt-player,
.yt-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.yt-song-info {
  text-align: center;
  padding: 0 0.25rem;
}

.yt-song-artist {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0 0 0.2rem;
}

.yt-song-note {
  font-size: 0.75rem;
  opacity: 0.55;
  margin: 0 0 0.6rem;
  font-style: italic;
}

.yt-song-info .btn-sm {
  padding: 0.45rem 1.25rem;
  font-size: 0.8rem;
}

.yt-lyrics {
  padding: 1rem 0.875rem 1.25rem;
  flex: 1;
}

.yt-lyrics-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.5;
  margin: 0 0 0.875rem;
  text-align: center;
}

.yt-lyrics-body {
  text-align: center;
}

.yt-lyric-line {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
  opacity: 0.85;
}

.yt-lyric-line.spacer {
  height: 0.5rem;
}

.yt-lyric-line.highlight {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 1;
  color: var(--accent-rose, #ff8fab);
  text-shadow: 0 0 18px rgba(255, 143, 171, 0.2);
}

.music-subtitle {
  font-size: 0.75rem;
  opacity: 0.55;
  text-align: center;
  margin: 0.25rem 0 0;
}

.yt-playlist-section {
  margin-top: 0.5rem;
}

.yt-playlist-heading {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 1.1rem;
  text-align: center;
  margin: 0 0 0.2rem;
  color: var(--text-primary, #fff5f8);
}

.yt-playlist-sub {
  font-size: 0.72rem;
  text-align: center;
  opacity: 0.5;
  margin: 0 0 0.875rem;
  font-style: italic;
}

.yt-playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.yt-song-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.75rem 0.65rem;
  text-align: left;
  border: 1px solid rgba(255, 143, 171, 0.15);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.yt-song-card:active {
  transform: scale(0.97);
}

.yt-song-card.active {
  border-color: rgba(255, 107, 157, 0.65);
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.2);
  background: rgba(255, 107, 157, 0.08);
}

.yt-song-card-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.yt-song-card-title {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #fff5f8);
  line-height: 1.2;
}

.yt-song-card-artist {
  font-size: 0.65rem;
  opacity: 0.6;
  line-height: 1.2;
}

.yt-song-card-tag {
  font-size: 0.6rem;
  opacity: 0.45;
  font-style: italic;
  margin-top: 0.1rem;
}

/* Birthday blessings */
.birthday-blessings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
  min-height: 2rem;
}

.blessing-pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  font-size: 0.68rem;
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 143, 171, 0.25);
  color: rgba(255, 200, 220, 0.9);
  animation: blessingFloat 3s ease-in-out infinite;
}

@keyframes blessingFloat {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.birthday-tagline {
  font-size: 0.82rem;
  opacity: 0.65;
  font-style: italic;
  margin-top: 1rem;
  text-align: center;
}

.final-quote {
  font-family: var(--font-display, 'Cormorant Garamond', serif);
  font-size: 1.05rem;
  font-style: italic;
  opacity: 0.85;
  margin: 0.75rem 0 1.25rem;
  color: var(--accent-rose, #ff8fab);
}

@media (max-width: 480px) {
  .yt-playlist-grid {
    gap: 0.5rem;
  }

  .yt-song-card {
    padding: 0.65rem 0.55rem;
  }

  .yt-song-card-title {
    font-size: 0.82rem;
  }

  .screen--music {
    padding-top: calc(0.5rem + var(--safe-top));
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .music-header {
    margin-bottom: 0.5rem;
  }

  .music-header .eyebrow {
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
  }

  .music-page-title {
    font-size: 1.2rem;
  }

  .yt-video-container {
    padding-bottom: 0;
    height: clamp(180px, 34dvh, 220px);
  }

  .yt-song-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0;
  }

  .yt-song-artist {
    width: 100%;
    margin: 0;
    font-size: 0.8rem;
  }

  .yt-song-note {
    margin: 0;
    font-size: 0.72rem;
    flex: 1;
    text-align: right;
  }

  .yt-song-info .btn-sm {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
  }

  .yt-lyrics {
    padding: 0.875rem 0.75rem 1rem;
    min-height: 28dvh;
  }

  .yt-lyric-line {
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .yt-lyric-line.highlight {
    font-size: 1rem;
  }
}

@media (min-width: 481px) {
  .yt-lyrics {
    max-height: 45dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
