:root {
  --spotify: #1db954;
  --spotify-hover: #1ed760;
  --bg-1: #0b0f1a;
  --bg-2: #1a1033;
  --bg-3: #3a1a4a;
  --text: #f5f1ea;
  --muted: #b9b3a7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at top, var(--bg-3) 0%, transparent 55%),
    radial-gradient(ellipse at bottom, var(--bg-2) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, #050811 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  position: relative;
}

/* Estrellas sutiles de fondo */
.stars {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 10% 70%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.6), transparent);
  background-size: 100% 100%;
  pointer-events: none;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to   { opacity: 0.9; }
}

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, transparent 0%, rgba(0,0,0,0.45) 90%);
  pointer-events: none;
}

.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 36px 28px 28px;
  background: rgba(20, 14, 35, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Monograma M + E */
.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  line-height: 1;
}

.monogram .m {
  font-family: "Allura", "Snell Roundhand", "Brush Script MT", cursive;
  font-size: 92px;
  color: #f3c6d8;
  background: linear-gradient(160deg, #ffd9e6 0%, #f3a8c4 50%, #d97aa3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 18px rgba(243, 168, 196, 0.25);
  transform: translateY(8px);
}

.monogram .amp {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 28px;
  color: var(--muted);
  font-weight: 500;
  opacity: 0.7;
  margin: 0 2px;
}

.monogram .e {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 56px;
  font-weight: 500;
  color: #f5f1ea;
  letter-spacing: 2px;
}

/* Aniversario */
.anniversary {
  margin: 4px 0 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  line-height: 1;
}

.anniversary .years {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 44px;
  font-weight: 500;
  color: #f3c6d8;
  letter-spacing: 2px;
}

.anniversary .years-label {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 13px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--muted);
}

.anniversary-sub {
  margin: 8px 0 0;
  font-family: "Allura", "Snell Roundhand", cursive;
  font-size: 26px;
  color: #f5f1ea;
  line-height: 1.1;
}

.divider {
  width: 60px;
  height: 1px;
  margin: 20px auto 18px;
  background: linear-gradient(90deg, transparent, rgba(243, 198, 216, 0.6), transparent);
}

/* Barras tipo Spotify "now playing" */
.now-playing {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
  margin-bottom: 12px;
}

.now-playing .bar {
  display: block;
  width: 4px;
  background: var(--spotify);
  border-radius: 2px;
  animation: bounce 1s ease-in-out infinite;
}

.now-playing .bar:nth-child(1) { animation-delay: -0.1s; }
.now-playing .bar:nth-child(2) { animation-delay: -0.3s; }
.now-playing .bar:nth-child(3) { animation-delay: -0.5s; }
.now-playing .bar:nth-child(4) { animation-delay: -0.2s; }
.now-playing .bar:nth-child(5) { animation-delay: -0.4s; }

@keyframes bounce {
  0%, 100% { height: 6px; }
  50%      { height: 28px; }
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--spotify);
  font-weight: 600;
}

.title {
  margin: 6px 0 4px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.artist {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
}

.message {
  margin: 0 auto 26px;
  max-width: 380px;
  font-style: italic;
  line-height: 1.6;
  color: #e8e2d6;
  font-size: 15px;
}

.player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  text-align: left;
}

.cover {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #3a1a4a 0%, #1a1033 100%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover.no-cover {
  background: linear-gradient(135deg, #d97aa3 0%, #3a1a4a 100%);
}

.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.95;
  transition: transform 0.15s ease, background 0.2s ease;
}

.play-btn:hover {
  background: var(--spotify);
  color: #000;
  transform: scale(1.06);
}

.play-btn .icon-pause { display: none; }
.player.playing .play-btn .icon-play { display: none; }
.player.playing .play-btn .icon-pause { display: block; }

.track-info {
  flex: 1 1 auto;
  min-width: 0;
}

.track-meta {
  margin-bottom: 8px;
}

.track-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--spotify);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Cuando suena, paramos la animación de las barras si está pausado */
.now-playing .bar { animation-play-state: paused; }

.play-btn:disabled {
  opacity: 0.4;
  cursor: wait;
}

/* Host del iframe de YouTube oculto fuera de pantalla pero presente en el layout */
.yt-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}
.yt-host iframe { width: 320px; height: 180px; }

.share-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.share-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(243, 198, 216, 0.5);
  transform: translateY(-1px);
}

.share-btn svg {
  color: #f3c6d8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

@media (max-width: 480px) {
  .title { font-size: 28px; }
  .card { padding: 28px 20px 22px; }
}
