/* ===== WINNERS CELEBRATION SCREEN ===== */
/* Design: Dark, cinematic, luxurious. Inspired by award show aesthetics. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #fbbf24;
  --gold-bright: #fde68a;
  --gold-dark: #b45309;
  --bg-deep: #0a0a1a;
  --bg-surface: #12122a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-glow: rgba(251, 191, 36, 0.3);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ===== IDLE SCREEN ===== */
.idle-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    var(--bg-deep);
  z-index: 10;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.idle-screen[hidden] {
  display: none !important;
}

.idle-content {
  text-align: center;
  position: relative;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.15);
  animation: pulseRing 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseRing {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
}

.idle-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 32px;
  filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.2));
  animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.idle-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.idle-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.idle-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.idle-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.3;
  animation: dotPulse 1.5s ease-in-out infinite;
}

.idle-dots span:nth-child(2) { animation-delay: 0.3s; }
.idle-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== AUDIO UNLOCK ===== */
.audio-unlock {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.audio-unlock[hidden] { display: none !important; }

.unlock-btn {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 36px;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: gentleFloat 2s ease-in-out infinite;
}

.unlock-btn:hover {
  background: rgba(251, 191, 36, 0.25);
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.2);
}

/* ===== WINNER SCREEN ===== */
.winner-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 20;
  overflow: hidden;
}

.winner-screen[hidden] { display: none !important; }

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.spotlight {
  position: fixed;
  top: -20%;
  left: 50%;
  width: 60vw;
  height: 120vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center top, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: spotlightPulse 4s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.winner-content {
  position: relative;
  z-index: 25;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: scale(0.8) translateY(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.winner-content.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Trophy */
.trophy-icon {
  font-size: 5rem;
  animation: trophyBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.5));
  opacity: 0;
  transform: scale(0);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

.winner-content.revealed .trophy-icon {
  opacity: 1;
  transform: scale(1);
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* Photo Frame */
.photo-frame {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-dark));
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.3), 0 0 120px rgba(251, 191, 36, 0.1);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s;
}

.winner-content.revealed .photo-frame {
  opacity: 1;
  transform: scale(1);
}

.winner-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  display: block;
}

.photo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.2);
  animation: glowRotate 6s linear infinite;
}

@keyframes glowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* No-photo state */
.photo-frame.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame.no-photo .winner-photo {
  display: none;
}

.photo-frame.no-photo::after {
  content: '🎤';
  font-size: 5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Winner Name */
.winner-name {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 80vw;
  background: linear-gradient(135deg, #ffffff 0%, var(--gold-bright) 40%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

.winner-content.revealed .winner-name {
  opacity: 1;
  transform: translateY(0);
}

/* Winner Details */
.winner-details {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease 1s;
}

.winner-content.revealed .winner-details {
  opacity: 1;
  transform: translateY(0);
}

/* Congratulations Banner */
.congrats-banner {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 48px;
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 60px;
  background: rgba(251, 191, 36, 0.08);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.2s;
}

.winner-content.revealed .congrats-banner {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.star {
  color: var(--gold-bright);
  animation: starTwinkle 2s ease-in-out infinite alternate;
}

.star:nth-child(3) { animation-delay: 1s; }

@keyframes starTwinkle {
  0% { opacity: 0.5; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* ===== FLOATING PARTICLES ===== */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 22;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(-10vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== HIDE / SHOW TRANSITIONS ===== */
.screen-exit {
  animation: screenExit 0.6s ease forwards;
}

@keyframes screenExit {
  to {
    opacity: 0;
    transform: scale(1.05);
    visibility: hidden;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .idle-title { font-size: 2rem; }
  .idle-logo { width: 80px; height: 80px; }
  .photo-frame { width: 160px; height: 160px; }
  .winner-name { font-size: 2.5rem; }
  .winner-details { font-size: 1rem; }
  .congrats-banner { font-size: 0.85rem; padding: 12px 28px; letter-spacing: 0.2em; }
  .trophy-icon { font-size: 3.5rem; }
}

@media (max-width: 480px) {
  .winner-name { font-size: 1.8rem; }
  .photo-frame { width: 130px; height: 130px; }
  .photo-frame.no-photo::after { font-size: 3rem; }
}

