/* ============================================
   Store Blindern Poker — Global Styles
   Mahogany + Apple Clean
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  /* Core palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1c1c1c;
  --bg-elevated: #1a1a1a;

  /* Mahogany / warm accents */
  --mahogany: #7a3535;
  --mahogany-light: #a04848;
  --mahogany-glow: rgba(160, 72, 72, 0.2);
  --mahogany-vivid: #c06060;
  --gold: #c9a84c;
  --gold-dim: #a68a3e;
  --gold-glow: rgba(201, 168, 76, 0.1);

  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --text-accent: #c9a84c;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(201, 168, 76, 0.2);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(ellipse 120% 60% at 50% 0%, rgba(122, 53, 53, 0.07), transparent 70%), var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: 780px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.page-content {
  flex: 1;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: opacity 0.2s var(--ease);
}

.nav__brand:hover {
  opacity: 0.8;
}

.nav__brand-icon {
  font-size: 1.3rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text-primary);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--gold);
  border-radius: 1px;
}

.nav__divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 -4px;
}

.nav__social {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.nav__social:hover {
  color: var(--gold);
  transform: scale(1.15);
}

/* Mobile nav */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-lg);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease);
  }

  .nav__links--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav__link {
    font-size: 1rem;
  }

  .nav__divider {
    width: 40px;
    height: 1px;
    margin: var(--space-xs) 0;
  }

  .nav__social {
    padding: var(--space-xs) 0;
  }
}

/* --- Hero --- */
.hero {
  padding: calc(64px + var(--space-4xl)) 0 var(--space-4xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background:
    radial-gradient(circle, rgba(160, 72, 72, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 400px 600px at 50% 40%, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.hero__title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold), #dbc06a, var(--gold-dim), var(--gold));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s ease-in-out infinite;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
  font-weight: 400;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}

.btn--primary {
  background: var(--gold);
  color: #0a0a0a;
}

.btn--primary:hover {
  background: #d4b255;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.25);
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* --- Section --- */
.section {
  padding: var(--space-4xl) 0;
}

.section__header {
  margin-bottom: var(--space-2xl);
}

.section__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section__description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: var(--space-md);
  max-width: 560px;
  line-height: 1.7;
}

/* --- Info Grid (Home) --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
  will-change: transform;
}

.info-card:hover {
  border-color: rgba(160, 72, 72, 0.25);
  background-color: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(122, 53, 53, 0.15), 0 0 0 1px rgba(160, 72, 72, 0.08);
}

.info-card__icon {
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
}

.info-card__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.info-card__text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Event Cards --- */
.events-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.event-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: var(--space-lg);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

.event-card:hover {
  border-color: rgba(160, 72, 72, 0.25);
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(122, 53, 53, 0.12), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.event-card__date {
  text-align: center;
}

.event-card__day {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.event-card__month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-top: 4px;
}

.event-card__weekday {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.event-card__info {
  min-width: 0;
}

.event-card__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.event-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Event links (location / registration) */
.event-card__links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.event-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.event-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.event-link--register {
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.2);
}

.event-link--register:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.35);
  color: var(--gold);
}

/* Modal actions row */
.event-modal__actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.event-card__badge {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.event-card__badge--upcoming {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.event-card__badge--past {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

.event-card__badge--live {
  background: rgba(107, 45, 45, 0.2);
  color: var(--mahogany-light);
  border: 1px solid rgba(139, 58, 58, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 640px) {
  .event-card {
    grid-template-columns: 60px 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .event-card__badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

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

.leaderboard-table thead {
  position: sticky;
  top: 64px;
  z-index: 10;
}

.leaderboard-table th {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-align: left;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.leaderboard-table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.leaderboard-table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
  text-align: right;
}

.leaderboard-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.leaderboard-table tbody tr {
  transition: background 0.2s var(--ease);
}

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

.leaderboard-table tbody tr.highlight-player-row {
  background:
    linear-gradient(90deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.02) 45%, transparent),
    var(--bg-secondary);
}

.leaderboard-table tbody tr.highlight-player-row td {
  border-bottom-color: rgba(201, 168, 76, 0.22);
}

.leaderboard-table tbody tr.highlight-player-row:hover {
  background:
    linear-gradient(90deg, rgba(201, 168, 76, 0.14), rgba(201, 168, 76, 0.05) 45%, rgba(122, 53, 53, 0.04)),
    var(--bg-card);
}

.leaderboard-table tbody tr.highlight-player-row--board {
  background:
    linear-gradient(90deg, rgba(176, 186, 204, 0.12), rgba(176, 186, 204, 0.03) 45%, transparent),
    var(--bg-secondary);
}

.leaderboard-table tbody tr.highlight-player-row--board td {
  border-bottom-color: rgba(176, 186, 204, 0.28);
}

.leaderboard-table tbody tr.highlight-player-row--board:hover {
  background:
    linear-gradient(90deg, rgba(176, 186, 204, 0.2), rgba(176, 186, 204, 0.06) 45%, rgba(122, 53, 53, 0.02)),
    var(--bg-card);
}

/* Rank column */
.rank-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rank-number {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 28px;
}

.rank-number--gold {
  color: var(--gold);
}

.rank-number--silver {
  color: #b0b0b0;
}

.rank-number--bronze {
  color: #b87333;
}

/* Rank change indicators */
.rank-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 40px;
}

.rank-change--up {
  color: #34c759;
}

.rank-change--down {
  color: #ff3b30;
}

.rank-change--same {
  color: var(--text-tertiary);
}

/* Player name */
.player-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}

.player-name {
  font-weight: 500;
}

.player-name-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.player-avatar--highlight {
  border-color: rgba(201, 168, 76, 0.7);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.08), 0 0 18px rgba(201, 168, 76, 0.35);
  animation: highlightPulse 2.4s ease-in-out infinite;
}

.player-avatar--highlight.player-avatar--board {
  border-color: rgba(176, 186, 204, 0.72);
  color: #d8dfef;
  box-shadow: 0 0 0 2px rgba(176, 186, 204, 0.12), 0 0 18px rgba(176, 186, 204, 0.34);
  animation: boardPulse 2.8s ease-in-out infinite;
}

.player-highlight-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: linear-gradient(120deg, rgba(201, 168, 76, 0.13), rgba(160, 72, 72, 0.12));
  color: #dfc57a;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.player-highlight-badge--board {
  border-color: rgba(176, 186, 204, 0.45);
  background: linear-gradient(120deg, rgba(176, 186, 204, 0.22), rgba(112, 128, 160, 0.14));
  color: #dbe3f1;
}

.player-highlight-badge--board::before {
  content: '◆';
  font-size: 0.55rem;
  margin-right: 6px;
  opacity: 0.85;
}

@keyframes highlightPulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.06), 0 0 12px rgba(201, 168, 76, 0.28);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.18), 0 0 24px rgba(201, 168, 76, 0.5);
    transform: scale(1.035);
  }
}

@keyframes boardPulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(176, 186, 204, 0.1), 0 0 10px rgba(176, 186, 204, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(176, 186, 204, 0.22), 0 0 22px rgba(176, 186, 204, 0.42);
    transform: scale(1.03);
  }
}

/* Points */
.points-cell {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Podium top 3 */
.leaderboard-table tbody tr:nth-child(1) .rank-number {
  color: var(--gold);
}

.leaderboard-table tbody tr:nth-child(2) .rank-number {
  color: #b0b0b0;
}

.leaderboard-table tbody tr:nth-child(3) .rank-number {
  color: #b87333;
}

/* Leaderboard stat cards */
.leaderboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stat-card:hover {
  border-color: rgba(160, 72, 72, 0.2);
  box-shadow: 0 4px 24px rgba(122, 53, 53, 0.1);
}

/* --- Leader Spotlight --- */
.leader-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  background-color: var(--bg-card);
  background-image:
    repeating-linear-gradient(
      95deg,
      transparent 0px, transparent 4px,
      rgba(160, 72, 72, 0.025) 4px, rgba(160, 72, 72, 0.025) 6px
    ),
    repeating-linear-gradient(
      87deg,
      transparent 0px, transparent 12px,
      rgba(160, 72, 72, 0.015) 12px, rgba(160, 72, 72, 0.015) 16px
    );
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-2xl);
  margin-bottom: var(--space-2xl);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.leader-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.05), transparent 50%, rgba(122, 53, 53, 0.05));
  pointer-events: none;
}

.leader-card:hover {
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow: 0 8px 40px rgba(201, 168, 76, 0.08), 0 0 60px rgba(122, 53, 53, 0.06);
}

.leader-card__crown {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.leader-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mahogany), var(--mahogany-light));
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.leader-card__info {
  flex: 1;
  min-width: 0;
}

.leader-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 2px;
}

.leader-card__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-card__points {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.leader-card__stats {
  display: flex;
  gap: var(--space-xl);
  flex-shrink: 0;
}

.leader-card__stat {
  text-align: center;
}

.leader-card__stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.leader-card__stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .leader-card {
    flex-wrap: wrap;
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .leader-card__stats {
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
  }
}

.stat-card__value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Table wrapper */
.table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Upcoming events preview (home) --- */
.events-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.events-preview__more {
  text-align: center;
  margin-top: var(--space-lg);
}

/* --- Footer --- */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 5%, rgba(160, 72, 72, 0.3), rgba(201, 168, 76, 0.15), rgba(160, 72, 72, 0.3), transparent 95%) 1;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.footer__links {
  display: flex;
  gap: var(--space-xl);
}

.footer__link {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  transition: color 0.2s var(--ease);
}

.footer__link:hover {
  color: var(--text-secondary);
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  transition: all 0.3s var(--ease);
}

.footer__social:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  transform: translateY(-2px);
}

.footer__text {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 72, 72, 0.3), rgba(201, 168, 76, 0.2), rgba(160, 72, 72, 0.3), transparent);
  margin: var(--space-3xl) 0;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__text {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeIn 0.6s var(--ease) forwards;
}

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

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

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Event detail modal --- */
.event-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.event-modal-overlay--active {
  display: flex;
}

.event-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 520px;
  width: 100%;
  position: relative;
  animation: modalIn 0.3s var(--ease-bounce);
}

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

.event-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}

.event-modal__close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.event-modal__date {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.event-modal__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.event-modal__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.event-modal__detail {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.event-modal__description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Season selector --- */
.season-selector {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.season-btn {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.season-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.season-btn--active {
  background: var(--gold);
  color: #0a0a0a;
  border-color: var(--gold);
}

/* Page header (events / leaderboard) */
.page-header {
  padding: calc(64px + var(--space-3xl)) 0 var(--space-2xl);
  text-align: center;
}

.page-header__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.page-header__subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* Events filter tabs */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-tab {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.filter-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-tab--active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* Last updated badge */
.last-updated {
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ============================================
   Visual Effects & Atmosphere
   ============================================ */

/* Ambient canvas — floating card suits */
#ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Film grain noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Scroll-driven warm glow */
.scroll-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 0.8s ease;
}

/* Wood grain texture on cards */
.info-card,
.event-card,
.stat-card,
.event-modal {
  background-image:
    repeating-linear-gradient(
      95deg,
      transparent 0px, transparent 4px,
      rgba(160, 72, 72, 0.025) 4px, rgba(160, 72, 72, 0.025) 6px
    ),
    repeating-linear-gradient(
      87deg,
      transparent 0px, transparent 12px,
      rgba(160, 72, 72, 0.015) 12px, rgba(160, 72, 72, 0.015) 16px
    ),
    repeating-linear-gradient(
      91deg,
      transparent 0px, transparent 28px,
      rgba(160, 72, 72, 0.01) 28px, rgba(160, 72, 72, 0.01) 30px
    );
}

/* Nav warm accent line on scroll */
.nav {
  transition: border-color 0.3s ease;
}

.nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 72, 72, 0.4), rgba(201, 168, 76, 0.25), rgba(160, 72, 72, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav--scrolled::after {
  opacity: 1;
}

/* Section label glow */
.section__label {
  text-shadow: 0 0 24px rgba(201, 168, 76, 0.3);
}

/* Hero bottom warm line */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 72, 72, 0.25), rgba(201, 168, 76, 0.15), rgba(160, 72, 72, 0.25), transparent);
}



/* Hero glow breathing animation */
@keyframes heroGlow {
  0% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Hero title gold shimmer */
@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

/* Warm player avatar border on leaderboard */
.player-avatar {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.leaderboard-table tbody tr:hover .player-avatar {
  border-color: rgba(160, 72, 72, 0.3);
  box-shadow: 0 0 12px rgba(122, 53, 53, 0.2);
}

/* Table wrapper warm hover glow */
.table-wrapper {
  transition: box-shadow 0.3s ease;
}

.table-wrapper:hover {
  box-shadow: 0 0 60px rgba(122, 53, 53, 0.06);
}

@media (max-width: 640px) {
  .leaderboard-table {
    min-width: 480px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: var(--space-sm) var(--space-md);
  }

  .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .leaderboard-table td {
    font-size: 0.825rem;
  }
}

/* --- Countdown --- */
.countdown-section {
  padding: var(--space-2xl) 0 0;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  background-color: var(--bg-card);
  background-image:
    repeating-linear-gradient(
      95deg,
      transparent 0px, transparent 4px,
      rgba(160, 72, 72, 0.025) 4px, rgba(160, 72, 72, 0.025) 6px
    ),
    repeating-linear-gradient(
      87deg,
      transparent 0px, transparent 12px,
      rgba(160, 72, 72, 0.015) 12px, rgba(160, 72, 72, 0.015) 16px
    );
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.countdown:hover {
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow: 0 0 40px rgba(201, 168, 76, 0.06);
}

.countdown::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.04), transparent 40%, rgba(122, 53, 53, 0.04));
  pointer-events: none;
}

.countdown__info {
  flex: 1;
  min-width: 0;
}

.countdown__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

.countdown__event-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.countdown__meta {
  font-size: 0.825rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.countdown__meta-sep {
  color: var(--text-tertiary);
}

.countdown__timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.countdown__digit {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 2px 8px rgba(0,0,0,0.2);
}

.countdown__unit-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.countdown__sep {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-dim);
  padding-bottom: 18px;
  animation: countdownPulse 2s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Countdown live state */
.countdown--live {
  border-color: rgba(160, 72, 72, 0.35);
}

.countdown--live .countdown__label {
  color: var(--mahogany-light);
}

.countdown--live .countdown__digit {
  color: var(--gold);
}

@media (max-width: 768px) {
  .countdown {
    flex-direction: column;
    text-align: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
  }

  .countdown__event-name {
    font-size: 1.05rem;
  }

  .countdown__meta {
    justify-content: center;
    font-size: 0.775rem;
  }

  .countdown__unit {
    min-width: 44px;
  }

  .countdown__digit {
    font-size: 1.4rem;
    min-width: 44px;
    padding: 6px 8px;
  }
}
