/* ================================================================
   DOMINO'LANTHA – Design System
   ================================================================ */

/* ---- Variables ---- */
:root {
  --fire1:       #ff6b2b;
  --fire2:       #ffaa00;
  --gold:        #e8c44a;
  --gold-light:  #f5d878;
  --gold-dark:   #a07830;
  --ember:       #ff4400;
  --wood:        #5a3a1a;
  --wood-light:  #7a5030;
  --wood-dark:   #3a2010;
  --sand:        #c8a060;
  --sand-light:  #e0c090;
  --bg-dark:     #000209;
  --bg-mid:      #000209;
  --bg-panel:    rgba(20,12,5,0.92);
  --bg-card:     rgba(30,18,8,0.85);
  --border-fire: rgba(255,107,43,0.35);
  --border-gold: rgba(232,196,74,0.4);
  --border-wood: rgba(90,58,26,0.7);
  --text-main:   #f0ddb0;
  --text-muted:  #907860;
  --text-gold:   #e8c44a;
  --danger:      #e24b4a;
  --success:     #00b894;
  --radius:      10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--fire1); text-decoration: none; }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

input, select, textarea, button { font-family: inherit; }

/* ================================================================
   BACKGROUND
   ================================================================ */
.bg-scene {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.bg-base {
  position: absolute; inset: 0;
  background: #000209;
}
.ember-canvas { position: absolute; inset: 0; }

/* ================================================================
   LAYOUT
   ================================================================ */
.site-wrapper {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.app {
  width: 100%; max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 100px;
  flex: 1;
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
  text-align: center;
  padding: 28px 16px 12px;
}

.logo-link { display: inline-block; }

.logo-img {
  width: min(480px, 85vw);
  height: auto;
  display: block;
  margin: 0 auto;
}
.logo-img:hover {
  opacity: 0.92;
}

.header-tagline {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-top: 6px;
}

/* ================================================================
   NAVIGATION
   ================================================================ */
.main-nav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px;
  padding: 0 16px 20px;
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #0a0805 70%, transparent);
  padding-top: 8px;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #2a1808 0%, #1a0e05 100%);
  border: 1px solid var(--border-wood);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.2s; cursor: pointer;
}
.nav-item:hover { border-color: var(--fire1); color: var(--text-main); }
.nav-item.active {
  background: linear-gradient(180deg, #3a1e08, #200f04);
  border-color: var(--fire1);
  color: var(--fire1);
  box-shadow: 0 0 16px rgba(255,107,43,0.2);
}
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { line-height: 1; }

/* ================================================================
   WOOD PANEL (base card)
   ================================================================ */
.wood-panel {
  background: linear-gradient(135deg, #2a1808 0%, #1e0f05 50%, #251208 100%);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative; overflow: hidden;
  margin-bottom: 20px;
}
.wood-panel::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    88deg, transparent 0, transparent 8px,
    rgba(90,58,26,0.04) 8px, rgba(90,58,26,0.04) 9px
  );
  pointer-events: none;
}
.wood-panel::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,196,74,0.2), transparent);
}

/* ================================================================
   SECTION TITLE
   ================================================================ */
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 10px; letter-spacing: 3px;
  color: var(--gold-dark); text-transform: uppercase;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-wood), transparent);
}
.section-title .icon { font-size: 16px; }

/* Page title */
.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(232,196,74,0.35);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 13px; color: var(--text-muted); margin-bottom: 24px;
}

/* ================================================================
   ÉPREUVE BANNER
   ================================================================ */
.epreuve-banner {
  background: linear-gradient(135deg, #2a1808, #1a0e05);
  border: 1px solid var(--border-fire);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 18px;
  position: relative; overflow: hidden;
}
.epreuve-banner::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--fire2), var(--fire1), var(--ember));
}
.epreuve-icon { font-size: 36px; flex-shrink: 0; }
.epreuve-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px; letter-spacing: 3px; color: var(--fire1); text-transform: uppercase;
}
.epreuve-name {
  font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700;
  color: var(--gold); text-shadow: 0 0 20px rgba(232,196,74,0.4);
  margin: 3px 0;
}
.epreuve-desc { font-size: 13px; color: var(--text-muted); }
.epreuve-dates { font-size: 11px; color: var(--gold-dark); margin-top: 4px; letter-spacing: 1px; }
.epreuve-mult {
  margin-left: auto; text-align: center; flex-shrink: 0;
  background: rgba(255,107,43,0.08);
  border: 1px solid var(--border-fire);
  border-radius: 8px; padding: 10px 18px;
}
.mult-label { font-size: 9px; color: var(--fire1); letter-spacing: 1px; text-transform: uppercase; }
.mult-val {
  font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; color: var(--gold);
}

/* ================================================================
   STATS CARDS
   ================================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 22px;
}
.stat-card {
  background: linear-gradient(180deg, #221408 0%, #160b04 100%);
  border: 1px solid var(--border-wood);
  border-radius: 8px; padding: 16px 12px;
  text-align: center; position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--border-fire); transform: translateY(-1px); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,196,74,0.3), transparent);
}
.stat-icon { font-size: 22px; margin-bottom: 6px; }
.stat-num {
  font-family: 'Cinzel', serif; font-size: 28px; font-weight: 700;
  color: var(--fire1); line-height: 1;
  text-shadow: 0 0 20px rgba(255,107,43,0.4);
}
.stat-num.gold { color: var(--gold); text-shadow: 0 0 20px rgba(232,196,74,0.4); }
.stat-label { font-size: 10px; color: var(--text-muted); margin-top: 5px; letter-spacing: 0.5px; }

/* ================================================================
   TABS
   ================================================================ */
.tabs {
  display: flex; gap: 3px;
  background: #120a04;
  border: 1px solid var(--border-wood);
  border-radius: var(--radius); padding: 4px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  flex: 1; min-width: 80px;
  padding: 9px 6px;
  background: none; border: 1px solid transparent; border-radius: 7px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
}
.tab:hover { color: var(--text-main); }
.tab.active {
  background: linear-gradient(135deg, rgba(255,107,43,0.18), rgba(255,107,43,0.06));
  color: var(--fire1);
  border-color: rgba(255,107,43,0.3);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ================================================================
   LEADERBOARD
   ================================================================ */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }

.lb-row {
  background: linear-gradient(135deg, #221408 0%, #180d05 100%);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius); padding: 14px 18px;
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  align-items: center; gap: 14px;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.lb-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--fire2), var(--fire1));
  opacity: 0; transition: opacity 0.2s;
}
.lb-row:hover::before { opacity: 1; }
.lb-row:hover { border-color: var(--border-fire); transform: translateX(2px); }

.lb-row.rank-1 {
  background: linear-gradient(135deg, #2e1a04 0%, #1e1004 100%);
  border-color: rgba(232,196,74,0.5);
  box-shadow: 0 0 24px rgba(232,196,74,0.08);
}
.lb-row.rank-1::before { background: linear-gradient(180deg,var(--gold-light),var(--gold)); opacity:1; }
.lb-row.rank-2 { border-color: rgba(192,192,192,0.3); }
.lb-row.rank-3 { border-color: rgba(205,127,50,0.35); }

.lb-rank {
  font-family: 'Cinzel', serif; font-size: 22px; text-align: center; line-height: 1;
  width: 54px; flex-shrink: 0;
}
.rank-1 .lb-rank { color: var(--gold); text-shadow: 0 0 16px rgba(232,196,74,0.5); }
.rank-2 .lb-rank { color: #c0c0c0; }
.rank-3 .lb-rank { color: #cd7f32; }
.lb-row:not(.rank-1):not(.rank-2):not(.rank-3) .lb-rank {
  color: var(--text-muted); font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700;
}

.lb-color-bar {
  position: absolute; right: 0; top: 0; bottom: 0; width: 3px;
  opacity: 0.5;
}

.lb-info { min-width: 0; }
.lb-name {
  font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-1 .lb-name { color: var(--gold); text-shadow: 0 0 12px rgba(232,196,74,0.3); }
.lb-team { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.lb-detail { text-align: right; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.lb-pts {
  font-family: 'Cinzel', serif; font-size: 26px; font-weight: 700;
  color: var(--text-main); text-align: right; line-height: 1;
  text-shadow: 0 0 12px rgba(255,107,43,0.2);
  white-space: nowrap;
}
.rank-1 .lb-pts { color: var(--gold); text-shadow: 0 0 18px rgba(232,196,74,0.5); }
.lb-pts-label {
  font-size: 9px; color: var(--text-muted); text-align: right;
  letter-spacing: 1px; text-transform: uppercase;
}

/* Progress bar in leaderboard */
.lb-progress { height: 3px; border-radius: 2px; margin-top: 5px; background: rgba(255,107,43,0.15); overflow: hidden; }
.lb-progress-fill { height: 100%; background: linear-gradient(90deg, var(--fire1), var(--gold)); border-radius: 2px; transition: width 0.6s ease; }

/* ================================================================
   WEEK NAV
   ================================================================ */
.week-nav {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px;
}
.week-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 18px; min-width: 80px;
  background: linear-gradient(180deg, #2a1808, #1a0e05);
  border: 1px solid var(--border-wood);
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
}
.week-btn:hover { border-color: var(--fire1); color: var(--text-main); }
.week-btn.active {
  background: linear-gradient(180deg, #3a1e08, #250f04);
  border-color: var(--fire1);
  box-shadow: 0 0 16px rgba(255,107,43,0.2);
}
.week-btn .wnum  { font-size: 20px; font-weight: 700; line-height: 1; }
.week-btn .wname { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.week-btn .wemoji{ font-size: 18px; }
.week-btn.active .wnum  { color: var(--fire1); }
.week-btn.active .wname { color: var(--gold-dark); }

/* ================================================================
   FORMS
   ================================================================ */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase;
}
.field-group input,
.field-group select,
.field-group textarea {
  background: #120a04;
  border: 1px solid var(--border-wood);
  border-radius: 6px; color: var(--text-main);
  font-size: 14px; padding: 9px 12px;
  outline: none; transition: border-color 0.2s; width: 100%;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus { border-color: var(--fire1); }
.field-group select option { background: #120a04; }
.field-group textarea { resize: vertical; min-height: 80px; }

.field-full { grid-column: 1 / -1; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  border: none; padding: 10px 22px; white-space: nowrap;
}
.btn-fire {
  background: linear-gradient(135deg, #8a2e08, #c84010, #8a2e08);
  border: 1px solid rgba(255,107,43,0.5);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  box-shadow: 0 2px 16px rgba(200,64,16,0.3);
}
.btn-fire:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 28px rgba(255,107,43,0.5);
  border-color: var(--fire1);
}
.btn-fire:active { transform: translateY(0); }

.btn-wood {
  background: #1a0e05; border: 1px solid var(--border-wood); color: var(--text-main);
}
.btn-wood:hover { border-color: var(--fire1); color: var(--fire1); }

.btn-gold {
  background: linear-gradient(135deg, #7a5020, #c89030, #7a5020);
  border: 1px solid rgba(232,196,74,0.4); color: #fff;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: rgba(226,75,74,0.1); border: 1px solid rgba(226,75,74,0.4); color: var(--danger);
}
.btn-danger:hover { background: rgba(226,75,74,0.2); }

.btn-sm { padding: 7px 14px; font-size: 11px; }
.btn-xs { padding: 4px 10px; font-size: 10px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ================================================================
   BADGES & CHIPS
   ================================================================ */
.badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-fire   { background: rgba(255,107,43,0.15); color: var(--fire1); border: 1px solid var(--border-fire); }
.badge-gold   { background: rgba(232,196,74,0.12); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-success{ background: rgba(0,184,148,0.12); color: #00b894; border: 1px solid rgba(0,184,148,0.3); }
.badge-muted  { background: rgba(90,58,26,0.3); color: var(--text-muted); border: 1px solid var(--border-wood); }

.bonus-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1a0e05; border: 1px solid var(--border-wood);
  border-radius: 20px; padding: 5px 14px;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
  color: var(--text-muted); user-select: none;
}
.bonus-chip:hover { border-color: var(--fire1); color: var(--text-main); }
.bonus-chip.selected {
  background: rgba(255,107,43,0.12);
  border-color: var(--fire1); color: var(--fire1);
}
.bonus-chip .bonus-pts {
  background: var(--fire1); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 7px;
}

/* ================================================================
   TABLE
   ================================================================ */
.data-table-wrapper {
  overflow-x: auto; margin-bottom: 4px;
  border-radius: var(--radius); border: 1px solid var(--border-wood);
}
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  background: #1a0e05; padding: 10px 14px; text-align: left;
  font-family: 'Rajdhani', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; border-bottom: 1px solid var(--border-wood);
}
.data-table td {
  padding: 10px 14px; border-bottom: 1px solid rgba(90,58,26,0.3);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,107,43,0.04); }
.data-table .pts-cell {
  font-family: 'Cinzel', serif; color: var(--gold); font-size: 15px; font-weight: 700;
}
.data-table .type-client  { color: var(--fire1); }
.data-table .type-prospect{ color: var(--gold); }

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px;
}
.filter-bar .field-group { flex: 1; min-width: 140px; }
.filter-bar .search-group { flex: 2; min-width: 200px; }

/* ================================================================
   ANNONCE BANNER
   ================================================================ */
.announce-banner {
  background: linear-gradient(135deg, #2a1808, #1e0f05);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius); padding: 18px 22px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.announce-banner::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-dark));
}
.announce-title {
  font-family: 'Cinzel', serif; font-size: 13px; color: var(--gold); margin-bottom: 6px;
}
.announce-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ================================================================
   CARDS GRIDS
   ================================================================ */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.card {
  background: linear-gradient(135deg, #221408, #180d05);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius); padding: 18px;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.card:hover { border-color: var(--border-fire); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,196,74,0.15), transparent);
}
.card-title {
  font-family: 'Cinzel', serif; font-size: 15px; color: var(--text-main); margin-bottom: 6px;
}
.card-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.card-stat {
  display: flex; align-items: baseline; gap: 6px;
}
.card-pts {
  font-family: 'Cinzel', serif; font-size: 30px; color: var(--gold); line-height: 1;
  text-shadow: 0 0 16px rgba(232,196,74,0.3);
}
.card-pts-label { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

/* Agency card color bar */
.card-color-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: 0.7;
}

/* ================================================================
   OPENING CARDS
   ================================================================ */
.opening-card {
  background: linear-gradient(135deg, #221408, #180d05);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius); padding: 18px;
  transition: all 0.2s; position: relative;
}
.opening-card:hover { border-color: var(--border-gold); }
.opening-card.multi-site { border-color: rgba(0,184,148,0.4); }

.opening-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.opening-client { font-family: 'Cinzel', serif; font-size: 15px; color: var(--gold); }
.opening-agency { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.opening-body { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.opening-cities {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.city-chip {
  background: rgba(0,184,148,0.1); border: 1px solid rgba(0,184,148,0.3);
  color: #00b894; border-radius: 12px; padding: 2px 9px; font-size: 10px;
}

/* ================================================================
   TOAST
   ================================================================ */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  background: linear-gradient(135deg, #2a1808, #1a0e05);
  border: 1px solid var(--fire1);
  border-radius: var(--radius); padding: 16px 22px; max-width: 320px;
  transform: translateX(380px); transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 20px rgba(255,107,43,0.15);
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-color: var(--success); }
.toast.toast-error   { border-color: var(--danger); }
.toast-title { font-family: 'Cinzel', serif; font-size: 14px; color: var(--gold); margin-bottom: 4px; }
.toast-body  { font-size: 12px; color: var(--text-muted); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center; padding: 50px 20px; color: var(--text-muted);
}
.empty-icon { font-size: 42px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(5,3,2,0.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: linear-gradient(135deg, #2a1808, #1e0f05);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95); transition: transform 0.3s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-title {
  font-family: 'Cinzel', serif; font-size: 18px; color: var(--gold);
  margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border-wood);
}
.modal-close {
  float: right; background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; transition: color 0.2s;
}
.modal-close:hover { color: var(--danger); }

/* ================================================================
   SCORING TABLE (challenge page)
   ================================================================ */
.scoring-table {
  width: 100%; font-size: 13px; border-collapse: collapse;
}
.scoring-table th, .scoring-table td { padding: 8px 12px; }
.scoring-table th {
  font-family: 'Rajdhani', sans-serif; font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted); text-align: left;
  border-bottom: 1px solid var(--border-wood);
}
.scoring-table td { border-bottom: 1px solid rgba(90,58,26,0.2); }
.scoring-table tr:last-child td { border-bottom: none; }
.pts-fire { color: var(--fire1); font-family: 'Cinzel', serif; font-weight: 700; }
.pts-gold { color: var(--gold); font-family: 'Cinzel', serif; font-weight: 700; }

/* ================================================================
   ADMIN PANEL
   ================================================================ */
.admin-panel { background: #120a04; }
.admin-sidebar {
  background: linear-gradient(180deg, #1a0e05, #0f0703);
  border-right: 1px solid var(--border-wood);
  padding: 20px 0;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: all 0.15s; border-left: 3px solid transparent;
}
.admin-nav-item:hover { color: var(--text-main); background: rgba(255,107,43,0.05); }
.admin-nav-item.active { color: var(--fire1); border-left-color: var(--fire1); background: rgba(255,107,43,0.05); }

.admin-layout {
  display: grid; grid-template-columns: 200px 1fr; min-height: 600px;
}

/* ================================================================
   SITE FOOTER BAR
   ================================================================ */
.site-footer-bar {
  text-align: center; padding: 16px;
  font-size: 11px; color: var(--text-muted); letter-spacing: 1px;
  border-top: 1px solid var(--border-wood);
  margin-top: auto;
}
.footer-sep { margin: 0 8px; }

/* ================================================================
   LOGIN SCREEN
   ================================================================ */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.login-box {
  width: 100%; max-width: 380px;
  background: linear-gradient(135deg, #2a1808, #1e0f05);
  border: 1px solid var(--border-wood);
  border-radius: var(--radius); padding: 36px 32px; text-align: center;
}
.login-box .page-title { margin-bottom: 4px; }
.login-icon { font-size: 44px; margin-bottom: 16px; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0805; }
::-webkit-scrollbar-thumb { background: var(--border-wood); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--wood-light); }

/* ================================================================
   UTILITIES
   ================================================================ */
.text-gold   { color: var(--gold); }
.text-fire   { color: var(--fire1); }
.text-muted  { color: var(--text-muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-right  { text-align: right; }

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

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.p-0 { padding: 0 !important; }

.w-full { width: 100%; }

.hidden { display: none !important; }

.divider {
  border: none; border-top: 1px solid var(--border-wood); margin: 20px 0;
}

/* Loading spinner */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(255,107,43,0.2);
  border-top-color: var(--fire1);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .app { padding: 0 12px 80px; }

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

  .lb-row { grid-template-columns: 44px 1fr auto; }
  .lb-detail { display: none; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .epreuve-mult { display: none; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--border-wood); }

  .main-nav { gap: 4px; }
  .nav-label { display: none; }
  .nav-item { padding: 8px 10px; }
  .nav-icon { font-size: 22px; }

  .week-btn { padding: 8px 12px; min-width: 64px; }

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

  .filter-bar { flex-direction: column; }
  .filter-bar .field-group { min-width: unset; width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .logo-img { width: min(300px, 85vw); }
  .lb-pts { font-size: 20px; }
  .lb-name { font-size: 12px; }
}
