/* PSP — thème sombre, repris de la maquette. */
:root {
  --fond: #0F1115;
  --carte: #1A1D24;
  --trait: #2A2F3A;
  --texte: #E8EAF0;
  --doux: #C3C8D4;
  --discret: #9AA3B2;
  --accent: #4C8DFF;
  --chaud: #F5B83D;
  --rayon: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: #0F1115; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.ecran {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  outline: none;
}

h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
h2 { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
h2.sans-marge { margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.discret { color: var(--discret); font-size: 13px; }
.accent { color: var(--accent); }
.chaud { color: var(--chaud); }
.vide { color: var(--discret); text-align: center; padding: 16px 0; }
.erreur { color: #F09595; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bandeau {
  margin: 0;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: #2A2416;
  color: #F5D99A;
  font-size: 13px;
  text-align: center;
}
.bandeau + .ecran { padding-top: 16px; }

.retour { color: var(--doux); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.retour span { font-size: 22px; line-height: 1; }

.entete { display: flex; gap: 16px; align-items: center; }
.entete > div { display: flex; flex-direction: column; gap: 6px; }
.centre { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.centre p { color: var(--doux); }

.vignette {
  flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teinte, #8FB4FF);
  color: #0F1115;
  font-weight: 800;
  font-size: 20px;
}

.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chiffre { background: var(--carte); border-radius: var(--rayon); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chiffre .valeur { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chiffre .legende { font-size: 12px; color: var(--discret); }

.bloc { background: var(--carte); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bloc.ligne { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.bloc.alerte { background: #2A2416; border: 1px solid #5C4A1F; color: #E8D9B5; }
.bloc.alerte strong { color: var(--chaud); }
.ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.barre { height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--accent); }
.barre span.pote { background: var(--doux); }

.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puce {
  min-height: 40px; padding: 8px 14px; border-radius: 20px; border: 0;
  background: var(--carte); color: var(--doux); font: inherit; font-size: 13px; cursor: pointer;
}
.puce[aria-pressed="true"] { background: var(--texte); color: var(--fond); font-weight: 600; }

.liste { display: flex; flex-direction: column; gap: 10px; }
.carte { display: flex; gap: 14px; align-items: center; background: var(--carte); border-radius: 16px; padding: 12px; min-height: 64px; }
.carte .corps { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.carte strong { font-weight: 600; }
.carte .droite { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.trophee.obtenu { opacity: 0.7; }

.medaille { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--doux); position: relative; }
.medaille::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: currentColor; opacity: 0.35; }
.medaille.platine { border-color: #B9D3FF; color: #B9D3FF; }
.medaille.or { border-color: #E3C565; color: #E3C565; }
.medaille.argent { border-color: #C3C8D4; color: #C3C8D4; }
.medaille.bronze { border-color: #C08A5B; color: #C08A5B; }
.medaille.grande { width: 88px; height: 88px; border-width: 3px; }
.medaille.grande::after { inset: 20px; }

.rarete { font-size: 12px; font-weight: 600; }
.rarete.ultra { color: var(--chaud); }
.rarete.tres { color: #8FB4FF; }
.rarete.rare { color: var(--doux); }
.rarete.commun { color: var(--discret); }

.etiquette { align-self: flex-start; padding: 4px 10px; border-radius: 12px; background: var(--trait); color: var(--doux); font-size: 12px; }

.recherche { display: flex; gap: 8px; }
.recherche input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: var(--rayon);
  border: 1px solid var(--trait); background: var(--carte); color: var(--texte); font: inherit;
}
.recherche input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.bouton {
  min-height: 48px; padding: 0 16px; border-radius: var(--rayon); border: 0; cursor: pointer;
  background: var(--trait); color: var(--texte); font: inherit; font-weight: 600;
}
.bouton.plein { background: var(--accent); color: var(--fond); }
.bouton:disabled { opacity: 0.5; cursor: default; }

.choix { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choix legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  border-radius: var(--rayon); background: var(--carte); border: 1.5px solid var(--trait); cursor: pointer;
}
.option:has(input:checked) { border-color: var(--accent); }
.option input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.option .corps { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.conseil { padding: 3px 8px; border-radius: 10px; background: #1E2A40; color: #8FB4FF; font-size: 11px; font-weight: 600; }
.bloc input[type="checkbox"] { accent-color: var(--accent); width: 22px; height: 22px; flex-shrink: 0; }

.onglets {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(15, 17, 21, 0.96); border-top: 1px solid var(--trait);
  padding-bottom: env(safe-area-inset-bottom);
}
.onglets a { min-height: 56px; display: flex; align-items: center; justify-content: center; color: var(--discret); font-size: 13px; font-weight: 500; }
.onglets a[aria-current="page"] { color: var(--texte); box-shadow: inset 0 2px 0 var(--accent); }

.note { font-size: 12px; margin-top: -6px; }
h2 .discret { font-weight: 400; }
