﻿/* ==========================================================
   Centre de Commande — village pixel (Dark Ascension)
   ========================================================== */
:root {
  --violet: #6D28D9;
  --violet-clair: #8B5CF6;
  --or: #D4AF37;
  --or-clair: #F2D778;
  --noir: #0A0A0F;
  --nuit: #120c24;
  --panneau: #1d1636;
  --panneau-2: #251c45;
  --bord: #0b0716;
  --relief: #3b2f6b;
  --texte: #F1EEF9;
  --doux: #B3ACD0;
  --faible: #7d76a0;
  --ok: #4ade80;
  --attention: #fbbf24;
  --alerte: #f43f5e;
  --bois: #8a5a2b;
  --bois-clair: #b07a40;
  --bois-sombre: #2a1608;
  --px: "Pixelify Sans", "Courier New", monospace;
  --corps: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --haut-h: 56px;
  --bas-h: 64px;
  --lat-w: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--corps);
  color: var(--texte);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  background-color: var(--nuit);
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.25) 50%, transparent 51%),
    radial-gradient(2px 2px at 200px 150px, rgba(212,175,55,.35) 50%, transparent 51%),
    radial-gradient(900px 500px at 50% -10%, rgba(109, 40, 217, .35), transparent 70%);
  background-size: 240px 200px, 240px 200px, 240px 200px, 100% 100%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--or-clair); }
code { font-size: .9em; background: rgba(255,255,255,.06); padding: 1px 5px; }
.px, img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.cache { display: none !important; }
.or { color: var(--or-clair); }
.texte-doux { color: var(--doux); font-size: 13px; }
.txt-alerte { color: var(--alerte); }
.vide-msg { color: var(--faible); font-size: 13px; padding: 8px 2px; margin: 0; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100dvh; }
.colonne { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contenu {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 14px 12px calc(var(--bas-h) + 24px + env(safe-area-inset-bottom));
}

.barre-haut {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--haut-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(180deg, #2b1f55, #1d1538);
  border-bottom: 3px solid var(--bord);
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.barre-haut .qg { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texte); }
.barre-haut .qg span { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--px); }
.barre-haut .qg b { font-size: 17px; color: var(--or-clair); }
.barre-haut .qg small { font-size: 12px; color: var(--doux); }
.ressources { display: flex; gap: 6px; }
.res {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--px); font-size: 14px;
  background: #140e29; border: 2px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief);
  padding: 3px 8px 3px 6px;
}

.barre-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--bas-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #1a1333; border-top: 3px solid var(--bord); box-shadow: 0 -3px 0 rgba(0,0,0,.3);
}
.barre-bas a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faible); text-decoration: none; font-family: var(--px); font-size: 11px;
}
.barre-bas a img { filter: grayscale(.85) brightness(.85); }
.barre-bas a.actif { color: var(--or-clair); background: linear-gradient(180deg, rgba(212,175,55,.12), transparent); }
.barre-bas a.actif img { filter: none; transform: translateY(-1px); }

.lateral {
  display: none; width: var(--lat-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  background: #150f2b; border-right: 3px solid var(--bord);
  padding: 14px 12px; flex-direction: column; gap: 6px;
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--or-clair); font-family: var(--px); font-size: 17px; line-height: 1.1; padding: 2px 4px 12px; }
.liste-lat { display: grid; gap: 5px; }
.item-lat {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; text-decoration: none; color: var(--texte);
  font-family: var(--px); font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  background: var(--panneau); border: 2px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief);
}
.item-lat .vis { width: 32px; display: flex; justify-content: center; flex-shrink: 0; }
.item-lat:hover { background: var(--panneau-2); }
.item-lat.actif { background: linear-gradient(90deg, #d4af37, #b8912a); color: #1a1405; box-shadow: inset 0 0 0 1px #f7dc7a; }
.lateral .pied { margin-top: auto; font-size: 12px; color: var(--faible); padding: 10px 4px 0; }

@media (min-width: 900px) {
  .lateral { display: flex; }
  .barre-bas { display: none; }
  .contenu { padding: 20px 26px 40px; }
  .barre-haut .qg { visibility: hidden; }
}

/* ---------- Panneaux & titres ---------- */
.panneau {
  background: var(--panneau);
  border: 3px solid var(--bord);
  box-shadow: inset 0 0 0 2px var(--relief), 0 4px 0 rgba(0,0,0,.45);
  padding: 14px;
  position: relative;
}
.titre-px {
  font-family: var(--px); font-weight: 600; font-size: 17px; letter-spacing: .5px;
  color: var(--or-clair); text-shadow: 2px 2px 0 #000;
  margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.titre-page { font-family: var(--px); font-size: 28px; color: var(--or-clair); text-shadow: 3px 3px 0 #000; margin: 6px 0 12px; }
.retour {
  display: inline-block; font-family: var(--px); font-size: 14px; text-decoration: none; color: var(--doux);
  margin: 2px 0 10px; padding: 4px 10px; background: var(--panneau); border: 2px solid var(--bord);
}
.retour:hover { color: var(--or-clair); }

/* ---------- Boutons pixel ---------- */
.btn-px {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--px); font-size: 15px; letter-spacing: .3px; white-space: nowrap;
  color: var(--texte); background: #3a2d6b;
  border: 3px solid var(--bord); box-shadow: inset 0 -3px 0 rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.15), 0 3px 0 var(--bord);
  padding: 7px 14px; position: relative; top: 0;
}
.btn-px:hover { filter: brightness(1.12); }
.btn-px:active { top: 3px; box-shadow: inset 0 -1px 0 rgba(0,0,0,.35), 0 0 0 var(--bord); }
.btn-px.primaire { background: #7c3aed; }
.btn-px.or { background: #d4af37; color: #1a1405; }
.btn-px.danger { background: #9f1239; }
.btn-px.petit { font-size: 13px; padding: 4px 10px; border-width: 2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.35), 0 2px 0 var(--bord); }
.btn-px:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.rangee-btn { display: flex; gap: 8px; flex-wrap: wrap; }
.puce {
  font-family: var(--px); font-size: 13px; padding: 4px 10px;
  background: #140e29; color: var(--doux); border: 2px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief);
}
.puce.on { background: #7c3aed; color: #fff; box-shadow: inset 0 0 0 1px #a78bfa; }
.filtres, .onglets, .choix-zone { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Barre de progression segmentée ---------- */
.barre-px { height: 16px; background: #120c24; border: 3px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief); margin-top: 8px; }
.barre-px i {
  display: block; height: 100%;
  background: repeating-linear-gradient(90deg, #e0b53f 0 9px, #9c7a1c 9px 11px);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.3);
  transition: width .4s steps(10);
}
.barre-px.alerte i { background: repeating-linear-gradient(90deg, #f43f5e 0 9px, #9f1239 9px 11px); }
.barre-px.attention i { background: repeating-linear-gradient(90deg, #fbbf24 0 9px, #a16207 9px 11px); }
.barre-px.ok i { background: repeating-linear-gradient(90deg, #4ade80 0 9px, #15803d 9px 11px); }

/* ---------- Le village ---------- */
.village-grille { display: grid; gap: 16px; }
@media (min-width: 1100px) { .village-grille { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; } }
.titre-village h1 { font-family: var(--px); font-size: clamp(22px, 5vw, 30px); margin: 0; color: var(--texte); text-shadow: 3px 3px 0 #000; }
.titre-village .sous { color: var(--doux); font-size: 13px; margin: 2px 0 12px; }
.village { position: relative; width: 100%; min-height: 300px; isolation: isolate; z-index: 0; }
.plateau { position: relative; margin: 0 auto; image-rendering: pixelated; overflow: hidden; }

.bat { position: absolute; display: block; text-decoration: none; transition: transform .12s steps(2); }
.bat .sprite { position: absolute; inset: 0; display: block; }
.bat:hover { transform: translateY(-3px); }
.bat:hover .sprite { filter: drop-shadow(0 0 6px rgba(247, 220, 122, .65)); }
.bat:active { transform: translateY(1px) scale(.98); }

.ecriteau {
  position: absolute; left: 50%; top: calc(100% - 4px); transform: translateX(-50%);
  white-space: nowrap; max-width: 150%; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--px); font-size: 12px; line-height: 1; color: #fff3d6;
  background: var(--bois); padding: 4px 8px 5px;
  border: 2px solid var(--bois-sombre); box-shadow: inset 0 2px 0 var(--bois-clair), 0 2px 0 var(--bois-sombre);
  text-shadow: 1px 1px 0 var(--bois-sombre); z-index: 2;
}
.hdv .ecriteau { font-size: 14px; }
.badge-bat {
  position: absolute; left: 50%; top: -14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-family: var(--px); font-size: 12px; line-height: 1; color: #fff;
  background: #22193f; padding: 3px 7px 3px 4px;
  border: 2px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief), 0 2px 0 rgba(0,0,0,.4);
  z-index: 3; animation: flotte 2.6s steps(4) infinite;
}
.badge-bat.ton-alerte { background: #7f1d1d; box-shadow: inset 0 0 0 1px #f43f5e, 0 2px 0 rgba(0,0,0,.4); }
.badge-bat.ton-attention { background: #713f12; box-shadow: inset 0 0 0 1px #fbbf24, 0 2px 0 rgba(0,0,0,.4); }
.badge-bat.ton-ok { background: #14532d; box-shadow: inset 0 0 0 1px #4ade80, 0 2px 0 rgba(0,0,0,.4); }
@keyframes flotte { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -3px); } }
.notif {
  position: absolute; right: 6%; top: -6px; z-index: 4;
  width: 20px; height: 20px; display: grid; place-items: center;
  font-family: var(--px); font-size: 13px; color: #fff; background: #e11d48;
  border: 2px solid var(--bord); box-shadow: inset 0 2px 0 rgba(255,255,255,.3);
  animation: pulse 1.2s steps(2) infinite;
}
@keyframes pulse { 50% { transform: scale(1.15); } }

.drapeau { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; animation: vent .5s steps(2) infinite; }
@keyframes vent { to { background-position: var(--fin) 0; } }
.fumee { position: absolute; width: 1px; height: 1px; }
.fumee i {
  position: absolute; left: 0; top: 0; width: var(--t); height: var(--t);
  background: rgba(230, 230, 240, .75); box-shadow: 0 0 0 1px rgba(80, 80, 100, .25);
  animation: fumee 3s steps(10) infinite; opacity: 0;
}
.fumee i:nth-child(2) { animation-delay: 1s; }
.fumee i:nth-child(3) { animation-delay: 2s; }
@keyframes fumee {
  0% { transform: translate(0, 0) scale(.6); opacity: .9; }
  100% { transform: translate(10px, -34px) scale(1.5); opacity: 0; }
}
.eclat {
  position: absolute; width: 6px; height: 6px; left: 20%; top: 20%;
  background: #fff7cc; box-shadow: 0 0 0 2px rgba(247,220,122,.6);
  animation: eclat 1.6s steps(3) infinite;
}
.eclat.e2 { left: 72%; top: 38%; animation-delay: .8s; }
@keyframes eclat { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }

.villageois {
  position: absolute; left: 0; top: 0; pointer-events: none;
  background-repeat: no-repeat; image-rendering: pixelated;
  animation: marche .36s steps(2) infinite;
}
.villageois.arret { animation-play-state: paused; }
@keyframes marche { to { background-position: var(--fin) 0; } }
.nuage {
  position: absolute; left: -140px; width: 120px; height: 36px; pointer-events: none; z-index: 900;
  background:
    linear-gradient(#fff, #fff) 24px 0 / 54px 12px no-repeat,
    linear-gradient(#fff, #fff) 6px 12px / 96px 12px no-repeat,
    linear-gradient(#fff, #fff) 30px 24px / 72px 12px no-repeat;
  opacity: .16; animation: nuage var(--d, 40s) linear infinite;
}
.nuage.n2 { animation-delay: -18s; transform: scale(.7); }
@keyframes nuage { to { left: 110%; } }

.cote-village { display: grid; gap: 14px; }
.liste-att { display: grid; gap: 6px; }
.att {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte);
  padding: 8px 10px; background: #140e29; border: 2px solid var(--bord); border-left-width: 5px; font-size: 13.5px;
}
.att span { flex: 1; }
.att b { font-family: var(--px); color: var(--faible); }
.att.ton-alerte { border-left-color: var(--alerte); }
.att.ton-attention { border-left-color: var(--attention); }
.att.ton-info { border-left-color: var(--violet-clair); }
.att:hover { background: var(--panneau-2); }

/* ---------- Tuiles de stats ---------- */
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.tuile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  background: var(--panneau); border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px var(--relief); padding: 8px 10px;
}
.tuile img { grid-row: 1 / 3; }
.tuile b { font-family: var(--px); font-size: 19px; color: var(--or-clair); line-height: 1.05; }
.tuile span { font-size: 11.5px; color: var(--doux); line-height: 1.2; }

/* ---------- En-tête d'un bâtiment ---------- */
.entete-bat { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; background: linear-gradient(180deg, #2b2158, #1d1636); margin-bottom: 4px; }
.entete-sprite {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 12px 4px; min-width: 120px;
  background: #4a8a2e radial-gradient(circle at 30% 40%, #5e9e3a 2px, transparent 3px) 0 0 / 14px 14px;
  border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px #2f5d1e;
}
.entete-txt { flex: 1; min-width: 200px; }
.entete-txt h1 { font-family: var(--px); font-size: clamp(22px, 5vw, 30px); margin: 0; color: var(--texte); text-shadow: 3px 3px 0 #000; line-height: 1.05; }
.entete-txt .sous { color: var(--doux); font-size: 13.5px; margin-top: 4px; }
.entete-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ligne-action { display: flex; gap: 10px; font-size: 14px; align-items: baseline; }
.ligne-action + .ligne-action { margin-top: 6px; }
.ligne-action .lbl { font-family: var(--px); font-size: 12px; color: var(--faible); text-transform: uppercase; width: 72px; flex-shrink: 0; }
.ligne-action .val { color: var(--doux); }
.ligne-action.prochaine .val { color: var(--texte); font-weight: 700; }
.actions-zone { margin-top: 12px; }
.deux-col { display: grid; gap: 4px 18px; }
@media (min-width: 900px) { .deux-col { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }

/* ---------- Le quartier (sous-projets) ---------- */
.quartier {
  display: grid; gap: 30px 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  padding: 26px 12px 18px;
  background: #5e9e3a radial-gradient(circle at 30% 40%, #73b548 1.5px, transparent 2px) 0 0 / 12px 12px;
  border: 3px solid var(--bord); box-shadow: inset 0 0 0 3px #2f5d1e;
}
.mini-bat { position: relative; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--texte); }
.mini-bat img { transition: transform .12s steps(2); }
.mini-bat:hover img { transform: translateY(-3px); filter: drop-shadow(0 0 5px rgba(247,220,122,.6)); }
.mini-bat .ecriteau { position: relative; left: auto; top: auto; transform: none; margin-top: -4px; max-width: 100%; }
.mini-bat .badge-bat { top: -12px; }
.mini-pa { font-size: 11.5px; color: #10270a; background: rgba(255,255,255,.55); padding: 1px 6px; margin-top: 6px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Priorités & quêtes ---------- */
.priorites, .quetes { display: grid; gap: 7px; }
.prio, .quete {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; background: #f3e3bf; color: #2b1d0e;
  border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px #fff7e0, inset 0 -3px 0 #d9c28f, 0 3px 0 rgba(0,0,0,.4);
}
.prio .num { font-family: var(--px); font-size: 16px; width: 26px; height: 26px; display: grid; place-items: center; background: #7c3aed; color: #fff; border: 2px solid var(--bord); flex-shrink: 0; }
.prio .txt, .quete .qt { flex: 1; min-width: 0; cursor: pointer; }
.prio .t, .quete .t { font-weight: 800; word-break: break-word; }
.prio .z, .quete .m { font-size: 12px; color: #6b5636; }
.prio.fait .t, .quete.fait .t { text-decoration: line-through; color: #8a7652; }
.quete.retard { box-shadow: inset 0 0 0 2px #fecaca, inset 0 -3px 0 #f87171, 0 3px 0 rgba(0,0,0,.4); }
.prio.vide {
  justify-content: center; gap: 8px; cursor: pointer; font-family: var(--px); font-size: 15px;
  background: #140e29; color: var(--doux); border-style: dashed; box-shadow: none;
}
.prio.vide:hover { color: var(--or-clair); }
.coche {
  width: 28px; height: 28px; flex-shrink: 0; padding: 0;
  display: grid; place-items: center; font-size: 0; color: transparent;
  background: #fffaf0; border: 3px solid var(--bord); box-shadow: inset 0 -3px 0 #d9c28f;
}
.coche.en_cours { background: #fde68a; }
.coche.en_cours::after { content: ""; width: 8px; height: 8px; background: #b45309; }
.coche.fait { background: #22c55e; color: #fff; font-size: 17px; font-weight: 900; box-shadow: inset 0 -3px 0 #15803d; }
.etoile { background: none; border: 0; padding: 4px; filter: grayscale(1) opacity(.35); }
.etoile.on { filter: none; }
.ajout-quete { display: flex; gap: 8px; margin-bottom: 10px; }
.ajout-quete input { flex: 1; min-width: 0; }
.ajout-quete select { width: auto; max-width: 40%; }
.liste-zones { display: grid; gap: 7px; }
.ligne-zone {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--texte);
  background: var(--panneau); border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px var(--relief); padding: 6px 12px 6px 8px;
}
.ligne-zone div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ligne-zone span { font-size: 13px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-zone em { font-family: var(--px); font-style: normal; color: var(--or-clair); font-size: 16px; }
.ligne-zone:hover { background: var(--panneau-2); }

/* ---------- Entrepôt ---------- */
.aide { margin: 12px 0; }
.grille-comptes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.compte-haut { display: flex; align-items: center; gap: 8px; font-family: var(--px); font-size: 19px; }
.compte-haut .pastille { width: 12px; height: 12px; background: var(--cc); border: 2px solid var(--bord); }
.lien-discret { margin-left: auto; text-decoration: none; font-family: var(--corps); }
.compte.ton-alerte { box-shadow: inset 0 0 0 2px #f43f5e, 0 4px 0 rgba(0,0,0,.45); }
.compte-milieu { display: flex; gap: 14px; align-items: flex-end; margin: 10px 0 2px; }
.pile {
  min-width: 108px; min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 6px; background: #4a8a2e radial-gradient(circle at 30% 40%, #5e9e3a 1.5px, transparent 2px) 0 0 / 10px 10px;
  border: 3px solid var(--bord);
}
.pile div { display: flex; line-height: 0; }
.pile small { font-family: var(--px); font-size: 12px; color: #fff; text-shadow: 1px 1px 0 #000; margin-top: 3px; }
.autonomie .gros { font-family: var(--px); font-size: 34px; line-height: 1; text-shadow: 2px 2px 0 #000; }
.autonomie .msg { font-family: var(--px); font-size: 15px; margin: 4px 0 2px; }
.niv-ok { color: var(--ok); }
.niv-attention { color: var(--attention); }
.niv-alerte { color: var(--alerte); }
.videos { display: grid; gap: 6px; margin-top: 12px; }
.video {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; background: #f3e3bf; color: #2b1d0e;
  border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px #fff7e0, inset 0 -3px 0 #d9c28f;
}
.video:hover { background: #e7f7d4; }
.video:active { transform: translateY(2px); }
.video .vt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.video .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video .d { font-size: 11.5px; color: #6b5636; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video .go { font-family: var(--px); font-size: 13px; color: #15803d; white-space: nowrap; }
.video.publiee { opacity: .75; background: #d9cfb5; cursor: default; }
details.publiees summary { cursor: pointer; font-family: var(--px); color: var(--doux); padding: 10px 0 4px; }
details.publiees .video { margin-bottom: 6px; }

/* ---------- Planning ---------- */
.onglets { margin: 14px 0 0; }
.titre-periode { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nav-date { display: flex; gap: 6px; margin-top: 12px; }
.jour-resume { display: flex; gap: 16px; align-items: center; }
.jour-resume > div:last-child { flex: 1; }
.gros-pct { font-family: var(--px); font-size: 46px; color: var(--or-clair); line-height: 1; text-shadow: 3px 3px 0 #000; }
.gros-pct small { font-size: 22px; }
.journal-temps { display: grid; gap: 5px; margin-top: 12px; }
.ligne-temps { display: flex; align-items: center; gap: 10px; padding: 5px 8px; background: #140e29; border: 2px solid var(--bord); font-size: 13.5px; }
.ligne-temps span { flex: 1; }
.ligne-temps b { font-family: var(--px); color: var(--or-clair); }
.choix-zone { margin-bottom: 10px; }
.objectifs { display: grid; gap: 12px; }
.obj-l { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.obj-l span:last-child { margin-left: auto; color: var(--doux); font-size: 13px; }
.obj .barre-px { margin-top: 4px; height: 14px; }
.pastille { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--bord); flex-shrink: 0; }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
@media (max-width: 640px) { .semaine { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.jour-col {
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; min-height: 120px;
  padding: 6px; background: var(--panneau); border: 2px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief); color: var(--texte);
}
.jour-col.auj { box-shadow: inset 0 0 0 2px var(--or); }
.jour-col .jn { font-family: var(--px); font-size: 12px; color: var(--faible); text-transform: uppercase; }
.jour-col .jd { font-family: var(--px); font-size: 20px; line-height: 1; }
.chip { font-size: 11px; line-height: 1.25; padding: 3px 5px; background: #f3e3bf; color: #2b1d0e; border: 1px solid var(--bord); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chip.fait { background: #bbf7d0; text-decoration: line-through; }
.chip.en_cours { background: #fde68a; }
.jm { font-family: var(--px); font-size: 12px; color: var(--or-clair); margin-top: auto; }
.barre-repart { display: flex; height: 22px; border: 3px solid var(--bord); background: #120c24; }
.barre-repart i { display: block; height: 100%; box-shadow: inset 0 3px 0 rgba(255,255,255,.25), inset -2px 0 0 var(--bord); }
.legende { display: grid; gap: 6px; margin-top: 12px; font-size: 13.5px; color: var(--doux); }
.legende b { color: var(--texte); }
.mois .entete-mois, .grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.entete-mois span { font-family: var(--px); text-align: center; color: var(--faible); font-size: 13px; padding: 8px 0 4px; }
.case {
  aspect-ratio: 1 / 1; min-height: 44px; position: relative; text-align: left; padding: 4px;
  display: flex; flex-direction: column; gap: 2px; color: var(--texte);
  background: color-mix(in srgb, #7c3aed calc(var(--i) * 70%), #1d1636);
  border: 2px solid var(--bord);
}
.case.hors { opacity: .35; }
.case.auj { box-shadow: inset 0 0 0 2px var(--or); }
.case .jd { font-family: var(--px); font-size: 14px; }
.case .points { display: flex; gap: 2px; flex-wrap: wrap; }
.case .points i { width: 6px; height: 6px; background: #b3acd0; border: 1px solid var(--bord); }
.case .points i.fait { background: var(--or); }
.case .jm { font-size: 10.5px; }
.annee { display: grid; gap: 6px; }
.mois-l { display: grid; grid-template-columns: 52px 1fr 70px 40px; gap: 8px; align-items: center; background: none; border: 0; color: var(--texte); padding: 2px 0; text-align: left; }
.mois-l .mn { font-family: var(--px); font-size: 14px; }
.mois-l .mb { height: 14px; background: #120c24; border: 2px solid var(--bord); }
.mois-l .mb i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #8b5cf6 0 8px, #5b21b6 8px 10px); }
.mois-l .mv { font-family: var(--px); font-size: 13px; color: var(--or-clair); text-align: right; }
.mois-l .mf { font-size: 12px; color: var(--ok); }
.mois-l:hover .mn { color: var(--or-clair); }

/* ---------- Réglages ---------- */
.liste-reglage { display: grid; gap: 8px; }
.ligne-reglage { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #140e29; border: 2px solid var(--bord); flex-wrap: wrap; }
.ligne-reglage .n { flex: 1; min-width: 140px; font-weight: 700; }
.ligne-reglage .n small { display: block; font-weight: 600; color: var(--faible); }
.ligne-reglage.enfant { margin-left: 22px; }
.ligne-reglage input[type="number"] { width: 80px; }

/* ---------- Champs ---------- */
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; background: #0f0a1f; border: 3px solid var(--bord); box-shadow: inset 0 0 0 1px var(--relief);
  padding: 9px 11px; outline: none; border-radius: 0;
}
input:focus, select:focus, textarea:focus { box-shadow: inset 0 0 0 2px var(--violet-clair); }
textarea { min-height: 80px; resize: vertical; }
label.champ { display: grid; gap: 6px; font-family: var(--px); font-size: 14px; color: var(--doux); margin-bottom: 12px; }
label.champ.ligne { display: flex; align-items: center; gap: 10px; }
.rangee { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
input[type="range"] { width: 100%; accent-color: var(--or); }
input[type="color"] { width: 100%; height: 44px; border: 3px solid var(--bord); background: #0f0a1f; padding: 3px; }

/* ---------- Modale ---------- */
.voile { position: fixed; inset: 0; background: rgba(5, 3, 12, .75); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fondu .15s steps(3); }
.modale {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--panneau); border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px var(--or), 0 6px 0 rgba(0,0,0,.5);
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: monte .2s steps(4);
}
@media (min-width: 640px) { .voile { align-items: center; } .modale { padding: 24px; } }
.modale h3 { font-family: var(--px); color: var(--or-clair); margin: 0 0 14px; font-size: 21px; text-shadow: 2px 2px 0 #000; }
.modale .boutons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modale .boutons .gauche { margin-right: auto; }
.apercu-bat { display: flex; justify-content: center; padding: 10px; margin-bottom: 12px; background: #5e9e3a; border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px #2f5d1e; }
.choix-liste { display: grid; gap: 6px; max-height: 45dvh; overflow: auto; margin-bottom: 12px; }
.choix-liste .grp { font-family: var(--px); font-size: 12px; text-transform: uppercase; color: var(--faible); margin: 8px 0 2px; }
.choix { text-align: left; padding: 8px 12px; background: #f3e3bf; color: #2b1d0e; border: 2px solid var(--bord); }
.choix:hover { background: #fff3d6; }
@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(24px); opacity: 0; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bas-h) + 16px + env(safe-area-inset-bottom)); z-index: 70; display: grid; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px;
  background: #22193f; border: 3px solid var(--bord); box-shadow: inset 0 0 0 2px var(--relief), 0 4px 0 rgba(0,0,0,.5);
  animation: monte .2s steps(4);
}
.toast .msg { flex: 1; }
.toast button { background: none; border: 0; color: var(--or-clair); font-family: var(--px); font-size: 14px; }
.toast.level { background: linear-gradient(180deg, #f7dc7a, #d4af37); color: #1a1405; font-family: var(--px); font-size: 17px; box-shadow: inset 0 0 0 2px #fff7cc, 0 4px 0 rgba(0,0,0,.5); animation: monte .2s steps(4), secoue .5s steps(4) .2s; }
@keyframes secoue { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

/* ---------- Divers ---------- */
.ecran-centre { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.ecran-centre .boite { max-width: 380px; }
.ecran-centre h1 { font-family: var(--px); color: var(--or-clair); font-size: 30px; margin: 16px 0 6px; text-shadow: 3px 3px 0 #000; }
.ecran-centre p { color: var(--doux); }
.chargement { font-family: var(--px); color: var(--doux); }
.mode-demo { font-size: 12.5px; color: var(--attention); border: 2px dashed rgba(251, 191, 36, .5); padding: 7px 11px; margin-bottom: 12px; background: rgba(251, 191, 36, .06); }
.bandeau-erreur { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; box-shadow: inset 0 0 0 2px var(--alerte); }
.bandeau-erreur span { flex: 1; }
