/* HestiaSC — habillage. Sombre par défaut (le jeu se joue la nuit), clair si le système le demande ou au choix.
   Les couleurs sont des variables : la flamme d'Hestia (orangé), le bleu des écrans de bord pour les données. */

@font-face { font-family: 'Barlow'; src: url('/polices/barlow-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/polices/barlow-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/polices/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/polices/barlow-condensed-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/polices/barlow-condensed-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/polices/barlow-condensed-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --fond: #0a0e15;
  --fond-2: #0e141e;
  --panneau: #131b28;
  --panneau-2: #18222f;
  --survol: #1c2837;
  --ligne: #223044;
  --ligne-forte: #31445e;
  --texte: #e6ecf5;
  --discret: #93a3b8;
  --tres-discret: #66778d;
  --accent: #ff6b3d;        /* la flamme */
  --accent-doux: rgba(255, 107, 61, .14);
  --ambre: #ffb547;
  --donnee: #5cc8f2;        /* les écrans de bord */
  --donnee-doux: rgba(92, 200, 242, .12);
  --ok: #3fd69b; --ok-doux: rgba(63, 214, 155, .13);
  --critique: #ff5873; --critique-doux: rgba(255, 88, 115, .13);
  --stanton: #6aa6ff; --pyro: #ff7a45; --nyx: #b48cff;
  --ombre: 0 10px 30px rgba(0, 0, 0, .35);
  --titre: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --corps: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rayon: 10px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --fond: #eef2f7; --fond-2: #e6ebf2; --panneau: #ffffff; --panneau-2: #f5f7fb; --survol: #eef3fa;
    --ligne: #dbe3ee; --ligne-forte: #c3cfde; --texte: #121a28; --discret: #4f5f75; --tres-discret: #7b8aa0;
    --accent: #e0532a; --accent-doux: rgba(224, 83, 42, .1); --ambre: #b97100;
    --donnee: #0a78a8; --donnee-doux: rgba(10, 120, 168, .09);
    --ok: #13895f; --ok-doux: rgba(19, 137, 95, .1); --critique: #c8243f; --critique-doux: rgba(200, 36, 63, .09);
    --stanton: #2563c9; --pyro: #c94a14; --nyx: #7046c8;
    --ombre: 0 8px 24px rgba(20, 35, 60, .12);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --fond: #eef2f7; --fond-2: #e6ebf2; --panneau: #ffffff; --panneau-2: #f5f7fb; --survol: #eef3fa;
  --ligne: #dbe3ee; --ligne-forte: #c3cfde; --texte: #121a28; --discret: #4f5f75; --tres-discret: #7b8aa0;
  --accent: #e0532a; --accent-doux: rgba(224, 83, 42, .1); --ambre: #b97100;
  --donnee: #0a78a8; --donnee-doux: rgba(10, 120, 168, .09);
  --ok: #13895f; --ok-doux: rgba(19, 137, 95, .1); --critique: #c8243f; --critique-doux: rgba(200, 36, 63, .09);
  --stanton: #2563c9; --pyro: #c94a14; --nyx: #7046c8;
  --ombre: 0 8px 24px rgba(20, 35, 60, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte); font: 400 15px/1.5 var(--corps);
  display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  grid-template-areas: "barre barre" "nav page" "nav pied"; min-height: 100vh;
}
a { color: var(--donnee); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--titre); font-weight: 600; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
.num, td.n, .stat b { font-variant-numeric: tabular-nums; }

/* ---- barre du haut ---- */
.barre {
  grid-area: barre; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--ligne);
}
.marque { display: flex; align-items: center; gap: 8px; color: var(--texte); text-decoration: none !important; }
.marque-nom { font: 700 22px/1 var(--titre); letter-spacing: .02em; }
.marque-nom b { color: var(--accent); }
.recherche { position: relative; flex: 1; max-width: 520px; }
.recherche input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: 8px; border: 1px solid var(--ligne); background: var(--panneau) no-repeat 11px 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' stroke='%2393a3b8' stroke-width='2'%3E%3Ccircle cx='6.5' cy='6.5' r='5'/%3E%3Cpath d='m10.5 10.5 3.5 3.5'/%3E%3C/svg%3E");
}
.recherche input:focus { outline: 2px solid var(--donnee); outline-offset: 0; border-color: transparent; }
.recherche-res {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panneau); border: 1px solid var(--ligne-forte);
  border-radius: 10px; box-shadow: var(--ombre); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.recherche-res a { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; color: var(--texte); border-bottom: 1px solid var(--ligne); }
.recherche-res a:last-child { border-bottom: 0; }
.recherche-res a:hover, .recherche-res a.sel { background: var(--survol); text-decoration: none; }
.recherche-res .genre { font: 600 11px var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--tres-discret); min-width: 82px; }
.version { font: 600 13px var(--titre); letter-spacing: .05em; color: var(--discret); padding: 4px 9px; border: 1px solid var(--ligne); border-radius: 999px; white-space: nowrap; }
.version b { color: var(--ok); }
.icone { background: none; border: 1px solid var(--ligne); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; color: var(--discret); }
.icone:hover { background: var(--survol); }
.compte { font: 600 14px var(--titre); letter-spacing: .04em; text-transform: uppercase; padding: 7px 12px; border-radius: 8px; background: var(--accent-doux); color: var(--accent); white-space: nowrap; }
.compte:hover { text-decoration: none; filter: brightness(1.1); }

/* ---- navigation ---- */
.nav { grid-area: nav; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--ligne); position: sticky; top: 59px; align-self: start; height: calc(100vh - 59px); }
.nav a {
  font: 600 16px var(--titre); letter-spacing: .03em; color: var(--discret); padding: 8px 12px; border-radius: 8px; border-left: 3px solid transparent;
}
.nav a:hover { background: var(--survol); color: var(--texte); text-decoration: none; }
.nav a.actif { color: var(--texte); background: var(--panneau); border-left-color: var(--accent); }
.nav .nav-moi { margin-top: auto; }

/* ---- page ---- */
.page { grid-area: page; padding: 22px 26px 40px; min-width: 0; outline: none; }
.pied { grid-area: pied; padding: 16px 26px 26px; color: var(--tres-discret); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--ligne); }
.chargement { color: var(--discret); }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin-bottom: 16px; }
.entete p { margin: 4px 0 0; color: var(--discret); max-width: 70ch; }
.entete .droite { margin-left: auto; }
.sur-titre { font: 600 12px var(--titre); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.fil { font-size: 13px; color: var(--discret); margin-bottom: 8px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grille-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.carte { background: var(--panneau); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; min-width: 0; }
.carte h2, .carte h3 { margin-bottom: 8px; }
.carte.lien { color: var(--texte); display: block; transition: border-color .15s, transform .15s; }
.carte.lien:hover { border-color: var(--ligne-forte); text-decoration: none; transform: translateY(-1px); }
.vide { color: var(--tres-discret); font-style: italic; }
.note { color: var(--discret); font-size: 13px; }
.section { margin-top: 26px; }
.section > h2 { margin-bottom: 10px; }

/* chiffres clés */
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 2px; }
.stat { display: flex; flex-direction: column; min-width: 70px; }
.stat span { font: 600 11px var(--titre); text-transform: uppercase; letter-spacing: .1em; color: var(--tres-discret); }
.stat b { font: 600 19px var(--titre); color: var(--texte); }

/* puces */
.puce { display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1 var(--titre); letter-spacing: .06em; padding: 4px 7px; border-radius: 5px;
  background: var(--panneau-2); color: var(--discret); border: 1px solid var(--ligne); white-space: nowrap; vertical-align: 1px; }
.puce.taille { background: var(--donnee-doux); color: var(--donnee); border-color: transparent; }
.puce.illegal { background: var(--critique-doux); color: var(--critique); border-color: transparent; }
.puce.ok { background: var(--ok-doux); color: var(--ok); border-color: transparent; }
.puce.flamme { background: var(--accent-doux); color: var(--accent); border-color: transparent; }
.puce.sys-stanton { color: var(--stanton); } .puce.sys-pyro { color: var(--pyro); } .puce.sys-nyx { color: var(--nyx); }
.puces { display: flex; flex-wrap: wrap; gap: 5px; }

/* tableaux */
.tableau { overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--panneau); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 12px var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--tres-discret); padding: 9px 10px; border-bottom: 1px solid var(--ligne); background: var(--panneau-2); white-space: nowrap; position: sticky; top: 0; }
td { padding: 8px 10px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--survol); }
td.n, th.n { text-align: right; white-space: nowrap; }
td.fort { font-weight: 600; }
.gain { color: var(--ok); font-weight: 600; }

/* filtres et formulaires */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filtres input[type=search], .filtres input[type=number], .filtres select, .champ input, .champ select, .champ textarea {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--ligne); background: var(--panneau); min-width: 0;
}
.filtres input[type=search] { flex: 1 1 220px; max-width: 360px; }
.filtres label, .case { display: inline-flex; align-items: center; gap: 6px; color: var(--discret); font-size: 14px; }
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.onglets a, .onglets button { font: 600 14px var(--titre); letter-spacing: .03em; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ligne); color: var(--discret); background: var(--panneau); cursor: pointer; }
.onglets a:hover, .onglets button:hover { text-decoration: none; color: var(--texte); }
.onglets .actif { background: var(--accent-doux); color: var(--accent); border-color: transparent; }
.bouton { font: 600 14px var(--titre); letter-spacing: .05em; text-transform: uppercase; padding: 8px 14px; border-radius: 8px; border: 0; cursor: pointer; background: var(--accent); color: #fff; }
.bouton:hover { filter: brightness(1.08); }
.bouton.second { background: var(--panneau-2); color: var(--texte); border: 1px solid var(--ligne); }
.bouton.petit { padding: 4px 9px; font-size: 12px; }
.bouton.danger { background: var(--critique-doux); color: var(--critique); }
.champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.champ span { font: 600 12px var(--titre); text-transform: uppercase; letter-spacing: .08em; color: var(--tres-discret); }
.champ textarea { min-height: 90px; resize: vertical; }
.erreur { color: var(--critique); }

/* vaisseaux */
.vaisseau-carte { display: flex; flex-direction: column; gap: 8px; padding: 0; overflow: hidden; }
.vaisseau-img { aspect-ratio: 16 / 9; background: var(--panneau-2) center / cover no-repeat; position: relative; }
.vaisseau-img .logo { position: absolute; left: 10px; bottom: 8px; width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7)); }
.vaisseau-corps { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.vaisseau-corps h3 { font-size: 19px; }
.ligne-chiffres { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--discret); }
.ligne-chiffres b { color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.prix { font: 600 16px var(--titre); color: var(--ambre); }
.fiche-haut { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fiche-img { border-radius: var(--rayon); aspect-ratio: 16 / 9; background: var(--panneau-2) center / cover no-repeat; border: 1px solid var(--ligne); }
.texte-long { max-width: 75ch; white-space: pre-line; color: var(--texte); }
.texte-long.en { color: var(--discret); font-style: italic; }

/* Hestia */
.hestia { display: flex; gap: 12px; align-items: flex-start; }
.hestia img { width: 34px; height: 34px; flex: none; }
.bulle { background: var(--panneau-2); border: 1px solid var(--ligne); border-radius: 4px 12px 12px 12px; padding: 10px 14px; flex: 1; min-width: 0; }
.demande { display: flex; gap: 8px; margin-top: 10px; }
.demande input { flex: 1; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--ligne); background: var(--panneau); min-width: 0; }
.faits { margin: 8px 0 0; padding-left: 18px; color: var(--discret); font-size: 13.5px; }
.faits li { margin: 3px 0; }
details summary { cursor: pointer; color: var(--discret); font-size: 13px; }

/* listes simples */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { padding: 9px 0; border-bottom: 1px solid var(--ligne); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.liste li:last-child { border-bottom: 0; }
.liste .droite { margin-left: auto; }

/* lieux */
.systeme { margin-bottom: 18px; }
.planete { border-left: 2px solid var(--ligne); padding: 4px 0 4px 12px; margin: 8px 0; }
.planete h4 { font-size: 16px; }
.planete .sites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* objectifs */
.objectif { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.objectif:last-child { border-bottom: 0; }
.objectif.fait .titre { text-decoration: line-through; color: var(--tres-discret); }
.etat-obj { min-width: 92px; }

/* écrans étroits : la navigation passe en bandeau sous la barre */
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "barre" "nav" "page" "pied"; }
  .barre { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .recherche { order: 5; flex: 1 1 100%; max-width: none; }
  .version { display: none; }
  .nav { position: sticky; top: 0; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ligne); padding: 6px 10px; gap: 4px; background: var(--fond); z-index: 15; scrollbar-width: none; }
  .nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: 6px; padding: 6px 10px; font-size: 15px; }
  .nav a.actif { border-bottom-color: var(--accent); }
  .nav .nav-moi { margin-top: 0; }
  .page { padding: 16px 16px 30px; }
  .pied { padding: 14px 16px 24px; }
  .fiche-haut { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
