/* =============================================================================
   LIMITLESS TRUEVIBE — voting.css
   Styles for voting.html and the winner banner on index.html
   Imports design tokens from styles.css (loaded first)
============================================================================= */


/* =============================================================================
   VOTING PAGE — HERO
============================================================================= */

.voting-hero {
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.voting-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 60%, rgba(96,55,107,0.55) 0%, transparent 65%),
    radial-gradient(ellipse 30% 30% at 80% 20%, rgba(209,129,168,0.15) 0%, transparent 55%),
    var(--bg);
  pointer-events: none;
}

.voting-hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.voting-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  margin: 1rem 0 0.8rem;
}

.voting-title em {
  color: var(--accent);
  font-style: italic;
}

.voting-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.voting-meta {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.voting-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(252,255,222,0.03);
}

.voting-meta-pill .challenge-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7dd87d;
  animation: pulse-dot 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.voting-meta-challenge {
  color: var(--accent);
  border-color: rgba(209,129,168,0.3);
  background: rgba(209,129,168,0.06);
}

.voting-meta-closed {
  color: var(--text-muted);
}

.voting-meta-pending {
  color: #f0c060;
  border-color: rgba(240,192,96,0.3);
}

.countdown-inline {
  color: var(--accent);
  font-weight: 700;
}


/* =============================================================================
   VOTING MAIN CONTAINER
============================================================================= */

.voting-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}


/* =============================================================================
   VOTING STATES (loading, notOpen, voted, closed, active)
============================================================================= */

.voting-state {
  text-align: center;
  padding: 4rem 1rem;
}

.voting-state.hidden {
  display: none;
}

.voting-state h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 0.8rem;
}

.voting-state p {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.state-icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  line-height: 1;
}

/* Loading bars animation */
.loading-bars {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-end;
  height: 50px;
  margin-bottom: 1.5rem;
}

.loading-bars span {
  display: block;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--accent-2), var(--accent));
  animation: wbAnim 0.8s ease-in-out infinite alternate;
}

.loading-bars span:nth-child(1) { animation-delay: 0s;    --h: 30px; }
.loading-bars span:nth-child(2) { animation-delay: 0.15s; --h: 44px; }
.loading-bars span:nth-child(3) { animation-delay: 0.3s;  --h: 50px; }
.loading-bars span:nth-child(4) { animation-delay: 0.15s; --h: 38px; }
.loading-bars span:nth-child(5) { animation-delay: 0s;    --h: 24px; }

.voted-countdown {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 1rem;
  letter-spacing: 0.08em;
}


/* =============================================================================
   VOTING INSTRUCTIONS
============================================================================= */

.voting-instructions {
  background: rgba(209,129,168,0.06);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.8rem;
  margin-bottom: 3rem;
  text-align: left;
}

.voting-instructions p {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.7;
}

.voting-instructions strong {
  color: var(--text);
  font-weight: 500;
}


/* =============================================================================
   TRACK CARDS
============================================================================= */

.tracks-grid {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  margin-bottom: 6rem;
}

.track-card {
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.track-card:hover {
  border-color: rgba(209,129,168,0.3);
  box-shadow: 0 8px 32px rgba(96,55,107,0.2);
}

.track-card.track-rated {
  border-color: rgba(125,216,125,0.35);
  box-shadow: 0 4px 20px rgba(60,180,80,0.08);
}

.track-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.track-anon-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(209,129,168,0.1);
  border: 1px solid rgba(209,129,168,0.2);
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
}

.track-genre-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(252,255,222,0.04);
  border: 1px solid var(--border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.track-title-display {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.2rem;
}


/* =============================================================================
   AUDIO PLAYER
============================================================================= */

.track-player {
  margin-bottom: 1.6rem;
}

.track-audio {
  width: 100%;
  border-radius: var(--radius-sm);
  height: 40px;
  accent-color: var(--accent);
  /* Style the native audio element as much as browsers allow */
  filter: sepia(20%) saturate(120%) hue-rotate(260deg) brightness(1.1);
}

.audio-tip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.7;
}

.audio-placeholder {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: rgba(252,255,222,0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.audio-placeholder-icon {
  font-size: 1.4rem;
}

.audio-placeholder-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 300;
}


/* =============================================================================
   STAR RATING
============================================================================= */

.track-rating {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.star-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stars {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: rgba(252,255,222,0.15);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: color 0.1s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.star-btn:hover,
.star-btn.active {
  color: var(--accent);
}

.star-btn:hover {
  transform: scale(1.15);
}

.star-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-height: 1.5rem;
}


/* =============================================================================
   VOTE SUBMIT BAR (sticky bottom)
============================================================================= */

.vote-submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(22,27,49,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
}

.vote-submit-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.vote-progress {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vote-progress-track {
  width: 180px;
  height: 4px;
  background: rgba(252,255,222,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.vote-submit-btn {
  min-width: 220px;
  margin: 0;
}

.vote-submit-btn.ready {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(209,129,168,0.25); }
  50%       { box-shadow: 0 4px 32px rgba(209,129,168,0.6); }
}


/* =============================================================================
   VOTE SUCCESS SCREEN
============================================================================= */

.vote-success-screen {
  text-align: center;
  padding: 5rem 2rem;
}

.vote-success-icon {
  font-size: 4rem;
  margin-bottom: 1.2rem;
  line-height: 1;
}

.vote-success-screen h2 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 0.8rem;
}

.vote-success-screen p {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.7;
}


/* =============================================================================
   RESULTS DISPLAY
============================================================================= */

.results-card {
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 2rem;
  text-align: left;
}

.results-winner-header {
  background: linear-gradient(135deg, rgba(96,55,107,0.5), rgba(209,129,168,0.15));
  padding: 2rem 2rem 1.8rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.results-winner-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

.results-winner-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.results-winner-track {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
}

.results-rankings {
  padding: 1.5rem 2rem;
}

.results-rankings-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(252,255,222,0.05);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row--winner {
  background: rgba(209,129,168,0.06);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.8rem;
  margin: 0 -0.8rem;
}

.result-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: center;
}

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.result-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.result-track {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
}

.result-score {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
}

.result-score-denom {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}


/* =============================================================================
   PAST CHALLENGES — HALL OF FAME
============================================================================= */

.past-challenges-section {
  padding-bottom: 4rem;
}

.past-challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.past-challenge-card {
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.past-challenge-card:hover {
  border-color: rgba(209,129,168,0.35);
  box-shadow: 0 8px 28px rgba(96,55,107,0.25);
  transform: translateY(-3px);
}

.past-challenge-num {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.past-challenge-crown {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.past-challenge-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.past-challenge-winner {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.past-challenge-track {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0.8rem;
}

.past-sc-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(209,129,168,0.3);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 0.5rem;
}

.past-sc-link:hover {
  background: var(--accent);
  color: white;
}

.past-challenge-date {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(252,255,222,0.25);
  margin-top: 0.4rem;
}

.repeat-winner-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0c060;
  background: rgba(240,192,96,0.12);
  border: 1px solid rgba(240,192,96,0.35);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}

.past-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: 3rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}


/* =============================================================================
   WINNER BANNER — index.html
   Hidden by default, shown by renderWinnerBanner() in script.js
============================================================================= */

.winner-banner-section {
  display: none;
  background: linear-gradient(
    135deg,
    rgba(96,55,107,0.45) 0%,
    rgba(22,27,49,0.9) 50%,
    rgba(209,129,168,0.12) 100%
  );
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem;
}

.winner-banner-section.active {
  display: block;
}

.winner-banner-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.winner-crown {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.4rem;
  animation: floatLogo 4s ease-in-out infinite;
}

.winner-banner-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.winner-banner-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.winner-banner-track {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.winner-sc-btn {
  margin-top: 0.5rem;
}


/* =============================================================================
   FORM LOCK NOTICE
============================================================================= */

.form-lock-notice {
  background: rgba(209,129,168,0.08);
  border: 1px solid rgba(209,129,168,0.2);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}


/* =============================================================================
   CHALLENGE STATUS VARIANTS
============================================================================= */

.challenge-status--pending {
  background: rgba(240,192,96,0.1);
  border-color: rgba(240,192,96,0.3);
  color: #f0c060;
}

.challenge-status-dot--pending {
  background: #f0c060;
}

.challenge-status--voting {
  background: rgba(88,101,242,0.12);
  border-color: rgba(88,101,242,0.35);
  color: #8b98f8;
}

.challenge-status--closed {
  background: rgba(252,255,222,0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Voting nav link */
.nav-voting {
  color: var(--accent) !important;
  border: 1px solid rgba(209,129,168,0.4);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem !important;
  animation: pulse-glow 2.5s ease-in-out infinite;
}


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

@media (max-width: 768px) {

  .voting-hero {
    padding: 7rem 1.5rem 3rem;
  }

  .voting-main {
    padding: 2rem 1.2rem 7rem;
  }

  .track-card {
    padding: 1.4rem;
  }

  .stars {
    gap: 1px;
  }

  .star-btn {
    font-size: 1.3rem;
  }

  .vote-submit-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .vote-progress-track {
    width: 100%;
  }

  .vote-submit-btn {
    min-width: unset;
    width: 100%;
  }

  .past-challenges-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .results-card {
    margin-top: 1.2rem;
  }

  .results-rankings {
    padding: 1rem;
  }
}
