* { box-sizing: border-box; }

:root{
  --card: rgba(255, 238, 246, 0.96);
  --accent: #ff3f87;
  --accentSoft: rgba(255, 63, 135, 0.55);
  --accentGlow: rgba(255, 111, 161, 0.32);
  --inkSoft: rgba(43,31,38,0.75);

  /* Safe column inside heart curve */
  --safeW: 0.88;
  --lift: -8%;

  /* Smooth SVG heart mask (white = visible) */
  --heartMask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3E%3Cpath%20fill='white'%20d='M50%2086%20C20%2065%205%2050%205%2032%20C5%2018%2016%208%2030%208%20C40%208%2047%2013%2050%2019%20C53%2013%2060%208%2070%208%20C84%208%2095%2018%2095%2032%20C95%2050%2080%2065%2050%2086%20Z'/%3E%3C/svg%3E");
}

body{
  margin: 0;
  font-family: "Nunito", sans-serif;
  background: url("background.jpg") center/cover no-repeat fixed;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 24px);
  overflow-x: hidden;
}

/* Floating hearts */
.hearts{
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.heartChar{
  position: absolute;
  bottom: -60px;
  font-size: clamp(18px, 4vw, 34px);
  animation: floatChar linear forwards;
}
@keyframes floatChar{
  0% { transform: translateY(0); opacity: 0.55; }
  100% { transform: translateY(-120vh); opacity: 0; }
}

.wrap{
  width: 100%;
  display: flex;
  justify-content: center;
}

/* HEART */
.card{
  position: relative;
  width: min(88vw, 720px);
  aspect-ratio: 1 / 1;
  padding: clamp(18px, 4vw, 44px);

  display: grid;
  place-items: center;

  background: var(--card);
  overflow: hidden;
  animation: floatHeart 5s ease-in-out infinite;

  /* Smooth mask edges on iOS */
  transform: translateZ(0);
}
@keyframes floatHeart{
  0%   { transform: translateY(0px) translateZ(0); }
  50%  { transform: translateY(-5px) translateZ(0); }
  100% { transform: translateY(0px) translateZ(0); }
}

/* Mathematically smooth heart (SVG mask) */
.heartCard{
  -webkit-mask-image: var(--heartMask);
  mask-image: var(--heartMask);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Glow */
.card::before{
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(circle,
      var(--accentSoft) 0%,
      var(--accentGlow) 42%,
      transparent 72%);
  z-index: -1;
  filter: blur(28px);
  opacity: 0.92;
}

/* CONTENT */
.stack{
  width: min(560px, calc(92% * var(--safeW)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;

  transform: translateY(var(--lift));
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.hidden{
  opacity: 0;
  transform: translateY(calc(var(--lift) + 4%));
  pointer-events: none;
}
.stack:not(.hidden){
  opacity: 1;
  transform: translateY(var(--lift));
}

.title{
  font-size: clamp(15px, 2.5vw, 22px);
  font-weight: 800;
  margin: 0;
}

.message{
  font-size: clamp(13px, 2vw, 16px);
  line-height: 1.5;
  font-weight: 700;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* GIF */
.mediaBlock{
  width: 100%;
  display: flex;
  justify-content: center;
}
.gif{
  width: clamp(110px, 35%, 200px);
  border-radius: 14px;
  border: none;
  box-shadow: none;
  opacity: 0;
  transform: translateY(6px);
}
.stack:not(.hidden) .gif{
  animation: fadeIn 0.6s ease forwards;
}
@keyframes fadeIn{
  to { opacity: 1; transform: translateY(0); }
}

/* PLAYER — narrower + glass blur */
.playerBlock{
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Narrower on desktop by default */
.compactPlayer{
  width: 76%;
  max-width: 320px;

  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;

  padding: 4px 6px;
  border-radius: 14px;

  /* Glass effect */
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(255, 63, 135, 0.18);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.10),
    0 1px 0 rgba(255,255,255,0.55) inset;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Smaller controls (NOT changing song title) */
.playBtn{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #ff6fa1, #ff3f87);
  display: grid;
  place-items: center;
}

.icon{ width: 0; height: 0; }
.icon.play{
  border-left: 6px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-left: 1px;
}
.icon.pause{
  width: 6px;
  height: 8px;
  background:
    linear-gradient(#fff,#fff) left/40% 100% no-repeat,
    linear-gradient(#fff,#fff) right/40% 100% no-repeat;
}

.track{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* Keep title text size (don’t shrink) */
.songTitle{
  font-weight: 800;
  font-size: 12px;
  color: #c2185b;
  text-align: center;
  word-break: break-word;
  line-height: 1.15;
}

.seek{
  width: 100%;
  height: 2px;
  accent-color: var(--accent);
}

.metaRow{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.time{
  font-size: 8px;
  font-weight: 800;
  color: var(--inkSoft);
  white-space: nowrap;
}

/* Volume (PC) */
.volWrap{
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.volBtn{
  border: 0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  color: var(--inkSoft);
}
.volume{
  width: 38px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.volWrap:hover .volume,
.volWrap:focus-within .volume{
  opacity: 1;
  pointer-events: auto;
}

/* COVER */
.cover{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  background: rgba(255,255,255,0.15);
}
.tapTitle{
  font-size: clamp(20px, 6vw, 48px);
  font-weight: 800;
  color: #c2185b;
  transform: translateY(-10%);
  text-align: center;
}

/* MOBILE / TOUCH */
@media (hover: none) and (pointer: coarse){

  /* Big heart based on height (wide in portrait) */
  .card{
    width: 108svh !important;
    height: 108svh !important;
    aspect-ratio: unset !important;
    padding: 10px !important;
  }

  :root{
    --safeW: 0.74;
    --lift: -5%;
  }

  .stack{ gap: 8px !important; }

  /* Keep text, but small enough to avoid clipping */
  .title{ font-size: 13px !important; }
  .message{
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .gif{ width: 135px !important; }

  /* Player narrower + smaller controls */
  .compactPlayer{
    width: 68% !important;
    max-width: 240px !important;
    padding: 3px 5px !important;
    border-radius: 13px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .playBtn{
    width: 18px !important;
    height: 18px !important;
  }

  .icon.play{
    border-left: 5px solid #fff !important;
    border-top: 3px solid transparent !important;
    border-bottom: 3px solid transparent !important;
  }
  .icon.pause{
    width: 5px !important;
    height: 7px !important;
  }

  .seek{ height: 2px !important; }

  /* Hide extras to ensure it fits in the heart curve */
  .time{ display: none !important; }
  .volume{ display: none !important; }

  /* Remove volume symbol on mobile only */
  .volBtn{ display: none !important; }

  .metaRow{ justify-content: center !important; }
}
