/* ============================================
   GSA VOTE — VOTER FRONTEND STYLES
   ============================================ */

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

:root {
  --g-blue:   #4285F4;
  --g-red:    #EA4335;
  --g-yellow: #FBBC04;
  --g-green:  #34A853;

  --bg-dark:    #0a0d14;
  --bg-card:    rgba(255,255,255,0.05);
  --bg-card-h:  rgba(255,255,255,0.09);
  --border:     rgba(255,255,255,0.10);
  --border-h:   rgba(255,255,255,0.22);
  --text-pri:   #f0f4ff;
  --text-sec:   rgba(240,244,255,0.6);
  --text-muted: rgba(240,244,255,0.35);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-pri);
  overflow: hidden;
}

/* ---- SCREENS ---- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: auto;
}
.screen.active { display: flex; }

/* ---- GLASS CARD ---- */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ---- BACKGROUND ORBS ---- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: #4285F4; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 350px; height: 350px; background: #EA4335; bottom: -80px; right: -80px; animation-delay: 3s; }
.orb-3 { width: 300px; height: 300px; background: #34A853; top: 40%; left: 50%; transform: translate(-50%,-50%); animation-delay: 1.5s; }
.orb-blue  { width: 450px; height: 450px; background: #4285F4; top: -80px; right: -80px; animation-delay: 0s; }
.orb-green { width: 350px; height: 350px; background: #34A853; bottom: -80px; left: -80px; animation-delay: 2s; }
.orb-gold  { width: 500px; height: 500px; background: #FBBC04; top: -120px; left: -120px; animation-delay: 0s; }
.orb-blue-2{ width: 400px; height: 400px; background: #4285F4; bottom: -100px; right: -100px; animation-delay: 2s; }

@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(30px,20px) scale(1.08); }
}

/* ============================================
   SCREEN 1 — NAME ENTRY
   ============================================ */
#screen-name { background: var(--bg-dark); }

.name-card {
  position: relative;
  z-index: 2;
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: min(480px, 92vw);
  animation: fadeUp 0.6s ease both;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.logo-text { display: flex; flex-direction: column; }
.logo-main { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-pri); }
.logo-sub  { font-size: 11px; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; margin-top: 2px; }

.card-title {
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.gradient-text {
  background: linear-gradient(135deg, #4285F4 0%, #EA4335 40%, #FBBC04 70%, #34A853 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card-desc { font-size: 14px; color: var(--text-sec); line-height: 1.6; margin-bottom: 28px; }

.input-wrap {
  position: relative;
  margin-bottom: 10px;
}
.input-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
}
.name-input {
  width: 100%;
  padding: 15px 16px 15px 46px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-pri);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.name-input:focus {
  border-color: var(--g-blue);
  background: rgba(66,133,244,0.08);
}
.name-input::placeholder { color: var(--text-muted); }

.error-msg { font-size: 12px; color: var(--g-red); margin-bottom: 14px; }
.hidden { display: none !important; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 28px;
  background: linear-gradient(135deg, #4285F4, #2563eb);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 24px rgba(66,133,244,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(66,133,244,0.5); }
.btn-primary:active { transform: translateY(0); }

/* ============================================
   SCREEN 2 — WAITING ROOM
   ============================================ */
#screen-waiting {
  background: var(--bg-dark);
  flex-direction: column;
}

.waiting-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.floating-names-container {
  position: relative;
  width: 100%;
  height: 100%;
}
.floating-name {
  position: absolute;
  font-size: clamp(11px, 2vw, 18px);
  font-weight: 600;
  color: rgba(255,255,255,0.12);
  white-space: nowrap;
  animation: floatName linear infinite;
  pointer-events: none;
  user-select: none;
}
.floating-name.self { color: rgba(66,133,244,0.35); }

@keyframes floatName {
  0%   { transform: translate(0, 0) rotate(var(--rot)); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

.waiting-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.waiting-card {
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: min(420px, 90vw);
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.pulse-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(66,133,244,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  animation: pulseRing 2s ease-in-out infinite;
}
@keyframes pulseRing {
  0%,100% { box-shadow: 0 0 0 0 rgba(66,133,244,0.3); }
  50%      { box-shadow: 0 0 0 16px rgba(66,133,244,0); }
}
.pulse-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.waiting-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.waiting-name  { font-size: 15px; color: var(--text-sec); margin-bottom: 8px; }
.waiting-name strong { color: var(--text-pri); }
.waiting-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

.participant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52,168,83,0.12);
  border: 1px solid rgba(52,168,83,0.25);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  color: #34A853;
  font-weight: 500;
}

/* ============================================
   SCREEN 3 — VOTING
   ============================================ */
#screen-voting {
  background: var(--bg-dark);
  padding: 24px;
}
.voting-container {
  position: relative;
  z-index: 2;
  width: min(500px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.5s ease both;
}

.voting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.round-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(234,67,53,0.15);
  border: 1px solid rgba(234,67,53,0.3);
  color: #EA4335;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
}
.timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(251,188,4,0.12);
  border: 1px solid rgba(251,188,4,0.25);
  color: #FBBC04;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-display.urgent {
  background: rgba(234,67,53,0.18);
  border-color: rgba(234,67,53,0.4);
  color: #EA4335;
  animation: timerPulse 0.7s ease-in-out infinite;
}
@keyframes timerPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.participant-spotlight {
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.spotlight-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.voting-for-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.spotlight-name   { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }

.vote-question { font-size: 15px; color: var(--text-sec); text-align: center; }

.voted-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(52,168,83,0.15);
  border: 1px solid rgba(52,168,83,0.3);
  color: #34A853;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  animation: fadeUp 0.4s ease both;
}

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.vote-btn:hover { transform: translateY(-4px); }
.vote-btn:active { transform: scale(0.96); }
.vote-btn-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-yes {
  background: linear-gradient(135deg, rgba(52,168,83,0.2), rgba(52,168,83,0.08));
  border-color: rgba(52,168,83,0.4);
  color: #34A853;
  box-shadow: 0 4px 24px rgba(52,168,83,0.15);
}
.vote-yes:hover { background: linear-gradient(135deg, rgba(52,168,83,0.3), rgba(52,168,83,0.15)); box-shadow: 0 8px 32px rgba(52,168,83,0.3); }
.vote-yes .vote-btn-icon { background: rgba(52,168,83,0.15); }

.vote-no {
  background: linear-gradient(135deg, rgba(234,67,53,0.2), rgba(234,67,53,0.08));
  border-color: rgba(234,67,53,0.4);
  color: #EA4335;
  box-shadow: 0 4px 24px rgba(234,67,53,0.15);
}
.vote-no:hover { background: linear-gradient(135deg, rgba(234,67,53,0.3), rgba(234,67,53,0.15)); box-shadow: 0 8px 32px rgba(234,67,53,0.3); }
.vote-no .vote-btn-icon { background: rgba(234,67,53,0.15); }

.live-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  backdrop-filter: blur(12px);
}
.stat-item { flex: 1; text-align: center; }
.stat-val   { display: block; font-size: 22px; font-weight: 800; color: var(--text-pri); }
.stat-label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); margin: 0 12px; }

/* ============================================
   SCREEN 4 — LEADERBOARD
   ============================================ */
#screen-leaderboard {
  background: var(--bg-dark);
  padding: 20px;
  overflow-y: auto;
}
.leaderboard-container {
  position: relative;
  z-index: 2;
  width: min(560px, 94vw);
  animation: fadeUp 0.6s ease both;
  padding-bottom: 40px;
}
.leaderboard-header { text-align: center; margin-bottom: 28px; }
.trophy-icon { font-size: 48px; margin-bottom: 10px; }
.lb-title    { font-size: 32px; font-weight: 900; letter-spacing: -1px; margin-bottom: 6px; }
.lb-subtitle { font-size: 14px; color: var(--text-sec); }

.leaderboard-list { display: flex; flex-direction: column; gap: 12px; }

.lb-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  animation: fadeUp 0.5s ease both;
}
.lb-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(251,188,4,0.15), rgba(251,188,4,0.05));
  border-color: rgba(251,188,4,0.4);
}
.lb-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(200,200,200,0.12), rgba(200,200,200,0.04));
  border-color: rgba(200,200,200,0.3);
}
.lb-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(180,100,30,0.15), rgba(180,100,30,0.05));
  border-color: rgba(180,100,30,0.3);
}
.lb-rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: var(--text-sec);
}
.lb-item:nth-child(1) .lb-rank { background: rgba(251,188,4,0.2); color: #FBBC04; }
.lb-item:nth-child(2) .lb-rank { background: rgba(200,200,200,0.15); color: #ccc; }
.lb-item:nth-child(3) .lb-rank { background: rgba(180,100,30,0.2); color: #cd7f32; }

.lb-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-stats-row {
  display: flex;
  gap: 14px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.lb-pct {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-pri);
  flex-shrink: 0;
}
.lb-item:nth-child(1) .lb-pct { color: #FBBC04; }

.lb-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.lb-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #4285F4, #34A853);
  transition: width 1s ease;
}
.lb-item:nth-child(1) .lb-bar { background: linear-gradient(90deg, #FBBC04, #EA4335); }

.lb-footer {
  text-align: center;
  margin-top: 36px;
}
.lb-footer-text { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.lb-badges { display: flex; justify-content: center; gap: 2px; }
.g-badge { font-size: 22px; font-weight: 900; font-family: 'Inter', sans-serif; }

/* ============================================
   SCREEN 5 — ROUND END
   ============================================ */
#screen-round-end {
  background: var(--bg-dark);
}
.round-end-card {
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: min(400px, 90vw);
  text-align: center;
  animation: fadeUp 0.5s ease both;
}
.round-end-icon  { font-size: 52px; margin-bottom: 16px; }
.round-end-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.round-end-desc  { font-size: 14px; color: var(--text-sec); margin-bottom: 20px; }
.round-end-results { display: flex; flex-direction: column; gap: 10px; }
.rnd-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-sec);
}
.rnd-stat strong { color: var(--text-pri); font-weight: 700; }

/* ---- SETTLED CREATOR FOOTER ---- */
.creator-footer,
.card-creator-tag,
.voting-creator-tag {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  letter-spacing: 0.2px;
  user-select: none;
  text-align: center;
}

.voting-creator-tag {
  border-top: none;
  padding-top: 0;
  margin-top: 16px;
}

.heart-icon {
  color: #EA4335;
  font-size: 14px;
  display: inline-block;
  vertical-align: middle;
}

.creator-name {
  font-weight: 700;
  color: var(--text-pri);
  letter-spacing: 0.25px;
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .name-card, .waiting-card { padding: 32px 24px; }
  .vote-buttons { grid-template-columns: 1fr; }
  .live-stats { padding: 14px; }
  .creator-footer, .card-creator-tag { font-size: 12px; }
}

