/* ============================================================
   RPG Coach — PWA mobile-first
   Style néon cohérent avec le Dashboard Obsidian :
   fond sombre + cyan (#00d4ff), vert (#00ff88), magenta (#ff006e),
   or (#ffd700), rouge (#f44336) pour les alertes.
   ============================================================ */

:root {
  --fond: #0a0a12;
  --surface: #12121f;
  --surface2: #1a1a2c;
  --bordure: #24243c;
  --texte: #e0e0e0;
  --texte-dim: #8a8aa3;
  --cyan: #00d4ff;
  --vert: #00ff88;
  --magenta: #ff006e;
  --or: #ffd700;
  --rouge: #f44336;

  --taille-base: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--taille-base);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Barre de statut + layout mobile sans scroll horizontal */
html { overflow-x: hidden; }

.vue { display: none; }
.vue.actif { display: block; }

.contenu {
  padding: 16px 14px;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

/* ================= LAYOUT APP : header + nav fixes ================= */
.app-cadre { display: flex; flex-direction: column; height: 100vh; }
.app-header {
  flex: 0 0 auto;
  background: linear-gradient(135deg, #12121f, #0a0a12);
  border-bottom: 1px solid var(--bordure);
  padding: 10px 14px;
}
.nav-bar {
  flex: 0 0 auto;
  position: sticky; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--bordure);
  display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 10;
}
.nav-btn {
  flex: 1;
  background: none; border: none; color: var(--texte-dim);
  font-size: 11px; padding: 8px 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn .emoji { font-size: 18px; }
.nav-btn.active { color: var(--cyan); }

/* ================= COMPOSANTS ================= */
.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 0 0 1px transparent;
}
.carte.neon { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,212,255,.25); }

.barre {
  height: 10px; width: 100%;
  border-radius: 6px;
  background: var(--surface2);
  overflow: hidden;
}
.barre.remplie {
  height: 100%;
  border-radius: 6px;
  background: var(--cyan);
  transition: width .4s ease;
}
.barre.hp { background: linear-gradient(90deg, var(--vert), var(--cyan)); }
.barre.hp.danger { background: var(--rouge); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 12px; font-weight: 600;
}
.chip.xp { color: var(--cyan); }
.chip.gold { color: var(--or); }
.chip.hp { color: var(--vert); }
.chip.rouge { color: var(--rouge); }

.titre-sec {
  font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  margin: 18px 0 8px; color: var(--texte-dim);
}

/* Item tâche / quête */
.item {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--bordure); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px;
  background: var(--surface);
}
.item .icone-statut { font-size: 20px; width: 26px; text-align: center; }
.item .corps { flex: 1; min-width: 0; }
.item .nom { font-weight: 600; font-size: 14.5px; line-height: 1.25; word-break: break-word; }
.item .meta { font-size: 12px; color: var(--texte-dim); margin-top: 3px; }
.item .actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chip-prio {
  display: inline-block; background: var(--surface2); border-radius: 4px;
  padding: 1px 6px; font-size: 11px;
}
.chip-prio.haute { color: var(--magenta); }
.chip-prio.moyenne { color: var(--cyan); }
.chip-prio.basse { color: var(--texte-dim); }
.chip-prio.en_retard { color: var(--rouge); background: var(--surface2); }

a.obsidian {
  font-size: 20px; line-height: 1; text-decoration: none; color: var(--texte-dim);
  padding: 4px;
}

.btn {
  border: 1px solid var(--bordure); background: var(--surface2); color: var(--texte);
  border-radius: 22px; padding: 9px 14px; font-size: 14px; font-weight: 600;
}
.btn.neon { border-color: var(--cyan); color: var(--cyan); background: #0d1420; }
.btn:disabled { opacity: .5; }

.bouton-valider {
  border: none; border-radius: 10px; padding: 7px 10px; font-size: 12px; font-weight: 700;
}
.bouton-valider.a_faire { color: var(--cyan); background: #0d1420; }
.bouton-valider.faite { color: var(--texte-dim); background: var(--surface2); }
.bouton-valider.en_retard { color: #fff; background: var(--rouge); }

.banniere {
  border: 1px solid var(--rouge); color: #fff;
  background: rgba(244,67,54,.12); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}

/* Boutique */
.article { border: 1px solid var(--bordure); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; background: var(--surface); }
.article .titre-a { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.article .prix { color: var(--or); font-weight: 700; }

/* Toast */
.toast {
  position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: #0f1a12; color: var(--vert);
  border: 1px solid var(--vert); border-radius: 12px;
  padding: 10px 16px; font-size: 13.5px; text-align: center;
  transform: translateY(120%); opacity: 0; transition: all .25s;
  max-width: 92%; margin: 0 auto; z-index: 100;
}
.toast.erreur { color: var(--rouge); border-color: var(--rouge); background: #1a0f0f; }
.toast.visible { transform: translateY(0); opacity: 1; }

/* ================= ÉCRAN CONFIG ================= */
.config-cadre { max-width: 420px; margin: 0 auto; padding-top: 40px; }
.config-cadre h1 { font-size: 30px; color: var(--cyan); margin-bottom: 4px; }
.config-cadre .sous-titre { color: var(--texte-dim); margin-bottom: 26px; line-height: 1.5; }
.config-cadre label { display: block; font-size: 13px; color: var(--texte-dim); margin: 12px 0 6px; }
.config-cadre input {
  width: 100%; background: var(--surface2); color: var(--texte);
  border: 1px solid var(--bordure); border-radius: 10px;
  padding: 12px 12px; font-size: 15px;
}
.msg { color: var(--texte-dim); font-size: 13px; margin-top: 14px; white-space: pre-line; }
.msg.ok { color: var(--vert); }
.msg.err { color: var(--rouge); }

/* ================= ÉCRAN ACCUEIL ================= */
.stats-gauche { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--surface2); border-radius: 12px; padding: 10px;
  text-align: center; font-size: 22px; font-weight: 700;
}
.stat .lbl { display: block; font-size: 11px; color: var(--texte-dim); margin-top: 2px; }

/* ================= ÉCRAN CONFIG (dans l'app) ================= */
.vue-config {
  width: 100%; max-width: 420px; margin: 0 auto; padding: 24px 14px;
}
.vue-config input { width: 100%; margin-top: 6px; }