/* EA Brand Colors */
:root {
  --ea-navy: #00008B;
  --ea-yale: #1A4D98;
  --ea-light: #F0F4F8;
  --ea-white: #FFFFFF;
  --ea-dark: #1a1a2e;
  --ea-gray: #6c757d;
  --ea-gray-light: #9CA3AF;
  --ea-success: #22C55E;
  --ea-danger: #EF4444;
  --ea-warning: #F59E0B;
  --ea-orange: #F97316;
  --xmas-red: #C41E3A;
  --xmas-green: #228B22;
  --xmas-gold: #FFD700;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--ea-light);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ea-dark);
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.game-container {
  padding: 0;
  background: var(--ea-light);
}

/* Header */
.header {
  background: var(--ea-white);
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-small {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: var(--ea-white);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.header-small .logo {
  width: 44px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.logo {
  width: 70px;
  margin: 0 auto 0.75rem;
}

.logo-img {
  width: 100%;
  height: auto;
}

.header h1 {
  font-size: 1.1rem;
  color: var(--ea-navy);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Transparent Header (for home page) */
.header-transparent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-bottom: none;
  position: relative;
  z-index: 100;
}

.header-transparent .logo {
  width: 60px;
  margin: 0;
}

.header-transparent h1 {
  color: white;
  font-size: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Game Page Header */
.header-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-bottom: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  z-index: 100;
}

.header-game .logo {
  width: 44px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.header-game .live-users {
  background: rgba(255,255,255,0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  color: white;
}

.header-game .live-users span {
  color: white;
}

.header-game .player-badge {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Live Users Indicator */
.live-users {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ea-dark);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--ea-success);
  border-radius: 50%;
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.player-badge {
  background: linear-gradient(135deg, var(--ea-yale) 0%, var(--ea-navy) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26, 77, 152, 0.3);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

/* Join Card */
.join-card {
  background: var(--ea-white);
  border-radius: 24px;
  padding: 2.5rem 1.75rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 380px;
}

.join-card h2 {
  color: var(--ea-navy);
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.join-card p {
  color: var(--ea-gray);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.select-input,
.input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 2px solid var(--ea-light);
  border-radius: 14px;
  background: var(--ea-light);
  color: var(--ea-dark);
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s;
  font-weight: 500;
}

.select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231A4D98' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  padding-right: 3rem;
}

.select-input:focus,
.input:focus {
  outline: none;
  border-color: var(--ea-yale);
  background: var(--ea-white);
  box-shadow: 0 0 0 4px rgba(26, 77, 152, 0.1);
}

/* Searchable Select */
.searchable-select {
  position: relative;
  width: 100%;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ea-white);
  border: 2px solid var(--ea-yale);
  border-top: none;
  border-radius: 0 0 14px 14px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.select-dropdown.hidden {
  display: none;
}

.select-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 500;
  color: var(--ea-dark);
  border-bottom: 1px solid var(--ea-light);
}

.select-option:last-child {
  border-bottom: none;
}

.select-option:hover,
.select-option.active {
  background: rgba(26, 77, 152, 0.1);
}

.select-option.no-result {
  color: var(--ea-gray);
  cursor: default;
  text-align: center;
}

.select-option.no-result:hover {
  background: transparent;
}

.select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.select-dropdown::-webkit-scrollbar-track {
  background: var(--ea-light);
  border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb {
  background: var(--ea-gray-light);
  border-radius: 4px;
}

.searchable-select .select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A4D98' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  width: 100%;
  touch-action: manipulation;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--ea-yale) 0%, var(--ea-navy) 100%);
  color: var(--ea-white);
  box-shadow: 0 4px 15px rgba(26, 77, 152, 0.35);
}

.btn-primary:not(:disabled):active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(26, 77, 152, 0.3);
}

.btn-secondary {
  background: var(--ea-light);
  color: var(--ea-yale);
}

.btn-danger {
  background: var(--ea-danger);
  color: var(--ea-white);
}

.btn-danger-outline {
  background: transparent;
  color: var(--ea-danger);
  border: 2px solid var(--ea-danger);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  width: auto;
}

/* Waiting Screen */
.waiting-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 1.25rem;
}

.waiting-content {
  text-align: center;
  padding: 2.5rem 1.75rem;
  background: var(--ea-white);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 440px;
}

#waiting-message,
#game-waiting-message {
  transition: opacity 0.3s ease;
}

.waiting-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--ea-navy);
  font-weight: 700;
}

.waiting-content p {
  color: var(--ea-gray);
}

/* Finished Waiting Screen */
.finished-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.finished-icon {
  animation: pulse-icon 2s ease-in-out infinite;
}

.finished-icon-img {
  width: 180px;
  height: auto;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.confetti-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.confetti-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: bounce-dot 1.4s ease-in-out infinite;
}

.confetti-dots span:nth-child(1) {
  background: var(--ea-yale);
  animation-delay: 0s;
}

.confetti-dots span:nth-child(2) {
  background: var(--ea-success);
  animation-delay: 0.2s;
}

.confetti-dots span:nth-child(3) {
  background: var(--ea-warning);
  animation-delay: 0.4s;
}

.confetti-dots span:nth-child(4) {
  background: var(--ea-danger);
  animation-delay: 0.6s;
}

.confetti-dots span:nth-child(5) {
  background: var(--ea-navy);
  animation-delay: 0.8s;
}

@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-15px); }
}

.players-remaining {
  color: var(--ea-yale);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1rem;
}

/* Countdown Screen */
.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.countdown-title {
  font-size: 1.5rem;
  color: var(--ea-navy);
  font-weight: 700;
  margin-bottom: 2rem;
}

.countdown-number {
  font-size: 8rem;
  font-weight: 800;
  color: var(--ea-yale);
  line-height: 1;
  animation: countdownPulse 1s ease-in-out infinite;
  text-shadow: 0 4px 20px rgba(26, 77, 152, 0.3);
}

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

.countdown-dots {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.countdown-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ea-yale);
  animation: countdownDot 1.5s ease-in-out infinite;
}

.countdown-dots span:nth-child(1) { animation-delay: 0s; }
.countdown-dots span:nth-child(2) { animation-delay: 0.2s; }
.countdown-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes countdownDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid var(--ea-light);
  border-top-color: var(--ea-yale);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.online-count {
  font-size: 0.9rem;
  color: var(--ea-gray-light);
  margin-top: 1rem;
}

/* Screens */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: var(--ea-light);
}

.screen.hidden {
  display: none;
}

/* Question Header */
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding: 0;
  width: 100%;
  max-width: 500px;
}

.question-number {
  color: var(--ea-gray);
  font-weight: 700;
  font-size: 0.9rem;
}

.game-badge {
  background: linear-gradient(135deg, var(--ea-yale) 0%, var(--ea-navy) 100%);
  color: var(--ea-white);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Timer */
.timer-container {
  flex: 1;
  max-width: 120px;
  height: 8px;
  background: var(--ea-light);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 1rem;
  border: 1px solid rgba(0,0,0,0.05);
}

.timer-bar {
  height: 100%;
  background: var(--ea-orange);
  border-radius: 4px;
  transition: width 0.1s linear;
  width: 100%;
}

.timer-text {
  background: var(--ea-orange);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  min-width: 55px;
  text-align: center;
}

/* Question Card */
.question-card {
  background: var(--ea-white);
  border-radius: 20px;
  padding: 1.25rem 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 500px;
}

.question-text {
  color: var(--ea-dark);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Options List */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  text-align: left;
  background: var(--ea-light);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--ea-dark);
  touch-action: manipulation;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-btn::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--ea-gray-light);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.selected {
  background: rgba(26, 77, 152, 0.1);
  border-color: var(--ea-yale);
}

.option-btn.selected::before {
  background: var(--ea-yale);
  border-color: var(--ea-yale);
  box-shadow: inset 0 0 0 4px white;
}

.option-btn.confirmed {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--ea-success);
}

.option-btn.confirmed::before {
  content: '✓';
  background: var(--ea-success);
  border-color: var(--ea-success);
  box-shadow: none;
  color: white;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-btn.correct {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--ea-success);
}

.option-btn.correct::before {
  background: var(--ea-success);
  border-color: var(--ea-success);
  box-shadow: inset 0 0 0 4px white;
}

.option-btn.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--ea-danger);
}

.option-btn.incorrect::before {
  background: var(--ea-danger);
  border-color: var(--ea-danger);
  box-shadow: inset 0 0 0 4px white;
}

.option-btn:disabled {
  cursor: not-allowed;
}

.option-btn.disabled {
  opacity: 0.5;
}

.option-btn.correct-answer {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.3));
  border-color: var(--ea-success);
  animation: selectPulse 0.5s ease-out;
}

.option-btn.correct-answer::before {
  content: '✓';
  background: var(--ea-success);
  border-color: var(--ea-success);
  box-shadow: none;
  color: white;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkPop 0.3s ease-out;
}

@keyframes selectPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes checkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Participant Search Selector */
.participant-search-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.participant-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 2px solid var(--ea-light);
  border-radius: 12px;
  background: var(--ea-white);
  color: var(--ea-dark);
  transition: all 0.2s;
  font-weight: 500;
}

.participant-search-input:focus {
  outline: none;
  border-color: var(--ea-yale);
  box-shadow: 0 0 0 4px rgba(26, 77, 152, 0.1);
}

.participant-search-input:disabled {
  opacity: 0.5;
  background: var(--ea-light);
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 4px;
}

.participants-list::-webkit-scrollbar {
  width: 6px;
}

.participants-list::-webkit-scrollbar-track {
  background: var(--ea-light);
  border-radius: 3px;
}

.participants-list::-webkit-scrollbar-thumb {
  background: var(--ea-gray-light);
  border-radius: 3px;
}

.participant-option {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  border: 2px solid var(--ea-light);
  border-radius: 10px;
  background: var(--ea-white);
  color: var(--ea-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.participant-option:hover {
  border-color: var(--ea-yale);
  background: rgba(26, 77, 152, 0.05);
}

.participant-option:active {
  transform: scale(0.98);
}

.participant-option.selected,
.participant-option.correct-answer {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.3));
  border-color: var(--ea-success);
  animation: selectPulse 0.5s ease-out;
}

.participant-option:disabled {
  cursor: not-allowed;
}

.participant-option.disabled {
  opacity: 0.5;
}

.no-results {
  text-align: center;
  color: var(--ea-gray);
  padding: 1rem;
  font-size: 0.9rem;
}

/* Screen Slide Animations */
.screen.slide-out {
  animation: slideOut 0.3s ease-in forwards;
}

.screen.slide-in {
  animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-30px);
  }
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Voted Message */
.voted-message {
  text-align: center;
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.voted-message.hidden {
  display: none;
}

.check-icon {
  width: 56px;
  height: 56px;
  background: var(--ea-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin: 0 auto 0.75rem;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.voted-message p {
  color: var(--ea-success);
  font-weight: 600;
}

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

/* Results Card */
.results-card {
  background: var(--ea-white);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 500px;
}

.result-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: var(--ea-light);
}

.result-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--ea-dark);
  font-weight: 500;
}

.result-bar-bg {
  height: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--ea-yale) 0%, var(--ea-navy) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 0;
}

.result-bar-fill.winner {
  background: linear-gradient(135deg, var(--ea-success) 0%, #16A34A 100%);
}

.result-item.my-vote {
  background: rgba(26, 77, 152, 0.15);
  border: 2px solid var(--ea-yale);
}

.result-item.correct-answer-result {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--ea-success);
}

/* Question Reveal (before showing results) */
.question-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2rem;
  text-align: center;
}

.question-reveal-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ea-navy);
  line-height: 1.4;
}

.question-reveal-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 3rem;
}

.question-reveal-card .question-reveal-text {
  font-size: 2.5rem;
}

/* Result avatars */
.result-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.result-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ea-yale) 0%, var(--ea-navy) 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
  position: relative;
  cursor: pointer;
}

.result-avatar::after {
  content: attr(data-name);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ea-dark);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  margin-bottom: 4px;
  z-index: 100;
}

.result-avatar:hover::after,
.result-avatar:active::after,
.result-avatar:focus::after {
  opacity: 1;
  visibility: visible;
}

.result-avatar:hover {
  transform: scale(1.15);
  z-index: 10;
}

.result-avatar.correct {
  background: linear-gradient(135deg, var(--ea-success) 0%, #16A34A 100%);
}

.result-avatar.incorrect {
  background: linear-gradient(135deg, var(--ea-danger) 0%, #DC2626 100%);
}

/* Election result block on final screen */
.election-result-block {
  background: var(--ea-white);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.election-result-block h4 {
  color: var(--ea-navy);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.correct-answer {
  color: var(--ea-success);
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.correct-answer::before {
  content: '✓';
  width: 24px;
  height: 24px;
  background: var(--ea-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Leaderboard */
.leaderboard-mini {
  background: var(--ea-white);
  border-radius: 24px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 500px;
}

.leaderboard-mini h3 {
  color: var(--ea-navy);
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ea-light);
  font-size: 0.95rem;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list .rank {
  font-weight: 700;
  color: var(--ea-yale);
  min-width: 32px;
  height: 32px;
  background: rgba(26, 77, 152, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.leaderboard-list li:first-child .rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

.leaderboard-list li:nth-child(2) .rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: white;
}

.leaderboard-list li:nth-child(3) .rank {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: white;
}

.leaderboard-list .name {
  flex: 1;
  margin-left: 0.75rem;
  font-weight: 500;
}

.leaderboard-list .points {
  font-weight: 700;
  color: var(--ea-navy);
  background: var(--ea-light);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* Final Screen */
.final-content {
  text-align: center;
  padding: 1.5rem 1rem;
  width: 100%;
  max-width: 500px;
}

.final-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--ea-navy);
  font-weight: 700;
}

.final-message {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--ea-gray);
}

.final-message p {
  margin-bottom: 0.5rem;
}

.leaderboard-full {
  background: var(--ea-white);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  text-align: left;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.leaderboard-full h3 {
  color: var(--ea-navy);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.leaderboard-full .top-three {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.podium-item {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 16px;
  min-width: 90px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.podium-item.first {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  order: 2;
  transform: scale(1.05);
}

.podium-item.second {
  background: linear-gradient(135deg, #E8E8E8, #C0C0C0);
  order: 1;
}

.podium-item.third {
  background: linear-gradient(135deg, #DEB887, #CD7F32);
  order: 3;
}

.podium-rank {
  font-size: 1.75rem;
}

.podium-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.podium-points {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.9);
  margin-top: 0.25rem;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Clickable badge */
.player-badge.clickable {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.player-badge.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(26, 77, 152, 0.4);
}

.player-badge.clickable:active {
  transform: scale(0.98);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--ea-white);
  border-radius: 20px;
  padding: 1.5rem;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
  color: var(--ea-navy);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  text-align: center;
}

.modal-content .select-input {
  margin-bottom: 1rem;
}

.modal-buttons {
  display: flex;
  gap: 0.75rem;
}

.modal-buttons .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* Responsive */
@media (min-width: 480px) {
  .join-card {
    padding: 3rem 2rem;
  }

  .question-card,
  .results-card,
  .leaderboard-mini,
  .leaderboard-full {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 768px) {
  .header {
    padding: 1.5rem 2rem;
  }

  .logo {
    width: 90px;
  }

  .header h1 {
    font-size: 1.25rem;
  }

  .question-text {
    font-size: 1.35rem;
  }

  .btn {
    font-size: 1.05rem;
  }
}

/* ============ Christmas Theme for Home Page ============ */

.christmas-bg {
  background: linear-gradient(180deg, #0f1e3d 0%, #1a3a5c 50%, #0d2847 100%);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

.christmas-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.8), transparent);
  background-size: 200px 200px;
  animation: twinkle 4s ease-in-out infinite;
  pointer-events: none;
}

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

/* Snowflakes */
.snowflakes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: white;
  font-size: 1rem;
  animation: fall linear infinite;
  opacity: 0.8;
  text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 8s; animation-delay: 0s; font-size: 0.8rem; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 12s; animation-delay: 1s; font-size: 1.2rem; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 10s; animation-delay: 2s; font-size: 0.9rem; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 14s; animation-delay: 0.5s; font-size: 1rem; }
.snowflake:nth-child(5) { left: 45%; animation-duration: 9s; animation-delay: 3s; font-size: 0.7rem; }
.snowflake:nth-child(6) { left: 55%; animation-duration: 11s; animation-delay: 1.5s; font-size: 1.1rem; }
.snowflake:nth-child(7) { left: 65%; animation-duration: 13s; animation-delay: 2.5s; font-size: 0.8rem; }
.snowflake:nth-child(8) { left: 75%; animation-duration: 10s; animation-delay: 0.8s; font-size: 1rem; }
.snowflake:nth-child(9) { left: 85%; animation-duration: 15s; animation-delay: 1.2s; font-size: 0.9rem; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 8s; animation-delay: 2s; font-size: 1.2rem; }

@keyframes fall {
  0% {
    top: -20px;
    transform: translateX(0) rotate(0deg);
  }
  100% {
    top: 100vh;
    transform: translateX(50px) rotate(360deg);
  }
}

/* Christmas Lights */
.xmas-lights {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.xmas-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: glow 1.5s ease-in-out infinite;
}

.xmas-light:nth-child(1) { background: #ff6b6b; animation-delay: 0s; }
.xmas-light:nth-child(2) { background: #ffd93d; animation-delay: 0.2s; }
.xmas-light:nth-child(3) { background: #6bcb77; animation-delay: 0.4s; }
.xmas-light:nth-child(4) { background: #4d96ff; animation-delay: 0.6s; }
.xmas-light:nth-child(5) { background: #ff6b6b; animation-delay: 0.8s; }
.xmas-light:nth-child(6) { background: #ffd93d; animation-delay: 1s; }
.xmas-light:nth-child(7) { background: #6bcb77; animation-delay: 1.2s; }

@keyframes glow {
  0%, 100% { opacity: 0.4; transform: scale(0.9); box-shadow: 0 0 5px currentColor; }
  50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 15px currentColor, 0 0 30px currentColor; }
}

