@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ═══════════════════════════════════════════
   CSS VARIABLES — THE PALETTE
   ═══════════════════════════════════════════ */
:root {
  --bg-deep: #060911;
  --bg-primary: #0a0e1a;
  --bg-card: #0f1527;
  --bg-card-hover: #141b33;
  --bg-elevated: #1a2240;
  --bg-input: #0d1220;

  --gold: #d4a843;
  --gold-bright: #f5c842;
  --gold-dim: #8a6d2b;
  --gold-glow: rgba(212, 168, 67, 0.15);

  --silver: #a8b4c4;
  --bronze: #cd7f32;

  --text-primary: #e8eaf0;
  --text-secondary: #8891a5;
  --text-dim: #505a70;

  --accent-red: #e84057;
  --accent-green: #2ecc71;
  --accent-blue: #3a7bd5;

  --border: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(212, 168, 67, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-gold: 0 0 40px rgba(212, 168, 67, 0.12);

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grain overlay for broadcast feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* Stadium spotlight ambient */
body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(212, 168, 67, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 9, 17, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 2px;
  min-width: 0;
}

.nav-brand .cricket-ball {
  font-size: 1.4rem;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.nav-links {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  min-width: 0;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
  color: var(--gold);
  background: var(--gold-glow);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.auth-actions[data-auth-ready="false"] {
  visibility: hidden;
}

.auth-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .nav {
    padding: 0 1rem;
  }

  .nav-inner {
    height: auto;
    min-height: 64px;
    padding: 0.75rem 0;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 18px;
  }

  .auth-actions {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .auth-status {
    font-size: 0.8rem;
    max-width: 100%;
    word-break: break-word;
  }
}

/* ═══════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════ */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

[hidden] {
  display: none !important;
}

/* ═══════════════════════════════════════════
   HERO HEADER
   ═══════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(212, 168, 67, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 6px;
  color: var(--gold);
  line-height: 1.1;
  text-shadow: 0 0 60px rgba(212, 168, 67, 0.2);
  position: relative;
}

.hero-title span {
  display: block;
  font-size: 0.4em;
  letter-spacing: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-subtitle {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* IPL Cricket Divider */
.ipl-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 2.5rem auto;
  max-width: 440px;
}

.ipl-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0.4;
}

.ipl-scene-wrap {
  flex-shrink: 0;
  width: 180px;
  height: 72px;
}

.ipl-scene {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Bat swing */
.ipl-bat-anim {
  transform-origin: 150px 52px;
  animation: iplBatSwing 4.5s ease-in-out infinite;
}

/* Ball path: bowled in → bounces → hit → flies away */
.ipl-ball-anim {
  animation: iplBallPath 4.5s ease-in-out infinite;
}

.ipl-ball-spin {
  transform-origin: 0 0;
  animation: iplBallSpin 1.2s linear infinite;
}

/* Red trail after the shot */
.ipl-trail-anim {
  animation: iplTrailFade 4.5s ease-in-out infinite;
}

/* Impact flash */
.ipl-impact-anim {
  transform-origin: 124px 52px;
  animation: iplImpactFlash 4.5s ease-out infinite;
}

@keyframes iplBatSwing {
  0%, 25% { transform: rotate(-50deg); }
  35%     { transform: rotate(-92deg); }
  48%     { transform: rotate(-112deg); }
  72%, 100% { transform: rotate(-50deg); }
}

@keyframes iplBallPath {
  0%       { transform: translate(192px, 28px); opacity: 0; }
  8%       { transform: translate(192px, 28px); opacity: 1; }
  22%      { transform: translate(158px, 62px); opacity: 1; }
  34%      { transform: translate(128px, 50px); opacity: 1; }
  36%      { transform: translate(122px, 48px); opacity: 1; }
  56%      { transform: translate(28px, 12px);  opacity: 1; }
  68%      { transform: translate(-15px, 2px);  opacity: 0; }
  100%     { transform: translate(-15px, 2px);  opacity: 0; }
}

@keyframes iplBallSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes iplTrailFade {
  0%, 34%  { opacity: 0; }
  38%      { opacity: 0.25; }
  50%      { opacity: 0.12; }
  62%, 100% { opacity: 0; }
}

@keyframes iplImpactFlash {
  0%, 32%  { opacity: 0; transform: scale(0.3); }
  36%      { opacity: 1; transform: scale(1); }
  48%      { opacity: 0.4; transform: scale(1.2); }
  60%, 100% { opacity: 0; transform: scale(1.4); }
}

/* ═══════════════════════════════════════════
   LEADERBOARD TABLE
   ═══════════════════════════════════════════ */
.leaderboard-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.leaderboard-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 3px;
  color: var(--gold);
}

.season-selector {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.season-selector label {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.season-selector select {
  min-width: 180px;
  padding: 0.55rem 0.75rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.leaderboard-table thead th:first-child {
  padding-left: 1.5rem;
  width: 50px;
}

.leaderboard-table tbody tr {
  transition: var(--transition);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table tbody tr:last-child {
  border-bottom: none;
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.leaderboard-table tbody td {
  padding: 1rem;
  font-size: 0.95rem;
}

.leaderboard-table tbody td:first-child {
  padding-left: 1.5rem;
}

.leaderboard-mobile-list {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.leaderboard-mobile-card {
  width: 100%;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--bg-card);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.leaderboard-mobile-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-mobile-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.leaderboard-mobile-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.leaderboard-mobile-user {
  flex: 1;
  min-width: 0;
}

.leaderboard-mobile-points {
  display: grid;
  gap: 0.1rem;
  min-width: 72px;
  text-align: right;
}

.leaderboard-mobile-points-label,
.leaderboard-mobile-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.leaderboard-mobile-points-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  line-height: 1;
}

.leaderboard-mobile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.leaderboard-mobile-stat {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.leaderboard-mobile-stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: var(--text-primary);
}

/* Position badges */
.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 1px;
}

.position-1 {
  background: linear-gradient(135deg, #d4a843, #f5c842);
  color: #1a1a0a;
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.position-2 {
  background: linear-gradient(135deg, #8891a5, #c0c8d8);
  color: #1a1a2e;
}

.position-3 {
  background: linear-gradient(135deg, #8a5a2a, #cd7f32);
  color: #1a1a0a;
}

.position-other {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Podium row highlights */
.row-gold {
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.08) 0%, transparent 60%);
  border-left: 3px solid var(--gold) !important;
}

.row-silver {
  background: linear-gradient(90deg, rgba(168, 180, 196, 0.06) 0%, transparent 60%);
  border-left: 3px solid var(--silver) !important;
}

.row-bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.06) 0%, transparent 60%);
  border-left: 3px solid var(--bronze) !important;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  font-size: 1.5rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  border: 1px solid var(--border);
}

.user-name {
  font-weight: 600;
}

.points-cell {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.points-positive {
  color: var(--accent-green);
}

.points-negative {
  color: var(--accent-red);
}

.points-zero {
  color: var(--text-secondary);
}

.stat-cell {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.first-place-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 600;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1rem;
}

/* ═══════════════════════════════════════════
   USER MANAGEMENT
   ═══════════════════════════════════════════ */
.section-collapsible {
  margin-top: 2rem;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.section-toggle:hover {
  background: var(--bg-card-hover);
}

.section-toggle .chevron {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.section-toggle.open .chevron {
  transform: rotate(180deg);
}

.section-toggle.open {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.section-content {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.5rem;
}

.section-content.open {
  display: block;
}

.user-form {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.user-chip:hover {
  border-color: var(--accent-red);
}

.user-chip .chip-emoji {
  font-size: 1.1rem;
}

.user-chip .remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  transition: var(--transition);
}

.user-chip .remove-btn:hover {
  color: var(--accent-red);
}

.auth-users-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-user-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.auth-user-title {
  font-weight: 700;
  color: var(--text-primary);
}

.auth-user-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-user-meta,
.auth-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.status-admin,
.status-active {
  background: rgba(46, 204, 113, 0.12);
  color: var(--accent-green);
}

.status-user {
  background: rgba(58, 123, 213, 0.12);
  color: var(--accent-blue);
}

.status-inactive {
  background: rgba(232, 64, 87, 0.12);
  color: var(--accent-red);
}

.compact-empty {
  padding: 1rem 0;
}

/* ═══════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════ */
input[type="text"],
input[type="password"],
input[type="date"],
select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238891a5' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #1a1a0a;
}

.btn-gold:hover {
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(232, 64, 87, 0.3);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(232, 64, 87, 0.1);
  border-color: var(--accent-red);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn.btn-loading:disabled {
  opacity: 0.85;
  cursor: wait;
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--gold);
}

/* ═══════════════════════════════════════════
   MATCH CARDS
   ═══════════════════════════════════════════ */
.matches-grid {
  display: grid;
  gap: 1rem;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.match-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card);
}

.match-card-top {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.match-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-elevated);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.match-date-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 1.5rem 1.5rem;
}

.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
}

.match-team .team-emoji {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: var(--transition);
}

.match-team.winner .team-emoji {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.15);
}

.match-team .team-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.match-team.winner .team-name {
  color: var(--accent-green);
}

.match-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-dim);
  letter-spacing: 3px;
}

.match-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 1.5rem 1.25rem;
  justify-content: flex-end;
}

/* Winner select dropdown */
.winner-select-wrap {
  display: flex;
  gap: 8px;
  padding: 0 1.5rem 1.25rem;
  flex-wrap: wrap;
}

.winner-select-wrap select {
  flex: 1;
  min-width: 180px;
}

/* ═══════════════════════════════════════════
   ADD MATCH / SCORE FORMS
   ═══════════════════════════════════════════ */
#add-match-section {
  position: sticky;
  top: 64px;
  z-index: 50;
  margin-bottom: 1.5rem;
}

#add-match-section .custom-select-menu {
  z-index: 90;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.custom-select {
  position: relative;
}

.custom-select-trigger,
.custom-select-option {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select-trigger {
  position: relative;
  padding-right: 42px;
}

.custom-select-trigger::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238891a5' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  transform: translateY(-50%);
  transition: transform var(--transition);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  display: none;
  z-index: 30;
  padding: 0.35rem;
  background: rgba(10, 14, 26, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 0.25rem;
}

.custom-select-option {
  min-height: 44px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
}

.custom-select-option:hover,
.custom-select-option.active {
  background: rgba(212, 168, 67, 0.14);
  color: var(--gold-bright);
}

.auth-admin-grid {
  align-items: end;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   SCORE ENTRY
   ═══════════════════════════════════════════ */
.score-selectors {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.score-selectors .form-group {
  flex: 1;
  min-width: 200px;
}

.rank-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 1.5rem 0;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.rank-row:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.rank-position {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 1px;
  min-width: 36px;
  text-align: center;
}

.rank-1 .rank-position { color: var(--gold); }
.rank-2 .rank-position { color: var(--silver); }
.rank-3 .rank-position { color: var(--text-secondary); }
.rank-4 .rank-position, .rank-5 .rank-position { color: var(--accent-red); }

.rank-points {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  min-width: 60px;
  text-align: center;
  white-space: nowrap;
}

.rank-1 .rank-points {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
}

.rank-2 .rank-points {
  background: rgba(168, 180, 196, 0.1);
  color: var(--silver);
}

.rank-3 .rank-points {
  background: rgba(136, 145, 165, 0.1);
  color: var(--text-secondary);
}

.rank-4 .rank-points, .rank-5 .rank-points {
  background: rgba(232, 64, 87, 0.1);
  color: var(--accent-red);
}

.rank-select {
  flex: 1;
}

/* Existing scores display */
.existing-scores {
  margin-top: 1.5rem;
}

.existing-score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.existing-score-row:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: toast-in 0.3s ease-out;
  max-width: 380px;
  word-break: break-word;
}

.toast.success {
  border-color: rgba(46, 204, 113, 0.3);
}

.toast.error {
  border-color: rgba(232, 64, 87, 0.3);
}

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

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* ═══════════════════════════════════════════
   LOADING SHIMMER
   ═══════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    rgba(255, 255, 255, 0.04) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in-up 0.5s ease-out both;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ═══════════════════════════════════════════
   USER HISTORY MODAL
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fade-in-up 0.2s ease-out;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.auth-modal {
  width: min(420px, calc(100vw - 2rem));
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-helper {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.login-stage {
  width: 100%;
  max-width: 560px;
  display: grid;
  gap: 1.5rem;
  margin: 0 auto;
}

.login-hero {
  padding: 0;
  text-align: center;
}

.login-copy {
  position: relative;
}

.login-copy::before {
  content: '';
  position: absolute;
  inset: auto 50% -12px auto;
  transform: translateX(50%);
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(58, 123, 213, 0.16) 0%, rgba(58, 123, 213, 0) 72%);
  filter: blur(10px);
}

.login-card {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    linear-gradient(135deg, rgba(15, 21, 39, 0.98), rgba(9, 13, 24, 0.96));
  border-color: rgba(212, 168, 67, 0.16);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-form {
  padding-top: 0.25rem;
  width: 100%;
}

.login-card .card-header {
  margin-bottom: 1.25rem;
}

.login-card .card-title {
  font-size: 1.35rem;
  letter-spacing: 3px;
}

.login-card .form-group label {
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  min-height: 54px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 16, 0.55);
  padding-inline: 1rem;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.login-card .form-actions {
  margin-top: 0.5rem;
  display: block;
}

.login-card .form-actions .btn {
  display: flex;
  width: 100%;
  min-height: 54px;
  justify-content: center;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .login-shell {
    padding: 1.25rem 0.9rem 2rem;
  }

  .login-stage {
    gap: 1.1rem;
  }

  .login-card {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .login-card .card-header {
    margin-bottom: 1rem;
  }

  .login-copy::before {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .login-stage,
  .login-card {
    max-width: 100%;
  }

  .login-card input[type="text"],
  .login-card input[type="password"],
  .login-card .form-actions .btn {
    min-height: 52px;
  }
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-mobile-list {
  display: grid;
  gap: 0.75rem;
}

.history-mobile-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}

.history-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.history-mobile-date {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.history-mobile-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: var(--gold);
}

.history-mobile-match {
  font-weight: 600;
  color: var(--text-primary);
}

.history-mobile-points {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════
   SECTION TITLES
   ═══════════════════════════════════════════ */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-bar .form-group {
  min-width: 180px;
}

/* ═══════════════════════════════════════════
   MATCH INFO HEADER (scores page)
   ═══════════════════════════════════════════ */
.match-info-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  text-align: center;
}

.match-info-header .team-emoji {
  font-size: 1.8rem;
}

.match-info-header .team-short {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 2px;
}

.match-info-header .vs {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--text-dim);
  letter-spacing: 3px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  input[type="date"],
  select,
  .custom-select-trigger,
  .custom-select-option,
  textarea {
    font-size: 16px;
    min-height: 52px;
  }

  .page-wrapper {
    padding: 1.5rem 1rem 3rem;
  }

  .hero {
    padding: 2rem 0.5rem 1.5rem;
  }

  .leaderboard-table thead th:nth-child(n+5),
  .leaderboard-table tbody td:nth-child(n+5) {
    display: none;
  }

  .match-teams {
    gap: 1rem;
    padding-inline: 1rem;
  }

  .match-team .team-emoji {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .score-selectors {
    flex-direction: column;
  }

  .rank-row {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .rank-position,
  .rank-points {
    min-width: 0;
  }

  .rank-select {
    width: 100%;
    flex-basis: 100%;
  }

  .user-form {
    flex-direction: column;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .match-card-top,
  .match-card-actions,
  .winner-select-wrap {
    padding-inline: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .existing-score-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .modal-overlay {
    padding: 1rem;
  }

  .modal {
    max-height: calc(100vh - 2rem);
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }

  .history-table th,
  .history-table td {
    white-space: nowrap;
  }

  .leaderboard-mobile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .hero-title {
    letter-spacing: 3px;
  }

  .hero-title span {
    letter-spacing: 5px;
  }

  .leaderboard-table thead th:nth-child(n+4),
  .leaderboard-table tbody td:nth-child(n+4) {
    display: none;
  }

  .leaderboard-table thead th,
  .leaderboard-table tbody td {
    padding-inline: 0.75rem;
  }

  .user-cell {
    gap: 8px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
  }

  .leaderboard-mobile-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .leaderboard-mobile-points {
    width: 100%;
    text-align: left;
  }

  .leaderboard-mobile-stats {
    grid-template-columns: 1fr;
  }

  .match-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .match-teams {
    gap: 0.5rem;
    padding-block: 0.75rem 1rem;
  }

  .match-team .team-name,
  .match-info-header .team-short {
    font-size: 1.1rem;
    letter-spacing: 1px;
  }

  .match-info-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }

  .winner-select-wrap .btn,
  .form-actions .btn,
  .match-card-actions .btn,
  .auth-user-actions .btn {
    width: 100%;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-status {
    text-align: left;
  }

  .nav-links a {
    justify-content: center;
  }

  .modal-header h3 {
    font-size: 1.1rem;
    letter-spacing: 1px;
  }
}

/* ==========================================================================
   Champion banner — season-end celebration
   ========================================================================== */

.champion-banner {
  position: relative;
  overflow: hidden;
  margin: 0 auto 1rem;
  max-width: 780px;
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: 18px;
  border: 1px solid rgba(212, 168, 67, 0.45);
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 200, 66, 0.22), transparent 60%),
    linear-gradient(180deg, #1a1305 0%, #0a0e1a 70%);
  box-shadow:
    0 18px 50px -24px rgba(245, 200, 66, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 60px 90px -50px rgba(245, 200, 66, 0.18);
  isolation: isolate;
  animation: champion-banner-in 0.8s ease-out both;
}

.champion-banner[hidden] {
  display: none;
}

.champion-spotlight {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 80%;
  background: radial-gradient(ellipse at center top, rgba(245, 200, 66, 0.35) 0%, rgba(245, 200, 66, 0.08) 35%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  animation: champion-spotlight-pulse 4.5s ease-in-out infinite alternate;
}

.champion-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.champion-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 200, 66, 0.4);
  background: rgba(245, 200, 66, 0.08);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(245, 200, 66, 0.5);
  animation: champion-fade-up 0.7s 0.1s ease-out both;
}

.champion-eyebrow-icon {
  display: inline-block;
  font-size: 0.9rem;
  animation: champion-bounce 1.6s ease-in-out infinite alternate;
}

.champion-eyebrow-icon--delay {
  animation-delay: 0.4s;
}

.champion-medallion {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, #fff5cf 0%, #f5c842 35%, #d4a843 70%, #8a6d2b 100%);
  box-shadow:
    0 0 0 6px rgba(15, 21, 39, 0.9),
    0 0 0 7px rgba(245, 200, 66, 0.7),
    0 0 60px rgba(245, 200, 66, 0.55),
    inset 0 -12px 30px rgba(0, 0, 0, 0.35),
    inset 0 12px 30px rgba(255, 255, 255, 0.25);
  animation: champion-fade-up 0.7s 0.25s ease-out both, champion-float 5s ease-in-out infinite;
}

.champion-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed rgba(245, 200, 66, 0.75);
  pointer-events: none;
  animation: champion-spin 14s linear infinite;
}

.champion-ring--inner {
  inset: -6px;
  border-style: dotted;
  border-color: rgba(255, 245, 207, 0.45);
  animation-duration: 22s;
  animation-direction: reverse;
}

.champion-avatar {
  font-size: 68px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.champion-name {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
  background: linear-gradient(135deg, #f5c842 0%, #fff5cf 25%, #f5c842 50%, #fff5cf 75%, #d4a843 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(245, 200, 66, 0.25);
  animation: champion-fade-up 0.7s 0.4s ease-out both, champion-shimmer 5s linear infinite;
}

.champion-subtitle {
  color: var(--text-secondary);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: champion-fade-up 0.7s 0.5s ease-out both;
}

.champion-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
  animation: champion-fade-up 0.7s 0.65s ease-out both;
}

.champion-stat {
  min-width: 110px;
  padding: 0.55rem 1rem;
  background: rgba(15, 21, 39, 0.7);
  border: 1px solid rgba(245, 200, 66, 0.25);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  backdrop-filter: blur(6px);
}

.champion-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.champion-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.champion-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.confetti-piece {
  position: absolute;
  top: -15%;
  left: 0;
  width: 8px;
  height: 14px;
  border-radius: 1px;
  background: hsl(var(--hue, 45), 85%, 60%);
  opacity: 0.9;
  transform: translate3d(var(--x, 50vw), -120%, 0) rotate(var(--rot, 0deg));
  animation: confetti-fall var(--duration, 5s) linear var(--delay, 0s) infinite;
}

.confetti-piece:nth-child(3n) {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.confetti-piece:nth-child(4n) {
  width: 10px;
  height: 4px;
  border-radius: 2px;
}

.runner-up-banner {
  margin: 0 auto 2rem;
  max-width: 780px;
  animation: champion-fade-up 0.6s 0.2s ease-out both;
}

.runner-up-banner[hidden] {
  display: none;
}

.runner-up-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(160, 170, 195, 0.1), rgba(15, 21, 39, 0.7));
  border: 1px solid rgba(190, 200, 220, 0.25);
  box-shadow: 0 10px 30px -18px rgba(190, 200, 220, 0.4);
}

.runner-up-medallion {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, #f5f7fa 0%, #d6dce6 35%, #a4adbf 70%, #6b7385 100%);
  box-shadow:
    0 0 0 3px rgba(15, 21, 39, 0.9),
    0 0 0 4px rgba(200, 210, 225, 0.55),
    0 0 16px rgba(200, 210, 225, 0.25),
    inset 0 -4px 10px rgba(0, 0, 0, 0.3),
    inset 0 4px 10px rgba(255, 255, 255, 0.3);
}

.runner-up-ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px dashed rgba(200, 210, 225, 0.55);
  pointer-events: none;
  animation: champion-spin 18s linear infinite;
}

.runner-up-avatar {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.runner-up-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.runner-up-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(220, 226, 235, 0.65);
  font-weight: 700;
}

.runner-up-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #f0f3f8 0%, #c3cad8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.runner-up-stats {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.runner-up-stats strong {
  color: #e8ebf2;
  font-weight: 700;
}

.season-status-summary {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-left: 3px solid var(--gold);
  font-size: 0.9rem;
  line-height: 1.45;
}

.season-lock-note {
  padding: 0.85rem 1rem;
  margin: -0.5rem 0 1.5rem;
  border-radius: 10px;
  background: rgba(212, 168, 67, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--gold);
  font-size: 0.9rem;
  line-height: 1.45;
}

.season-lock-inline {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.season-history-list {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.season-history-card {
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: 0.85rem;
}

.season-history-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.season-history-name {
  margin: 0;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.season-history-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.season-history-champion,
.season-history-runner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(212, 168, 67, 0.08);
}

.season-history-runner {
  background: rgba(192, 192, 192, 0.07);
}

.season-history-champion .champion-avatar,
.season-history-runner .runner-up-avatar {
  font-size: 1.6rem;
  line-height: 1;
}

.season-history-champion-label,
.season-history-runner-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.season-history-champion-name,
.season-history-runner-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.season-history-champion-stats,
.season-history-runner-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .season-history-champion,
  .season-history-runner {
    grid-template-columns: auto 1fr;
  }
  .season-history-champion-stats,
  .season-history-runner-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@keyframes champion-banner-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes champion-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes champion-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes champion-bounce {
  from { transform: translateY(0) rotate(-6deg); }
  to   { transform: translateY(-6px) rotate(6deg); }
}

@keyframes champion-spotlight-pulse {
  from { opacity: 0.55; }
  to   { opacity: 0.95; }
}

@keyframes champion-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(var(--x, 50vw), -120%, 0) rotate(var(--rot, 0deg));
    opacity: 0;
  }
  8% { opacity: 0.95; }
  100% {
    transform: translate3d(calc(var(--x, 50vw) + var(--drift, 40px)), 130vh, 0) rotate(calc(var(--rot, 0deg) + 720deg));
    opacity: 0.95;
  }
}

@media (max-width: 900px) {
  .champion-banner {
    padding: 1.25rem 1rem 1.4rem;
    margin-bottom: 0.75rem;
    border-radius: 16px;
  }

  .champion-inner {
    gap: 0.65rem;
  }

  .champion-medallion {
    width: 92px;
    height: 92px;
    margin: 1.1rem 0 0.4rem;
  }

  .champion-avatar {
    font-size: 52px;
  }

  .champion-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    padding: 0.3rem 0.8rem;
  }

  .champion-subtitle {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
  }

  .champion-stats {
    flex-direction: row;
    width: 100%;
    gap: 0.45rem;
  }

  .champion-stat {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.55rem;
    align-items: center;
    text-align: center;
  }

  .champion-stat-value {
    font-size: 1rem;
  }

  .champion-stat-label {
    font-size: 0.55rem;
    letter-spacing: 0.18em;
  }

  .runner-up-card {
    padding: 0.7rem 0.85rem;
    gap: 0.8rem;
  }

  .runner-up-medallion {
    width: 48px;
    height: 48px;
  }

  .runner-up-avatar {
    font-size: 24px;
  }

  .runner-up-name {
    font-size: 1.05rem;
  }

  .runner-up-stats {
    font-size: 0.72rem;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .champion-banner,
  .champion-eyebrow,
  .champion-eyebrow-icon,
  .champion-medallion,
  .champion-ring,
  .champion-name,
  .champion-subtitle,
  .champion-stats,
  .champion-spotlight,
  .confetti-piece,
  .runner-up-banner,
  .runner-up-ring {
    animation: none !important;
  }

  .champion-banner--reduced .champion-confetti {
    display: none;
  }
}
