/* ══════════════════════════════════════════════════════════════════════
   BRAND TOKENS — seul bloc à modifier pour changer de club/organisation
   ══════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'BrandFont';
  src: url('/fonts/brand.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* Couleurs de marque */
  --brand-primary:        #e8593d;              /* CTA, actif, accent fort   */
  --brand-primary-dim:    rgba(232,89,61,0.12); /* fond bouton hover          */
  --brand-primary-mid:    rgba(232,89,61,0.25); /* bordure active             */
  --brand-secondary:      #1e3a8a;              /* headers, nav, badges       */
  --brand-secondary-dim:  rgba(30,58,138,0.10); /* teinture subtile navy      */
  --brand-accent:         #8b2f3f;              /* accent secondaire          */
  --brand-bg:             #f4e3c1;              /* fond principal             */
  --brand-surface:        #ffffff;              /* cartes, surfaces élevées   */
  --brand-border:         rgba(0,0,0,0.08);     /* bordures légères           */
  --brand-text:           #1a1a2e;              /* texte principal sur clair  */
  --brand-text-muted:     #5a5a5a;              /* texte secondaire           */
  --brand-on-primary:     #ffffff;              /* texte sur --brand-primary  */
  --brand-on-secondary:   #ffffff;              /* texte sur --brand-secondary*/

  /* Police — swap src du @font-face pour changer de club */
  --font-display: 'BrandFont', 'Barlow Condensed', sans-serif;
  --font-body:    'BrandFont', system-ui, sans-serif;

  /* Tokens structurels (inchangés entre clubs) */
  --radius:    16px;
  --radius-sm: 10px;
  --gold:      #f5a623;

  /* Texte sur fond intentionnellement sombre (cartes à dégradé foncé,
     overlays plein écran). Fixes, indépendants du thème clair/sombre —
     ne jamais utiliser --white/--white-muted ici : ces derniers pointent
     vers --brand-text (texte foncé) dans le thème clair actuel. */
  --on-dark:       #ffffff;
  --on-dark-muted: rgba(255,255,255,0.65);
}

/* ══════════════════════════════════════════════════════════════════════
   COMPAT — anciens tokens utilisés dans les inline styles HTML
   À supprimer progressivement au fil de la migration des inline styles
   ══════════════════════════════════════════════════════════════════════ */
:root {
  --black:       var(--brand-bg);
  --black2:      var(--brand-surface);
  --black3:      rgba(0,0,0,0.05);
  --black4:      var(--brand-border);
  --black5:      rgba(0,0,0,0.10);
  --red:         var(--brand-primary);
  --red-dim:     var(--brand-primary-dim);
  --red-mid:     var(--brand-primary-mid);
  --white:       var(--brand-text);
  --white-dim:   rgba(0,0,0,0.04);
  --white-mid:   rgba(0,0,0,0.12);
  --white-muted: var(--brand-text-muted);
  --navy:        var(--brand-secondary);
  --navy-bright: rgba(255,255,255,0.15);
}

/* ══════════════════════════════════════════════════════════════════════
   RESET & SHELL
   ══════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; width: 100%; overflow: hidden;
  background: var(--brand-secondary);
  color: var(--brand-text);
  font-family: var(--font-body);
  /* Filet de secours au meta viewport (maximum-scale/user-scalable) : evite
     le pincement/zoom (pinch-zoom) accidentel qui decale toute l'appli et
     donne l'impression d'un debordement horizontal (cf Design/beug
     trocardiere.jpeg), tout en preservant le pan horizontal ET vertical
     (necessaire aux listes qui scrollent en horizontal ailleurs dans l'app,
     ex. .collection-tabs/.trade-cards-row) — a la difference du raccourci
     "manipulation" qui autorise encore le pinch-zoom. */
  touch-action: pan-x pan-y;
}

#app {
  height: 100vh; height: 100dvh; height: var(--app-height, 100dvh); width: 100vw;
  display: flex; flex-direction: column;
  max-width: 430px; margin: 0 auto;
  position: relative; overflow: hidden;
  background: var(--brand-bg);
}

.screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.screen.active { display: flex; }

/* Zone scrollable des onglets principaux — padding-bottom = hauteur navbar */
.screen-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

/* ══════════════════════════════════════════════════════════════════════
   NAVBAR — SVG creux dynamique + cercle actif
   ══════════════════════════════════════════════════════════════════════ */
.navbar {
  /* absolute (pas fixed) ancre le menu au bas de #app plutôt qu'au vrai
     viewport : sur iOS en PWA installée, un menu fixed peut rester figé
     à la hauteur mesurée au lancement (avant stabilisation du viewport
     standalone) et laisser un vide en dessous. #app a une hauteur fiable
     (recalculée en JS, voir --app-height dans index.html), donc ancrer
     dessus suit toujours le vrai bas d'écran. */
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: 72px;
  background: transparent;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.navbar-svg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.navbar-items {
  position: absolute; inset: 0;
  display: flex; justify-content: space-around; align-items: flex-start;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; flex: 1; padding-top: 16px;
  background: none; border: none; cursor: pointer;
}
.nav-icon { font-size: 20px; line-height: 1; opacity: 0.6; }
.nav-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  font-family: var(--font-display);
}
/* Onglet actif */
.nav-btn.active { padding-top: 1px; gap: 4px; }
.nav-btn.active .nav-label { color: var(--brand-primary); font-size: 10px; }
.nav-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  box-shadow: 0 3px 10px rgba(232,89,61,0.4);
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER ONGLETS (navy + blob wave)
   ══════════════════════════════════════════════════════════════════════ */
.tab-header {
  flex-shrink: 0;
  background: var(--brand-secondary);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.tab-header-logo {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 900; letter-spacing: -1px;
  color: var(--brand-on-secondary); flex-shrink: 0;
}
.tab-header-right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.tab-header-actions { display: flex; gap: 6px; align-items: center; }
.tab-header-actions .settings-icon-btn { width: 30px; height: 30px; font-size: 14px; }
.tab-header-stats { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.tab-header-logo span { color: var(--brand-primary); }

.tab-blob {
  flex-shrink: 0; display: block; width: 100%; height: 40px;
  margin-bottom: -40px;
  position: relative; z-index: 2; pointer-events: none;
}
.tab-content {
  flex: 1; min-height: 0; overflow-y: auto;
  background: var(--brand-bg);
  padding: 68px 16px calc(84px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 1;
  isolation: isolate;
}
.tab-content::-webkit-scrollbar { display: none; }
/* Filet de securite : Safari iOS ignore parfois le padding-bottom d'un
   conteneur scrollable qui est aussi un flex-item (bug WebKit connu et
   ancien). Un vrai element en fin de contenu, lui, est toujours respecte —
   c'est ce qui garantit que le dernier element ne reste jamais a moitie
   cache sous la navbar une fois scrolle tout en bas. */
.scroll-end-spacer { height: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* ══════════════════════════════════════════════════════════════════════
   LOADING
   ══════════════════════════════════════════════════════════════════════ */
#screen-loading {
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
  background: var(--brand-secondary);
}
#screen-loading.active { display: flex; }
.loading-logo {
  font-family: var(--font-display);
  font-size: 52px; font-weight: 900; letter-spacing: -2px;
  color: var(--brand-on-secondary);
}
.loading-logo span { color: var(--brand-primary); }
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--brand-primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════
   ONBOARDING
   ══════════════════════════════════════════════════════════════════════ */
#screen-onboarding {
  display: none; align-items: center; justify-content: center;
  flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 28px calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: var(--brand-secondary);
}
#screen-onboarding.active { display: flex; }
.ob-logo {
  font-family: var(--font-display);
  font-size: 60px; font-weight: 900; letter-spacing: -2px;
  line-height: 1; color: var(--brand-on-secondary); margin-bottom: 2px;
}
.ob-logo span { color: var(--brand-primary); }
.ob-sub {
  font-size: 11px; font-weight: 700; letter-spacing: 4px;
  color: rgba(255,255,255,0.45); text-transform: uppercase; margin-bottom: 32px;
}
.ob-mascot { width: 150px; height: 150px; margin: 0 auto 28px; }
.ob-tagline {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800; line-height: 1.15;
  color: var(--brand-on-secondary); margin-bottom: 10px;
}
.ob-tagline em { color: var(--brand-primary); font-style: normal; }
.ob-desc { font-size: 14px; color: rgba(255,255,255,0.5); line-height: 1.6; margin-bottom: 32px; }

/* ══════════════════════════════════════════════════════════════════════
   NAME INPUT
   ══════════════════════════════════════════════════════════════════════ */
#screen-name {
  display: none; align-items: center; justify-content: center;
  flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 28px calc(40px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: var(--brand-bg);
}
#screen-name.active { display: flex; }
.name-title {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800;
  color: var(--brand-text); margin-bottom: 8px;
}
.name-sub { font-size: 14px; color: var(--brand-text-muted); margin-bottom: 32px; line-height: 1.5; }

.input-field {
  width: 100%; background: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  color: var(--brand-text);
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  padding: 16px 20px; margin-bottom: 12px;
  outline: none; transition: border-color .2s;
  text-align: center; letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.input-field:focus { border-color: var(--brand-primary); }
.input-field::placeholder { color: var(--brand-text-muted); font-weight: 400; font-size: 18px; letter-spacing: 0; }

/* ══════════════════════════════════════════════════════════════════════
   AVATAR CREATION
   ══════════════════════════════════════════════════════════════════════ */
#screen-create-avatar { display: none; flex-direction: column; flex: 1; overflow: hidden; background: var(--brand-bg); }
#screen-create-avatar.active { display: flex; }
.create-av-scroll { flex: 1; overflow-y: auto; padding: 0 20px calc(100px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
.picker-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-text-muted); margin-bottom: 10px; }
.skin-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 24px; }
.skin-btn { height: 44px; border-radius: 10px; border: 2px solid var(--brand-border); cursor: pointer; transition: all .15s; position: relative; }
.skin-btn.sel { border-color: var(--brand-primary); transform: scale(1.08); }
.skin-btn.sel::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.opt-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin-bottom: 20px; }
.opt-btn { background: var(--brand-surface); border: 2px solid var(--brand-border); border-radius: 20px; padding: 9px 10px; cursor: pointer; color: var(--brand-text-muted); font-family: var(--font-body); font-size: 13px; font-weight: 500; transition: all .15s; text-align: center; }
.opt-btn.sel { border-color: var(--brand-primary); background: var(--brand-primary-dim); color: var(--brand-primary); font-weight: 600; }
.hair-color-grid { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
.hair-color-btn { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--brand-border); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.hair-color-btn.sel { border-color: var(--brand-primary); transform: scale(1.18); }

/* ══════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════ */
.btn-red {
  background: var(--brand-primary); color: var(--brand-on-primary);
  border: none; border-radius: var(--radius);
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 16px 40px; cursor: pointer; width: 100%;
  transition: transform .1s, opacity .1s;
  position: relative; overflow: hidden;
}
.btn-red::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%); }
.btn-red:active { transform: scale(.97); opacity: .88; }
.btn-red:disabled { opacity: .4; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════════════
   TOPBAR (écrans non-onglets : jeux, avatar création, etc.)
   ══════════════════════════════════════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 10px; flex-shrink: 0;
  background: var(--brand-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.xp-chip {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.1); border-radius: 20px;
  padding: 5px 8px; border: 1px solid rgba(255,255,255,0.15);
}
.xp-chip-val { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--brand-primary); }
.xp-chip-label { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--brand-text-muted);
  padding: 18px 16px 8px; font-family: var(--font-display);
}
.section-label-tight { padding-top: 10px; padding-bottom: 6px; }

/* ══════════════════════════════════════════════════════════════════════
   TRIBUNE
   ══════════════════════════════════════════════════════════════════════ */
.tribune-hero {
  margin: 6px 16px 0;
  background: var(--brand-secondary);
  border-radius: var(--radius); padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.tribune-hero::before { content: ''; position: absolute; top: -30px; right: -20px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%); }
.tribune-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tribune-hero-label { font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--brand-primary); }
.tribune-hero-fans { font-size: 11px; font-weight: 700; color: var(--brand-on-secondary); background: rgba(255,255,255,0.1); border-radius: 20px; padding: 4px 9px; display: flex; align-items: center; gap: 4px; flex-shrink: 0; position: relative; z-index: 1; }
.tribune-hero-match { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--brand-on-secondary); line-height: 1.1; margin-bottom: 4px; }
.tribune-hero-date { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 14px; }
.countdown-row { display: flex; gap: 8px; }
.countdown-box { background: rgba(255,255,255,0.08); border-radius: 8px; padding: 8px 12px; text-align: center; flex: 1; min-width: 0; }
.countdown-val { font-family: var(--font-display); font-size: 24px; font-weight: 900; color: var(--brand-on-secondary); line-height: 1; display: block; }
.countdown-unit { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }
.pouls-collectif {
  margin: 0 16px; background: var(--brand-surface);
  border-radius: var(--radius); border: 1px solid var(--brand-border);
  padding: 12px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pouls-collectif-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--brand-text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); animation: pulse-anim 1.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse-anim { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.4; transform:scale(.7); } }
/* Jauge a curseur unique : les 4 categories de vote sont ramenees a un
   seul score 0-100 (Nerveux=0 ... En feu=100, cf community.js) plutot que
   montrees separement - plus lisible d'un coup d'oeil qu'une repartition
   a 4 valeurs. Piste en degrade (froid->chaud) + curseur positionne en %,
   bulle de valeur au-dessus qui suit le curseur. */
.mood-gauge { position: relative; height: 8px; margin: 32px 8px 6px; border-radius: 4px; background: linear-gradient(90deg, #7c8aa0 0%, var(--gold) 50%, var(--red) 100%); }
.mood-gauge-cursor { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--brand-surface); border: 3px solid var(--brand-text); box-shadow: 0 2px 6px rgba(0,0,0,0.25); transition: left 1s ease; }
.mood-gauge-badge {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--brand-text); color: var(--brand-surface);
  font-family: var(--font-display); font-size: 12px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.mood-gauge-badge::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--brand-text); }
.mood-gauge-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--brand-text-muted); }
.fan-jour {
  margin: 0 16px;
  background: linear-gradient(135deg, rgba(245,166,35,0.08) 0%, var(--brand-surface) 100%);
  border-radius: var(--radius); border: 1px solid rgba(245,166,35,0.2);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
}
.fan-jour-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.fan-jour-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--brand-text); margin-bottom: 1px; }
.fan-jour-sub { font-size: 12px; color: var(--brand-text-muted); }
.fan-jour-note { margin: 6px 16px 0; font-size: 11px; color: var(--brand-text-muted); line-height: 1.4; text-align: center; }
.fans-wall { padding: 0 16px; }
.fans-wall-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.fan-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fan-tile-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand-bg); border: 1.5px solid var(--brand-border);
  overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative;
}
.fan-tile-name { font-size: 11px; color: var(--brand-text-muted); text-align: center; line-height: 1.2; }

/* ══════════════════════════════════════════════════════════════════════
   MUR DES FANS (UGC)
   ══════════════════════════════════════════════════════════════════════ */
.wall-compose-btn {
  display: block; width: calc(100% - 32px); margin: 0 16px 12px;
  background: var(--brand-primary-dim); border: 1.5px dashed var(--brand-primary-mid);
  border-radius: var(--radius-sm); padding: 12px; cursor: pointer;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--brand-primary);
}
.wall-preview { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; margin-bottom: 12px; }
.wall-see-all-btn {
  display: block; width: calc(100% - 32px); margin: 0 16px 16px;
  background: transparent; border: 1px solid var(--brand-border); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--brand-text-muted);
}
.wall-post-card {
  background: var(--brand-surface); border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm); padding: 12px 14px; text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wall-post-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wall-post-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden; }
.wall-post-avatar svg { width: 100%; height: 100%; }
.wall-post-name { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--brand-text); }
.wall-post-date { font-size: 11px; color: var(--brand-text-muted); }
.wall-post-text { font-size: 13px; color: var(--brand-text); line-height: 1.5; margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; }
.wall-post-image { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; display: block; }
.wall-post-pending-badge {
  display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--gold);
  background: rgba(245,166,35,.12); border-radius: 10px; padding: 3px 9px;
}

/* ══════════════════════════════════════════════════════════════════════
   MISSIONS
   ══════════════════════════════════════════════════════════════════════ */
.xp-bar-wrap { padding: 0 16px; margin-top: -12px; }
.xp-bar-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.xp-bar-level { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--brand-text); }
.xp-bar-pts { font-size: 11px; color: var(--brand-text-muted); }
.xp-bar-track { height: 7px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: var(--brand-primary); border-radius: 4px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.streak-card {
  margin: 0 16px; background: var(--brand-secondary);
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color .3s ease, box-shadow .3s ease;
}
/* Fond sombre conserve tel quel (le texte blanc a ete pense pour ce
   contraste) : seul un liseret vert signale l'etat "recupere", pas de
   changement de fond qui rendrait le texte illisible. */
.streak-card.claimed { border-color: rgba(76,175,80,.55); box-shadow: inset 0 0 0 1px rgba(76,175,80,.2); }
.streak-val { font-family: var(--font-display); font-size: 24px; font-weight: 900; color: var(--brand-on-secondary); line-height: 1; }
.streak-val b { color: var(--brand-primary); }
.streak-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.streak-freeze-badge { position: absolute; bottom: -2px; right: -6px; font-size: 14px; }
.streak-claim-icon { font-size: 22px; flex-shrink: 0; animation: pulse-anim 1.5s ease-in-out infinite; }
/* Badge "recupere" dessine en CSS (rond + coche) plutot que l'emoji ✅,
   trop cartoonesque/generique a cote du reste des icones custom de l'app. */
.streak-card.claimed .streak-claim-icon {
  animation: none; font-size: 0; width: 24px; height: 24px; border-radius: 50%;
  background: #4caf50; display: flex; align-items: center; justify-content: center;
}
.streak-card.claimed .streak-claim-icon::after { content: '✓'; font-size: 14px; font-weight: 900; color: #fff; }
.missions-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.mission-card {
  background: var(--brand-surface); border-radius: var(--radius);
  border: 1px solid var(--brand-border); overflow: hidden; cursor: pointer;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mission-card.available { border-color: var(--brand-primary-mid); }
.mission-card.done { opacity: .5; pointer-events: none; }
.mission-card:active { transform: scale(.985); }
.mission-card-inner { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.mission-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-primary-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.mission-card.done .mission-icon { background: rgba(0,0,0,0.05); }
.mission-info { flex: 1; }
.mission-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--brand-text); margin-bottom: 2px; }
.mission-desc { font-size: 12px; color: var(--brand-text-muted); line-height: 1.4; }
.mission-xp { font-family: var(--font-display); font-size: 14px; font-weight: 700; padding: 5px 10px; border-radius: 20px; flex-shrink: 0; }
.xp-avail { background: var(--brand-primary); color: var(--brand-on-primary); }
.xp-done { background: rgba(0,0,0,0.06); color: var(--brand-text-muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px; }
.stat-box { background: var(--brand-surface); border-radius: var(--radius-sm); border: 1px solid var(--brand-border); padding: 14px 10px; text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.stat-val { font-family: var(--font-display); font-size: 26px; font-weight: 900; color: var(--brand-text); line-height: 1; }
.stat-label { font-size: 10px; color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.next-unlocks { padding: 0 16px; display: flex; flex-direction: column; gap: 7px; }
.next-unlock-row { background: var(--brand-surface); border-radius: var(--radius-sm); border: 1px solid var(--brand-border); padding: 10px 14px; display: flex; align-items: center; gap: 12px; }
.next-unlock-info { flex: 1; }
.next-unlock-name { font-size: 13px; font-weight: 500; color: var(--brand-text); margin-bottom: 5px; }
.next-unlock-bar { height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; overflow: hidden; }
.next-unlock-fill { height: 100%; background: var(--brand-primary); border-radius: 2px; transition: width .6s; }
.next-unlock-count { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--brand-text-muted); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════
   AVATAR SCREEN
   ══════════════════════════════════════════════════════════════════════ */
.avatar-header { padding: 14px 16px 0; text-align: center; }
.avatar-display { width: 150px; height: 150px; margin: 8px auto 0; border-radius: 50%; overflow: hidden; background: var(--brand-bg); border: 3px solid var(--brand-border); }
.avatar-display svg { width: 100%; height: 100%; display: block; }
.avatar-fan-name { font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--brand-text); text-align: center; margin-top: 6px; }
.avatar-rank { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-primary); text-align: center; margin-top: 2px; margin-bottom: 16px; }
.equip-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px; }
.equip-item { background: var(--brand-surface); border-radius: var(--radius-sm); border: 1px solid var(--brand-border); padding: 14px 8px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.equip-item.unlocked { border-color: var(--brand-primary-mid); }
.equip-item.active-eq { border-color: var(--brand-primary); background: var(--brand-primary-dim); }
.equip-item.locked-eq { opacity: .4; cursor: default; }
.equip-icon { font-size: 28px; margin-bottom: 5px; }
.equip-name { font-size: 10px; color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: .5px; }
.equip-req { font-size: 9px; color: var(--brand-primary); font-weight: 600; margin-top: 3px; }

/* ══════════════════════════════════════════════════════════════════════
   GAME SCREENS (fond navy pour "mode jeu" distinct)
   ══════════════════════════════════════════════════════════════════════ */
.game-screen { display: none; flex-direction: column; flex: 1; background: var(--brand-secondary); overflow: hidden; }
.game-screen.active { display: flex; }
.game-scroll { flex: 1; overflow-y: auto; padding: 20px 20px calc(100px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.game-topbar { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 10px; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.game-back-btn { width: 36px; height: 36px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: var(--brand-on-secondary); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.game-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--brand-on-secondary); }
.game-xp-label { font-size: 11px; color: rgba(255,255,255,0.45); }
.pouls-q { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--brand-on-secondary); line-height: 1.2; text-align: center; margin-bottom: 6px; }
.pouls-match-info { font-size: 13px; color: rgba(255,255,255,0.5); text-align: center; margin-bottom: 28px; }
.emotions-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 24px; }
.emotion-btn { background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 18px 12px; cursor: pointer; text-align: center; transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.emotion-btn:active { transform: scale(.95); }
.emotion-btn.sel { border-color: var(--brand-primary); background: var(--brand-primary-dim); }
.emotion-emoji { font-size: 34px; }
.emotion-label { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--brand-on-secondary); }
.emotion-btn.sel .emotion-label { color: var(--brand-primary); }
.pouls-result-wrap { display: none; flex-direction: column; align-items: center; text-align: center; padding-top: 20px; }
.pouls-result-wrap.show { display: flex; }
.result-big-emoji { font-size: 72px; animation: pop .4s cubic-bezier(.17,.67,.5,1.4); margin-bottom: 14px; }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.result-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--brand-on-secondary); margin-bottom: 10px; }
.result-desc { font-size: 14px; color: rgba(255,255,255,0.5); line-height: 1.6; margin-bottom: 24px; }
.result-desc strong { color: var(--brand-on-secondary); }
.xp-earned-badge { background: var(--brand-primary-dim); border: 1px solid var(--brand-primary); border-radius: var(--radius); padding: 14px 28px; font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--brand-primary); margin-bottom: 20px; }
.player-card { background: rgba(255,255,255,0.06); border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 18px; border: 1px solid rgba(255,255,255,0.12); }
.player-number { font-family: var(--font-display); font-size: 60px; font-weight: 900; color: var(--brand-primary); line-height: 1; }
.player-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--brand-on-secondary); }
.player-pos { font-size: 12px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }
.v-question { font-size: 15px; color: var(--brand-on-secondary); line-height: 1.5; text-align: center; margin-bottom: 18px; background: rgba(255,255,255,0.06); padding: 14px; border-radius: var(--radius-sm); }
.v-question strong { color: var(--brand-primary); }
.answers-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.answer-btn { background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 13px 16px; cursor: pointer; text-align: left; transition: all .15s; font-family: var(--font-body); font-size: 14px; color: var(--brand-on-secondary); display: flex; align-items: center; gap: 10px; }
.answer-btn.correct { border-color: #1a9e5e; background: rgba(26,158,94,.12); color: #4fd49a; }
.answer-btn.wrong { border-color: var(--brand-primary); background: var(--brand-primary-dim); color: var(--brand-primary); opacity: .7; }
.answer-letter { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.v-explication { background: rgba(255,255,255,0.06); border-radius: var(--radius-sm); padding: 14px; font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.6; margin-bottom: 16px; display: none; }

/* ══════════════════════════════════════════════════════════════════════
   TUTORIAL
   ══════════════════════════════════════════════════════════════════════ */
.tuto-slide { display: none; flex-direction: column; justify-content: flex-start; padding: 32px 28px 24px; flex: 1; overflow-y: auto; animation: fadeIn .3s ease; }
.tuto-slide.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.tuto-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,0.15); transition: all .2s; }
.tuto-dot.active { width: 24px; border-radius: 4px; background: var(--brand-primary); }

#screen-tuto { background: var(--brand-bg); }

.tuto-hero-emoji { font-size: 72px; margin-bottom: 16px; }
.tuto-hero-emoji.sm { font-size: 56px; margin-bottom: 10px; }

.tuto-title { font-family: var(--font-display); font-size: 42px; font-weight: 900; color: var(--brand-text); line-height: 1.05; margin-bottom: 16px; }
.tuto-title.lg { font-size: 36px; line-height: 1.1; margin-bottom: 10px; }
.tuto-title.md { font-size: 34px; line-height: 1.1; margin-bottom: 8px; }
.tuto-title .accent { color: var(--brand-primary); }
.tuto-title .accent-gold { color: var(--gold); }

.tuto-desc { font-size: 15px; color: var(--brand-text-muted); line-height: 1.7; margin-bottom: 20px; }
.tuto-desc.sm { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.tuto-desc.xs { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.tuto-desc.footnote { font-size: 12px; font-style: italic; text-align: center; margin-bottom: 0; }
.tuto-desc.hint { font-size: 11px; text-align: center; margin-bottom: 0; }

@keyframes coinPop { 0% { transform: scale(0) rotate(-15deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.tuto-coin-emoji.tuto-coin-pop { animation: coinPop .6s cubic-bezier(.34,1.56,.64,1); }
.tuto-coin-counter {
  font-family: var(--font-display); font-size: 44px; font-weight: 900;
  color: var(--brand-primary); text-align: center; margin: 4px 0 20px;
}

.tuto-card-dark { background: linear-gradient(135deg, var(--brand-secondary) 0%, #0a1428 100%); border-radius: var(--radius-sm); padding: 16px; border: 1px solid rgba(255,255,255,0.15); }
.tuto-card-dark-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--on-dark); margin-bottom: 10px; }
.tuto-feature-list { display: flex; flex-direction: column; gap: 8px; }
.tuto-feature-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-dark-muted); }
.tuto-feature-row .emoji { font-size: 20px; }

.tuto-mission-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tuto-mission-card { background: rgba(0,0,0,0.05); border-radius: var(--radius-sm); padding: 10px 6px; text-align: center; border: 1px solid rgba(0,0,0,0.10); }
.tuto-mission-card.special { background: rgba(245,166,35,.1); border-color: rgba(245,166,35,.5); }
.tuto-mission-card .icon { font-size: 22px; }
.tuto-mission-card .label { font-size: 10px; color: var(--brand-text-muted); margin-top: 4px; }
.tuto-mission-card.special .label { color: var(--gold); font-weight: 700; }

.tuto-flow { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.tuto-flow-arrow { display: flex; justify-content: center; font-size: 18px; color: var(--brand-text-muted); }
.tuto-flow-card { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.05); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid rgba(0,0,0,0.10); }
.tuto-flow-card.highlight { background: rgba(245,166,35,.1); border-color: rgba(245,166,35,.4); }
.tuto-flow-icon { font-size: 26px; flex-shrink: 0; }
.tuto-flow-text { font-size: 14px; color: var(--brand-text-muted); line-height: 1.4; }
.tuto-flow-text strong { color: var(--brand-text); }
.tuto-flow-card.highlight .tuto-flow-text strong { color: var(--gold); }

.tuto-levels { display: flex; flex-direction: column; gap: 6px; }
.tuto-level-row { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.05); border-radius: var(--radius-sm); padding: 10px 14px; border: 1px solid rgba(0,0,0,0.10); }
.tuto-level-row.accent { border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent); }
.tuto-level-row.legend { background: linear-gradient(135deg, rgba(245,166,35,.1) 0%, color-mix(in srgb, var(--brand-primary) 8%, transparent) 100%); border-color: rgba(245,166,35,.4); }
.tuto-level-emoji { font-size: 16px; }
.tuto-level-info { flex: 1; }
.tuto-level-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--brand-text); }
.tuto-level-row.legend .tuto-level-name { color: var(--gold); }
.tuto-level-xp { font-size: 11px; color: var(--brand-text-muted); }

.tuto-install-cta { display: none; margin-bottom: 12px; }
.tuto-install-cta .btn-red { width: 100%; }

.tuto-platform-card { background: rgba(0,0,0,0.05); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid rgba(0,0,0,0.10); margin-bottom: 10px; }
.tuto-platform-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--brand-text); margin-bottom: 8px; }
.tuto-steps { display: flex; flex-direction: column; gap: 7px; }
.tuto-step { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--brand-text-muted); }
/* Le texte de chaque etape est regroupe dans un seul <span> (flex:1) plutot
   que laisse en enfants flex directs : sinon le texte en gras et le texte
   qui suit deviennent chacun un flex-item separe et se retrouvent dans des
   colonnes independantes au lieu de former une seule phrase qui s'enchaine. */
.tuto-step > span { flex: 1; min-width: 0; }
.tuto-step strong { color: var(--brand-text); }
.tuto-step-num { background: var(--brand-primary); border-radius: 50%; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--brand-on-primary); flex-shrink: 0; }

.tuto-nav-footer { padding: 20px 28px max(40px, calc(20px + env(safe-area-inset-bottom, 0px))); flex-shrink: 0; }
.tuto-dots-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.tuto-nav-buttons { display: flex; gap: 10px; align-items: stretch; }
.tuto-btn-outline { background: transparent; color: var(--brand-text); border: 1px solid rgba(0,0,0,0.12); border-radius: var(--radius); font-family: var(--font-display); font-size: 16px; font-weight: 700; padding: 14px; cursor: pointer; }
.tuto-btn-prev { display: none; padding: 14px 18px; white-space: nowrap; }
.tuto-btn-skip { flex: 1; }
.tuto-btn-next { flex: 2; padding: 14px 20px; }

.avatar-edit-btn { margin: 0 auto 4px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.10); border-radius: 20px; padding: 8px 16px; color: var(--brand-text-muted); font-family: var(--font-display); font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: .5px; }

/* ══════════════════════════════════════════════════════════════════════
   NOTIFICATIONS & MODALS
   ══════════════════════════════════════════════════════════════════════ */
.notif {
  position: fixed; top: max(20px, env(safe-area-inset-top, 20px));
  left: 50%; transform: translateX(-50%) translateY(calc(-100% - 20px));
  background: var(--brand-surface); border: 1px solid var(--brand-border);
  border-radius: var(--radius); padding: 11px 20px;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--brand-text); z-index: 999;
  width: max-content; max-width: min(300px, calc(100vw - 40px));
  text-align: center; transition: transform .35s cubic-bezier(.17,.67,.5,1.3);
  pointer-events: none; white-space: normal; word-break: break-word;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.notif.show { transform: translateX(-50%) translateY(0); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: flex-end; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal {
  background: var(--brand-surface); border-radius: 24px 24px 0 0;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 430px; max-height: 85vh; overflow-y: auto; text-align: center;
  animation: slideUp .35s cubic-bezier(.17,.67,.5,1.3);
}
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-pill { width: 40px; height: 4px; background: var(--brand-border); border-radius: 2px; margin: 0 auto 24px; }
.modal-unlock-icon { font-size: 64px; margin-bottom: 12px; }
.modal-badge { font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--brand-primary); margin-bottom: 8px; }
.modal-title { font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--brand-text); margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--brand-text-muted); line-height: 1.5; margin-bottom: 24px; }
.error-banner { background: var(--brand-primary-dim); border: 1px solid var(--brand-primary-mid); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; color: var(--brand-primary); text-align: center; margin: 12px 0 0; display: none; }
.error-banner.show { display: block; }

/* ══════════════════════════════════════════════════════════════════════
   ADMIN CMS (interface fonctionnelle, thème neutral)
   ══════════════════════════════════════════════════════════════════════ */
.admin-header { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; border-bottom: 1px solid var(--brand-border); flex-shrink: 0; }
.admin-back { background: none; border: none; color: var(--brand-text); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px; line-height: 1; }
.admin-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--brand-text); }
.admin-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius-sm); margin-bottom: 6px; }
.admin-row-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow: hidden; }
.admin-row-date { font-size: 11px; font-weight: 700; color: var(--brand-text-muted); white-space: nowrap; flex-shrink: 0; }
.admin-row-type { font-size: 13px; font-weight: 600; color: var(--brand-text); white-space: nowrap; flex-shrink: 0; }
.admin-row-preview { font-size: 12px; color: var(--brand-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.admin-toggle { border-radius: 6px; padding: 4px 9px; font-size: 11px; font-weight: 700; cursor: pointer; border: 1px solid; font-family: var(--font-body); }
.admin-toggle.on { background: var(--brand-primary-dim); border-color: var(--brand-primary-mid); color: var(--brand-primary); }
.admin-toggle.off { background: rgba(0,0,0,0.04); border-color: var(--brand-border); color: var(--brand-text-muted); }
.admin-del { background: transparent; border: none; font-size: 16px; cursor: pointer; padding: 2px 4px; opacity: 0.55; line-height: 1; }
.admin-del:hover { opacity: 1; }
.admin-date-input { background: transparent; border: none; border-bottom: 1px solid var(--brand-border); border-radius: 0; padding: 1px 2px; color: var(--brand-text-muted); font-family: var(--font-body); font-size: 11px; font-weight: 700; width: 98px; min-width: 0; cursor: pointer; }
.admin-date-input:focus { outline: none; border-bottom-color: var(--gold); color: var(--brand-text); }
.admin-img-btn { background: var(--brand-bg); border: 1px dashed var(--brand-border); border-radius: 8px; padding: 10px 12px; color: var(--brand-text-muted); font-family: var(--font-body); font-size: 13px; cursor: pointer; width: 100%; text-align: center; transition: all .15s; }
.admin-img-btn:hover { border-color: var(--gold); color: var(--brand-text); }
.admin-type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 14px; }
.admin-type-btn { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: 8px; padding: 9px 4px; color: var(--brand-text-muted); font-family: var(--font-body); font-size: 11px; cursor: pointer; text-align: center; transition: all .15s; line-height: 1.3; }
.admin-type-btn:hover { border-color: var(--brand-primary-mid); color: var(--brand-text); }
.admin-type-btn.sel { background: var(--brand-primary-dim); border-color: var(--brand-primary); color: var(--brand-primary); font-weight: 700; }
.admin-form { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius); padding: 16px; margin-bottom: 8px; }
.admin-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.admin-field:last-child { margin-bottom: 0; }
.admin-field label { font-size: 11px; font-weight: 600; color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: .4px; }
.admin-field input, .admin-field textarea, .admin-field select { background: var(--brand-bg); border: 1px solid var(--brand-border); border-radius: 8px; padding: 10px 12px; color: var(--brand-text); font-family: var(--font-body); font-size: 14px; width: 100%; min-width: 0; }
.admin-field input:focus, .admin-field textarea:focus, .admin-field select:focus { outline: none; border-color: var(--brand-primary-mid); }
.admin-field textarea { resize: vertical; min-height: 60px; }
.admin-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
/* Safari iOS garde son "chrome" natif sur type=date/time (padding/bordure
   propres qui ignorent width:100%), d'ou un cadre qui deborde du conteneur
   parent malgre box-sizing:border-box — desactive pour forcer le modele de
   boite CSS standard. */
.admin-field input[type="date"], .admin-field input[type="time"] { -webkit-appearance: none; appearance: none; }
.admin-field-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; min-width: 0; }
.admin-field-row .admin-field { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════════════
   CARTES COLLECTION
   ══════════════════════════════════════════════════════════════════════ */
.card-wrap { perspective: 600px; position: relative; }
.collection-card { cursor: pointer; }
.collection-card .card-info { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .22s ease, padding .32s ease; }
.collection-card.info-shown .card-info { max-height: 46px; padding: 5px 6px 4px; opacity: 1; }
.collection-card .card-rarity-badge { opacity: 0; transition: opacity .22s ease; }
.collection-card.info-shown .card-rarity-badge { opacity: 1; }
.card-info-hint { position: absolute; bottom: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; line-height: 16px; text-align: center; opacity: .85; transition: opacity .2s ease; pointer-events: none; z-index: 2; }
.collection-card.info-shown .card-info-hint { opacity: 0; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.card-inner.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; overflow: hidden; }
.card-back-face {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 30% 20%, var(--brand-primary-mid) 0%, transparent 55%),
    linear-gradient(135deg, var(--brand-secondary) 0%, #0a1428 100%);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.06), inset 0 0 24px rgba(0,0,0,0.35);
  opacity: 1;
  transition: opacity .2s linear;
}
/* Filet de sécurité cross-browser : certains WebKit ne masquent pas fiablement
   backface-visibility quand l'élément a aussi un box-shadow + une animation
   continue (le dos "transparaît" derrière le recto). On force la disparition
   par opacité en plus de la rotation 3D. */
.card-inner.flipped .card-back-face { opacity: 0; pointer-events: none; }
.card-back-face::before {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; pointer-events: none;
}
.card-back-face::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg); animation: cardShine 3.2s ease-in-out infinite;
}
@keyframes cardShine { 0% { left: -60%; } 45%, 100% { left: 130%; } }
.card-back-emblem { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; z-index: 1; }
.card-back-emblem .ball { font-size: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.card-back-emblem .word { font-family: var(--font-display); font-size: 15px; font-weight: 900; letter-spacing: 1px; color: rgba(255,255,255,0.5); }
.card-front-face { transform: rotateY(180deg); display: flex; flex-direction: column; background: #111; }
#overlay-booster {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 30% 15%, var(--brand-primary-mid) 0%, transparent 55%),
    linear-gradient(160deg, var(--brand-secondary) 0%, #060d1c 100%);
  overflow-y: auto;
}
@keyframes cardDeal { 0% { opacity: 0; transform: translateY(24px) scale(.85); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.card-deal { animation: cardDeal .5s cubic-bezier(.17,.67,.5,1.4) both; }
@keyframes cardPop { 0% { transform: scale(1); } 35% { transform: scale(1.08); } 60% { transform: scale(0.97); } 100% { transform: scale(1); } }
.card-pop { animation: cardPop .38s ease-out; }
@keyframes goldBurst { 0% { box-shadow: 0 0 0 rgba(255,215,0,0); } 30% { box-shadow: 0 0 40px 8px rgba(255,215,0,.55); } 100% { box-shadow: 0 0 18px rgba(255,215,0,.35); } }
.card-rarity-gold.card-pop { animation: cardPop .38s ease-out, goldBurst .9s ease-out; }
.card-new-badge { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; padding: 3px 7px; border-radius: 10px; background: var(--brand-primary); color: var(--brand-on-primary); letter-spacing: .3px; white-space: nowrap; animation: newBadgePulse 1.4s ease-in-out infinite; }
@keyframes newBadgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.card-rarity-bronze .card-front-face { border: 2px solid #cd7f32; }
.card-rarity-silver .card-front-face { border: 2px solid #b8b8c8; }
.card-rarity-gold .card-front-face { border: 2px solid #ffd700; box-shadow: 0 0 18px rgba(255,215,0,.35); }
.card-photo { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: top center; display: block; }
.card-info { padding: 5px 6px 4px; background: #111; }
.card-name { font-family: var(--font-display); font-size: 11px; font-weight: 800; color: #fff; line-height: 1.15; text-transform: uppercase; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.card-pos { font-size: 9px; color: rgba(255,255,255,0.45); margin-top: 1px; }
.card-rarity-badge { position: absolute; top: 5px; right: 5px; font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 4px; letter-spacing: .5px; text-transform: uppercase; }
.card-rarity-bronze .card-rarity-badge { background: #cd7f32; color: #fff; }
.card-rarity-silver .card-rarity-badge { background: #b8b8c8; color: #111; }
.card-rarity-gold .card-rarity-badge { background: #ffd700; color: #111; }
.card-slot-empty { border: 2px dashed var(--brand-border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--brand-bg); gap: 4px; }
.collection-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 12px 16px calc(88px + env(safe-area-inset-bottom, 0px)); }
.settings-icon-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; font-size: 16px; cursor: pointer; }
.collection-tabs { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; flex-shrink: 0; }
.collection-tab { background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.10); border-radius: 20px; padding: 8px 16px; font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--brand-text-muted); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.collection-tab.active { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary); }

/* ══════════════════════════════════════════════════════════════════════
   AMIS
   ══════════════════════════════════════════════════════════════════════ */
.friends-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--brand-primary); color: var(--brand-on-primary);
  font-size: 9px; font-weight: 800; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1; border: 1.5px solid var(--brand-secondary);
}
.classement-toggle { display: flex; gap: 8px; padding: 0 16px 8px; }
.classement-toggle-btn {
  flex: 1; background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.1);
  border-radius: 20px; padding: 8px; font-family: var(--font-display);
  font-size: 13px; font-weight: 700; color: var(--brand-text-muted);
  cursor: pointer; text-align: center;
}
.classement-toggle-btn.active { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary); }

.friend-code-card { background: var(--brand-secondary); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.friend-code-label { font-size: 11px; color: var(--on-dark-muted); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-display); }
.friend-code-value { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--on-dark); flex: 1; }
.friend-copy-btn {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  color: var(--on-dark); border-radius: 20px; padding: 8px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.friend-code-input {
  flex: 1; min-width: 0; background: var(--brand-surface); border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--font-body);
  font-size: 14px; color: var(--brand-text); text-transform: uppercase;
}
.friend-add-btn {
  background: var(--brand-primary); color: var(--brand-on-primary); border: none;
  border-radius: var(--radius-sm); padding: 12px 18px; font-family: var(--font-display);
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.friend-request-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-surface); border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.friend-request-info { flex: 1; min-width: 0; }
.friend-request-name { font-size: 13px; font-weight: 600; color: var(--brand-text); }
.friend-request-sub { font-size: 11px; color: var(--brand-text-muted); margin-top: 2px; }
.friend-action-btn {
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 7px 14px; cursor: pointer; border: none;
  text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0;
}
.friend-action-accept { background: var(--brand-primary); color: var(--brand-on-primary); }
.friend-action-decline { background: rgba(0,0,0,0.06); color: var(--brand-text-muted); }
.friend-tile { cursor: pointer; }
.friend-remove-btn {
  background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.1); color: var(--brand-text-muted);
  border-radius: 20px; padding: 6px 14px; font-size: 11px; cursor: pointer;
}
#overlay-trade-composer { overflow-y: auto; }
.trade-cards-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; flex-shrink: 0; }
.trade-card-pick {
  width: 78px; height: 112px; flex-shrink: 0; border-radius: 8px; overflow: hidden;
  position: relative; cursor: pointer; border: 2px solid transparent; opacity: .75;
  transition: border-color .15s, opacity .15s; display: flex; flex-direction: column;
}
.trade-card-pick.card-rarity-bronze { border-color: #cd7f32; }
.trade-card-pick.card-rarity-silver { border-color: #b8b8c8; }
.trade-card-pick.card-rarity-gold   { border-color: #ffd700; }
.trade-card-pick.picked { border-color: var(--brand-primary); opacity: 1; }
.trade-card-count {
  position: absolute; top: 24px; right: 5px; font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 8px; background: rgba(0,0,0,0.65); color: #fff;
}
.trade-card-count-warn { background: var(--brand-primary); }

.ranking-section { border-top: 1px solid var(--brand-border); }
.ranking-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; padding: 14px 2px 8px;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: 1.5px;
  cursor: pointer;
}
.ranking-chevron { transition: transform .2s; font-size: 12px; flex-shrink: 0; }
.ranking-toggle.expanded .ranking-chevron { transform: rotate(180deg); }
.ranking-body { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }

.profile-bio {
  font-size: 13px; color: var(--brand-text); text-align: center;
  max-width: 280px; line-height: 1.4; cursor: pointer; padding: 2px 8px;
  margin: 0 auto 14px;
}
.profile-bio-empty { color: var(--brand-text-muted); font-style: italic; }
.profile-bio-input {
  width: 100%; resize: none; background: var(--brand-surface); border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font-body);
  font-size: 13px; color: var(--brand-text);
}
.profile-bio-save-btn {
  background: var(--brand-primary); color: var(--brand-on-primary); border: none;
  border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-red-compact {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  line-height: 1.3; padding: 13px 16px; font-size: 14px;
}

/* ══════════════════════════════════════════════════════════════════════
   UTILITAIRES — extraits des styles inline les plus dupliqués
   (index.html en comptait 383, souvent identiques répétés 3-27 fois).
   Volontairement limité aux valeurs uniques/simples déjà répétées
   plusieurs fois — pas une refonte complète, voir TECHNICAL_ROADMAP.md.
   ══════════════════════════════════════════════════════════════════════ */
.u-hidden       { display: none; }
.u-white        { color: var(--white); }
.u-on-dark      { color: var(--on-dark); }
.u-red          { color: var(--red); }
.u-flex1        { flex: 1; }
.u-flex1-shrink { flex: 1; min-width: 0; }
.u-center       { text-align: center; }
.u-relative     { position: relative; }
.u-fs13         { font-size: 13px; }
.u-fs18         { font-size: 18px; }
.u-fs20         { font-size: 20px; }
.u-mt20         { margin-top: 20px; }
.u-h16          { height: 16px; }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .fans-wall-grid { grid-template-columns: repeat(4,1fr); }
  .ob-tagline { font-size: 26px; }
  .ob-logo { font-size: 50px; }
  .countdown-val { font-size: 18px; }
  .countdown-unit { font-size: 8px; letter-spacing: 0.5px; }
  .countdown-row { gap: 4px; }
  .countdown-box { padding: 8px 4px; }
  .fan-tile-name { font-size: 11px; }
}
