/* ============================================================
   ImageVoter — Universal Image Voting Platform
   Design System & Animations v1.0
   Fonts loaded non-blocking via <link> in header.php
   ============================================================ */

/* ============================================================
   CSS VARIABLES (theme-able via admin)
   ============================================================ */
:root {
  --primary:   #FF4757;
  --secondary: #2F3542;
  --accent:    #FFA502;
  --bg:        #0d0d1a;
  --surface:   #161629;
  --surface2:  #1e1e35;
  --surface3:  #252540;
  --text:      #f0f0f5;
  --text-muted:#8888aa;
  --border:    rgba(255,255,255,0.08);
  --success:   #2ed573;
  --danger:    #ff4757;
  --warning:   #ffa502;
  --info:      #1e90ff;

  --font-display: -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-body:    -apple-system, 'Segoe UI', system-ui, sans-serif;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(255,71,87,0.2);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --spring:     0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255,71,87,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,165,2,0.04) 0%, transparent 50%);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }

.display-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 700px; margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,26,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.navbar-title {
  color: var(--primary);
  white-space: nowrap;
}

/* On small phones: if logo is present, hide the text title to save space */
@media (max-width: 480px) {
  .navbar-logo + .navbar-title { display: none; }
  .navbar { padding: 0 14px; }
}

.navbar-brand span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px; cursor: pointer;
  padding: 8px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text); display: block;
  transition: all var(--transition);
  border-radius: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative; overflow: hidden;
}

.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn:hover::before { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,71,87,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,71,87,0.4);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 20px rgba(255,165,2,0.25);
}
.btn-accent:hover { transform: translateY(-2px); color: #000; }

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface3); color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 20px 48px; font-size: 1.25rem; border-radius: var(--radius-xl); font-weight: 700; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

/* Vote buttons */
.vote-btn {
  width: 100%; padding: 20px;
  border-radius: var(--radius-lg);
  font-size: 1.3rem; font-weight: 700;
  transition: all var(--spring);
  position: relative; overflow: hidden;
}

.vote-btn-yes {
  background: linear-gradient(135deg, var(--primary), #ff6b81);
  color: #fff;
  box-shadow: 0 8px 40px rgba(255,71,87,0.35);
}
.vote-btn-yes:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 50px rgba(255,71,87,0.5);
}
.vote-btn-yes:active { transform: scale(0.97); }

.vote-btn-no {
  background: linear-gradient(135deg, var(--surface3), var(--surface2));
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.vote-btn-no:hover {
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, var(--surface2), var(--surface));
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body { padding: 20px; }

/* Image card (leaderboard) */
.img-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.img-card:hover {
  border-color: rgba(255,71,87,0.3);
  box-shadow: 0 8px 40px rgba(255,71,87,0.15);
  transform: translateY(-4px);
}

.img-card-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.img-card:hover .img-card-thumb { transform: scale(1.04); }

.img-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 50%);
  pointer-events: none;
}

.img-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
}

.img-card-score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.img-card-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.img-card-rank {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.img-card-badges {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  backdrop-filter: blur(10px);
}
.badge-trending  { background: rgba(255,165,2,0.25); color: var(--accent); border: 1px solid rgba(255,165,2,0.3); }
.badge-champion  { background: rgba(255,215,0,0.2); color: gold; border: 1px solid rgba(255,215,0,0.3); }
.badge-rising    { background: rgba(46,213,115,0.2); color: var(--success); border: 1px solid rgba(46,213,115,0.3); }
.badge-controversial { background: rgba(30,144,255,0.2); color: var(--info); border: 1px solid rgba(30,144,255,0.3); }
.badge-winner    { background: rgba(255,215,0,0.15); color: gold; border: 1px solid rgba(255,215,0,0.4); }
.badge-sponsored { background: rgba(255,255,255,0.1); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   VOTE ARENA (main voting UI)
   ============================================================ */
.vote-arena {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px 20px;
}

.vote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
}

.vote-image-wrap {
  position: relative; overflow: hidden;
  background: var(--surface2);
  /* Responsive height — shorter on small screens to avoid scrolling */
  aspect-ratio: 1;
  max-height: min(60vh, 480px);
}

.vote-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.vote-prompt {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  text-align: center;
  padding: 16px 20px 0;
  line-height: 1.3;
}

.vote-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 4px 20px 0;
}

.vote-buttons {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 14px 20px 18px;
}

.vote-stats {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  padding: 0 20px 14px;
  font-size: 0.82rem; color: var(--text-muted);
}

.vote-stat strong { color: var(--text); font-weight: 600; }

/* Vote counter strip */
.vote-counter {
  display: flex; align-items: center;
  gap: 8px; padding: 0 28px 16px;
}
.vote-bar {
  flex: 1; height: 4px;
  background: var(--surface3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* --- Base transition --- */
.vote-image-wrap { position: relative; }
.vote-img-inner {
  position: absolute; inset: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.vote-img-inner img { width: 100%; height: 100%; object-fit: cover; }

/* Punch */
@keyframes punch-exit {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  20%  { transform: scale(1.08) rotate(-3deg); }
  100% { transform: scale(0) rotate(15deg) translateX(200%); opacity: 0; }
}
@keyframes punch-fist {
  0%   { transform: translateX(-150%) translateY(-50%) scale(0.5); opacity: 0; }
  40%  { transform: translateX(0%) translateY(-50%) scale(1.2); opacity: 1; }
  60%  { transform: translateX(20%) translateY(-50%) scale(1.0); opacity: 1; }
  100% { transform: translateX(150%) translateY(-50%) scale(0.8); opacity: 0; }
}
@keyframes punch-enter {
  0%   { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.anim-punch .vote-img-inner { animation: punch-exit 0.5s forwards; }
.anim-punch::after {
  content: '👊';
  position: absolute; top: 50%; left: 0; right: 0;
  font-size: 5rem; text-align: center;
  animation: punch-fist 0.6s forwards;
  pointer-events: none; z-index: 10;
}
.anim-punch-enter .vote-img-inner { animation: punch-enter 0.4s 0.3s both; }

/* Fade / no vote */
@keyframes fade-exit {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}
@keyframes fade-enter {
  0%   { opacity: 0; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
.anim-fade .vote-img-inner { animation: fade-exit 0.35s forwards; }
.anim-fade-enter .vote-img-inner { animation: fade-enter 0.35s forwards; }

/* Hearts */
@keyframes hearts-exit {
  0%   { transform: scale(1); filter: brightness(1); }
  30%  { transform: scale(1.05); filter: brightness(1.3) saturate(1.5); }
  100% { transform: scale(0) translateY(-60px); opacity: 0; }
}
@keyframes heart-float {
  0%   { transform: translateY(0) scale(0); opacity: 1; }
  100% { transform: translateY(-200px) scale(1.5); opacity: 0; }
}
.anim-hearts .vote-img-inner { animation: hearts-exit 0.5s forwards; }
.anim-hearts::before {
  content: '❤️'; position: absolute; bottom: 20%; left: 25%;
  font-size: 2.5rem; animation: heart-float 0.8s forwards; pointer-events: none; z-index: 10;
}
.anim-hearts::after {
  content: '💕'; position: absolute; bottom: 20%; right: 25%;
  font-size: 2rem; animation: heart-float 0.8s 0.1s forwards; pointer-events: none; z-index: 10;
}

/* Stars */
@keyframes stars-exit {
  0%   { filter: brightness(1); transform: scale(1); }
  100% { filter: brightness(3); transform: scale(1.1); opacity: 0; }
}
.anim-stars .vote-img-inner { animation: stars-exit 0.4s forwards; }

/* Slide */
@keyframes slide-r-exit { to { transform: translateX(120%); opacity: 0; } }
@keyframes slide-l-exit { to { transform: translateX(-120%); opacity: 0; } }
@keyframes slide-enter  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.anim-slide-r .vote-img-inner { animation: slide-r-exit 0.35s forwards; }
.anim-slide-l .vote-img-inner { animation: slide-l-exit 0.35s forwards; }
.anim-slide-enter .vote-img-inner { animation: slide-enter 0.35s forwards; }

/* Rocket */
@keyframes rocket-exit {
  0%   { transform: scale(1) rotate(0deg); }
  100% { transform: scale(0.2) rotate(-15deg) translateY(-150%); opacity: 0; }
}
.anim-rocket .vote-img-inner { animation: rocket-exit 0.5s forwards; }

/* Ghost */
@keyframes ghost-exit {
  0%   { opacity: 1; filter: blur(0); }
  50%  { opacity: 0.5; filter: blur(4px) brightness(2); }
  100% { opacity: 0; filter: blur(10px); transform: scale(1.1); }
}
.anim-ghost .vote-img-inner { animation: ghost-exit 0.6s forwards; }

/* Splat */
@keyframes splat-exit {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); filter: hue-rotate(20deg); }
  100% { transform: scale(0.9) rotate(3deg); opacity: 0; }
}
.anim-splat .vote-img-inner { animation: splat-exit 0.4s forwards; }
.anim-splat::after {
  content: '🍅'; position: absolute; top: 30%; left: 50%;
  font-size: 4rem; transform: translateX(-50%);
  animation: punch-fist 0.5s forwards; pointer-events: none; z-index: 10;
}

/* Page load */
@keyframes page-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-in { animation: page-in 0.5s ease both; }

/* Stagger utility */
.stagger > * { animation: page-in 0.5s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* Score pop */
@keyframes score-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); color: var(--accent); }
  100% { transform: scale(1); }
}
.score-pop { animation: score-pop 0.4s ease; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 7px;
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text); font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,71,87,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.form-error { color: var(--danger); font-size: 0.83rem; margin-top: 6px; }
.form-hint  { color: var(--text-muted); font-size: 0.83rem; margin-top: 6px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(255,71,87,0.04);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-text { color: var(--text-muted); font-size: 0.95rem; }
.upload-text strong { color: var(--text); }

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: rgba(46,213,115,0.12); border: 1px solid rgba(46,213,115,0.25); color: var(--success); }
.alert-danger   { background: rgba(255,71,87,0.12);  border: 1px solid rgba(255,71,87,0.25);  color: var(--danger); }
.alert-warning  { background: rgba(255,165,2,0.12); border: 1px solid rgba(255,165,2,0.25);  color: var(--warning); }
.alert-info     { background: rgba(30,144,255,0.12); border: 1px solid rgba(30,144,255,0.25); color: var(--info); }

/* Toast notifications */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  min-width: 260px; max-width: 360px;
  animation: toast-in 0.3s ease;
  pointer-events: auto;
}
.toast.removing { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in  { from { transform: translateX(100%); opacity: 0; } }
@keyframes toast-out { to   { transform: translateX(100%); opacity: 0; } }

/* ============================================================
   SHARE BAR
   ============================================================ */
.share-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface2);
}
.share-btn:hover { background: var(--surface3); color: var(--text); transform: translateY(-1px); }
.share-btn-twitter:hover  { border-color: #1DA1F2; color: #1DA1F2; }
.share-btn-facebook:hover { border-color: #4267B2; color: #4267B2; }
.share-btn-reddit:hover   { border-color: #FF4500; color: #FF4500; }

/* ============================================================
   LEADERBOARD / GRID
   ============================================================ */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.leaderboard-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface2);
  transition: all var(--transition);
  cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   PROFILE / USER PAGES
   ============================================================ */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 32px;
  display: flex; align-items: center; gap: 32px;
}

.profile-avatar {
  width: 100px; height: 100px;
  border-radius: var(--radius-full);
  background: var(--surface2);
  border: 3px solid var(--primary);
  flex-shrink: 0;
  object-fit: cover;
  font-size: 2.5rem;
  display: flex; align-items: center; justify-content: center;
}

.profile-stats {
  display: flex; gap: 32px; margin-top: 16px;
}
.profile-stat { text-align: center; }
.profile-stat .value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.profile-stat .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   TIER BADGES
   ============================================================ */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 700;
}
.tier-1 { background: rgba(205,127,50,0.15); color: #cd7f32; border: 1px solid rgba(205,127,50,0.3); }
.tier-2 { background: rgba(192,192,192,0.15); color: #c0c0c0; border: 1px solid rgba(192,192,192,0.3); }
.tier-3 { background: rgba(255,215,0,0.15); color: gold; border: 1px solid rgba(255,215,0,0.3); }
.tier-4 { background: linear-gradient(135deg,rgba(255,71,87,0.2),rgba(255,165,2,0.2)); color: var(--accent); border: 1px solid rgba(255,165,2,0.4); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 40px; flex-wrap: wrap;
}
.page-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; transform: translateY(-1px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.text-lg      { font-size: 1.125rem; }

.mt-0 { margin-top: 0; }    .mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }

.mb-1 { margin-bottom: 8px; }  .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }   .p-2 { padding: 16px; }
.p-3 { padding: 24px; }  .p-4 { padding: 32px; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.w-full { width: 100%; }
.gap-2 { gap: 16px; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Spinner */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--surface3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sound toggle */
.sound-toggle {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 50;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted);
}
.sound-toggle:hover { background: var(--surface3); color: var(--text); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(255,71,87,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title { margin-bottom: 20px; }
.hero-sub {
  font-size: 1.2rem; color: var(--text-muted);
  max-width: 520px; margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* Stats strip */
.stats-strip {
  display: flex; justify-content: center; gap: 48px;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 32px;
}
.stat-item { text-align: center; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px; z-index: 99;
  }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .leaderboard-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .vote-card { border-radius: var(--radius-lg); }
  .vote-prompt { font-size: 1.3rem; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
  .stats-strip { gap: 24px; }
  .hero { padding: 48px 20px 40px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .leaderboard-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vote-buttons { grid-template-columns: 1fr; gap: 10px; }
  .vote-btn { padding: 16px; font-size: 1.1rem; }
  .display-title { font-size: 2rem; }
  .share-bar { justify-content: center; }
}

/* ============================================================
   PRINT / ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ============================================================
   COOKIE CONSENT
   ============================================================ */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  z-index: 200; flex-wrap: wrap;
  animation: slide-up 0.4s ease;
}
@keyframes slide-up { from { transform: translateY(100%); } }

/* Age gate overlay */
#age-gate {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.age-gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 440px;
  text-align: center;
}

/* Contest live pulse animation */
@keyframes nav-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.4); }
}
