:root {
  --ink: #2b1d3a;
  --muted: #7a6a8c;
  --paper: #fdf6e8;
  --paper-2: #f5ecd8;
  --gold: #e8b923;
  --pink: #ff5fa2;
  --teal: #1fa98f;
  --red: #ec2f2f;
  --locked: #cdc5d6;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --font-title: "Arial Black", "Arial Narrow Bold", Impact, system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  background-image: radial-gradient(var(--paper-2) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  color: var(--ink);
  padding-bottom: 84px;
}

header.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}

header.entete h1 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  margin: 0;
  letter-spacing: 0.5px;
}

#statut-sauvegarde {
  font-size: 0.75rem;
  color: var(--muted);
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px 20px;
}

.ecran.hidden { display: none; }

.carte {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.carte h2 {
  font-family: var(--font-title);
  font-size: 1rem;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.palier-nom {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--ink);
}

.barre-progression {
  position: relative;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  margin: 6px 0;
}

.barre-progression .remplissage {
  height: 100%;
  border-radius: 999px;
}

.barre-progression.chant .remplissage { background: var(--pink); }
.barre-progression.repertoire .remplissage { background: var(--teal); }
.barre-progression.global .remplissage { background: var(--gold); }

.jauge-ligne {
  margin-bottom: 14px;
}

.jauge-ligne .entete-jauge {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.jauge-verrouillee {
  opacity: 0.55;
  filter: grayscale(1);
}

.jauge-verrouillee .barre-progression { background: var(--locked); }

.mission-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  margin-bottom: 8px;
  background: var(--paper-2);
}

.mission-titre {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 4px 0;
}

.mission-artiste, .mission-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.actions-mission {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

button {
  font-family: inherit;
  font-weight: bold;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  background: #fff;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}

button:active { box-shadow: none; transform: translate(2px, 2px); }
button:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

button.principal { background: var(--gold); }
button.joker { background: var(--paper-2); }
button.supprimer { background: var(--red); color: #fff; padding: 6px 10px; font-size: 0.8rem; }
button.ajouter { background: var(--teal); color: #fff; width: 100%; margin-top: 8px; }

.statut-jour {
  font-weight: bold;
  padding: 10px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  text-align: center;
  margin-top: 10px;
}

.serie {
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--muted);
}

.ligne-item {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.ligne-item .champs { flex: 1; display: flex; flex-direction: column; gap: 4px; }

input[type="text"], select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  width: 100%;
}

.sous-liste-titre {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: bold;
  margin: 14px 0 8px;
}

.etat-vide {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 12px;
}

nav.onglets {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: #fff;
  border-top: 3px solid var(--ink);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

nav.onglets button {
  flex: 1;
  border: none;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  padding: 6px 2px;
  border-radius: 10px;
}

nav.onglets button .emoji { font-size: 1.3rem; }
nav.onglets button.actif { background: var(--paper-2); }

#toast {
  position: fixed;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}

#toast.visible { opacity: 1; }
