@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&family=Courier+Prime&display=swap');

:root {
  --crt-green: #00FF41;
  --crt-cyan: #00D9FF;
  --crt-gold: #FFD700;
  --crt-magenta: #FF00FF;
  --crt-orange: #FF6B35;
}

/* Dark background overridee */
body {
  background: #000;
  color: var(--crt-green);
  font-family: 'VT323', 'Share Tech Mono', 'Courier Prime', 'Courier New', monospace;
  filter: brightness(1.10);
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
  border-radius: 15px;
}

/* Screen vignette with enhanced bezel - brighter */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%),
    linear-gradient(45deg, transparent 0%, rgba(0,255,65,0.03) 50%, transparent 100%);
  pointer-events: none;
  z-index: 10;
  border: 8px solid #1a1a1a;
  border-radius: 15px;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.5);
}

/* CRT Scanline overlay - VISIBLE */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 65, 0.08) 0px,
    rgba(0, 255, 65, 0.08) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 12;
  mix-blend-mode: screen;
  animation: subtle-flicker 0.2s steps(1, end) infinite;
}

@keyframes subtle-flicker {
  0% { opacity: 0.98; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

/* Phosphor glow overlay with CRT noise */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(0, 255, 65, 0.08) 0%,
      rgba(0, 255, 65, 0.04) 45%,
      rgba(0, 255, 65, 0.00) 70%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

/* Hide CRT effects during boot */
body.boot-mode::before,
body.boot-mode::after {
  opacity: 0;
}

body.boot-mode .corner-reticle {
  opacity: 0;
}

/* FULL-SCREEN STATIC NOISE - TV TUNING EFFECT */
.static-full {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      #000 0px,
      #000 2px,
      #0d0d0d 2px,
      #0d0d0d 4px
    ),
    repeating-linear-gradient(
      90deg,
      #000 0px,
      #000 2px,
      #0d0d0d 2px,
      #0d0d0d 4px
    );
  mix-blend-mode: screen;
  animation:
    staticOn 1.2s steps(4, end) forwards,
    noiseShift 0.12s steps(4, end) infinite;
}

@keyframes staticOn {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 0.95;
  }
  50% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}

@keyframes noiseShift {
  0% {
    background-position: 0 0, 0 0;
  }
  25% {
    background-position: 10px -5px, -8px 6px;
  }
  50% {
    background-position: -5px 10px, 6px -10px;
  }
  75% {
    background-position: 5px 5px, -4px -6px;
  }
  100% {
    background-position: 0 0, 0 0;
  }
}

/* Boot sequence */
.boot-sequence {
  position: fixed;
  top: 30vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  text-align: left;
  font-size: 0.9rem;
  opacity: 1;
  pointer-events: none;
}

.boot-sequence.hidden {
  animation: fade-out 0.5s ease-out forwards;
}

@keyframes fade-out {
  to { opacity: 0; }
}

.boot-line {
  color: var(--crt-green);
  text-shadow: 0 0 5px var(--crt-green);
  margin: 5px 0;
  opacity: 0;
}

/* Text buzz effect - RGB separation */
.content {
  position: relative;
}

.content.buzz h1::before,
.content.buzz .section-title::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: rgba(255, 0, 100, 0.8);
  filter: blur(1px);
  z-index: -1;
  animation: buzz-red-intense 40ms linear;
}

.content.buzz h1::after,
.content.buzz .section-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: rgba(0, 255, 200, 0.8);
  filter: blur(1px);
  z-index: -1;
  animation: buzz-cyan-intense 40ms linear;
}

@keyframes buzz-red-intense {
  0% { transform: translateX(-1px) translateY(0); }
  25% { transform: translateX(-1.5px) translateY(-0.3px); }
  50% { transform: translateX(-1.2px) translateY(0.3px); }
  75% { transform: translateX(-1.8px) translateY(0); }
  100% { transform: translateX(-1px) translateY(-0.3px); }
}

@keyframes buzz-cyan-intense {
  0% { transform: translateX(1px) translateY(0); }
  25% { transform: translateX(1.5px) translateY(0.3px); }
  50% { transform: translateX(1.2px) translateY(-0.3px); }
  75% { transform: translateX(1.8px) translateY(0); }
  100% { transform: translateX(1px) translateY(0.3px); }
}

/* Screen flicker */
.content.flicker {
  animation: screen-flicker 0.3s ease-out;
}

body.crt-flicker .content {
  animation: screen-flicker 0.3s ease-out;
}

@keyframes screen-flicker {
  0% { opacity: 1; }
  5% { opacity: 0.88; }
  10% { opacity: 1; }
  15% { opacity: 0.92; }
  20% { opacity: 1; }
  100% { opacity: 1; }
}

/* Corner reticles */
.corner-reticle {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 2px solid var(--crt-orange);
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  animation: reticle-appear 0.5s ease-out 3s forwards;
  /* Account for CRT border offset */
  transform: translateZ(0);
}

@keyframes reticle-appear {
  to { opacity: 1; }
}

.corner-reticle.tl {
  top: 8px; /* Match CRT border offset */
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.corner-reticle.tr {
  top: 8px; /* Match CRT border offset */
  right: 8px;
  border-left: none;
  border-bottom: none;
}

.corner-reticle.bl {
  bottom: 8px; /* Match CRT border offset */
  left: 8px;
  border-right: none;
  border-top: none;
}

.corner-reticle.br {
  bottom: 8px; /* Match CRT border offset */
  right: 8px;
  border-left: none;
  border-top: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .scanlines,
  .content.buzz h1::before,
  .content.buzz h1::after,
  .content.buzz .section-title::before,
  .content.buzz .section-title::after,
  .content.flicker,
  body.crt-flicker .content {
    animation: none !important;
  }
  
  body::before {
    animation: none !important;
  }
}

/* RESPONSIVE LAYOUT STYLES */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  width: 100%;
  max-width: 1400px;
}

.top-bar-left { display: flex; gap: 12px; flex-wrap: wrap; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }

.btn {
  background: rgba(0, 255, 65, 0.1);
  border: 2px solid var(--crt-green);
  color: var(--crt-green);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 5px var(--crt-green);
}

.btn:hover {
  background: rgba(0, 255, 65, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.2), 0 0 20px rgba(0, 255, 65, 0.5);
}

/* Video Promo Button - Cyan accent */
.btn-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: rgba(0, 217, 255, 0.1);
  border-color: var(--crt-cyan);
  color: var(--crt-cyan);
  text-shadow: 0 0 5px var(--crt-cyan);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-video:hover {
  background: rgba(0, 217, 255, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 217, 255, 0.2), 0 0 20px rgba(0, 217, 255, 0.5);
  color: var(--crt-cyan);
}

.btn-video .video-icon {
  flex-shrink: 0;
}

/* Toggle Switch for Reduce Glow */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: all 0.3s ease;
  font-family: 'VT323', 'Share Tech Mono', 'Courier Prime', 'Courier New', monospace;
}

.toggle-switch:hover {
  background: transparent;
}

.toggle-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  width: 44px;
  height: 22px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--crt-green);
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
  flex-shrink: 0;
}

.toggle-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--crt-green);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px var(--crt-green);
}

.toggle-switch input[type="checkbox"]:checked {
  background: rgba(0, 255, 65, 0.3);
}

.toggle-switch input[type="checkbox"]:checked::before {
  left: 24px;
  box-shadow: 0 0 12px var(--crt-green);
}

.toggle-label {
  color: var(--crt-green);
  font-size: 1.15rem;
  font-weight: 600;
  text-shadow: none;
}

.toggle-slider {
  display: none;
}

.refresh-timer {
  font-size: 0.85rem;
  color: var(--crt-green);
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 65, 0.3);
}

header {
  text-align: center;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

/* CRT Logo */
.logo-container {
  text-align: center;
  margin-bottom: 0;
  padding: 0;
}

.logo-container a {
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logo-container a:hover .crt-logo {
  filter:
    drop-shadow(0 0 12px rgba(0, 255, 65, 1))
    drop-shadow(0 0 20px rgba(0, 255, 65, 0.8))
    drop-shadow(0 0 28px rgba(0, 255, 65, 0.5))
    brightness(1.3)
    saturate(1.2);
  transform: scale(1.02);
}

.crt-logo {
  width: 250px;
  height: auto;
  max-width: 100%;
  filter:
    drop-shadow(0 0 10px rgba(0, 255, 65, 0.8))
    drop-shadow(0 0 20px rgba(0, 255, 65, 0.4))
    brightness(1.1)
    contrast(1.2);
  animation: subtle-pulse 6s ease-in-out infinite;
  display: block;
  margin: 0 auto;
  transition: all 0.3s ease;
  /* Enhanced glow effects for transparent PNG */
  filter:
    drop-shadow(0 0 8px rgba(0, 255, 65, 0.9))
    drop-shadow(0 0 16px rgba(0, 255, 65, 0.6))
    drop-shadow(0 0 24px rgba(0, 255, 65, 0.3))
    brightness(1.2)
    saturate(1.1);
}

@keyframes subtle-pulse {
  0%, 100% { 
    filter: 
      drop-shadow(0 0 8px rgba(0, 255, 65, 0.9))
      drop-shadow(0 0 16px rgba(0, 255, 65, 0.6))
      drop-shadow(0 0 24px rgba(0, 255, 65, 0.3))
      brightness(1.2)
      saturate(1.1);
  }
  50% { 
    filter: 
      drop-shadow(0 0 12px rgba(0, 255, 65, 1))
      drop-shadow(0 0 20px rgba(0, 255, 65, 0.8))
      drop-shadow(0 0 32px rgba(0, 255, 65, 0.4))
      brightness(1.3)
      saturate(1.2);
  }
}

.ascii-title {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--crt-green);
  font-family: 'VT323', monospace;
  text-shadow: 0 0 10px var(--crt-green);
  line-height: 1.2;
  letter-spacing: 2px;
  margin: 4px auto 6px auto;
}

/* INTENSE glitch on title - NO BLUR, just RGB jitter */
h1::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: rgba(255, 0, 100, 0.5);
  z-index: -1;
  pointer-events: none;
  animation: buzz-red-intense 40ms linear infinite;
}

h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: rgba(0, 255, 200, 0.5);
  z-index: -1;
  pointer-events: none;
  animation: buzz-cyan-intense 40ms linear infinite;
}

.subtitle {
  color: var(--crt-cyan);
  font-size: 1.3rem;
  text-shadow: 0 0 8px var(--crt-cyan);
  font-family: 'VT323', monospace;
}

.search-bar {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 1400px;
  text-align: center;
}

.search-bar input {
  width: 100%;
  max-width: 500px;
  padding: 10px 16px;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--crt-green);
  border-radius: 0;
  color: var(--crt-green);
  outline: none;
  display: block;
  margin: 0 auto;
  text-shadow: 0 0 5px var(--crt-green);
}

.search-bar input::placeholder {
  color: rgba(0, 255, 65, 0.5);
}

.search-bar input:focus {
  box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.2), 0 0 20px rgba(0, 255, 65, 0.5);
}

.search-hint {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(0, 255, 65, 0.6);
  font-family: 'VT323', monospace;
  margin-top: 0.25rem;
  text-shadow: 0 0 3px rgba(0, 255, 65, 0.4);
  opacity: 0.85;
  font-style: italic;
}

.info-btn {
  background: rgba(0, 217, 255, 0.1);
  border: 2px solid var(--crt-cyan);
  color: var(--crt-cyan);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-family: 'VT323', monospace;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 5px var(--crt-cyan);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.info-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  box-shadow: inset 0 0 15px rgba(0, 217, 255, 0.2), 0 0 15px rgba(0, 217, 255, 0.5);
}

nav {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 1400px;
}

nav button {
  background: rgba(0, 255, 65, 0.1);
  border: 2px solid var(--crt-green);
  color: var(--crt-green);
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 8px var(--crt-green);
}

nav button:hover {
  background: rgba(0, 255, 65, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.2), 0 0 20px rgba(0, 255, 65, 0.5);
}

nav button[aria-selected="true"] {
  background: rgba(0, 255, 65, 0.25);
  box-shadow: inset 0 0 25px rgba(0, 255, 65, 0.3), 0 0 25px rgba(0, 255, 65, 0.7);
}

/* Leaderboard Wrapper - contains controls and board */
.leaderboard-wrapper {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--crt-green);
  box-shadow: inset 0 0 40px rgba(0, 255, 65, 0.15), 0 0 30px rgba(0, 255, 65, 0.4);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  position: relative;
  overflow: hidden;
}


/* Controls bar inside leaderboard */
.leaderboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid var(--crt-green);
  gap: 1rem;
  flex-shrink: 0;
}

.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  width: auto;
  max-width: none;
}

.leaderboard-tabs button {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.leaderboard-search {
  flex-shrink: 0;
}

.leaderboard-search input {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--crt-green);
  color: var(--crt-green);
  outline: none;
  width: 200px;
  font-family: 'VT323', monospace;
}

.leaderboard-search input::placeholder {
  color: rgba(0, 255, 65, 0.5);
}

.leaderboard-search input:focus {
  box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.2), 0 0 10px rgba(0, 255, 65, 0.3);
}

/* Team scoring help button - small ? icon */
.team-scoring-help {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  font-weight: bold;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--crt-cyan);
  color: var(--crt-cyan);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
}

.team-scoring-help:hover {
  background: rgba(0, 217, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* ============================================
   MAIN LAYOUT WITH SIDEBARS
   ============================================ */
.main-layout {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Sidebars - Desktop Only */
.sidebar {
  flex: 0 0 220px;
  max-width: 220px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--crt-green);
  box-shadow:
    0 0 15px rgba(0, 255, 65, 0.2),
    inset 0 0 20px rgba(0, 255, 65, 0.05);
  padding: 0;
}

.sidebar-content {
  padding: 1rem;
}

.sidebar h3 {
  color: var(--crt-gold);
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.3);
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.sidebar p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--crt-green);
  margin: 0 0 0.75rem 0;
  opacity: 0.9;
}

.sidebar-contact {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 255, 65, 0.2);
  font-size: 1rem;
  line-height: 1.6;
}

.sidebar-contact strong {
  color: var(--crt-cyan);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.sidebar-contact .contact-name {
  color: var(--crt-green);
  font-weight: bold;
  font-size: 0.95rem;
}

.sidebar-contact .contact-title {
  color: var(--crt-green);
  opacity: 0.8;
  font-size: 0.9rem;
}

.sidebar-contact a {
  color: var(--crt-cyan);
  text-decoration: none;
  font-size: 0.95rem;
  word-break: break-all;
}

.sidebar-contact a:hover {
  color: var(--crt-gold);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* Sponsor benefits list */
.sponsor-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
}

.sponsor-benefits li {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--crt-green);
  padding: 0.35rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(0, 255, 65, 0.3);
  margin-bottom: 0.35rem;
}

.sponsor-benefits li strong {
  color: var(--crt-cyan);
  display: block;
  font-size: 1rem;
}

/* Get Involved button - hidden on desktop, shown on mobile */
.btn-get-involved {
  display: none;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.board {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  box-shadow: none;
  position: relative;
  min-height: 200px;
  width: 100%;
  margin: 0;

  /* Scroll performance optimizations */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  contain: layout style paint;
  transform: translateZ(0);
  will-change: scroll-position;
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(0,255,65,0.02) 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* Classified text moved to .leaderboard-wrapper::before */

.board {
  scrollbar-width: thin;
  scrollbar-color: #00FF41 rgba(0, 255, 65, 0.15);
}

.board::-webkit-scrollbar { 
  width: 12px; 
}

.board::-webkit-scrollbar-track { 
  background: rgba(0, 255, 65, 0.06); 
  box-shadow: inset 0 0 6px rgba(0, 255, 65, 0.2);
}

.board::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, #00FF41, #00D96A);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
  border: 2px solid rgba(0, 40, 0, 0.9);
  border-radius: 0;
}

.board::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00FF7A, #00FF41);
  box-shadow: 0 0 14px rgba(0, 255, 65, 1);
}

.header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  background: rgba(0, 0, 0, 0.98);
  border: none;
  border-bottom: 1px solid var(--crt-green);
  margin: 0 0 12px 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--crt-gold);
  text-shadow: 0 0 8px var(--crt-gold);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  width: 100%;
}

.row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-radius: 0;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-left: 3px solid rgba(0, 255, 65, 0.3);
  transition: all 0.3s ease;
  width: 100%;

  /* Scroll performance optimizations */
  contain: layout style;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.row:hover {
  background: rgba(0, 255, 65, 0.05);
  border-color: var(--crt-green);
  border-left-color: var(--crt-green);
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1), 0 0 15px rgba(0, 255, 65, 0.3);
}

.row.rank-1 {
  border-color: #FFFFFF;
  border-left-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.row.rank-2 {
  border-color: #FF3366;
  border-left-color: #FF3366;
  background: rgba(255, 51, 102, 0.05);
}

.row.rank-3 {
  border-color: #FF8C00;
  border-left-color: #FF8C00;
  background: rgba(255, 140, 0, 0.05);
}

.cell.rank {
  width: 80px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--crt-gold);
}

.cell.score {
  width: 120px;
  text-align: right;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--crt-gold);
  text-shadow: 0 0 8px var(--crt-gold);
}

.cell.main {
  flex: 1;
  min-width: 0;
  width: auto;
  overflow: visible;
}

.username, .team-name {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--crt-green);
  transition: color 0.3s ease;
  text-shadow: 0 0 5px var(--crt-green);
  position: relative;
  font-family: 'VT323', monospace;
  overflow: visible;
  display: inline-block;
}

@keyframes buzz-red-subtle {
  0%, 100% { transform: translateX(-0.15px); }
  50% { transform: translateX(-0.3px); }
}

@keyframes buzz-cyan-subtle {
  0%, 100% { transform: translateX(0.15px); }
  50% { transform: translateX(0.3px); }
}

h1 {
  position: relative;
}

h1::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: rgba(255, 0, 100, 0.3);
  filter: blur(0.3px);
  z-index: -1;
  animation: buzz-red-subtle 80ms infinite;
  pointer-events: none;
}

h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: rgba(0, 255, 200, 0.3);
  filter: blur(0.3px);
  z-index: -1;
  animation: buzz-cyan-subtle 80ms infinite;
  pointer-events: none;
}

.username:hover, .team-name:hover {
  color: var(--crt-green);
  text-shadow: 0 0 10px var(--crt-green);
}

.ellipsis {
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  /* Scroll performance optimizations */
  contain: layout style;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.username-text {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.badges-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Apply buzz effect to username-text ONLY on hover */
.username:hover .username-text::before, .team-name:hover .username-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  color: rgba(255,0,100,0.3);
  filter: none;
  z-index: -1;
  animation: buzz-red-intense 30ms infinite;
  pointer-events: none;
  white-space: nowrap;
}

.username:hover .username-text::after, .team-name:hover .username-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  color: rgba(0,255,200,0.3);
  filter: none;
  z-index: -1;
  animation: buzz-cyan-intense 30ms infinite;
  pointer-events: none;
  white-space: nowrap;
}

.team-info {
  color: rgba(0, 255, 65, 0.6);
  font-size: 0.85rem;
  margin-top: 4px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0 1rem 1rem 1rem;
}

/* Last row bottom margin for better scroll visibility */
.row:last-child {
  margin-bottom: 80px;
}

#panel-students, #panel-teams {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

#students-board, #teams-board {
  width: 100%;
  max-width: 1000px;
}

#hover-card {
  position: absolute;
  z-index: 9999;
  background: rgba(0, 20, 10, 0.98);
  color: var(--crt-green);
  border: 1px solid var(--crt-green);
  padding: 10px 12px;
  max-width: 300px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
  line-height: 1.4;
  font-size: 0.8rem;
}

#hover-card strong {
  color: var(--crt-gold);
}

#hover-card a {
  color: var(--crt-cyan);
  text-decoration: none;
}

#hover-card a:hover {
  text-shadow: 0 0 8px var(--crt-cyan);
}

#hover-card > div {
  margin-bottom: 4px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at center, rgba(0, 40, 20, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 65, 0.02) 0px,
      rgba(0, 255, 65, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.3s ease-out;
  backdrop-filter: blur(4px);
  padding: 2rem;
  box-sizing: border-box;
}

.modal {
  background:
    linear-gradient(135deg, rgba(0, 30, 15, 0.98) 0%, rgba(0, 20, 10, 0.98) 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      rgba(0, 255, 65, 0.03) 1px,
      transparent 2px
    );

  /* border less intense */
  border: 1px solid rgba(0, 255, 65, 0.6);
  border-radius: 0;

  padding: 2rem;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;

  /* glow reduced (removed huge halo, lowered blur + alpha) */
  box-shadow:
    inset 0 0 12px rgba(0, 255, 65, 0.06),
    0 0 18px rgba(0, 255, 65, 0.35);

  position: relative;
  color: var(--crt-green);
  font-family: 'VT323', monospace;
  animation: modal-slide-in 0.4s ease-out forwards;
  margin: auto;

  /* Scroll performance optimizations */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #00FF41 rgba(0, 255, 65, 0.15);
}

/* .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at center, rgba(0, 40, 20, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 65, 0.02) 0px,
      rgba(0, 255, 65, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.3s ease-out;
  backdrop-filter: blur(4px);
  padding: 2rem;
  box-sizing: border-box;
}

.modal {
  background:
    linear-gradient(135deg, rgba(0, 30, 15, 0.98) 0%, rgba(0, 20, 10, 0.98) 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      rgba(0, 255, 65, 0.03) 1px,
      transparent 2px
    );
  border: 3px solid var(--crt-green);
  border-radius: 0;
  padding: 2rem;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    inset 0 0 30px rgba(0, 255, 65, 0.1),
    0 0 50px rgba(0, 255, 65, 0.6),
    0 0 100px rgba(0, 255, 65, 0.3);
  position: relative;
  color: var(--crt-green);
  font-family: 'VT323', monospace;
  animation: modal-slide-in 0.4s ease-out forwards;
  margin: auto;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #00FF41 rgba(0, 255, 65, 0.15);
} */

/* Scrollbar styling moved to main .modal rule */

.modal::-webkit-scrollbar { 
  width: 12px; 
}

.modal::-webkit-scrollbar-track { 
  background: rgba(0, 255, 65, 0.06); 
  box-shadow: inset 0 0 6px rgba(0, 255, 65, 0.2);
}

.modal::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, #00FF41, #00D96A);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
  border: 2px solid rgba(0, 40, 0, 0.9);
  border-radius: 0;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00FF7A, #00FF41);
  box-shadow: 0 0 14px rgba(0, 255, 65, 1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 0, 0, 0.15);
  border: 2px solid #ff4444;
  color: #ff4444;
  width: 40px;
  height: 40px;
  border-radius: 0;
  cursor: pointer;
  font-size: 1.4rem;
  font-family: 'VT323', monospace;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-shadow: 0 0 8px #ff4444;
  z-index: 100;
  line-height: 1;
  text-align: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.modal-close:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: #ff6666;
  color: #ff6666;
  box-shadow: 
    0 0 15px rgba(255, 68, 68, 0.8),
    inset 0 0 15px rgba(255, 0, 0, 0.2);
  text-shadow: 0 0 12px #ff6666;
}

.modal h2 {
  color: var(--crt-gold);
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
  padding-right: 80px;
  font-size: 2.2rem;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 4px var(--crt-gold), 0 0 30px var(--crt-gold);
  text-align: center;
  position: relative;
  line-height: 1.2;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.stat-card {
  background: 
    linear-gradient(135deg, rgba(0, 255, 65, 0.08) 0%, rgba(0, 255, 65, 0.03) 100%);
  border: 2px solid rgba(0, 255, 65, 0.4);
  border-radius: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.stat-card:hover {
  border-color: var(--crt-green);
  box-shadow: 
    inset 0 0 25px rgba(0, 255, 65, 0.15),
    0 0 20px rgba(0, 255, 65, 0.3);
}

.stat-value {
  font-size: 2.8rem;
  font-weight: 800;
  font-family: 'VT323', monospace;
  color: var(--crt-gold);
  text-shadow: 0 0 4px var(--crt-gold), 0 0 25px var(--crt-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: rgba(0, 255, 65, 0.8);
  font-size: 1rem;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

.tier-legend {
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.12) 0%, rgba(0, 255, 65, 0.06) 100%);
  border: 3px solid var(--crt-gold);
  border-radius: 0;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow:
    inset 0 0 30px rgba(0, 255, 65, 0.15),
    0 0 20px rgba(255, 215, 0, 0.3);
}

.tier-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.tier-legend-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: 0;
  border: 1px solid rgba(0, 255, 65, 0.3);
  transition: all 0.3s ease;
}

.tier-legend-item:hover {
  border-color: var(--crt-green);
  background: rgba(0, 255, 65, 0.08);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.tier-color {
  width: 40px;
  height: 40px;
  border-radius: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bronze-color {
  background: linear-gradient(135deg, #00FF41 0%, #00D932 100%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(0, 255, 65, 0.6);
}

.silver-color {
  background: linear-gradient(135deg, #00D9FF 0%, #00B8D4 100%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(0, 217, 255, 0.6);
}

.gold-color {
  background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(255, 215, 0, 0.7);
}

.platinum-color {
  background: linear-gradient(135deg, #FF00FF 0%, #B026FF 50%, #FF00FF 100%);
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 0, 255, 0.8);
  animation: platinum-pulse 2s ease-in-out infinite;
}

@keyframes platinum-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 10px rgba(0, 0, 0, 0.5),
      0 0 20px rgba(255, 0, 255, 0.8);
  }
  50% {
    box-shadow:
      inset 0 0 10px rgba(0, 0, 0, 0.5),
      0 0 30px rgba(255, 0, 255, 1);
  }
}

.badge-item {
  background:
    linear-gradient(135deg, rgba(0, 255, 65, 0.08) 0%, rgba(0, 255, 65, 0.03) 100%);
  border: 2px solid rgba(0, 255, 65, 0.3);
  border-radius: 0;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  /* Scroll performance optimizations */
  contain: layout style;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.badge-item:hover {
  border-color: var(--crt-green);
  box-shadow:
    inset 0 0 25px rgba(0, 255, 65, 0.1),
    0 0 15px rgba(0, 255, 65, 0.2);
}

.badge-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal .badge {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  position: relative;
  transform: none !important;
  animation: none !important;
  will-change: auto;
  /* Additional scroll performance optimizations */
  contain: layout style;
  backface-visibility: hidden;
  filter: none !important;
}

.badge-name {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'VT323', monospace;
  color: var(--crt-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 3px var(--crt-gold);
}

.badge-description {
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: rgba(0, 255, 65, 0.9);
  font-family: 'VT323', monospace;
}

.badge-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier {
  background: rgba(0, 255, 65, 0.08);
  padding: 0.8rem 1rem;
  border-radius: 0;
  font-size: 0.9rem;
  font-family: 'VT323', monospace;
  border: 1px solid rgba(0, 255, 65, 0.3);
  display: block;
  transition: all 0.2s ease;
  border-left: 3px solid rgba(0, 255, 65, 0.5);
}

.tier:hover {
  background: rgba(0, 255, 65, 0.12);
  border-left-color: var(--crt-cyan);
}

.tier strong {
  color: var(--crt-cyan);
  text-shadow: 0 0 5px var(--crt-cyan);
}

/* About ScamBusters Modal Styling */
.about-modal h3 {
  color: var(--crt-gold);
  font-size: 1.6rem;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 3px var(--crt-gold);
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 0.5rem;
}

.about-section {
  margin-bottom: 2rem;
  line-height: 1.7;
}

.about-section p {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  color: rgba(0, 255, 65, 0.95);
}

.overview-section {
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.08) 0%, rgba(0, 255, 65, 0.03) 100%);
  border: 2px solid rgba(0, 255, 65, 0.4);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0;
}

.impact-highlight {
  background: rgba(0, 0, 0, 0.5);
  border-left: 4px solid var(--crt-gold);
  padding: 1.2rem;
  margin: 1.5rem 0;
  font-size: 1.15rem;
  line-height: 1.8;
  font-weight: 600;
  text-align: center;
}

.stat-highlight {
  color: var(--crt-gold);
  font-size: 1.3em;
  font-weight: 800;
  text-shadow: 0 0 4px var(--crt-gold), 0 0 20px var(--crt-gold);
  font-family: 'VT323', monospace;
}

.impact-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.impact-list li {
  background: rgba(0, 255, 65, 0.05);
  border-left: 3px solid var(--crt-cyan);
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.impact-list li strong {
  color: var(--crt-gold);
  font-size: 1.2em;
  text-shadow: 0 0 3px var(--crt-gold);
}

.get-involved-section {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.08) 0%, rgba(0, 217, 255, 0.03) 100%);
  border: 2px solid rgba(0, 217, 255, 0.4);
  padding: 1.5rem;
  border-radius: 0;
}

.contact-box {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--crt-cyan);
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
  box-shadow:
    inset 0 0 20px rgba(0, 217, 255, 0.1),
    0 0 20px rgba(0, 217, 255, 0.3);
  line-height: 1.8;
}

.contact-box strong {
  color: var(--crt-gold);
  font-size: 1.2rem;
  text-shadow: 0 0 3px var(--crt-gold);
}

.contact-box a:hover {
  text-shadow: 0 0 15px currentColor;
}

.sponsor-section {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.03) 100%);
  border: 2px solid rgba(255, 215, 0, 0.4);
  padding: 1.5rem;
  border-radius: 0;
}

.sponsor-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.sponsor-list li {
  background: rgba(255, 215, 0, 0.05);
  border-left: 3px solid var(--crt-gold);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  line-height: 1.7;
}

.sponsor-list li strong {
  color: var(--crt-gold);
  font-size: 1.1em;
  text-shadow: 0 0 3px var(--crt-gold);
}

.sponsor-contact {
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--crt-gold);
  box-shadow:
    inset 0 0 20px rgba(255, 215, 0, 0.1),
    0 0 20px rgba(255, 215, 0, 0.3);
}

.i4g-section {
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.06) 0%, rgba(0, 255, 65, 0.02) 100%);
  border: 2px solid rgba(0, 255, 65, 0.3);
  padding: 1.5rem;
  border-radius: 0;
}

.i4g-section a {
  color: var(--crt-cyan);
  text-decoration: none;
  transition: all 0.3s ease;
}

.i4g-section a:hover {
  color: var(--crt-gold);
  text-shadow: 0 0 10px currentColor;
}

.i4g-links {
  text-align: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 65, 0.3);
  font-size: 1.05rem;
}

.i4g-links a {
  color: var(--crt-cyan);
  text-decoration: none;
  transition: all 0.3s ease;
}

.i4g-links a:hover {
  color: var(--crt-gold);
  text-shadow: 0 0 15px var(--crt-gold);
}

/* ASCII Art styling */
.ascii-art {
  text-align: center;
  color: var(--crt-green);
  font-family: 'VT323', monospace;
  font-size: 0.8rem;
  margin: 20px auto;
  text-shadow: 0 0 8px var(--crt-green);
  line-height: 1.2;
  letter-spacing: 1px;
}

/* Terminal prompt styling */
.terminal-prompt {
  text-align: center;
  color: var(--crt-green);
  font-family: 'VT323', monospace;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  margin: 2px auto 8px auto;
  text-shadow: 0 0 8px var(--crt-green);
}

/* Blinking cursor animation */
.cursor {
  animation: blink 1.5s infinite;
  color: var(--crt-green);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes modal-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes modal-slide-in {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Powered By Section */
.powered-by-section {
  margin-top: 3rem;
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid rgba(0, 255, 65, 0.3);
}

.powered-by-header {
  color: var(--crt-green);
  font-family: 'VT323', 'Share Tech Mono', 'Courier Prime', 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin: 0 0 1.5rem 0;
  text-shadow: 0 0 10px var(--crt-green);
}

.powered-by-logos {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
}

.powered-by-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0.5rem;
}

.powered-by-logo-link:hover {
  transform: scale(1.05);
}

.powered-by-logo {
  height: 90px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(0, 255, 65, 0.5));
  transition: all 0.3s ease;
}

.powered-by-logo-link:hover .powered-by-logo {
  filter: brightness(1.3) drop-shadow(0 0 15px rgba(0, 255, 65, 0.8));
}

/* Adjust ZETAlytics logo alignment (middle logo) */
.powered-by-logo-link:nth-child(2) {
  transform: translateY(8px);
}

.powered-by-logo-link:nth-child(2):hover {
  transform: translateY(8px) scale(1.05);
}

/* COMPREHENSIVE RESPONSIVE DESIGN */

/* Tablet Landscape and smaller desktops */
@media screen and (max-width: 1024px) {
  html {
    font-size: 14px;
  }

  .ascii-title {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .terminal-prompt {
    font-size: 1rem;
  }

  .container {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  body {
    padding: 0.75rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .top-bar-left, .top-bar-right {
    justify-content: center;
  }

  /* Hide sidebars on tablet, show Get Involved button */
  .sidebar {
    display: none;
  }

  .main-layout {
    padding: 0;
  }

  .btn-get-involved {
    display: inline-flex;
  }
}

/* Tablet Portrait */
@media screen and (max-width: 768px) {
  html {
    font-size: 12px;
  }

  .crt-logo {
    width: 200px;
  }

  .ascii-title {
    font-size: 1.1rem;
    letter-spacing: 1px;
    margin: 6px auto 8px auto;
  }

  .terminal-prompt {
    font-size: 0.95rem;
    margin: 4px auto 8px auto;
  }

  /* Reduce search/nav on tablet */
  .search-bar input {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  nav button {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .board {
    max-height: 500px;
  }

  body {
    padding: 0.5rem;
  }

  /* Tier legend tablet adjustments */
  .tier-legend {
    padding: 1.5rem;
  }

  .tier-legend-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .badge-icons img {
    width: 28px !important;
    height: 28px !important;
  }
  
  .cell.rank {
    width: 60px;
    font-size: 1rem;
  }
  
  .cell.score {
    width: 100px;
    font-size: 1.1rem;
  }
  
  .username, .team-name {
    font-size: 1.2rem;
  }
  
  .header {
    padding: 10px 12px;
    font-size: 0.75rem;
  }
  
  .row {
    padding: 12px;
    gap: 8px;
  }
  
  nav button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .search-bar input {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* Mobile Landscape */
@media screen and (max-width: 640px) {
  body {
    overflow-y: auto;
  }

  .crt-logo {
    width: 180px;
  }

  .ascii-title {
    font-size: 1rem;
    margin: 6px auto 8px auto;
  }

  .terminal-prompt {
    font-size: 0.9rem;
    margin: 4px auto 8px auto;
  }

  /* Leaderboard wrapper on mobile */
  .leaderboard-wrapper {
    max-height: calc(100vh - 200px);
  }

  .leaderboard-controls {
    flex-direction: column;
    gap: 0.5rem;
    padding: 10px 12px;
  }

  .leaderboard-tabs {
    width: 100%;
    justify-content: center;
  }

  .leaderboard-tabs button {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  .leaderboard-search {
    width: 100%;
  }

  .leaderboard-search input {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .team-scoring-help {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
  }

  .top-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .top-bar-left {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .top-bar-left .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .btn-video {
    justify-content: center;
  }

  .btn-video .video-icon {
    width: 14px;
    height: 14px;
  }

  .toggle-switch {
    flex: 1;
    padding: 8px 10px;
    justify-content: center;
  }

  .toggle-label {
    font-size: 0.8rem;
  }

  .top-bar-right {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  nav {
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
  }
  
  nav button {
    flex: 1;
    max-width: 150px;
  }
  
  .search-bar input {
    max-width: 100%;
  }

  .powered-by-section {
    margin-top: 2rem;
    padding: 1.5rem 0.5rem;
  }

  .powered-by-logos {
    gap: 1.5rem;
  }

  .powered-by-logo {
    height: 70px;
    max-width: 200px;
  }
}

/* Mobile Portrait */
@media screen and (max-width: 480px) {
  html {
    font-size: 12px;
  }

  body {
    padding: 0.5rem;
    border-radius: 8px;
    overflow-y: auto;
  }

  body::before {
    border: 4px solid #1a1a1a;
    border-radius: 8px;
  }

  /* Tier legend responsive layout */
  .tier-legend {
    padding: 1rem;
  }

  .tier-legend-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tier-legend-item {
    padding: 0.75rem;
  }

  .tier-color {
    width: 32px;
    height: 32px;
  }

  .badge-icons {
    gap: 0.5rem;
  }

  .badge-icons img {
    width: 24px !important;
    height: 24px !important;
  }
  
  /* Mobile button layout: 2-column grid for buttons */
  .top-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .top-bar-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .top-bar-left .btn {
    font-size: 0.75rem;
    padding: 8px 10px;
    text-align: center;
    justify-content: center;
  }

  .btn-video {
    gap: 4px;
  }

  .top-bar-right {
    display: flex;
    justify-content: center;
  }

  /* Toggle switch spans full width on mobile */
  .top-bar-left .toggle-switch {
    grid-column: 1 / -1;
    justify-content: center;
  }

  /* Optimize SVG badges for mobile performance and make them smaller */
  .badge {
    width: 20px !important;
    height: 20px !important;
    margin-right: 3px !important;
    margin-left: 3px !important;
    animation: none !important;
    will-change: auto;
    transform: translateZ(0); /* Force GPU acceleration */
  }
  
  /* Apply same scaling to podium placement icons */
  .podium-icon {
    width: 32px !important;
    height: 32px !important;
    animation: none !important;
    filter: none !important;
  }
  
  /* Reduce badge visual effects on mobile to improve performance */
  .badge.tier-bronze,
  .badge.tier-silver, 
  .badge.tier-gold,
  .badge.is-platinum {
    filter: none !important;
    animation: none !important;
  }

  .crt-logo {
    width: 160px;
  }

  .ascii-title {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin: 5px auto 6px auto;
  }

  .terminal-prompt {
    font-size: 0.85rem;
    margin: 4px auto 6px auto;
  }

  /* Leaderboard wrapper on mobile portrait */
  .leaderboard-wrapper {
    max-height: 450px;
  }

  .leaderboard-controls {
    padding: 8px 10px;
  }

  .leaderboard-tabs button {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .leaderboard-search input {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  /* Leaderboard on mobile - fixed height to allow page scrolling */
  .board {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--crt-green) transparent;
    min-height: 200px;
    max-height: 400px;
  }
  
  .header, .row {
    padding: 8px 12px;
  }

  .cell.rank {
    width: 40px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .cell.score {
    width: 70px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .cell.main {
    flex: 1;
    min-width: 0;
  }
  
  .username, .team-name {
    font-size: 1rem;
  }
  
  .header {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }
  
  .row {
    gap: 8px;
    margin-bottom: 1px;
  }
  
  .list {
    padding: 0 0.5rem 0.5rem 0.5rem;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    touch-action: manipulation;
  }
  
  nav button {
    padding: 12px 20px;
    font-size: 0.9rem;
    touch-action: manipulation;
  }
  
  .search-bar input {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .team-info {
    font-size: 0.8rem;
  }
  
  /* Better touch targets */
  .username, .team-name {
    padding: 4px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Hide some decorative elements on very small screens */
  .corner-reticle {
    display: none;
  }
  
  .scanlines {
    opacity: 0.3;
  }

  .powered-by-section {
    margin-top: 1.5rem;
    padding: 1rem 0.5rem;
  }

  .powered-by-header {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  .powered-by-logos {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-left: 0;
  }

  .powered-by-logo-link {
    transform: none;
  }

  .powered-by-logo-link:nth-child(2) {
    transform: none;
  }

  .powered-by-logo {
    height: 60px;
    max-width: 160px;
  }
}

/* Ultra-small screens */
@media screen and (max-width: 360px) {
  body {
    overflow-y: auto;
  }

  .top-bar-left .btn {
    font-size: 0.7rem;
    padding: 6px 8px;
  }

  .btn-video .video-icon {
    width: 12px;
    height: 12px;
  }

  .crt-logo {
    width: 140px;
  }

  .ascii-title {
    font-size: 0.8rem;
    margin: 4px auto 5px auto;
  }

  .terminal-prompt {
    font-size: 0.75rem;
    margin: 3px auto 5px auto;
  }

  /* Smaller search/nav on ultra-small */
  .search-bar input {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .search-hint {
    display: none;
  }

  nav button {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .board {
    max-height: 320px;
  }

  .cell.rank {
    width: 35px;
  }

  .cell.score {
    width: 70px;
  }
  
  .username, .team-name {
    font-size: 0.9rem;
  }

  .header {
    font-size: 0.6rem;
    padding: 6px;
  }

  .row {
    padding: 6px;
    gap: 4px;
  }
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.loading-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 255, 65, 0.1);
  border-top-color: var(--crt-green);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
  box-shadow:
    0 0 10px rgba(0, 255, 65, 0.3),
    inset 0 0 10px rgba(0, 255, 65, 0.2);
}

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

.loading-text {
  font-family: 'VT323', 'Share Tech Mono', 'Courier Prime', 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--crt-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.8);
  letter-spacing: 2px;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  /* Gold/yellow glow clamp for mobile */
  .modal h2,
  .modal .stat-value,
  .modal .stat-highlight,
  .modal .badge-name,
  .modal .about-modal h3,
  .modal .impact-list li strong,
  .modal .sponsor-list li strong,
  .modal .contact-box strong {
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.22) !important;
  }
}

