/* Beat Matt's Ballot - Main Stylesheet (Readable Version) */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
  /* Primary Colors */
  --primary-red: #bc4b51;
  --primary-gold: #dca54a;
  
  /* Background & Text */
  --background: #fffcf1;
  --text-dark: #1f2937;
  --text-medium: #6b7280;
  --text-light: #9ca3af;
  --white: white;
  
  /* Borders */
  --border-light: #e1e5e9;
  --border-gray: #e5e7eb;
  
  /* Status Colors */
  --success-green: #10b981;
  --error-red: #ef4444;
  --warning-amber: #f59e0b;
  --warning-amber-dark: #d97706;
  --purple: #7c3aed;
  --tie-purple: #9333ea;
  --tie-purple-light: #a855f7;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  
  /* Font Sizes */
  --font-base: 14px;
  --font-lg: 16px;
  --font-xl: 18px;
  
  /* Gradients */
  --gradient-gold-light: linear-gradient(135deg, #fef3cd, #fde68a);
  --gradient-amber-dark: linear-gradient(135deg, #fbbf24, #d97706);
  --gradient-red: linear-gradient(135deg, var(--primary-red), #a04147);
  --gradient-yellow: linear-gradient(135deg, #fbbf24, #f59e0b);
  --gradient-purple: linear-gradient(135deg, #a855f7, #9333ea);
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: #333;
  min-height: 100vh;
  line-height: 1.4;
  font-size: var(--font-xl);
  padding: clamp(8px, 2vw, 16px);
}

/* ============================================================================
   REFRESH BUTTON
   ============================================================================ */
.refresh-btn {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #d1d5db;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.refresh-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translate3d(0, -1px, 0);
  box-shadow: var(--shadow-md);
}

.refresh-btn:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

.refresh-icon {
  font-size: 14px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.refresh-btn:hover .refresh-icon {
  transform: rotate(180deg);
}

/* ============================================================================
   LOCK SCREEN
   ============================================================================ */
#lockScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--background) 0%, #fff8e7 50%, #ffe4cc 100%);
  z-index: 10000;
  display: none;
  flex-direction: column;
  padding: 20px;
}

#lockScreen.show {
  display: flex;
}

.lock-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.lock-logo-container {
  margin-bottom: 40px;
}

.lock-logo {
  max-width: 384px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

.lock-title {
  color: var(--primary-red);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
}

.lock-message {
  color: var(--text-dark);
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--background) 0%, #fff8e7 100%);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  padding-top: calc(40vh - 200px);
}

#loadingScreen.show {
  display: flex;
}

.loading-content {
  text-align: center;
  padding: 32px;
  max-width: 900px;
  width: 100%;
}

.loading-header {
  color: #9ca3af;
  font-size: clamp(17px, 3.2vw, 22px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 25px;
}

.loading-screen-message {
  color: var(--primary-red);
  font-size: clamp(30px, 5.2vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 35px;
  text-align: center;
  padding: 0 10px;
  text-shadow: 0 2px 4px rgba(188, 75, 81, 0.1);
}

.loading-spinner-wrapper {
  width: 200px;
  height: 200px;
  margin: 0 auto 28px;
  position: relative;
}

.loading-spinner {
  width: 100%;
  height: 100%;
  border: 6px solid rgba(220, 165, 74, 0.2);
  border-top-color: var(--primary-gold);
  border-radius: 50%;
  animation: simpleRotate 1s linear infinite;
}

.spinner-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
  font-size: 100px;
  filter: sepia(0.5) hue-rotate(350deg) saturate(1.5);
}

@keyframes simpleRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-submessage {
  color: var(--text-medium);
  font-size: clamp(17px, 3vw, 22px);
  font-style: italic;
  margin-bottom: 15px;
}

.loading-progress {
  width: 100%;
  max-width: 500px;
  height: 8px;
  background: rgba(220, 165, 74, 0.2);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--primary-gold);
  border-radius: 4px;
  animation: progress 15s ease-out;
}

@keyframes progress {
  0% {
    width: 0%;
  }
  20% {
    width: 30%;
  }
  40% {
    width: 50%;
  }
  60% {
    width: 70%;
  }
  80% {
    width: 85%;
  }
  100% {
    width: 100%;
  }
}

/* ============================================================================
   MAIN APP CONTAINER
   ============================================================================ */
#mainApp {
  display: none;
  padding: 12px;
  max-width: 900px;
  margin: 0 auto;
  overflow-x: hidden;
}

#mainApp.show {
  display: block;
}

/* ============================================================================
   CARD STYLES (Dashboard, Raffle, Jury, Latest Update, Announcement)
   ============================================================================ */
.dashboard-card,
.raffle-card,
.jury-card,
.latest-update-card,
.announcement-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
  overflow: hidden;
}

.dashboard-card,
.raffle-card,
.jury-card {
  border: 2px solid var(--primary-gold);
  box-shadow: var(--shadow-sm);
}

.latest-update-card {
  border: 2px solid var(--primary-gold);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--primary-gold);
  animation: subtleGlow 3s ease-in-out infinite;
}

@keyframes subtleGlow {
  0%, 100% {
    box-shadow: var(--shadow-sm), 0 0 0 3px var(--primary-gold);
  }
  50% {
    box-shadow: 0 4px 16px rgba(220, 165, 74, 0.3), 0 0 0 3px var(--primary-gold);
  }
}

.announcement-card {
  border: 2px solid var(--primary-red);
  box-shadow: var(--shadow-sm);
  animation: subtleGlowRed 3s ease-in-out infinite;
}

@keyframes subtleGlowRed {
  0%, 100% {
    box-shadow: var(--shadow-sm), 0 0 0 3px rgba(188, 75, 81, 0.2);
  }
  50% {
    box-shadow: 0 4px 16px rgba(188, 75, 81, 0.3), 0 0 0 3px rgba(188, 75, 81, 0.3);
  }
}

/* Card Titles */
.dashboard-title,
.raffle-title,
.jury-title,
.latest-update-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.announcement-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Card Headers */
.dashboard-header,
.raffle-header,
.jury-header,
.latest-update-header {
  background: var(--gradient-gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.jury-header {
  background: var(--gradient-gold-light);
  border-bottom: 2px solid var(--primary-gold);
}

.dashboard-header,
.raffle-header,
.jury-header {
  padding: 8px 16px;
}

.latest-update-header {
  padding: 10px 16px;
}

.dashboard-header,
.latest-update-header {
  border-bottom: 2px solid var(--primary-gold);
}

.raffle-header {
  border-bottom: 2px solid var(--warning-amber);
}

.announcement-header {
  padding: 12px 16px;
  background: var(--gradient-red);
  border-bottom: 2px solid var(--primary-red);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card Icons */
.dashboard-icon,
.raffle-icon,
.jury-icon,
.latest-update-icon,
.announcement-icon {
  font-size: 20px;
}

.jury-icon {
  font-size: 20px;
}

/* Dashboard Content */
.dashboard-content {
  padding: 4px 20px 20px 20px;
}

/* Announcement Content */
.announcement-content {
  padding: 20px;
  background: #fef2f2;
}

.announcement-message {
  font-size: 20px;
  color: #991b1b;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
}

/* ============================================================================
   DASHBOARD STATS
   ============================================================================ */
.dashboard-three-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contestant-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 2px 0 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.contestant-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  flex: 1;
  min-width: 0;
}

.contestant-stat.clickable {
  border: 3px dashed #9ca3af;
  cursor: pointer;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease;
}

.contestant-stat.clickable:active {
  transform: translate3d(0, 0, 0) scale(0.95);
}

.contestant-stat.active {
  background: var(--gradient-red);
  border: 3px solid var(--primary-red);
  border-style: solid;
  box-shadow: 0 4px 12px rgba(188, 75, 81, 0.4), 0 0 0 2px rgba(188, 75, 81, 0.2);
  transform: translate3d(0, -2px, 0);
}

.contestant-stat.active .stat-number {
  color: var(--white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.contestant-stat.active .stat-label {
  color: var(--white);
  font-weight: 700;
}

.contestant-stat.active .filter-hint {
  color: var(--white);
  font-weight: 700;
}

.stat-number {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary-gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  margin-bottom: 6px;
}

.filter-hint {
  font-size: 16px;
  color: var(--primary-gold);
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */
.progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
}

.progress-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-sublabel {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-light);
  font-style: italic;
}

.progress-values-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 4px;
}

.progress-values {
  font-size: 22px;
  font-weight: 700;
}

.progress-values.categories {
  color: var(--primary-red);
}

.progress-values.points {
  color: var(--primary-gold);
}

.progress-bar {
  height: 10px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-fill.categories {
  background: linear-gradient(90deg, var(--primary-red), #d44248);
}

.progress-fill.points {
  background: linear-gradient(90deg, var(--primary-gold), #e6b55c);
}

/* ============================================================================
   CASH POT
   ============================================================================ */
.cash-pot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  margin: 16px 0 0 0;
  border: 3px solid var(--success-green);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cash-pot .icon {
  font-size: 34px;
}

.cash-pot .label {
  font-size: 19px;
  font-weight: 800;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cash-pot .amount {
  font-size: 34px;
  font-weight: 900;
  color: #047857;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   RAFFLE & JURY CONTENT
   ============================================================================ */
.raffle-content,
.jury-content {
  padding: 16px;
  text-align: center;
}

.raffle-status-text,
.jury-status-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-medium);
}

.raffle-message,
.jury-message {
  font-size: 16px;
  color: #92400e;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  line-height: 1.4;
}

.jury-stats {
  font-size: 18px;
  color: var(--text-medium);
  margin-top: 8px;
  font-style: italic;
}

.jury-trophy {
  font-size: 32px;
}

.raffle-card.drawn .raffle-content {
  background: #fffbeb;
}

.raffle-card.drawn .raffle-status-text {
  font-size: 22px;
  font-weight: 700;
  color: #92400e;
}

.jury-card.announced .jury-content {
  background: #fffbeb;
}

.jury-card.announced .jury-status-text {
  font-size: 28px;
  font-weight: 700;
  color: #92400e;
}

/* ============================================================================
   LATEST UPDATE CARD
   ============================================================================ */
.latest-update-info {
  padding: 16px;
  background: var(--white);
}

.latest-update-category {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-red);
  margin-bottom: 6px;
  line-height: 1.2;
}

.latest-update-winner {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.latest-update-winner em {
  font-style: italic;
  font-weight: 600;
}

/* TIE HANDLING: Winner display with tie badge */
.winner-with-tie {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.tie-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gradient-purple);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.tie-badge-icon {
  font-size: 16px;
}

.tie-separator {
  font-weight: 700;
  color: var(--tie-purple);
  margin: 0 4px;
}

/* Latest Update Accuracy Section */
.latest-update-accuracy {
  padding: 14px 16px;
  border-top: 1px solid var(--border-gray);
}

.latest-update-accuracy.green {
  background: #d1fae5;
}

.latest-update-accuracy.yellow {
  background: #fef3cd;
}

.latest-update-accuracy.red {
  background: #fee2e2;
}

.latest-update-accuracy-main {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.latest-update-accuracy.green .latest-update-accuracy-main {
  color: #065f46;
}

.latest-update-accuracy.yellow .latest-update-accuracy-main {
  color: #92400e;
}

.latest-update-accuracy.red .latest-update-accuracy-main {
  color: #991b1b;
}

.latest-update-accuracy-detail {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
}

.latest-update-accuracy.green .latest-update-accuracy-detail {
  color: #047857;
}

.latest-update-accuracy.yellow .latest-update-accuracy-detail {
  color: #78350f;
}

.latest-update-accuracy.red .latest-update-accuracy-detail {
  color: #7f1d1d;
}

/* Competitive Only Notice */
.competitive-only-notice {
  padding: 14px 16px;
  border-top: 1px solid var(--border-gray);
  background: #f9fafb;
}

.competitive-only-text {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-medium);
  line-height: 1.3;
  font-style: italic;
  text-align: center;
}

/* Latest Update Timestamp */
.latest-update-timestamp {
  padding: 12px 18px;
  background: #f9fafb;
  border-top: 1px solid var(--border-gray);
  font-size: 16px;
  color: var(--text-medium);
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.timestamp-refresh-icon {
  font-size: 18px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s ease;
  line-height: 1;
  vertical-align: middle;
}

.timestamp-refresh-icon:hover {
  opacity: 1;
}

/* ============================================================================
   CONTESTANT SECTION & LEADERBOARD
   ============================================================================ */
.contestant-section {
  max-width: 100%;
  position: relative;
  overflow: visible;
  margin-bottom: 20px;
}

.leaderboard-search-wrapper {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Filter Active Banner */
.filter-active-banner {
  background: #fee2e2;
  border-bottom: 1px solid #fca5a5;
  padding: 10px 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filter-active-banner.show {
  display: flex;
}

.filter-banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.filter-banner-icon {
  font-size: 17px;
  color: #dc2626;
}

.filter-banner-text {
  font-size: 15px;
  font-weight: 600;
  color: #991b1b;
  text-transform: uppercase;
}

.filter-banner-clear {
  background: transparent;
  border: none;
  color: #dc2626;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: underline;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-banner-clear:hover {
  color: #991b1b;
}

/* Leaderboard Header */
.leaderboard-header {
  background: var(--gradient-red);
  padding: 12px 16px;
  border-bottom: 2px solid var(--primary-red);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 3;
}

.leaderboard-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.section-header {
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  text-align: left;
  flex: 1;
}

/* Search Box */
.search-box {
  background: var(--white);
  border: 2px solid var(--primary-red);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(188, 75, 81, 0.1);
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 4;
}

.search-icon {
  font-size: 24px;
  color: var(--text-light);
  position: relative;
  z-index: 5;
}

.search-input-inline {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 16px;
  outline: none;
  color: var(--text-dark);
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 5;
  padding-left: 24px;
}

.search-input-inline::placeholder {
  color: var(--text-light);
}

.search-clear-inline {
  background: none;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  padding: 4px;
  visibility: hidden;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  transition: color 0.2s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.search-clear-inline.show {
  visibility: visible;
}

.search-clear-inline:hover {
  color: var(--text-dark);
}

/* ============================================================================
   CONTESTANT CARDS
   ============================================================================ */
.contestant-card {
  background: var(--white);
  border-radius: 14px;
  margin-bottom: 0px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #d1d5db;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  contain: layout paint;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0s;
}

.contestant-card:last-child {
  border-bottom: none;
}

.contestant-card.pinned {
  border: 1px solid #fca5a5;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
  border-radius: var(--radius-xl);
  margin-bottom: 0px;
}

.contestant-card.pinned:hover {
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.12);
}

.contestant-card.search-hidden,
.contestant-card.filter-hidden {
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  transition: height 0.2s ease, opacity 0.15s ease, margin 0.2s ease, padding 0.2s ease;
}

.contestant-card {
  transition: height 0.2s ease, opacity 0.15s ease, margin 0.2s ease, padding 0.2s ease;
  opacity: 1;
}

.pinned-header {
  background: var(--gradient-red);
  color: var(--background);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  margin: -1px -1px 0 -1px;
  border-radius: 16px 16px 0 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Trend Circle */
.trend-circle {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: white;
  z-index: 10;
}

.contestant-card.pinned .trend-circle {
  top: 29px;
}

.trend-circle.up {
  background: #10b981;
}

.trend-circle.down {
  background: #ef4444;
}

.trend-circle::before {
  content: '▲';
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.trend-circle.down::before {
  content: '▼';
}

/* Card Main Layout */
.card-main {
  display: flex;
  align-items: stretch;
}

/* Rank Section */
.rank-section {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 8px 10px;
  text-align: center;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.rank-num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-top: 8px;
}

.rank-num.icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
}

.rank-num.icon-only {
  font-size: 28px;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.rank-label {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.95;
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Middle Section */
.middle-section {
  flex: 1;
  padding: 12px 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 96px;
}

.contestant-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
  margin-bottom: 2px;
}

.contestant-location {
  font-size: 14px;
  color: var(--text-medium);
  margin-bottom: 0;
}

/* Badges Row */
.badges-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.prize-icon {
  font-size: 24px;
  line-height: 1;
  margin-right: 4px;
  flex-shrink: 0;
}

.badge {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: inline-block;
}

.badge-win {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #047857;
}

.badge-matt {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #4338ca;
}

.badge-tie-matt {
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid rgba(147, 51, 234, 0.4);
  color: #6d28d9;
}

/* Points Section */
.points-section {
  background: var(--primary-red);
  color: white;
  padding: 12px 10px;
  text-align: center;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.points-num {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.points-label {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.95;
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Buttons Section */
.buttons-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
  justify-content: center;
}

.card-btn {
  border: 2px solid #d1d5db;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.card-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.pin-btn {
  background: #e5e7eb;
  color: #374151;
  font-size: 22px;
}

.pin-btn.pinned {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fca5a5;
}

.pin-btn.pinned:hover {
  color: #991b1b;
  background: #fee2e2;
  border-color: #f87171;
}

.expand-btn {
  background: var(--primary-gold);
  color: white;
  font-size: 24px;
  font-weight: 700;
  border-color: rgba(184, 134, 11, 0.4);
}

.expand-btn.expanded {
  transform: rotate(45deg);
}

.expand-btn.expanded:hover {
  transform: translateY(-2px) rotate(45deg);
}

/* ============================================================================
   EXPANDED CONTESTANT CONTENT
   ============================================================================ */
.no-predictions-section {
  background: #f9fafb;
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 16px;
  text-align: center;
}

.no-predictions-message {
  font-size: 16px;
  color: var(--text-medium);
  margin-bottom: 12px;
  font-style: italic;
}

.raffle-tickets-display {
  font-size: 17px;
  color: var(--text-medium);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.dummy-note-section {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border: 2px solid #6366f1;
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 18px;
  position: relative;
}

.contestant-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.15s ease-out;
}

.contestant-expanded.open {
  max-height: 50000px;
}

.expanded-content {
  padding: 0 0 16px 0;
  border-top: 1px solid var(--border-light);
}

.ballot-predictions-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-bottom: 2px solid var(--border-gray);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.ballot-predictions-icon {
  font-size: 20px;
}

.ballot-predictions-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.ballot-collapse-section {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
  margin-top: 12px;
  border-top: 1px solid var(--border-light);
}

.collapse-ballot-btn {
  background: #f3f4f6;
  border: 1px solid var(--border-gray);
  color: var(--text-medium);
  font-size: 16px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.collapse-ballot-btn:hover {
  background: #e5e7eb;
  color: var(--text-dark);
  border-color: #d1d5db;
}

.collapse-ballot-btn:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

/* ============================================================================
   BALLOT DISPLAY
   ============================================================================ */
.ballot-categories-wrapper {
  margin: 0;
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15);
}

/* Rank Movement Compact */
.rank-movement-compact {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid #10b981;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  padding: 8px 16px;
  margin: 0;
  color: #065f46;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rank-movement-compact.down {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
  border-bottom-color: rgba(239, 68, 68, 0.2);
  color: #991b1b;
}

.rank-movement-compact .arrow {
  font-size: 22px;
  font-weight: 900;
  color: #10b981;
}

.rank-movement-compact.down .arrow {
  color: #ef4444;
}

.rank-movement-category {
  font-weight: 700;
  font-style: italic;
}

/* Ballot Header */
.ballot-header {
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 2px solid var(--border-gray);
}

.ballot-stats-row {
  display: flex;
  gap: 8px;
}

.ballot-stat-box {
  flex: 1;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 3px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.ballot-stat-box.accuracy-red {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

.ballot-stat-box.accuracy-yellow {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.ballot-stat-box.accuracy-green {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.ballot-stat-label {
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ballot-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ballot-stat-icon {
  font-size: 22px;
}

.ballot-stat-box.accuracy-red .ballot-stat-value {
  color: #dc2626;
}

.ballot-stat-box.accuracy-yellow .ballot-stat-value {
  color: #d97706;
}

.ballot-stat-box.accuracy-green .ballot-stat-value {
  color: #16a34a;
}

/* Ballot Toggle Section */
.ballot-toggle-section {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 8px 16px;
}

.ballot-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.ballot-toggle-group {
  display: flex;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.ballot-toggle-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex: 1;
  text-transform: uppercase;
}

.ballot-toggle-btn:first-child {
  flex: 0.6;
}

.ballot-toggle-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.ballot-toggle-btn.active::before {
  content: '• ';
  font-size: 18px;
  margin-right: 4px;
}

/* Ballot Categories List */
.ballot-categories {
  padding: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  touch-action: pan-y;
  position: relative;
}

.ballot-categories::-webkit-scrollbar {
  width: 10px;
}

.ballot-categories::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
  margin: 4px 0;
}

.ballot-categories::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
  border: 2px solid #f1f5f9;
}

.ballot-categories::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Individual Category */
.ballot-category {
  background: white;
  margin: 8px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  border-left: 4px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}

.ballot-category.correct {
  border-left-color: #10b981;
  background: linear-gradient(to right, #f0fdf4 0%, white 100%);
}

.ballot-category.incorrect {
  border-left-color: #ef4444;
  background: linear-gradient(to right, #fef2f2 0%, white 100%);
}

.ballot-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ballot-prediction-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.ballot-prediction-indicator.empty {
  background: transparent;
  border: 2px solid #cbd5e1;
}

.ballot-category.correct .ballot-prediction-indicator {
  background: #10b981;
  color: white;
}

.ballot-category.incorrect .ballot-prediction-indicator {
  background: #ef4444;
  color: white;
}

.ballot-category-name {
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.ballot-category-prediction {
  font-size: 21px;
  font-weight: 600;
  color: #1e293b;
  padding-left: 34px;
  line-height: 1.3;
}

.ballot-actual-winner {
  margin-top: 6px;
  padding-left: 34px;
  padding-top: 6px;
  border-top: 1px dashed #fca5a5;
  font-size: 21px;
  font-weight: 400;
  font-style: italic;
  color: #991b1b;
  line-height: 1.3;
}

.ballot-actual-winner::before {
  content: 'Actual: ';
  font-weight: 400;
}

/* TIE HANDLING: Updated tie winner display in ballot */
.ballot-actual-winner.tie {
  border-top-color: rgba(147, 51, 234, 0.3);
  color: #6b21a8;
}

.ballot-actual-winner.tie::before {
  content: 'Actual (TIE): ';
  font-weight: 700;
}

/* ============================================================================
   PRIZE DISPLAY
   ============================================================================ */
.ballot-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: fit-content;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-medium);
  white-space: nowrap;
}

.filter-toggle {
  display: flex;
  background: #e5e7eb;
  border-radius: 20px;
  padding: 4px;
  gap: 4px;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  border-radius: 16px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--primary-red);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(188, 75, 81, 0.3);
}

.filter-btn:hover:not(.active) {
  color: #374151;
  background: rgba(0, 0, 0, 0.05);
}

.accuracy-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #dcfce7;
  border: 2px solid #86efac;
  white-space: nowrap;
}

.accuracy-badge.poor {
  background: #fee2e2;
  border-color: #fca5a5;
}

.accuracy-badge-icon {
  font-size: 18px;
  font-weight: 700;
}

.accuracy-badge.good .accuracy-badge-icon {
  color: #15803d;
}

.accuracy-badge.poor .accuracy-badge-icon {
  color: #dc2626;
}

.accuracy-badge-label {
  font-size: 16px;
  font-weight: 600;
  color: #15803d;
}

.accuracy-badge.poor .accuracy-badge-label {
  color: #dc2626;
}

.raffle-tickets-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #fef3cd;
  border: 2px solid #fde68a;
  white-space: nowrap;
}

.raffle-tickets-icon {
  font-size: 18px;
}

.raffle-tickets-label {
  font-size: 16px;
  font-weight: 600;
  color: #92400e;
}

.prediction-indicator {
  font-size: 20px;
  margin-right: 6px;
  font-weight: bold;
  display: inline-block;
}

.category-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.category-prediction {
  font-size: 20px;
  color: var(--text-dark);
  font-weight: 500;
}

.actual-winner {
  font-size: 17px;
  color: var(--text-medium);
  margin-top: 6px;
  font-style: italic;
}

.actual-winner::before {
  content: '➤ Actual: ';
  font-weight: 600;
  font-size: 17px;
}

.prize-section {
  background: var(--gradient-gold-light);
  border: 2px solid var(--warning-amber);
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 18px;
  position: relative;
}

.prize-icon-display {
  position: absolute;
  top: -12px;
  right: 16px;
  font-size: 26px;
  background: var(--white);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.prize-title {
  font-size: 17px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.prize-note {
  font-size: 18px;
  color: #78350f;
  line-height: 1.4;
  margin-bottom: 10px;
}

.tie-message {
  font-size: 17px;
  color: #92400e;
  font-style: italic;
  border-top: 1px solid rgba(146, 64, 14, 0.2);
  padding-top: 10px;
}

.default-prize-message {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  margin: 16px 0;
  padding: 14px;
  font-size: 17px;
  color: var(--text-medium);
  text-align: center;
  font-style: italic;
}

/* ============================================================================
   LOADING & ERROR STATES
   ============================================================================ */
.ballot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 20px;
  color: var(--text-medium);
  font-size: 22px;
  font-weight: 600;
}

.ballot-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--border-gray);
  border-top-color: var(--primary-gold);
  border-radius: 50%;
  animation: ballotSpin 0.8s linear infinite;
}

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

.ballot-error {
  padding: 20px;
  text-align: center;
  color: var(--error-red);
  font-size: 16px;
}

.retry-button {
  background: var(--primary-red);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  margin: 10px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease;
}

.retry-button:hover {
  background: #a04147;
  transform: translate3d(0, -1px, 0);
}

.retry-button:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

/* ============================================================================
   TOAST NOTIFICATION
   ============================================================================ */
.toast-notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-red);
  color: var(--white);
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: bottom 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  min-width: 400px;
  text-align: center;
}

.toast-notification.show {
  bottom: 20px;
  opacity: 1;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
  }
  50% {
    box-shadow: 0 0 20px rgba(220, 165, 74, 0.5);
  }
}

#regularCards {
  contain: layout style paint;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.header {
  text-align: center;
  margin-bottom: 0;
  position: relative;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-bottom: 16px;
}

.header-main-container {
  display: flex;
  align-items: stretch;
  gap: 20px;
  flex: 1;
  max-width: 100%;
  background: linear-gradient(to right, #fffcf1 0%, #fff8e7 100%);
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.main-logo {
  height: 100%;
  max-height: 190px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header-right-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.header-text {
  text-align: right;
  line-height: 1;
}

/* Desktop: Display as "Oscar Night" / "Results" (2 lines) */
.header-line {
  font-size: 44px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1;
  color: var(--text-dark);
}

.header-line:nth-child(1)::after {
  content: " Night";
}

.header-line:nth-child(2) {
  display: none;
}

.header-line:nth-child(3) {
  color: var(--primary-red);
  margin-top: 4px;
}

.header-refresh {
  margin-top: 8px;
}

.header-refresh .refresh-btn {
  margin-top: 0;
  padding: 8px 16px;
  font-size: 15px;
}

/* ============================================================================
   TOGGLE SWITCH
   ============================================================================ */
.toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.toggle-switch {
  display: flex;
  background-color: var(--primary-gold);
  border-radius: var(--radius-md);
  padding: 3px;
  width: 100%;
  max-width: clamp(350px, 90vw, 440px);
}

.toggle-option {
  flex: 1;
  padding: clamp(12px, 2.5vw, 16px) clamp(8px, 1.5vw, 14px);
  text-align: center;
  color: #333;
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  background-color: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: clamp(-0.5px, 0.02vw, 0px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: all 0.2s ease-in-out;
}

.toggle-option:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

.toggle-option.active {
  background-color: var(--primary-red);
  color: var(--background);
  font-weight: bold;
  box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
}

.toggle-option.active::before {
  content: '● ';
  font-size: clamp(11px, 1.8vw, 14px);
  margin-right: clamp(3px, 0.8vw, 6px);
  line-height: 1;
  vertical-align: middle;
}

/* ============================================================================
   SEARCH (Hidden on Current Design)
   ============================================================================ */
.search-container {
  display: none;
}

.search-input-wrapper {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: var(--font-lg);
  border: 2px solid var(--border-gray);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(220, 165, 74, 0.1);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  display: none;
  font-size: var(--font-xl);
  line-height: 1;
}

.search-clear.show {
  display: block;
}

.search-clear:hover {
  color: var(--text-medium);
}

/* ============================================================================
   NO RESULTS & ERROR MESSAGES
   ============================================================================ */
.no-results-message {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  border: 1px solid var(--border-light);
}

.no-results-message h3 {
  color: var(--text-dark);
  font-size: var(--font-xl);
  margin-bottom: 8px;
}

.no-results-message p {
  color: var(--text-medium);
  font-size: var(--font-base);
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  font-size: var(--font-lg);
  color: #dc2626;
  background-color: #fee2e2;
  border-radius: var(--radius-md);
  margin: 20px 0;
  display: none;
}

.loading-message {
  text-align: center;
  padding: 40px 20px;
  font-size: var(--font-lg);
  color: var(--text-medium);
}

/* ============================================================================
   RIPPLE EFFECT
   ============================================================================ */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(220, 165, 74, 0.4);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================================
   PROCESSING OVERLAY
   ============================================================================ */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 252, 241, 0.85);
  backdrop-filter: blur(3px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}

.processing-overlay.show {
  display: flex;
}

.processing-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(220, 165, 74, 0.2);
  border-top-color: var(--primary-gold);
  border-radius: 50%;
  animation: simpleRotate 0.6s linear infinite;
}

/* ============================================================================
   SCROLL INDICATOR
   ============================================================================ */
.scroll-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #2563eb;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  font-weight: 900;
  z-index: 1000;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translateZ(0);
  will-change: transform;
}

.scroll-indicator.show {
  display: flex;
  animation: scrollAppear 1s ease-out forwards, pulseBeat 2s ease-in-out 1s infinite;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #2563eb;
  animation: rippleOut 2s ease-out infinite;
}

@keyframes scrollAppear {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  70% {
    opacity: 0.6;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseBeat {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.6);
  }
}

@keyframes rippleOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ============================================================================
   BACK TO TOP BUTTONS
   ============================================================================ */
.back-to-top-dynamic {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 1001;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.back-to-top-dynamic.show {
  display: flex;
}

.back-to-top-dynamic:hover {
  background: #1d4ed8;
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.back-to-top-dynamic:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

.back-to-top-dynamic .arrow {
  font-size: 20px;
  font-weight: 800;
}

.back-to-top-container {
  display: flex;
  justify-content: center;
  padding: 40px 20px 30px 20px;
}

.back-to-top-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.back-to-top-btn:hover {
  background: #1d4ed8;
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.back-to-top-btn:active {
  transform: translate3d(0, 0, 0) scale(0.97);
}

.back-to-top-btn .arrow {
  font-size: 24px;
  font-weight: 800;
}

/* ============================================================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ============================================================================ */

/* Desktop header size adjustment - smaller on desktop only */
@media (min-width: 769px) {
  .title-main {
    font-size: clamp(28px, 6.5vw, 42px);
  }
  
  .title-subtitle {
    font-size: clamp(22px, 5.5vw, 34px);
  }
  
  .lock-title-main {
    font-size: clamp(28px, 6.5vw, 42px);
  }
  
  .lock-title-subtitle {
    font-size: clamp(22px, 5.5vw, 34px);
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  body {
    font-size: 20px;
    padding: 4px;
  }
  
  #mainApp {
    padding: 4px;
  }
  
  .header-top {
    flex-direction: column;
    gap: 0;
  }
  
  .header-main-container {
    width: 100%;
    gap: 16px;
    padding: 8px 12px;
  }
  
  .main-logo {
    max-height: 150px;
  }
  
  /* MOBILE HEADER: 3-line tight stack */
  .header-text {
    line-height: 0.85;
  }
  
  .header-line {
    font-size: 36px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dark);
  }
  
  .header-line:nth-child(1)::after {
    content: none;
  }
  
  .header-line:nth-child(2) {
    display: block;
  }
  
  .header-line:nth-child(3) {
    color: var(--primary-red);
    font-weight: 900;
    margin-top: 0;
  }
  
  .header-refresh .refresh-btn {
    padding: 7px 14px;
    font-size: 14px;
  }
  
  .lock-logo {
    max-width: 310px;
  }
  
  .lock-title {
    font-size: 26px;
  }
  
  .lock-message {
    font-size: 18px;
  }
  
  .back-to-top-dynamic {
    top: 10px;
    right: 10px;
    padding: 10px 20px;
    font-size: 15px;
  }
  
  .back-to-top-dynamic .arrow {
    font-size: 18px;
    font-weight: 800;
  }
  
  .ballot-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .filter-row {
    flex-direction: column;
    width: 100%;
  }
  
  .filter-toggle {
    width: 100%;
  }
  
  .filter-btn {
    flex: 1;
  }
  
  .info-row {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }
  
  .accuracy-badge,
  .raffle-tickets-badge {
    width: 100%;
    justify-content: center;
  }
  
  .section-header {
    font-size: 22px;
  }
  
  .leaderboard-icon {
    font-size: 22px;
  }
  
  .card-main {
    padding: 0;
    gap: 0;
  }
  
  .contestant-name {
    font-size: 24px;
  }
  
  .contestant-location {
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .contestant-card {
    margin-bottom: 0px;
  }
  
  .points-num {
    font-size: 30px;
  }
  
  .rank-num {
    font-size: 36px;
  }
  
  .points-section {
    min-width: 62px;
    padding: 12px 10px;
  }
  
  .rank-section {
    min-width: 62px;
    padding: 8px 10px;
  }
  
  .rank-num.icon {
    font-size: 30px;
    height: 36px;
  }
  
  .rank-num.icon-only {
    font-size: 26px;
    margin-top: 0;
    height: 100%;
  }
  
  .points-label,
  .rank-label {
    font-size: 14px;
  }
  
  .middle-section {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  
  .filter-label {
    font-size: 17px;
  }
  
  .category-name {
    font-size: 18px;
  }
  
  .category-prediction {
    font-size: 18px;
  }
  
  .prediction-indicator {
    font-size: 18px;
  }
  
  .actual-winner {
    font-size: 16px;
  }
  
  .actual-winner::before {
    font-size: 16px;
  }
  
  .prize-title {
    font-size: var(--font-lg);
  }
  
  .prize-note {
    font-size: 17px;
  }
  
  .tie-message {
    font-size: 16px;
  }
  
  .default-prize-message {
    font-size: 16px;
  }
  
  .dashboard-content {
    padding: 10px 16px 16px 16px;
  }
  
  .stat-number {
    font-size: 36px;
  }
  
  .stat-label {
    font-size: 18px;
  }
  
  .filter-hint {
    font-size: 16px;
  }
  
  .progress-label {
    font-size: 18px;
  }
  
  .progress-values {
    font-size: 19px;
  }
  
  .latest-update-category {
    font-size: 20px;
  }
  
  .latest-update-winner {
    font-size: 18px;
  }
  
  .latest-update-accuracy-main {
    font-size: 18px;
  }
  
  .latest-update-accuracy-detail {
    font-size: 18px;
  }
  
  .toast-notification {
    min-width: 300px;
    max-width: 90vw;
  }
  
  .raffle-tickets-display {
    font-size: 16px;
  }
  
  .raffle-card.drawn .raffle-status-text {
    font-size: 20px;
  }
  
  .raffle-message {
    font-size: 16px;
  }
  
  .jury-card.announced .jury-status-text {
    font-size: 28px;
  }
  
  .jury-message {
    font-size: 16px;
  }
  
  .jury-stats {
    font-size: 18px;
  }
  
  .jury-trophy {
    font-size: 24px;
  }
  
  .buttons-section {
    padding: 0 4px;
  }
  
  .cash-pot {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .cash-pot .icon {
    font-size: 28px;
  }
  
  .cash-pot .label {
    font-size: 16px;
  }
  
  .cash-pot .amount {
    font-size: 28px;
  }
  
  .ballot-stat-label {
    font-size: 14px;
  }
  
  .ballot-stat-value {
    font-size: 16px;
  }
  
  .ballot-toggle-label {
    font-size: 14px;
  }
  
  .ballot-toggle-btn {
    font-size: 15px;
    padding: 8px 12px;
  }
  
  .ballot-toggle-btn:first-child {
    flex: 0.6;
  }
  
  .ballot-category-name {
    font-size: 14px;
  }
  
  .ballot-category-prediction {
    font-size: 18px;
  }
  
  .ballot-actual-winner {
    font-size: 18px;
  }
  
  .rank-movement-compact {
    font-size: 16px;
    padding: 6px 12px;
    gap: 4px;
  }
  
  .rank-movement-compact .arrow {
    font-size: 20px;
  }
  
  .filter-active-banner {
    padding: 10px 12px;
  }
  
  .filter-banner-text {
    font-size: 15px;
  }
  
  .filter-banner-clear {
    font-size: 15px;
  }
  
  .filter-banner-icon {
    font-size: 17px;
  }
  
  .prize-icon {
    font-size: 22px;
    line-height: 0.9;
    vertical-align: middle;
  }
  
  .loading-content {
    padding: 15px 10px;
  }
  
  .loading-header {
    margin-bottom: 20px;
    color: #9ca3af;
  }
  
  .loading-screen-message {
    margin-bottom: 25px;
    font-size: clamp(34px, 6vw, 58px);
  }
  
  .loading-spinner-wrapper {
    width: 140px;
    height: 140px;
    margin-bottom: 22px;
  }
  
  .spinner-icon {
    font-size: 70px;
  }
  
  .loading-submessage {
    margin-bottom: 12px;
  }
  
  .loading-progress {
    max-width: 320px;
    height: 6px;
  }
  
  .lock-icon-container {
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
  }
  
  .lock-icon {
    font-size: 80px;
  }
  
  .lock-title {
    font-size: 26px;
  }
  
  #loadingScreen {
    padding-top: calc(35vh - 150px);
  }
  
  .tie-badge {
    font-size: 13px;
    padding: 3px 8px;
  }
  
  .tie-badge-icon {
    font-size: 14px;
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .main-logo {
    max-height: 120px;
  }
  
  .header-line {
    font-size: 24px;
  }
  
  .header-refresh .refresh-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    padding: 12px;
  }
}

/* Large desktop adjustments */
@media (min-width: 1441px) {
  #mainApp {
    padding: 16px;
  }
}