/* Public Display Styles - 16:9 TV Screen Layout */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --primary: #00d4ff;
  --primary-glow: rgba(0, 212, 255, 0.5);
  --secondary: #ff00aa;
  --secondary-glow: rgba(255, 0, 170, 0.5);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.5);
  --dark: #0a0a1a;
  --darker: #050510;
  --light: #ffffff;
  --gray: #666;
  --success: #00ff88;
  --danger: #ff4444;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans SC', 'Segoe UI', sans-serif;
  background: var(--darker);
  color: var(--light);
}

/* Main Container - Fixed 16:9 Aspect Ratio */
.main-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0a2e 0%, #1a0a2e 50%, #0a1a2e 100%);
}

/* Animated Background */
.bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bg-animation::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(255, 0, 170, 0.1) 0%, transparent 50%);
  animation: bgRotate 30s linear infinite;
}

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

/* Particle Effect */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
  opacity: 0.6;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  50% { transform: translateY(-100vh) translateX(50px); }
}

/* Screen Content */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Content Screen */
.content-screen {
  text-align: center;
  padding: 5%;
}

.content-screen .title {
  font-family: 'Orbitron', sans-serif;
  font-size: 6vw;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px var(--primary-glow);
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { filter: drop-shadow(0 0 20px var(--primary-glow)); }
  to { filter: drop-shadow(0 0 40px var(--secondary-glow)); }
}

.content-screen .subtitle {
  font-size: 2.5vw;
  margin-top: 2vh;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.1em;
}

.content-screen .description {
  font-size: 1.8vw;
  margin-top: 4vh;
  max-width: 70%;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

.content-screen .content-image {
  max-width: 50%;
  max-height: 50vh;
  margin-top: 4vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Click Hint */
.click-hint {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5vw;
  color: rgba(255, 255, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Vote Screen */
.vote-screen {
  position: relative;
}

.vote-header {
  position: absolute;
  top: 3%;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 20;
}

.vote-header .award-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 4vw;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, #ffaa00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vote-header .award-desc {
  font-size: 1.5vw;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1vh;
  max-width: 60%;
  margin-left: auto;
  margin-right: auto;
}

/* Floating Candidates */
.candidates-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  z-index: 5;
}

.floating-candidate {
  position: absolute;
  width: 120px;
  height: 150px;
  transform-style: preserve-3d;
  animation: floatAround 20s ease-in-out infinite;
}

.floating-candidate .photo-frame {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(var(--rotateY, 0deg)) rotateX(var(--rotateX, 0deg));
  transition: transform 0.3s ease;
}

.floating-candidate .photo-frame::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 15px;
  z-index: -1;
  transform: translateZ(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.floating-candidate img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  transform: translateZ(5px);
}

.floating-candidate .name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 10px 10px;
  transform: translateZ(5px);
}

@keyframes floatAround {
  0%, 100% { 
    transform: translate(var(--startX), var(--startY)) rotateY(0deg); 
  }
  25% { 
    transform: translate(calc(var(--startX) + 5vw), calc(var(--startY) - 3vh)) rotateY(15deg); 
  }
  50% { 
    transform: translate(calc(var(--startX) + 2vw), calc(var(--startY) + 5vh)) rotateY(-10deg); 
  }
  75% { 
    transform: translate(calc(var(--startX) - 3vw), calc(var(--startY) + 2vh)) rotateY(5deg); 
  }
}

/* QR Code Section */
.qr-section {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.qr-section.active {
  opacity: 1;
}

.qr-container {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
}

.qr-container canvas,
.qr-container img {
  display: block;
}

.qr-label {
  margin-top: 2vh;
  font-size: 1.5vw;
  color: var(--primary);
}

/* Vote Results Bar */
.vote-results {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 5%;
  z-index: 25;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.vote-result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 1vw;
  transition: all 0.5s ease;
}

.vote-result-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  filter: blur(8px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: all 0.5s ease;
}

.vote-result-item.winner img {
  filter: none;
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: scale(1.5);
}

.vote-result-item .votes {
  font-size: 1.2vw;
  font-weight: 700;
  margin-top: 8px;
  color: var(--primary);
}

.vote-result-item .result-name {
  font-size: 0.9vw;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* End Vote Button */
.end-vote-btn {
  position: absolute;
  top: 3%;
  right: 3%;
  padding: 15px 30px;
  font-size: 1.2vw;
  font-weight: 600;
  background: linear-gradient(135deg, var(--danger) 0%, #cc0000 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  z-index: 40;
  transition: all 0.3s ease;
}

.end-vote-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(255, 68, 68, 0.4);
}

/* Winner Reveal */
.winner-reveal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
}

.winner-reveal.active {
  display: flex;
}

.winner-card {
  text-align: center;
  animation: winnerEnter 1s ease forwards;
}

@keyframes winnerEnter {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.winner-card img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid var(--gold);
  box-shadow: 0 0 60px var(--gold-glow);
  animation: winnerPulse 2s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%, 100% { box-shadow: 0 0 60px var(--gold-glow); }
  50% { box-shadow: 0 0 100px var(--gold-glow), 0 0 150px var(--gold); }
}

.winner-card .winner-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 4vw;
  font-weight: 700;
  margin-top: 3vh;
  background: linear-gradient(135deg, var(--gold) 0%, #ffaa00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.winner-card .winner-title {
  font-size: 2vw;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 1vh;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 3s ease-in-out forwards;
}

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

/* Lottery Screen */
.lottery-screen {
  position: relative;
}

.lottery-header {
  position: absolute;
  top: 3%;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 20;
}

.lottery-header .prize-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 4vw;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lottery-header .prize-desc {
  font-size: 1.8vw;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1vh;
}

.lottery-header .prize-progress {
  font-size: 1.5vw;
  color: var(--primary);
  margin-top: 1vh;
}

/* Lottery Container */
.lottery-container {
  width: 80%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10%;
}

/* Wheel Lottery */
.wheel-container {
  position: relative;
  width: 500px;
  height: 500px;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  transition: transform 5s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
}

.wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  left: 50%;
  top: 0;
  transform-origin: 0% 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-segment img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  transform: rotate(calc(var(--rotation) * -1 - 45deg)) translateY(-30px);
}

.wheel-pointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 50px solid var(--gold);
  filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.5));
  z-index: 10;
}

/* Slot Machine */
.slot-container {
  display: flex;
  gap: 20px;
  background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.slot-reel {
  width: 150px;
  height: 200px;
  overflow: hidden;
  background: #111;
  border-radius: 10px;
  position: relative;
}

.slot-reel::before,
.slot-reel::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 50px;
  z-index: 5;
}

.slot-reel::before {
  top: 0;
  background: linear-gradient(to bottom, #111 0%, transparent 100%);
}

.slot-reel::after {
  bottom: 0;
  background: linear-gradient(to top, #111 0%, transparent 100%);
}

.slot-items {
  display: flex;
  flex-direction: column;
  transition: transform 3s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.slot-item {
  width: 150px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slot-item img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
}

/* Ball Drop */
.ball-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ball {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: ballFall 2s ease-in forwards;
  opacity: 0;
}

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

@keyframes ballFall {
  0% { transform: translateY(-200px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(var(--endY)); opacity: 1; }
}

.ball.winner {
  animation: ballWinner 0.5s ease forwards;
}

@keyframes ballWinner {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1.2); box-shadow: 0 0 50px var(--gold); }
}

/* Card Flip */
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 80%;
}

.flip-card {
  width: 120px;
  height: 160px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  font-size: 40px;
}

.flip-card-back {
  background: #222;
  transform: rotateY(180deg);
  overflow: hidden;
}

.flip-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-card.winner {
  animation: cardWin 0.5s ease forwards;
}

@keyframes cardWin {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Lottery Button */
.lottery-btn {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 60px;
  font-size: 2vw;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, #ffaa00 100%);
  color: #000;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  z-index: 30;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px var(--gold-glow);
}

.lottery-btn:hover {
  transform: translateX(-50%) scale(1.1);
}

.lottery-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Next Step Button */
.next-btn {
  position: absolute;
  bottom: 5%;
  right: 5%;
  padding: 15px 40px;
  font-size: 1.5vw;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  z-index: 50;
  display: none;
  transition: all 0.3s ease;
}

.next-btn.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.next-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px var(--primary-glow);
}

/* Utility Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }

