/* =====================================================================
   DA reprise du site docs (docs.s4na.fr) : fond animé Aurora, palette
   indigo/noir-bleuté, accent périwinkle #7d7dfa, typo Inter, cartes sobres.
   ===================================================================== */
/* Inter en local (auto-hébergé) : respecte la CSP stricte 'self' et marche
   même sans Internet (Wi-Fi local). Fichier : /fonts/inter-var.woff2 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}

:root {
  --bg: hsl(240 12% 4%);
  --bg-2: hsl(240 10% 6.5%);
  --card: hsl(240 9% 8.5%);
  --card-2: hsl(240 8% 12%);
  --border: hsl(240 7% 16%);
  --text: hsl(240 20% 98%);
  --muted: hsl(240 6% 65%);
  /* accent unique (périwinkle) façon docs : on ramène tous les ex-accents festifs dessus */
  --brand: #7d7dfa;
  --brand-light: #d8d8ff;
  --pink: #7d7dfa;
  --yellow: #d8d8ff;
  --cyan: #7d7dfa;
  --green: #34d399;
  --red: #ff6b6b;
  --violet: #7d7dfa;
  --gold: #d8d8ff;
  --silver: #b9c0d6;
  --bronze: #9a8cff;
  --radius: 12px;
  --tabbar-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Fond animé Aurora (canvas WebGL injecté par aurora.js) + fondu vers le bas */
#aurora { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -10; pointer-events: none; }
#aurora-fade {
  position: fixed; inset: 0; z-index: -9; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(9,9,12,0) 0%, rgba(9,9,12,0.45) 50%, rgba(9,9,12,0.82) 74%, rgba(9,9,12,0.97) 90%, var(--bg) 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* --- Barre du haut ------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(13, 8, 32, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title h1 {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, var(--yellow), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo { font-size: 24px; }
.topbar-meta { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.chip-btn { gap: 4px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.chip-btn:active { transform: scale(.96); }
.chip-ended { background: rgba(255, 210, 63, .15); border-color: var(--yellow); color: var(--yellow); }

.ended-banner {
  margin: 12px 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 210, 63, .2), rgba(255, 77, 157, .2));
  border: 1px solid var(--yellow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.ended-banner strong { font-size: 20px; }

/* --- Mise en page ----------------------------------------------------------- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}
.screen { display: flex; flex-direction: column; gap: 14px; animation: fade-in .25s ease; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.card-title { font-size: 17px; margin-bottom: 12px; color: var(--muted); font-weight: 700; }
.card-title:not(:first-child) { margin-top: 18px; }

.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head h2 { font-size: 22px; }
.label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: block; }
.hint { margin-top: 14px; color: var(--muted); font-size: 14px; text-align: center; }

.live-dot { font-size: 13px; color: var(--green); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.live-dot::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(124, 242, 156, .7);
  animation: pulse 1.8s infinite;
}

/* --- Formulaires et boutons ------------------------------------------------------ */
.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--cyan); }
.input-xl { font-size: 22px; padding: 16px 18px; font-weight: 700; }
select.input { appearance: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: var(--card-2);
  transition: transform .1s, filter .15s, opacity .15s;
  touch-action: manipulation;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 8px 20px rgba(255, 77, 157, .35);
}
.btn-xl { width: 100%; min-height: 60px; font-size: 20px; border-radius: 16px; margin-top: 16px; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-ghost { background: transparent; border: 2px solid var(--border); color: var(--muted); }
.btn-chip { min-height: 48px; padding: 8px 4px; background: var(--card-2); border: 1px solid var(--border); font-size: 17px; }
.btn-icon { min-height: 44px; min-width: 44px; padding: 0; font-size: 20px; }
.btn-danger { background: var(--red); color: #200; }
.btn-danger-ghost { background: rgba(255, 107, 107, .12); border: 1px solid rgba(255, 107, 107, .4); }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: 15px; }

.form-error { color: var(--red); font-weight: 600; min-height: 1.4em; margin-top: 8px; font-size: 15px; }

/* --- Connexion --------------------------------------------------------------- */
.login { justify-content: center; min-height: 60vh; }
.login-card { text-align: center; padding: 28px 20px; }
.login-card h2 { font-size: 26px; margin: 6px 0 8px; }
.login-card form { margin-top: 22px; text-align: left; }
.login-emoji { font-size: 64px; line-height: 1; animation: float 3s ease-in-out infinite; }

/* --- Onglet Ajouter -------------------------------------------------------------- */
.my-total { display: flex; justify-content: space-between; align-items: center; }
.big-number { font-size: 44px; font-weight: 900; line-height: 1; color: var(--yellow); display: inline-block; }
.big-number small { font-size: 18px; color: var(--muted); font-weight: 700; }
.my-rank { text-align: right; }
.rank-badge { font-size: 36px; font-weight: 900; line-height: 1; }

.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game-option {
  min-height: 58px;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  word-break: break-word;
  transition: transform .1s, border-color .15s, background .15s;
  touch-action: manipulation;
}
.game-option:active { transform: scale(.97); }
.game-option.selected {
  border-color: var(--cyan);
  background: rgba(62, 230, 255, .15);
  box-shadow: 0 0 0 3px rgba(62, 230, 255, .2);
}
.game-option.selected::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 6px;
  vertical-align: -0.15em;
  background: currentColor;
  color: var(--cyan);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.points-row { display: flex; gap: 8px; }
.points-input { text-align: center; font-size: 32px; letter-spacing: .03em; }
.points-row .btn { flex: 0 0 60px; font-size: 20px; }
.quick-points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }

/* Option ×2 : grande zone cliquable, jaune quand elle est cochée */
.double-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .15s, background .15s;
}
.double-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.double-box {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--border);
  color: var(--muted);
  font-weight: 900;
  font-size: 18px;
  transition: all .15s;
}
.double-text { flex: 1; }
.points-preview { font-weight: 900; color: var(--yellow); white-space: nowrap; }
.double-toggle.checked { border-color: var(--yellow); background: rgba(255, 210, 63, .12); }
.double-toggle.checked .double-box { background: var(--yellow); border-color: var(--yellow); color: #2a1a00; transform: scale(1.08); }
.double-toggle:focus-within { box-shadow: 0 0 0 3px rgba(62, 230, 255, .35); }

.closed-card { text-align: center; }
.closed-card h2 { margin: 6px 0; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.history-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.history-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main .muted { font-size: 13px; }
.history-points { font-weight: 900; font-size: 20px; color: var(--green); }

/* --- Classement ---------------------------------------------------------------------- */
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  will-change: transform;
}
.row-rank { flex: 0 0 38px; text-align: center; font-weight: 900; font-size: 18px; color: var(--muted); }
.row-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-player { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name small { font-size: 13px; }
.row-total { font-weight: 900; font-size: 22px; white-space: nowrap; display: inline-block; }
.row-total small { font-size: 13px; color: var(--muted); font-weight: 700; }

.podium .row-rank { font-size: 30px; }
.podium-1 { background: linear-gradient(135deg, rgba(255, 210, 63, .28), var(--card) 70%); border-color: var(--gold); padding: 16px 14px; }
.podium-1 .row-player { font-size: 21px; }
.podium-1 .row-total { color: var(--gold); font-size: 26px; }
.podium-2 { background: linear-gradient(135deg, rgba(215, 222, 240, .2), var(--card) 70%); border-color: var(--silver); }
.podium-2 .row-total { color: var(--silver); }
.podium-3 { background: linear-gradient(135deg, rgba(240, 161, 94, .22), var(--card) 70%); border-color: var(--bronze); }
.podium-3 .row-total { color: var(--bronze); }

.rank-row.me { outline: 3px solid var(--cyan); outline-offset: 2px; box-shadow: 0 0 24px rgba(62, 230, 255, .35); }
.you {
  display: inline-block;
  width: fit-content;
  margin: 2px 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cyan);
  color: #002;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.leaderboard.compact .rank-row { padding: 10px 12px; }
.leaderboard.compact .podium .row-rank { font-size: 24px; }

.delta {
  position: absolute;
  right: 12px;
  top: -10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #032;
  font-weight: 900;
  font-size: 13px;
  animation: delta-pop 2.6s ease forwards;
  pointer-events: none;
}
.delta.negative { background: var(--red); color: #200; }

/* --- Stats ----------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
}
.tile-value { font-size: 28px; font-weight: 900; color: var(--yellow); line-height: 1.1; }
.tile:nth-child(2) .tile-value { color: var(--pink); }
.tile:nth-child(3) .tile-value { color: var(--cyan); }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.best-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.best-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.best-game { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.best-player { font-weight: 800; font-size: 18px; word-break: break-word; }

.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip.active { background: var(--pink); border-color: var(--pink); color: #fff; }

/* --- Barre d'onglets du bas ---------------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(20, 13, 43, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.tab-icon { font-size: 24px; transition: transform .2s; filter: grayscale(.6); }
.tab.active { color: var(--text); }
.tab.active .tab-icon { transform: translateY(-2px) scale(1.12); filter: none; }
.tab.active::after { content: ""; width: 26px; height: 4px; border-radius: 4px; background: var(--pink); margin-top: 2px; }

/* --- Notifications et confettis ------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translate(-50%, 20px);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.gold { border-color: var(--gold); background: #3a2d05; }

#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* --- Animations -------------------------------------------------------------------------------- */
.bump { animation: bump .6s cubic-bezier(.2, .8, .2, 1.4); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.3); color: var(--green); }
  100% { transform: scale(1); }
}
@keyframes delta-pop {
  0% { opacity: 0; transform: translateY(8px) scale(.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  80% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 242, 156, .7); }
  70% { box-shadow: 0 0 0 10px rgba(124, 242, 156, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 242, 156, 0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Très petits écrans (iPhone SE…) */
@media (max-width: 360px) {
  body { font-size: 16px; }
  .quick-points .btn-chip { font-size: 15px; }
  .tile-value { font-size: 22px; }
  .big-number { font-size: 38px; }
}

/* =====================================================================
   Espace organisateur
   ===================================================================== */
.admin main { max-width: 900px; padding-bottom: 40px; }
.admin .card + .card { margin-top: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-row .grow { flex: 1 1 160px; min-width: 0; }
.admin-row .input { padding: 10px 12px; }
.admin-row .input-points { flex: 0 0 110px; width: 110px; }
.admin-row .meta { font-size: 13px; color: var(--muted); }
.admin-row strong { word-break: break-word; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 200px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.danger-zone { border-color: var(--red); }
.danger-zone .card-title { color: var(--red); }
.checkbox { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; font-weight: 600; }
.checkbox input { width: 22px; height: 22px; accent-color: var(--pink); }
.admin-grid { display: grid; gap: 14px; }
@media (min-width: 800px) {
  .admin-grid.two { grid-template-columns: 1fr 1fr; align-items: start; }
}

.mb-12 { margin-bottom: 12px; }

/* =====================================================================
   Overrides DA docs : on neutralise les dégradés/couleurs festives codés
   en dur pour retomber sur la charte sobre (surface + accent périwinkle).
   Placé en fin de fichier -> gagne sur les règles précédentes.
   ===================================================================== */
.topbar {
  background: rgba(9, 9, 12, .72);
  border-bottom: 1px solid var(--border);
}
.topbar-title h1 {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo { filter: grayscale(1) brightness(1.4); }

.chip-ended {
  background: rgba(125, 125, 250, .12);
  border-color: rgba(125, 125, 250, .5);
  color: var(--brand-light);
}
.ended-banner {
  background: rgba(125, 125, 250, .08);
  border: 1px solid rgba(125, 125, 250, .35);
}

/* Cartes -> surface plate façon docs */
.card {
  background: var(--card);
  box-shadow: none;
}

/* Boutons -> .btn-brand : périwinkle plein, texte sombre */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  background: var(--brand);
  color: #0e0e2e;
  border: 1px solid var(--brand-light);
  box-shadow: none;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.06); }
.input, .game-option, .double-toggle { border-radius: 10px; }
.input { border-width: 1px; }

/* États sélectionnés -> accent unique */
.game-option.selected {
  border-color: var(--brand);
  background: rgba(125, 125, 250, .14);
  box-shadow: 0 0 0 3px rgba(125, 125, 250, .18);
}
.game-option.selected::before { color: var(--brand-light); }
.double-toggle.checked {
  border-color: var(--brand);
  background: rgba(125, 125, 250, .12);
}
.double-toggle.checked .double-box {
  background: var(--brand);
  border-color: var(--brand);
  color: #0e0e2e;
}
.double-toggle:focus-within,
.input:focus { box-shadow: 0 0 0 3px rgba(125, 125, 250, .28); }
.double-toggle.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.points-preview, .big-number, .tile-value,
.tile:nth-child(2) .tile-value, .tile:nth-child(3) .tile-value { color: var(--brand-light); }

/* Classement : "moi" en accent, podium en dégradés sobres */
.rank-row { border-radius: 12px; }
.rank-row.me {
  outline: 2px solid var(--brand);
  box-shadow: 0 0 24px rgba(125, 125, 250, .3);
}
.you { background: var(--brand); color: #0e0e2e; }
.podium-1 { background: linear-gradient(135deg, rgba(216, 216, 255, .16), var(--card) 70%); border-color: rgba(216, 216, 255, .55); }
.podium-1 .row-total { color: var(--gold); }
.podium-2 { background: linear-gradient(135deg, rgba(185, 192, 214, .14), var(--card) 70%); border-color: rgba(185, 192, 214, .5); }
.podium-2 .row-total { color: var(--silver); }
.podium-3 { background: linear-gradient(135deg, rgba(154, 140, 255, .16), var(--card) 70%); border-color: rgba(154, 140, 255, .5); }
.podium-3 .row-total { color: var(--bronze); }

/* Chips de filtre + barre d'onglets */
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: #0e0e2e; }
.tabbar { background: rgba(9, 9, 12, .82); border-top: 1px solid var(--border); }
.tab.active::after { background: var(--brand); }
.toast.gold { border-color: var(--brand-light); background: var(--card-2); }
.checkbox input { accent-color: var(--brand); }
kbd, code, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* =====================================================================
   Icônes SVG (remplacent les émojis). Le sprite est injecté par icons.js ;
   .ic pilote taille + trait (les <symbol> n'ont ni fill ni stroke propres).
   ===================================================================== */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--brand-light); }
.logo { display: inline-flex; }
.logo .ic { width: 22px; height: 22px; color: var(--brand-light); }
.login-emoji .ic { width: 54px; height: 54px; stroke-width: 1.5; color: var(--brand); }
.tab-icon .ic { width: 24px; height: 24px; }
.tab-icon { filter: none; }
.chip-btn .ic, .btn .ic { width: 1.05em; height: 1.05em; }
.row-rank .ic, .medal .ic { width: 1.35em; height: 1.35em; vertical-align: -0.28em; }
.medal-1 { color: var(--gold); }
.medal-2 { color: var(--silver); }
.medal-3 { color: var(--bronze); }
.best-player .crown-ic { color: var(--gold); vertical-align: -0.16em; }

/* =====================================================================
   Fenêtre modale "petit fou" (tentative de plus de 10 points)
   ===================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  background: rgba(5, 5, 10, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in .18s ease;
}
.modal-card {
  position: relative;
  max-width: 360px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  animation: pop-in .22s cubic-bezier(.2, .8, .2, 1.3);
}
.modal-card h2 { font-size: 21px; margin: 14px 0 6px; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
}
.modal-close:hover { background: var(--card-2); }
.fou-img {
  width: 100%;
  max-height: 46vh;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.modal-card .btn { margin-top: 16px; }
@keyframes pop-in {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: none; }
}
