/* css/pages.css */

/* ── Home ────────────────────────────────────────────────────── */
.view--home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  /* padding shorthand : redéfinit aussi le haut, donc le safe-area (cf. .view) doit être
     réintégré ici explicitement plutôt que laissé à la règle générique. */
  padding: calc(5vh + var(--safe-top)) 16px 20px;
  text-align: center;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--text);
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 4px 5px 4px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bankroll-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Streak badge (sous la barre XP) ─────────────────────────────── */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 8px;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.streak-badge--active {
  color: var(--gold);
  background: rgba(255,203,91,.12);
}
.streak-badge--alive {
  color: #FF9C3A;
  background: rgba(255,156,58,.1);
}
.streak-badge--broken {
  color: var(--text2);
  background: rgba(255,255,255,.05);
  filter: grayscale(1);
}
.streak-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  width: 200px;
  text-align: left;
  line-height: 1.4;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  white-space: normal;
}
.streak-tooltip--visible { opacity: 1; }
@media (hover: hover) {
  .streak-badge:hover .streak-tooltip { opacity: 1; }
}
.level-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
}
.level-num::before { content: 'Nv. '; }

.xp-bar {
  width: 80px;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
}
.xp-pct {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}

.bankroll-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bankroll-label  { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .12em; }
.bankroll-amount { font-size: 38px; font-weight: 800; color: var(--gold); letter-spacing: -.01em; }

.play-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 300px;
}
.play-secondary-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.btn--solo {
  padding: 13px 44px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .1em;
}
.btn--play-sm {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
}

.btn--recharge {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 12px;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}

/* ── Home avatar (inside player-chip) ────────────────────────── */
.home-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Avatar selector (Settings) ───────────────────────────────── */
.avatar-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.avatar-option {
  border-radius: 14px;
  padding: 14px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .18s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.avatar-option:active { transform: scale(.95); }
.avatar-option--active { border-color: rgba(255,255,255,.55); }
.avatar-emoji { font-size: 30px; line-height: 1; }
.avatar-name  { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .06em; }

/* ── Boutique ─────────────────────────────────────────────────── */
.shop-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 8px 16px 20px;
}
.shop-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.shop-item__preview { display: flex; align-items: center; justify-content: center; height: 52px; }
.shop-item__name  { font-size: 11px; color: var(--text2); text-align: center; }
.shop-item__price { font-size: 12px; color: var(--gold); font-weight: 700; }

/* Avatar preview in shop */
.shop-avatar-preview {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* Frame previews */
.shop-frame-preview {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
}

/* Apparence équipée : un cadre est un anneau décoratif posé AUTOUR de l'avatar (position absolue, jamais de
   changement de taille ni de mise en page). Il reprend l'aspect des classes .shop-frame--* ci-dessous, d'où sa
   place AVANT elles (leur couleur de bordure doit l'emporter) et des longhands (le raccourci `border` effacerait
   border-image). `border-image` ignore le rayon : sur un avatar rond, la flamme garde donc sa teinte et son halo
   en anneau plein (cf. .avatar-frame.shop-frame--flame). */
.avatar--framed { position: relative; }
.avatar-frame {
  position: absolute;
  inset: var(--frame-out, -3px);
  border-width: var(--frame-width, 3px);
  border-style: solid;
  border-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}
.shop-frame--cyan  { border-color: var(--accent); box-shadow: 0 0 var(--frame-glow, 10px) rgba(55,230,182,.4); }
.shop-frame--gold  { border-color: var(--gold);   box-shadow: 0 0 var(--frame-glow, 10px) rgba(255,203,91,.4); }
.shop-frame--flame { border-image: linear-gradient(135deg,#f12711,#f5af19) 1; border-radius: 50%; box-shadow: 0 0 var(--frame-glow, 12px) rgba(241,39,17,.35); }
.avatar-frame.shop-frame--flame { border-image: none; border-color: #f5871e; }

/* Badge preview */
.shop-badge-preview { font-size: 32px; line-height: 1; }

/* Boutique réelle (js/ui/pages/shop.js) : états des cartes. Aucune carte ne change de taille. */
.shop-item--equipped { border-color: var(--accent); }
.shop-item__price--owned { color: var(--accent); }
.shop-item__btn--on { color: var(--accent); border-color: var(--accent); }
.shop-item__missing { font-size: 10px; line-height: 1.3; color: var(--text2); text-align: center; text-wrap: balance; }

/* Profil : badge équipé à côté du libellé « Pseudo ». */
.stats-pseudo-badge { margin-left: 6px; font-size: 14px; line-height: 1; }

/* ── Défis ────────────────────────────────────────────────────── */
.view--challenges {
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 8px 16px 20px;
  width: 100%;
  box-sizing: border-box;
}
.challenge-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 0;
}
.challenge-card:hover { border-color: var(--accent); }
.challenge-card--claimable { border-color: rgba(255,200,80,.4); }
.challenge-card--complete  { border-color: rgba(55,230,182,.3); }
.challenge-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.challenge-card__icon   { font-size: 18px; flex-shrink: 0; }
.challenge-card__label  { font-size: 11px; font-weight: 700; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.challenge-card__rank   { font-size: 9px; font-weight: 700; margin-left: auto; flex-shrink: 0; }
.challenge-card__footer { display: flex; justify-content: space-between; align-items: center; }

.challenge-progress-bar  { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.challenge-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s ease; }

/* ── Dim overlay (bottom sheet) ──────────────────────────────────── */
.detail-dim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 199;
  opacity: 0;
  transition: opacity .28s ease;
}
.detail-dim.is-open { opacity: 1; }

/* ── Challenge detail — carte flottante centrée ───────────────────── */
.challenge-detail {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(358px, calc(100% - 32px));
  max-height: 85dvh;
  background: var(--bg);
  border-radius: 20px;
  z-index: 200;
  overflow-y: auto;
  padding: 16px 16px 20px;
  box-sizing: border-box;
  transform: translate(-50%, 100vh);
  transition: transform .36s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 8px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.06);
}
.challenge-detail.is-open { transform: translate(-50%, -50%); }

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-icon        { font-size: 28px; flex-shrink: 0; }
.detail-title-block { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.detail-title       { font-size: 18px; font-weight: 800; margin: 0; }
.detail-subtitle    { font-size: 12px; color: var(--text2); margin: 0; }

.detail-progress-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.detail-progress-top { display: flex; justify-content: space-between; align-items: center; }

.detail-ranks { display: flex; flex-direction: column; }

/* ── Rang complété ───────────────────────────────────────────── */
.detail-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-rank-row--done { opacity: 0.55; }

/* Rang complété, récompense pas encore réclamée */
.detail-rank-row--claimable {
  background: rgba(255, 203, 91, 0.07);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  margin: 2px 0;
}
.detail-rank-row--claimable .detail-rank-label {
  color: var(--gold);
  font-weight: 700;
}
.detail-rank-claim-btn {
  background: var(--gold);
  color: #0B0B0E;
  border: none;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity .15s;
}
.detail-rank-claim-btn:active { opacity: 0.75; }
.detail-rank-left    { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.detail-rank-label   { font-size: 13px; font-weight: 600; }
.detail-rank-req     { font-size: 10px; color: var(--text2); }
.detail-rank-reward  { font-size: 12px; color: var(--gold); font-weight: 700; flex-shrink: 0; }
.detail-rank-status  { font-size: 11px; color: var(--text2); flex-shrink: 0; min-width: 48px; text-align: right; }
.detail-rank-status--done  { color: var(--accent); }
.detail-rank-status--claim { color: var(--gold); cursor: pointer; text-decoration: underline; font-weight: 700; }

/* ── Rang en cours (barre de progression inline) ─────────────── */
.detail-rank-row--current {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.detail-rank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-rank-top .detail-rank-label { font-size: 13px; font-weight: 700; color: var(--text); }
.detail-rank-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-rank-progress-wrap .challenge-progress-bar { height: 5px; }
.detail-rank-progress-wrap .detail-rank-req {
  font-size: 10px;
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Rang verrouillé (futur) ─────────────────────────────────── */
.detail-rank-row--locked {
  opacity: 0.35;
  filter: grayscale(0.4);
}
.detail-rank-row--locked .detail-rank-label { font-size: 13px; font-weight: 600; }
.detail-rank-row--locked .detail-rank-reward { color: var(--text2); }

/* ── Tab bar (Défis) ─────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Timed challenges (daily/weekly) ─────────────────────────── */
.timed-countdown {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  padding: 4px 0 8px;
}
.timed-card {
  padding: 14px;
}

/* ── Amis ─────────────────────────────────────────────────────── */
.view--friends { padding: var(--safe-top) 16px 0; }

/* ── Paramètres ───────────────────────────────────────────────── */
.settings-content { padding: 0 16px 20px; }
.settings-section { margin-bottom: 24px; }
.settings-section__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text2);
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.settings-row input[type="text"] {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 160px;
  text-align: right;
}
/* Ligne « Règles du jeu » : un vrai <button> (clavier, lecteur d'écran), cible tactile ≥ 44 px. */
.settings-row--link {
  width: 100%;
  min-height: 48px;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.settings-row--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.settings-row--link:active .settings-row__go { opacity: .6; }
.settings-row__go { color: var(--accent); }
.toggle {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform var(--transition);
}
.toggle.on::after { transform: translateX(20px); }

/* ── Équité vérifiable (entrée Paramètres + panneau, js/ui/pages/fairness.js) ── */
.settings-row--link {
  width: 100%;
  background: none;
  color: var(--text);
  font-size: 15px;
  text-align: left;
  gap: 12px;
}
.settings-row--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.settings-row__go { color: var(--accent); flex-shrink: 0; }
.fair-overlay .stats-title { margin: 0; }
.fair-overlay .btn--back:focus-visible,
.fair-overlay .btn:focus-visible,
.fair-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fair-body { display: flex; flex-direction: column; gap: 14px; }
.fair-lead, .fair-card p { font-size: 13px; line-height: 1.55; color: var(--text2); }
.fair-lead strong, .fair-card strong { color: var(--text); }
.fair-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.fair-card__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text2);
}
.fair-card--note code { font-size: 11px; word-break: break-all; color: var(--text); }
.fair-dl { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fair-dl__row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fair-dl dt { font-size: 11px; color: var(--text2); }
.fair-dl dd { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); flex-wrap: wrap; }
.fair-hash {
  flex: 1 1 180px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--cyan);
  word-break: break-all;
  user-select: all;
}
.fair-tag {
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.fair-copy {
  flex-shrink: 0;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}
.fair-empty { font-size: 13px; color: var(--text2); line-height: 1.5; }
.fair-label { font-size: 12px; color: var(--text2); }
.fair-seed { display: flex; flex-direction: column; gap: 8px; }
.fair-seed__row { display: flex; gap: 8px; }
.fair-seed__input {
  flex: 1;
  min-width: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fair-seed__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fair-seed__input[aria-invalid="true"] { border-color: var(--danger); }
.fair-seed__random {
  align-self: flex-start;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fair-card .fair-hint { font-size: 12px; }
.fair-card .fair-status { font-size: 12px; min-height: 1em; }
.fair-card .fair-status--ok { color: var(--accent); }
.fair-card .fair-status--ko { color: var(--danger); }
.fair-history { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.fair-item {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fair-item:first-child { border-top: none; padding-top: 0; }
.fair-item__head { display: flex; flex-direction: column; gap: 2px; }
.fair-item__title { font-size: 14px; font-weight: 700; color: var(--text); }
.fair-item__meta { font-size: 11px; color: var(--text2); }
.fair-verify-btn { align-self: flex-start; }
.fair-result:empty { display: none; }
.fair-card .fair-verdict { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.fair-card .fair-verdict--ok { color: var(--accent); }
.fair-card .fair-verdict--ko { color: var(--danger); }
.fair-checks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; }
.fair-check { display: flex; gap: 8px; font-size: 12px; line-height: 1.45; color: var(--text2); }
.fair-check__mark { flex-shrink: 0; font-weight: 800; }
.fair-check--ok .fair-check__mark { color: var(--accent); }
.fair-check--ko .fair-check__mark { color: var(--danger); }
.fair-check--ko { color: var(--text); }
.fair-overlay .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Profil du joueur — pseudo + avatar picker ───────────────── */
.stats-pseudo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.stats-pseudo-label { font-size: 14px; color: var(--text); }
.stats-pseudo-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 140px;
  text-align: right;
  font-family: inherit;
}
.stats-pseudo-input:focus { outline: 1px solid var(--accent); }

/* Sélecteur d'avatar circulaire */
.avatar-picker {
  display: flex;
  justify-content: space-between;
  padding: 4px 0 8px;
}
.avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  border: 2.5px solid transparent;
  box-sizing: border-box;
  transition: border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.avatar-circle--active {
  border-color: rgba(255,255,255,.85);
  box-shadow: 0 0 0 3px rgba(55,230,182,.3);
}
.avatar-circle:active { transform: scale(.88); }

.avatar-circle { --frame-out: -5.5px; }   /* le cadre se pose en dehors de la bordure (2,5 px) du cercle */

/* Boutique : seuls les avatars possédés sont proposés — rangés à gauche, et une mention renvoie à la Boutique. */
.avatar-picker--partial { justify-content: flex-start; gap: 16px; }
.avatar-picker-hint { font-size: 11px; color: var(--text2); padding: 0 0 8px; }

/* ── Stats & Niveaux overlay ─────────────────────────────────── */
.stats-overlay {
  position: absolute;
  inset: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
.stats-inner {
  /* Encoche / indicateur d'accueil iOS (viewport-fit=cover) : += inset ; inchangé (16 16 28) quand les insets sont 0.
     Sert aussi au panneau « Équité » (.fair-overlay). */
  padding: calc(16px + var(--safe-top)) max(16px, env(safe-area-inset-right, 0px))
           calc(28px + var(--safe-bottom)) max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--text);
  flex: 1;
}
.btn-sync-profile {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text2);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-sync-profile:active { color: var(--accent); border-color: var(--accent); }

/* Level + XP block */
/* ── Carte niveau unifiée ────────────────────────────────────────── */
.stats-level-card {
  background: linear-gradient(135deg, rgba(55,230,182,.10) 0%, rgba(255,200,80,.07) 100%);
  border: 1px solid rgba(55,230,182,.25);
  border-radius: 16px;
  padding: 16px;
}
.slc-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.slc-level-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 1px;
}
.slc-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.slc-num {
  font-size: 42px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}
.slc-rank {
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.slc-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4px;
}
.slc-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slc-bar-area {
  flex: 1;
  position: relative;
  padding-top: 20px;
}
.slc-bar {
  height: 12px;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  overflow: hidden;
}
.slc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 6px;
}
.slc-pct-tip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: none;
}
.slc-next-info {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.slc-bar-next {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}
.slc-next-reward {
  font-size: 10px;
  color: var(--text2);
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}
.slc-next-reward strong {
  color: var(--gold);
  font-weight: 800;
}

/* Section title */
.stats-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.stats-section-title--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* "Tout voir" link-button */
.btn--go-challenges {
  font-size: 10px;
  color: var(--accent);
  background: transparent;
  border: 1px solid rgba(55,230,182,.35);
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Stats 2-column grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-card__label {
  font-size: 9px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stat-card__value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.stat-card__sub {
  font-size: 10px;
  color: var(--text2);
  margin-top: 1px;
}

.btn--danger-ghost {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  width: 100%;
  margin-top: 12px;
}

/* ── Mini card fan (défis rangs) ─────────────────────────────────── */
.mc-fan {
  position: relative;
  width: 36px;
  height: 28px;
  flex-shrink: 0;
}
.mc {
  position: absolute;
  width: 20px;
  height: 28px;
  background: #fff;
  border-radius: 3px;
  border: 1px solid #d8d8d8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  color: #111;
}
.mc--red { color: #D93030; }
.mc-suit { font-size: 7px; line-height: 1; }
.mc:nth-child(1) { left: 0; top: 0; transform: rotate(-8deg); z-index: 1; }
.mc:nth-child(2) { left: 12px; top: 0; transform: rotate(7deg);  z-index: 2; }
.mc:only-child   { left: 8px; transform: rotate(0deg); z-index: 1; }

/* Variante grande — header du panneau détail */
.mc-fan--lg { width: 52px; height: 44px; }
.mc-fan--lg .mc {
  width: 30px;
  height: 44px;
  font-size: 14px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.mc-fan--lg .mc-suit { font-size: 10px; }
.mc-fan--lg .mc:nth-child(1) { left: 0; }
.mc-fan--lg .mc:nth-child(2) { left: 18px; }
.mc-fan--lg .mc:only-child   { left: 11px; }

/* ── Daily completion bonus ──────────────────────────────────────── */
.completion-bonus-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(255,203,91,.1) 0%, rgba(55,230,182,.07) 100%);
  border: 1px solid rgba(255,203,91,.35);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .2s;
  margin-top: 4px;
}
.completion-bonus-card:hover { border-color: rgba(255,203,91,.6); }
.completion-bonus-card--claimed {
  opacity: .5;
  cursor: default;
  border-color: rgba(55,230,182,.2);
}
.completion-bonus-card--locked {
  opacity: .45;
  cursor: default;
}
.completion-bonus-icon { font-size: 26px; flex-shrink: 0; }
.completion-bonus-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.completion-bonus-title { font-size: 12px; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
.completion-bonus-desc  { font-size: 10px; color: var(--text2); }
.completion-bonus-reward { font-size: 16px; font-weight: 800; color: var(--gold); flex-shrink: 0; }

/* ── Prochain rang (home) ────────────────────────────────────────── */
.home-next-rank {
  width: 100%;
  max-width: 320px;
  background: var(--bg2);
  border: 1px solid rgba(255,203,91,.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.next-rank-icon { font-size: 20px; flex-shrink: 0; }
.next-rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.next-rank-cat  { font-size: 9px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .1em; }
.next-rank-label { font-size: 12px; font-weight: 700; color: var(--text); }
.next-rank-progress { display: flex; align-items: center; gap: 6px; }
.next-rank-bar  { flex: 1; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.next-rank-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s ease; }
.next-rank-count { font-size: 10px; color: var(--text2); flex-shrink: 0; }
.next-rank-reward { font-size: 14px; font-weight: 800; color: var(--gold); flex-shrink: 0; }

/* ── Daily widget (home) ─────────────────────────────────────────── */
.daily-widget {
  width: 100%;
  max-width: 320px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.daily-widget:hover,
.daily-widget:focus-visible { border-color: rgba(55,230,182,.3); }   /* + anneau clavier global (base.css) */

.daily-widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.daily-streak {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(255,203,91,.1);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.daily-widget-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text2);
  text-transform: uppercase;
  flex: 1;
}
.daily-widget-arrow { font-size: 14px; color: var(--text2); }

.daily-missions-list { display: flex; flex-direction: column; gap: 7px; }

.daily-mission-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-icon { font-size: 14px; flex-shrink: 0; }
.dm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-label { font-size: 11px; font-weight: 600; color: var(--text); }
.dm-bar { height: 3px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.dm-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s ease; }
.dm-reward { font-size: 10px; font-weight: 700; color: var(--gold); flex-shrink: 0; white-space: nowrap; }

.daily-mission--done   .dm-reward,
.daily-mission--done   .dm-fill { color: var(--accent); background: var(--accent); }
.daily-mission--ready  .dm-fill  { background: var(--gold); }
.daily-mission--ready  .dm-reward { color: var(--gold); }

/* ── Toast notifications ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(18px + var(--safe-top));   /* sous l'encoche iOS ; = 18px quand l'inset est 0 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(340px, 88vw);
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 10, 16, 0.97);
  border: 1px solid var(--toast-color, var(--accent));
  border-radius: 12px;
  padding: 11px 15px;
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 22px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
  cursor: pointer;
}
.toast--in  { opacity: 0; transform: translateY(-10px) scale(0.96); }
.toast--out { opacity: 0; transform: translateY(-6px)  scale(0.97); }
.toast-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.toast-body { display: flex; flex-direction: column; gap: 1px; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.toast-subtitle { font-size: 11px; color: var(--text2); }

/* ── Boîte de dialogue de confirmation générique ─────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.confirm-card {
  width: min(320px, 100%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.confirm-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-message {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 18px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .btn { flex: 1; }

/* ── Règles du jeu : overlay plein écran, accordéon (js/ui/rules.js) ─────────────
   Mobile : feuille plein écran (safe-area iOS gérée en tête et en pied). Desktop : carte centrée.
   Même langage que .confirm-overlay : fond sombre flouté, accent #37E6B6, cyan #7AE1FF, or #FFCB5B. */
.rules-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.rules-sheet {
  --rules-pad-l: max(16px, env(safe-area-inset-left, 0px));
  --rules-pad-r: max(16px, env(safe-area-inset-right, 0px));
  width: min(480px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  outline: none;
  animation: rules-in .22s ease-out;
}
@keyframes rules-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .rules-sheet { animation: none; } }
.rules-sheet :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.rules-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) var(--rules-pad-r) 10px var(--rules-pad-l);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.rules-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}
.rules-title__gem { color: var(--gold); font-size: 12px; }
.rules-close {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.rules-close:active { color: var(--accent); border-color: var(--accent); }

.rules-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px var(--rules-pad-r) 20px var(--rules-pad-l);
}
.rules-foot {
  flex-shrink: 0;
  padding: 10px var(--rules-pad-r) calc(10px + var(--safe-bottom)) var(--rules-pad-l);
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.rules-done { width: 100%; min-height: 48px; }

/* Chiffres clés */
.rules-key {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.rules-key__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(55,230,182,.10) 0%, rgba(255,200,80,.07) 100%);
  border: 1px solid rgba(55,230,182,.25);
}
.rules-key__v { font-size: 15px; font-weight: 800; white-space: nowrap; }
.rules-key__l { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
@media (max-width: 340px) { .rules-key { grid-template-columns: repeat(2, 1fr); } }

.rules-toolbar { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.rules-toggle-all {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

/* Sections repliables (<details>) */
.rules-sec {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.rules-sec[open] { border-color: rgba(55,230,182,.28); }
.rules-sec__head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.rules-sec__head::-webkit-details-marker { display: none; }
.rules-sec__head::after {
  content: '';
  width: 8px; height: 8px;
  flex-shrink: 0;
  margin-right: 4px;
  border-right: 2px solid var(--text2);
  border-bottom: 2px solid var(--text2);
  transform: rotate(-45deg);
  transition: transform var(--transition);
}
.rules-sec[open] > .rules-sec__head::after { transform: rotate(45deg); border-color: var(--accent); }
.rules-sec__head:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
.rules-sec__ico { width: 24px; text-align: center; font-size: 18px; flex-shrink: 0; }
.rules-sec__title { flex: 1; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text); }
.rules-sec__body { padding: 2px 14px 14px; }

/* Texte */
.rules-lead { font-size: 14px; line-height: 1.55; color: var(--text); margin-bottom: 12px; }
.rules-text { font-size: 13px; line-height: 1.55; color: var(--text2); margin: 4px 0 8px; }
.rules-sub  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text2); margin: 14px 0 6px; }
.rules-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.rules-list li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.55; color: var(--text2); }
.rules-list li::before { content: '◆'; position: absolute; left: 0; top: 4px; font-size: 8px; color: var(--accent); }
.rules-lead strong, .rules-text strong, .rules-list strong, .rules-note strong { color: var(--text); }
.rules-sec strong.rules-val, .rules-key strong.rules-val { color: var(--gold); font-weight: 800; white-space: nowrap; }
.rules-note {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(55,230,182,.07);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text2);
}
.rules-note--cyan { border-left-color: var(--cyan); background: rgba(122,225,255,.08); }

/* Tableaux de gains */
.rules-table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; }
.rules-table thead th {
  text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text2);
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
}
.rules-table thead th:last-child { text-align: right; }
.rules-table tbody th { text-align: left; font-weight: 400; vertical-align: top; padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); }
.rules-table tbody td { text-align: right; vertical-align: middle; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rules-table tbody tr:last-child th,
.rules-table tbody tr:last-child td { border-bottom: none; }
.rules-table--simple tbody th { font-size: 14px; font-weight: 600; color: var(--text); }
.rules-combo { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.rules-combo-desc { display: block; font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--text2); margin-top: 2px; }
.rules-cards { display: flex; gap: 4px; margin-top: 6px; }
.rules-pay { font-size: 17px; font-weight: 800; white-space: nowrap; color: var(--gold); }
.rules-pay--muted, .rules-pay--lose { font-size: 12px; font-weight: 700; color: var(--text2); }
.rules-pay--lose { color: var(--danger); }
.rules-card {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 26px; padding: 0 5px;
  border-radius: 5px;
  background: #FAFAFA;
  border: 1px solid #E0E0E0;
  color: #111;
  font-size: 12px; font-weight: 800;
}
.rules-card--red { color: #CC0000; }

/* Téléphone en paysage : la croix de l'en-tête suffit, on rend la hauteur au contenu */
@media (max-height: 500px) {
  .rules-foot { display: none; }
  .rules-head { padding-top: calc(var(--safe-top) + 6px); padding-bottom: 6px; }
}

/* Desktop : carte centrée plutôt que feuille plein écran */
@media (min-width: 600px) and (min-height: 560px) {
  .rules-overlay { align-items: center; padding: 24px; }
  .rules-sheet {
    height: auto;
    max-height: min(860px, 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
  }
  .rules-head { padding-top: 12px; }
}

/* ── Confidentialité (js/ui/privacy.js) : même feuille que « Règles du jeu » (.rules-*) ─────────────
   L'overlay est dans #app, SOUS la boîte de confirmation (10000) pour qu'elle puisse s'ouvrir par-dessus. */
/* La ligne d'entrée garde la hauteur de l'ancienne ligne « Confidentialité » (47 px, cible tactile ≥ 44) : le reste de
   l'écran Paramètres (bouton Déconnexion) ne bouge pas d'un pixel. */
.settings-row--link.settings-row--privacy { min-height: 47px; }
.privacy-overlay { z-index: 9990; }
.privacy-id { margin-bottom: 8px; }
.privacy-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--cyan); }
.privacy-tbc { color: var(--gold); font-style: normal; font-weight: 700; }
.rules-list a, .rules-sec__body a { color: var(--accent); text-underline-offset: 2px; }
.privacy-actions { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--border); }
.privacy-action { margin-bottom: 16px; }
.privacy-action__btn { width: 100%; min-height: 48px; margin-top: 0; }
.privacy-action__btn--busy { opacity: .45; cursor: progress; }
.privacy-action__desc { font-size: 12px; line-height: 1.5; color: var(--text2); margin: 6px 2px 0; }
.privacy-status { min-height: 1.5em; font-size: 13px; line-height: 1.5; color: var(--text2); }
.privacy-status--ok    { color: var(--accent); }
.privacy-status--error { color: var(--danger); }

/* Champ de confirmation forte (confirmDialog({ typeToConfirm })) */
.confirm-input {
  width: 100%;
  box-sizing: border-box;
  margin: -6px 0 16px;
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.confirm-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.confirm-actions .btn:disabled { opacity: .35; }

/* ── Tab badge (Secrets) ─────────────────────────────────────────── */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  background: var(--accent);
  color: #0B0B0E;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
  margin-left: 3px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Achievements secrets ────────────────────────────────────────── */
.secrets-header {
  grid-column: 1 / -1;
  padding: 4px 0 10px;
  text-align: center;
}
.secrets-count {
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}
.challenge-card--secret { opacity: .45; filter: grayscale(.5); }
.secret-desc {
  font-size: 10px;
  color: var(--text2);
  margin: 0;
  line-height: 1.4;
}

/* ── Login / Signup ───────────────────────────────────────── */
.view-login {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 90% 60% at 50% 25%, #141B2C 0%, #06060E 100%);
}

.login-card {
  width: min(360px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-bottom: 40px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.login-brand {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .28em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,203,91,.3);
}

.login-tagline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--text2);
  text-transform: uppercase;
  opacity: 0.7;
}

.login-tabs {
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.login-tab {
  flex: 1;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  background: none;
  border-radius: 9px;
  transition: all .15s;
}

.login-tab--active {
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}

.login-input:focus {
  outline: none;
  border-color: rgba(55,230,182,.5);
  background: rgba(55,230,182,.04);
}

.login-input::placeholder {
  color: rgba(166,166,176,.5);
}

.login-error {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

.login-submit {
  width: 100%;
  padding: 15px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .1em;
  margin-top: 4px;
  border-radius: 12px;
}

.login-forgot {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 8px 0 0;
  cursor: pointer;
  opacity: .7;
  transition: opacity var(--transition);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-forgot:hover { opacity: 1; }

/* Bouton déconnexion dans Paramètres */
.settings-logout-btn {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--danger);
  border: 1px solid rgba(255,90,103,.3);
  border-radius: var(--radius);
  background: rgba(255,90,103,.06);
  transition: background .15s, border-color .15s;
}

.settings-logout-btn:hover {
  background: rgba(255,90,103,.12);
  border-color: rgba(255,90,103,.5);
}

/* ── Lobby multijoueur (table publique / privée) ─────────────────── */
.view--lobby {
  display: flex;
  flex-direction: column;
  /* padding shorthand : redéfinit aussi le haut, donc le safe-area (cf. .view) doit être
     réintégré ici explicitement plutôt que laissé à la règle générique. */
  padding: var(--safe-top) 16px 20px;
}
.lobby-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
}
.lobby-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}
.lobby-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  transition: background .15s, color .15s, border-color .15s;
}
.lobby-tab--active {
  background: rgba(55,230,182,.12);
  border-color: rgba(55,230,182,.4);
  color: var(--accent);
}
.lobby-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lobby-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.lobby-divider::before, .lobby-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.lobby-join-row {
  display: flex;
  gap: 8px;
}
.lobby-code-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: center;
  font-family: inherit;
  -webkit-appearance: none;
}
.lobby-code-input:focus {
  outline: none;
  border-color: rgba(55,230,182,.5);
  background: rgba(55,230,182,.04);
}
.lobby-code-input::placeholder { letter-spacing: .18em; color: rgba(166,166,176,.5); }
.lobby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-empty {
  color: var(--text2);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}
.lobby-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lobby-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lobby-row-host { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-row-sub  { font-size: 11px; color: var(--text2); }
.lobby-row-join { flex-shrink: 0; }
.lobby-error {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--danger);
  margin: 4px 0 0;
}
.lobby-loading {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  margin-top: 4px;
}
