/* ==========================================================================
   PERPLEXITY DESIGN SYSTEM BASE
   ========================================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&display=swap');

:root {
  /* Primitive Color Tokens - Base System */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(241, 235, 221, 1);
  --color-cream-100: rgba(248, 244, 233, 1);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;

  /* ==========================================================================
     LES GILETS BRAND OVERRIDES (MERGED)
     ========================================================================== */
  /* Les Gilets Brand Colors - Specific */
  --brand-red: #E8291C;
  --brand-cream: #F1EBDD;
  --brand-white: #FFFFFF;
  --brand-gray: #333333;
  --brand-red-hover: #C72318;
  --brand-red-active: #A61E14;
  --brand-gray-light: #666666;
  --brand-border: #D4D0B8;

  /* RGB versions for opacity */
  --brand-red-rgb: 232, 41, 28;
  --brand-cream-rgb: 241, 235, 221;
  --brand-gray-rgb: 51, 51, 51;

  /* Semantic Color Tokens - OVERRIDES using Les Gilets colors */
  --color-background: var(--brand-cream);
  --color-surface: var(--brand-white);
  --color-text: var(--brand-gray);
  --color-text-secondary: var(--brand-gray-light);
  --color-primary: var(--brand-red);
  --color-primary-hover: var(--brand-red-hover);
  --color-primary-active: var(--brand-red-active);
  --color-secondary: var(--brand-cream);
  --color-secondary-hover: #E0DBAF;
  --color-secondary-active: #D4CFA0;
  --color-border: var(--brand-border);
  --color-btn-primary-text: var(--brand-white);
  --color-card-border: var(--brand-border);
  --color-card-border-inner: rgba(var(--brand-gray-rgb), 0.1);
  --color-error: var(--brand-red);
  --color-success: #28A745;
  --color-warning: #FFC107;
  --color-info: var(--brand-gray-light);
  --color-focus-ring: rgba(var(--brand-red-rgb), 0.3);
  --color-select-caret: var(--brand-gray);
  
  /* Overwrite derived variables that depend on the above */
  --focus-outline: 2px solid var(--color-primary);
  --color-success-rgb: 40, 167, 69;
  --color-error-rgb: var(--brand-red-rgb);
  --color-warning-rgb: 255, 193, 7;
  --color-info-rgb: 102, 102, 102;
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

/* garde bien : */
*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

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

.btn--secondary:active {
  background: var(--color-secondary-active);
}

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

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

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

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: var(--space-4);
}

.gap-8 {
  gap: var(--space-8);
}

.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}

.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}

.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}

.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-8);
  color: var(--brand-red);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  color: var(--brand-red);
  margin-bottom: 24px;
  letter-spacing: -0.015em;
  display: block;
}

.section-header {
  margin-bottom: var(--space-32);
}

.section-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  margin: 0;
}

h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-16);
}

header {
  background-color: transparent;
  border-bottom: none;
  padding: 0;
  box-shadow: none;
}

/* Hero Banner */
.hero-banner {
  position: relative;
  height: 280px;
  background: linear-gradient(135deg, var(--brand-red) 0%, #C72318 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(241, 235, 221, 0.75) 0%, rgba(241, 235, 221, 1) 100%);
  z-index: 1;
}

.hero-title {
  position: relative;
  z-index: 2;
  font-size: 4rem;
  color: var(--brand-red);
  font-weight: 700;
  font-family: 'Poppins', 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0;
  padding: 0 var(--space-24);
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  cursor: default;
}

.hero-title .trophy-icon {
  width: 48px;
  height: 48px;
  display: inline-block;
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-title:hover .trophy-icon {
  transform: scale(1.15) rotate(8deg);
  animation: trophyBounce 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes trophyBounce {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1.15) rotate(8deg); }
}

/* Main Navigation */
.main-nav {
  background-color: var(--color-background);
  border-bottom: 2px solid var(--color-border);
  padding: 0;
}

.nav-container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-16);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

nav {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text);
  padding: var(--space-12) var(--space-16);
  font-size: var(--font-size-base);
  cursor: pointer;
  border-radius: 0;
  transition: all var(--duration-fast) var(--ease-standard);
  font-weight: var(--font-weight-medium);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: transform var(--duration-fast) var(--ease-standard);
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--brand-red);
  background-color: rgba(232, 41, 28, 0.05);
}

.nav-btn:hover .nav-icon {
  transform: scale(1.1);
}

.nav-btn.active {
  border-bottom-color: var(--brand-red);
  color: var(--brand-red);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

.container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-32) var(--space-24);
  min-height: calc(100vh - 120px);
}

.page {
  animation: fadeIn var(--duration-normal) var(--ease-standard);
}

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

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  overflow: hidden;
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

.card__body {
  padding: var(--space-24);
}

.form-group {
  margin-bottom: var(--space-16);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--space-10) var(--space-12);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--brand-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard);
  font-family: var(--font-family-base);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

textarea.form-control {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-20);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  border: none;
  text-decoration: none;
  font-family: var(--font-family-base);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--outline {
  background: var(--brand-white);
  border: 2px solid var(--brand-red);
  color: var(--brand-red);
}

.btn--outline:hover {
  background: var(--brand-red);
  color: var(--brand-white);
}

.btn--sm {
  padding: var(--space-6) var(--space-12);
  font-size: var(--font-size-sm);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-24);
  margin-bottom: var(--space-24);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
}

.table-container {
  overflow-x: auto;
}

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

.stats-table th,
.stats-table td {
  padding: var(--space-12);
  text-align: left;
  border-bottom: 1px solid var(--color-card-border-inner);
}

.stats-table th {
  font-weight: var(--font-weight-semibold);
  color: var(--brand-white);
  background-color: var(--brand-red);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
}

.stats-table th:hover {
  background-color: var(--brand-red-hover);
}

.stats-table tbody tr:hover {
  background-color: rgba(var(--brand-cream-rgb), 0.5);
}

.stats-table a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.stats-table a:hover {
  text-decoration: underline;
}

.chart-container {
  position: relative;
  height: 400px;
  margin-top: var(--space-16);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--duration-fast) var(--ease-standard);
}

.modal-content {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-32);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-normal) var(--ease-standard);
}

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

.season-card {
  margin-bottom: var(--space-16);
}

.season-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-12);
}

.season-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(var(--color-success-rgb), var(--status-bg-opacity));
  color: #1E7A35;
  border: 1px solid rgba(var(--color-success-rgb), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(var(--color-info-rgb), var(--status-bg-opacity));
  color: var(--color-info);
  border: 1px solid rgba(var(--color-info-rgb), var(--status-border-opacity));
}

.checkbox-group {
  margin-bottom: var(--space-12);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  cursor: pointer;
  padding: var(--space-8);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.checkbox-group label:hover {
  background-color: rgba(var(--brand-cream-rgb), 0.5);
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.alert {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-16);
  font-size: var(--font-size-sm);
}

.alert--success {
  background-color: rgba(var(--color-success-rgb), 0.15);
  color: #1E7A35;
  border: 1px solid rgba(var(--color-success-rgb), 0.3);
}

.alert--error {
  background-color: rgba(var(--brand-red-rgb), 0.15);
  color: var(--brand-red);
  border: 1px solid rgba(var(--brand-red-rgb), 0.3);
}

.action-buttons {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* ======= LEADERBOARD CENTERED CONTAINER ======= */
.leaderboard-content-container {
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(248, 244, 233, 0.97) 0%, rgba(241, 235, 221, 0.9) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-32) var(--space-24);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-card-border);
}

@media (prefers-color-scheme: dark) {
  .leaderboard-content-container {
    background: linear-gradient(135deg, rgba(38, 40, 40, 0.95) 0%, rgba(31, 33, 33, 0.8) 100%);
  }
}

/* ======= PODIUM LEADERBOARD - Animated Design ======= */
.top3-leaderboard-section {
  display: flex;
  flex-direction: row;
  gap: 24px;
  margin-bottom: var(--space-32);
  justify-content: center;
  align-items: flex-end;
  padding: var(--space-24) 0;
}

/* Podium Card Base */
.top3-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-24) var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--color-card-border);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
}

/* 1st Place - Center, Largest */
.top3-card.rank-1 {
  order: 2;
  min-width: 240px;
  padding-top: var(--space-32);
  animation: podiumPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 2nd Place - Left, Medium */
.top3-card.rank-2 {
  order: 1;
  min-width: 210px;
  margin-top: 40px;
  animation: podiumPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
}

/* 3rd Place - Right, Smallest */
.top3-card.rank-3 {
  order: 3;
  min-width: 190px;
  margin-top: 60px;
  animation: podiumPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

@keyframes podiumPopIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  60% {
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Crown for 1st Place */
.top3-crown {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 36px;
  z-index: 10;
  animation: crownFloat 2s ease-in-out infinite, crownGlow 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.4));
}

@keyframes crownFloat {
  0%, 100% {
    transform: translateX(-50%) translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateX(-50%) translateY(-8px) rotate(5deg);
  }
}

@keyframes crownGlow {
  0%, 100% {
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.8));
  }
}

/* Avatar with Medal Borders */
.top3-card .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-cream);
  object-fit: cover;
  margin-bottom: var(--space-16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
  border: 3px solid var(--brand-red);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  user-select: none;
  transition: transform var(--duration-fast) ease;
}

/* 1st Place Avatar - GOLD border */
.top3-card.rank-1 .avatar {
  width: 120px;
  height: 120px;
  font-size: 3rem;
  border: 8px solid #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 2nd Place Avatar - SILVER border */
.top3-card.rank-2 .avatar {
  width: 100px;
  height: 100px;
  font-size: 2.5rem;
  border: 8px solid #C0C0C0;
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.5), 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 3rd Place Avatar - BRONZE border */
.top3-card.rank-3 .avatar {
  width: 80px;
  height: 80px;
  font-size: 2rem;
  border: 8px solid #CD7F32;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.4), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.top3-card:hover .avatar {
  transform: scale(1.08);
}

/* Player Name */
.top3-card-name {
  margin-top: var(--space-8);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-12);
  text-align: center;
  letter-spacing: 0.01em;
}

.top3-card.rank-1 .top3-card-name {
  font-size: 20px;
}

.top3-card.rank-2 .top3-card-name {
  font-size: 16px;
}

.top3-card.rank-3 .top3-card-name {
  font-size: 14px;
}

/* Main Stat */
.top3-card-mainstat {
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
  margin-bottom: var(--space-4);
  line-height: 1;
}

.top3-card.rank-1 .top3-card-mainstat {
  font-size: 32px;
}

.top3-card.rank-2 .top3-card-mainstat {
  font-size: 26px;
}

.top3-card.rank-3 .top3-card-mainstat {
  font-size: 22px;
}

/* Label */
.top3-card-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
  text-align: center;
}

/* Rank Badge (removed, using crown and medals instead) */
.top3-rank {
  display: none;
}

/* Medal Badge (removed, using border colors) */
.top3-card-medal {
  display: none;
}

@media (max-width: 900px) {
  .top3-leaderboard-section {
    flex-direction: column;
    align-items: center;
    gap: var(--space-20);
  }

  .top3-card {
    min-width: 0;
    max-width: 400px;
    width: 90%;
  }

  .top3-card.rank-1,
  .top3-card.rank-2,
  .top3-card.rank-3 {
    order: initial;
    margin-top: 0;
  }

  .top3-crown {
    top: -24px;
    font-size: 32px;
  }
}

.leaderboard-table-card {
  margin-top: var(--space-24);
  background: transparent;
  border: none;
  box-shadow: none;
}

.leaderboard-table {
  min-width: 520px;
}

.leaderboard-table thead th {
  background: var(--brand-cream);
  color: var(--brand-red);
  font-size: var(--font-size-base);
  letter-spacing: 0.025em;
  border: 0;
}

.leaderboard-table th, .leaderboard-table td {
  border-bottom: 1px solid var(--color-card-border-inner);
}

.leaderboard-table td {
  background: transparent;
  vertical-align: middle;
  font-size: var(--font-size-base);
  color: var(--color-text);
  border: 0;
}

.leaderboard-table .leaderboard-mainstat {
  color: var(--brand-red);
  font-weight: var(--font-weight-bold);
}

.leaderboard-table .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-cream);
  font-size: 1.2rem;
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--brand-red);
}

@media (max-width: 600px) {
  .leaderboard-table {
    min-width: 340px;
    font-size: var(--font-size-sm);
  }

  .top3-card {
    padding: var(--space-16) var(--space-12);
  }

  .top3-card.rank-1 .avatar {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    border-width: 6px;
  }

  .top3-card.rank-2 .avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    border-width: 6px;
  }

  .top3-card.rank-3 .avatar {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    border-width: 6px;
  }

  .top3-crown {
    font-size: 28px;
    top: -22px;
  }
}

.stat-mode-switch-container {
  margin-top: var(--space-16);
  display: flex;
  justify-content: center;
  gap: var(--space-12);
}

.stat-mode-btn.selected {
  background: var(--brand-red);
  color: var(--brand-white);
}

/* Leaderboard Category Tabs - CENTERED PILL STYLE */
.leaderboard-tabs {
  display: flex;
  gap: var(--space-12);
  margin-bottom: var(--space-32);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-8) 0;
}

.leaderboard-tab {
  background: transparent;
  border: 2px solid var(--brand-red);
  border-radius: var(--radius-full);
  padding: var(--space-12) var(--space-24);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--brand-red);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  position: relative;
}

.leaderboard-tab:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(232, 41, 28, 0.2);
  background-color: rgba(232, 41, 28, 0.05);
}

.leaderboard-tab.active {
  background: var(--brand-red);
  color: var(--brand-white);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 4px 16px rgba(232, 41, 28, 0.3);
  transform: scale(1.05);
}

.leaderboard-tab.active:hover {
  background: var(--brand-red-hover);
  box-shadow: 0 6px 20px rgba(232, 41, 28, 0.4);
}

@media (max-width: 768px) {
  .leaderboard-tabs {
    gap: var(--space-8);
  }

  .leaderboard-tab {
    padding: var(--space-10) var(--space-16);
    font-size: var(--font-size-sm);
  }
}

/* Compact leaderboard header layout */
.leaderboard-header-compact {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-32);
  padding: 0 var(--space-16);
}

.leaderboard-header-compact .section-title {
  flex: 1;
  text-align: center;
  margin: 0;
}

.leaderboard-season-selector {
  position: absolute;
  right: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 200px;
}

.leaderboard-season-selector .form-label {
  display: none;
}

@media (max-width: 768px) {
  .leaderboard-header-compact {
    flex-direction: column;
    align-items: center;
    gap: var(--space-16);
    padding: 0;
  }

  .leaderboard-header-compact .section-title {
    order: 1;
    font-size: 28px;
  }

  .leaderboard-season-selector {
    position: static;
    transform: none;
    order: 2;
    width: 100%;
    max-width: 300px;
  }
}

/* Player profile header with photo */
.player-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  margin-bottom: var(--space-24);
  flex-wrap: wrap;
}

.player-profile-avatar-large {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* C'est CE div qui devient le cercle */
#player-profile-avatar-display {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: var(--brand-cream);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 3px solid var(--brand-red);
  box-shadow: 0 8px 20px rgba(var(--brand-red-rgb), 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
}

/* Si jamais tu mets un dedans un jour */
#player-profile-avatar-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-profile-info {
  flex: 1;
  min-width: 200px;
}

.player-profile-info h2 {
  margin-bottom: var(--space-12);
}

.player-profile-photo-controls {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.player-profile-photo-controls label {
  cursor: pointer;
}

/* ================================================ */
.banner-preview-box {
  height: 120px;
  background: linear-gradient(135deg, var(--brand-red) 0%, #C72318 100%);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-base);
  border: 2px solid var(--color-border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-preview-box::after {
  content: '🏆 Les Gilets - Bowling';
  position: relative;
  z-index: 2;
  font-size: var(--font-size-2xl);
  color: var(--brand-red);
  font-weight: 700;
  font-family: 'Poppins', 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.02em;
  text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.6), 0px 2px 10px rgba(232, 41, 28, 0.2);
}

.banner-preview-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(238, 233, 200, 0.75) 0%, rgba(238, 233, 200, 1) 100%);
  z-index: 1;
}

/* ============================================ */
/* ARCADE ANIMATIONS */
/* ============================================ */
/* Page transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* Card animations */
@keyframes scalePop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Button animations */
@keyframes buttonSuccess {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  75% { transform: scale(0.98); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

/* Trophy animation */
@keyframes floatTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

/* Toast notifications */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Highlight effect */
@keyframes highlight {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(232, 41, 28, 0.1); }
}

/* Nav underline animation */
@keyframes navUnderline {
  from { width: 0; }
  to { width: 100%; }
}

/* Animation classes */
.page-enter {
  animation: fadeIn 0.3s ease-out, slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-enter {
  animation: cardEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.card-stagger-1 { animation-delay: 0.05s; }
.card-stagger-2 { animation-delay: 0.1s; }
.card-stagger-3 { animation-delay: 0.15s; }
.card-stagger-4 { animation-delay: 0.2s; }
.card-stagger-5 { animation-delay: 0.25s; }
.card-stagger-6 { animation-delay: 0.3s; }
.card-stagger-7 { animation-delay: 0.35s; }
.card-stagger-8 { animation-delay: 0.4s; }

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.highlight-update {
  animation: highlight 1s ease-out;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  pointer-events: none;
}

.toast {
  min-width: 300px;
  padding: var(--space-16) var(--space-20);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: var(--space-12);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all;
  border-left: 4px solid;
}

.toast.toast-out {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
  border-color: var(--color-success);
  background: rgba(var(--color-success-rgb), 0.1);
}

.toast-error {
  border-color: var(--color-error);
  background: rgba(var(--color-error-rgb), 0.1);
}

.toast-info {
  border-color: var(--brand-red);
  background: rgba(var(--brand-red-rgb), 0.1);
}

.toast-icon {
  font-size: 24px;
  line-height: 1;
}

.toast-message {
  flex: 1;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

/* Enhanced button hover */
.btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn--primary:hover {
  box-shadow: 0 4px 12px rgba(var(--brand-red-rgb), 0.3);
}

/* Trophy float animation */
.hero-title .trophy-icon {
  animation: floatTrophy 3s ease-in-out infinite;
}

.hero-title .trophy-icon.spinning {
  animation: spinTrophy 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Nav active state with underline */
.nav-btn {
  position: relative;
  overflow: visible;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--brand-red);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn.active::after {
  width: 100%;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
    letter-spacing: 0.02em;
    flex-direction: column;
    gap: var(--space-8);
  }

  .hero-title .trophy-icon {
    width: 36px;
    height: 36px;
  }

  .hero-banner {
    height: 200px;
  }

  .nav-container {
    flex-direction: row;
    padding: var(--space-8);
  }

  .nav-btn {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: var(--font-size-sm);
    padding: var(--space-10) var(--space-8);
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .stat-value {
    font-size: var(--font-size-2xl);
  }

  .toast-container {
    right: 10px;
    left: 10px;
    top: 70px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* Avatar dans la section Joueurs */
.player-list-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--brand-cream);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--brand-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: var(--font-weight-bold);
  color: var(--brand-red);
  overflow: hidden;
}

html[data-color-scheme="light"] {
  color-scheme: light;
}

html[data-color-scheme="light"] .leaderboard-content-container {
  background: linear-gradient(
    135deg,
    rgba(248, 244, 233, 0.97) 0%,
    rgba(241, 235, 221, 0.9) 100%
  );
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: #F1EBDD; /* beige Les Gilets */
  color: var(--color-text);
}
