/* Festivalen – the voting page: one row per entry, four hearts each (0, 2, 4, 6 – bigger heart, more points;
   0 = a small grey heart, "not my thing"). */

body.f-vote { overflow-x: hidden; }

.v-main {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  margin: 0 auto;
  padding: max(0.8rem, env(safe-area-inset-top)) 0.8rem 2rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.v-title {
  margin: 0.2rem 0 0.8rem;
  text-align: center;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 800;
}

.v-waiting, .v-thanks {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.v-waiting .f-heart, .v-thanks .f-heart {
  width: 34vmin;
  height: 34vmin;
  color: #fff;
  filter: drop-shadow(0 0 2vmin #fff) drop-shadow(0 0 6vmin rgba(255, 120, 200, 0.8));
}

.v-thanks .f-heart { color: var(--p1); }

.v-beat { animation: v-beat 1.4s ease-in-out infinite; }

@keyframes v-beat {
  0%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(0.98); }
  45% { transform: scale(1.06); }
}

.v-outside {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 30vh;
}

.v-lives { list-style: none; padding: 0; display: grid; gap: 1rem; margin-top: 2rem; }

.v-live {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1.2rem;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--f-ink);
  border-radius: 1.4rem;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 1.4rem rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.v-live .f-key { font-size: 1.6rem; }

.v-entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }

.v-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.6rem 0.45rem 0.45rem;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 214, 250, 0.82));
  border: 3px solid #fff;
  box-shadow: 0 0 0.8rem rgba(255, 255, 255, 0.7);
  transition: opacity 0.4s, filter 0.4s, transform 0.4s, box-shadow 0.4s;
}

.v-entry.closed { opacity: 0.38; filter: grayscale(0.7); }
.v-entry.closed .v-hearts { pointer-events: none; }

.v-entry.now {
  transform: scale(1.02);
  box-shadow: 0 0 1rem #fff, 0 0 2.4rem rgba(255, 130, 210, 0.85);
  animation: v-glow 1.6s ease-in-out infinite alternate;
}

@keyframes v-glow {
  from { box-shadow: 0 0 0.8rem #fff, 0 0 1.4rem rgba(255, 130, 210, 0.6); }
  to { box-shadow: 0 0 1.4rem #fff, 0 0 3rem rgba(255, 130, 210, 1); }
}

.v-face {
  position: relative;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  background: linear-gradient(160deg, var(--f-lilac), var(--f-pink));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
}

.v-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.v-face .v-number {
  position: absolute;
  right: -0.1rem;
  bottom: -0.1rem;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--f-ink);
  color: #fff;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  z-index: 1;
}

.v-names { display: grid; min-width: 0; line-height: 1.15; }
.v-song { font-weight: 800; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-artist { font-size: 0.85rem; color: var(--f-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v-hearts { display: flex; align-items: center; gap: 0.25rem; }

.v-heart {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--colour);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s, opacity 0.2s;
}

.v-heart .f-heart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(var(--size));
  opacity: 0.35;
  transition: opacity 0.2s, filter 0.2s;
}

.v-heart b {
  position: relative;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 0.3em rgba(0, 0, 0, 0.35);
  margin-top: -0.1rem;
}

.v-heart[data-points="0"] { --colour: #9b93b3; --size: 0.6; }
.v-heart[data-points="2"] { --colour: var(--p2); --size: 0.74; }
.v-heart[data-points="4"] { --colour: var(--p4); --size: 0.87; }
.v-heart[data-points="6"] { --colour: var(--p6); --size: 1; }

.v-heart:active { transform: scale(0.9); }
.v-heart.chosen .f-heart { opacity: 1; filter: drop-shadow(0 0 0.35rem #fff) drop-shadow(0 0 0.7rem var(--colour)); }
.v-heart.chosen { animation: v-pop 0.4s ease; }
.v-hearts.has-choice .v-heart:not(.chosen) { opacity: 0.55; }

@keyframes v-pop {
  40% { transform: scale(1.3); }
}

@media (max-width: 520px) {
  .v-entry { grid-template-columns: auto 1fr; }
  .v-hearts { grid-column: 1 / -1; justify-content: space-around; }
  .v-heart { width: 3.4rem; height: 3.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .v-beat, .v-entry.now, .v-heart.chosen { animation: none; }
}

/* The entry being presented: it glows at full strength, but its hearts sleep until 15 s into the clip */
.v-entry.now.closed { opacity: 1; filter: none; }
.v-entry.now.closed .v-heart { opacity: 0.35; filter: grayscale(0.8); }

/* ... then they wake with a jump, one after another */
.v-entry.woke .v-heart { animation: v-wake 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.v-entry.woke .v-heart:nth-child(2) { animation-delay: 0.08s; }
.v-entry.woke .v-heart:nth-child(3) { animation-delay: 0.16s; }
.v-entry.woke .v-heart:nth-child(4) { animation-delay: 0.24s; }

@keyframes v-wake {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.v-live-badge { width: 3.4rem; height: 3.4rem; }

/* ---------- Heart votes: a big burning heart at the bottom, tap tap tap ---------- */

.v-main { padding-bottom: 8.5rem; }

.v-heart-vote {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 5;
  width: 6.4rem;
  height: 6.4rem;
  margin-left: -3.2rem;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #ffd9a8, #ff7ab8 55%, #e0417f);
  box-shadow: 0 0 1.4rem rgba(255, 255, 255, 0.9), 0 0 3rem rgba(255, 110, 160, 0.8);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  animation: v-beat 1.4s ease-in-out infinite;
}

.v-heart-vote > .f-heart {
  position: absolute;
  inset: 22%;
  width: auto;
  height: auto;
  color: #fff;
  filter: drop-shadow(0 0 0.4rem rgba(255, 255, 255, 0.9));
}

.v-heart-vote.tapped { animation: v-tap 0.25s ease; }

@keyframes v-tap {
  50% { transform: scale(0.88); }
}

.v-heart-fly {
  position: absolute;
  left: 35%;
  top: 0;
  width: 2rem;
  height: 2rem;
  color: #ff7ab8;
  filter: drop-shadow(0 0 0.4rem #fff);
  pointer-events: none;
  animation: v-fly 1s ease-out forwards;
}

@keyframes v-fly {
  from { transform: translate(0, 0) scale(0.7); opacity: 1; }
  to { transform: translate(var(--drift, 0), -9rem) scale(1.2); opacity: 0; }
}
