/* app.css — l'app web. Un seul jeu de styles, du téléphone au bureau.
   Les jetons de couleur sont ceux du moteur : le jaune est celui des taxis. */

:root {
  --fond: #14130F;
  --surface: #1E1C17;
  --surface-2: #22201A;
  --surface-3: #2E2B23;
  --bord: #332F26;
  --texte: #F5F1E8;
  --texte-2: #CFC8BA;
  --texte-3: #8C867A;
  --or: #E8B61E;
  --laterite: #C0532F;
  --vert: #7FC27A;
  --r: 16px;
  --rail: 0px;
  --gouttiere: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fond);
  color: var(--texte);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--or); }

/* ------------------------------------------------------------ ossature */

#appli {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

#vue {
  padding: 14px var(--gouttiere) 14px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* --- barre du haut */
#chapeau {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.chapeau-interieur {
  max-width: 760px;
  margin: 0 auto;
  padding: 13px var(--gouttiere);
  display: flex;
  align-items: center;
  gap: 12px;
}
.marque { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.chapeau-interieur .gonfle { flex: 1; }
.solde {
  font-size: 13px; font-weight: 700; color: var(--or);
  background: var(--surface-2); padding: 7px 12px; border-radius: 999px;
}

/* --- barre du bas, téléphone */
#pied {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--fond) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
}
.pied-interieur {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-around;
  padding: 9px var(--gouttiere) 11px;
}
.onglet {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--texte-3);
  padding: 4px 10px; border-radius: 12px; min-width: 56px;
  text-decoration: none;
}
.onglet svg { width: 21px; height: 21px; }
.onglet[aria-current="page"] { color: var(--or); }
.onglet.primaire {
  background: var(--or); color: var(--fond); font-weight: 800;
  padding: 10px 18px; border-radius: 999px; flex-direction: row; gap: 6px;
}
.onglet.primaire svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------- briques */

.titre { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; margin: 20px 0 4px; }
.chapo { font-size: 14px; font-weight: 500; color: var(--texte-3); line-height: 1.5; margin: 0 0 18px; }

.pilules { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.pilules::-webkit-scrollbar { display: none; }
.pilule {
  flex: none; font-size: 13px; font-weight: 600; padding: 8px 14px;
  border-radius: 999px; background: var(--surface-2); color: var(--texte-2);
  white-space: nowrap;
}
.pilule[aria-pressed="true"] { background: var(--or); color: var(--fond); font-weight: 700; }

.bouton {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font-size: 15px; font-weight: 800; padding: 15px; border-radius: 14px;
  background: var(--or); color: var(--fond);
}
.bouton.calme { background: var(--surface-3); color: var(--texte); font-weight: 700; }

.fil { display: grid; gap: 14px; }

.carte {
  border-radius: var(--r); background: var(--surface); overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.carte .vignette { aspect-ratio: 16 / 9; position: relative; display: block; }
.carte .vignette svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.carte .corps { padding: 13px 15px 15px; }
.carte .ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.carte h2 { margin: 0; font-size: 17px; font-weight: 800; }
.carte .meta { font-size: 12px; font-weight: 500; color: var(--texte-3); margin-top: 4px; }
.carte .meta b { color: var(--or); font-weight: 600; }
.carte .alerte { font-size: 12px; font-weight: 600; color: var(--texte-2); margin-top: 8px; }
.vivant { font-size: 11px; font-weight: 600; color: var(--vert); white-space: nowrap; }
.fanion {
  position: absolute; top: 11px; left: 11px; z-index: 1;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  padding: 5px 9px; border-radius: 999px; background: var(--or); color: var(--fond);
}

.carte.ligne-simple { display: flex; gap: 13px; align-items: center; padding: 13px 15px; }
.carte.ligne-simple .pastille {
  width: 58px; height: 58px; border-radius: 13px; flex: none;
  background: linear-gradient(160deg, #3C5A6B, #8D7A4E);
}
.carte.ligne-simple .texte { flex: 1; min-width: 0; }
.carte.ligne-simple h2 { font-size: 15px; }

.vide {
  border-radius: var(--r); border: 1px dashed #4A453A; padding: 16px;
}
.vide h2 { margin: 0; font-size: 15px; font-weight: 800; }

/* --- création : la conversation */
.apercu { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 7; margin-bottom: 14px; }
.apercu svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.apercu .note {
  position: absolute; right: 10px; top: 10px; font-size: 10px; font-weight: 700;
  background: rgba(20,19,15,0.86); color: var(--vert); padding: 5px 10px; border-radius: 999px;
}

.echanges { display: flex; flex-direction: column; gap: 11px; padding-bottom: 10px; }
.bulle { max-width: min(78%, 420px); padding: 11px 14px; font-size: 14px; line-height: 1.5; }
.bulle.eux { align-self: flex-start; background: var(--surface); border-radius: 16px 16px 16px 5px; color: var(--texte-2); }
.bulle.moi { align-self: flex-end; background: var(--or); color: var(--fond); border-radius: 16px 16px 5px 16px; font-weight: 600; }
.bulle.eux strong { color: var(--texte); font-weight: 700; }
.marques { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.marque-ajout {
  font-size: 10px; font-weight: 700; color: var(--vert);
  background: #1B2A1C; padding: 4px 9px; border-radius: 999px;
}
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; }
.suggestion {
  font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 999px;
  background: var(--surface-3); color: var(--texte); border: 1px solid #403B30;
}

.saisie {
  position: sticky; bottom: 0; padding: 10px 0 4px;
  background: linear-gradient(transparent, var(--fond) 22%);
}
.saisie-boite {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: 15px; padding: 9px 11px;
}
.saisie-boite input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 15px; font-weight: 500; }
.saisie-boite input::placeholder { color: var(--texte-3); }
.rond { flex: none; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-3); }
.rond.or { background: var(--or); }
.rond svg { width: 18px; height: 18px; }

/* --- la ville en 3D */
.scene { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.scene iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------- écrans plus larges */

@media (min-width: 900px) {
  :root { --gouttiere: 28px; }

  #appli { grid-template-rows: auto 1fr; grid-template-columns: 236px 1fr; }
  #chapeau { grid-column: 1 / -1; }
  #pied {
    position: static; grid-row: 2; grid-column: 1; border-top: 0;
    border-right: 1px solid var(--bord); background: none; backdrop-filter: none;
  }
  .pied-interieur {
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 22px 16px; position: sticky; top: 72px;
  }
  .onglet {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 15px; font-weight: 700; padding: 11px 14px; border-radius: 12px;
  }
  .onglet:hover { background: var(--surface); }
  .onglet svg { width: 20px; height: 20px; }
  .onglet.primaire { justify-content: center; margin-top: 10px; }
  #vue { grid-row: 2; grid-column: 2; padding-top: 4px; }
  .titre { font-size: 30px; }
}

@media (min-width: 1240px) {
  #vue { max-width: 1040px; }
  .fil { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .fil > .large { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .carte { transition: transform .15s ease; }
  .carte:hover { transform: translateY(-2px); }
}

/* ------------------------------------------- l'ecran de creation, en vrai */

.saisie-nom { display: grid; gap: 8px; margin: 18px 0 22px; }
.etiquette { font-size: 13px; color: var(--doux); letter-spacing: .02em; }
.saisie-nom input {
  background: #1C1A16; border: 1px solid #2E2B24; border-radius: 12px;
  color: var(--texte); font: inherit; font-size: 17px; padding: 13px 14px;
}
.saisie-nom input:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.adresse { color: var(--or); font-size: 14px; margin: 0; font-variant-numeric: tabular-nums; }
.adresse[data-mauvais] { color: var(--laterite); }
.adresse-vive { color: var(--or); }

.paliers { display: grid; gap: 8px; margin-bottom: 16px; }
@media (min-width: 620px) { .paliers { grid-template-columns: repeat(2, 1fr); } }
.palier {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline;
  gap: 4px 10px; padding: 12px 14px; border: 1px solid #2E2B24;
  border-radius: 12px; background: #1A1813; cursor: pointer;
}
.palier:has(input:checked) { border-color: var(--or); background: #201D16; }
.palier input { accent-color: var(--or); }
.palier-nom { font-weight: 600; }
.palier-prix { color: var(--or); font-variant-numeric: tabular-nums; }
.palier-detail { grid-column: 2 / -1; color: var(--doux); font-size: 13px; }
.promesse {
  color: var(--doux); font-size: 14px; line-height: 1.5;
  border-left: 2px solid var(--or); padding-left: 12px; margin: 0;
}

.manifeste { background: #1A1813; border: 1px solid #2E2B24; border-radius: 14px; padding: 14px; margin: 14px 0; }
.manifeste-titre { font-size: 14px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.compte { color: var(--doux); font-weight: 400; font-variant-numeric: tabular-nums; }
.manifeste-vide { color: var(--doux); font-size: 14px; margin: 0; }
.manifeste-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.manifeste-liste li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.manifeste-liste .champ { color: var(--doux); }
.manifeste-liste .valeur { color: var(--texte); font-weight: 600; text-align: right; }

.bulle.attente { opacity: .55; letter-spacing: .3em; }
.avis-maquette, .cout, .hors-ligne {
  font-size: 13px; color: var(--doux); line-height: 1.5;
  background: #1A1813; border: 1px dashed #3A3528; border-radius: 10px;
  padding: 10px 12px; margin: 10px 0;
}
.avis-maquette code, .hors-ligne code { color: var(--or); }
.lien {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--or); text-decoration: underline; cursor: pointer;
}

/* Le fieldset des paliers : pas de bordure de navigateur, juste la grille. */
fieldset.paliers { border: 0; margin: 6px 0 2px; padding: 0; }
fieldset.paliers legend { padding: 0; margin-bottom: 8px; }

/* l'entrée vers les scènes 3D de la ville (maquettes/) */
.entrer-3d { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 16px 18px; border-radius: 18px; background: var(--or); color: #14130f; text-decoration: none; box-shadow: 0 8px 22px rgba(232, 182, 30, .28); }
.entrer-3d span { display: flex; flex-direction: column; gap: 2px; }
.entrer-3d b { font-size: 17px; font-weight: 800; }
.entrer-3d small { font-size: 12.5px; font-weight: 600; opacity: .75; }
.entrer-3d i { margin-left: auto; font-style: normal; font-size: 22px; font-weight: 800; }

/* Pour toi : la vraie carte de la ville en vignette */
.vignette .vraie-carte { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }

/* tirer pour actualiser : la pastille qui descend du haut */
.tirer { position: fixed; left: 50%; top: 0; z-index: 90; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: #14130f; display: grid; place-items: center; font-size: 20px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); transform: translate(-50%, -50px); transition: transform .2s; pointer-events: none; }
.tirer.pret { background: var(--or); }
.tirer.charge { transform: translate(-50%, 40px) !important; }
.tirer.charge span { display: inline-block; animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* la page d'une ville : sa carte en grand (on la déplace au doigt), une fiche, un bouton */
.ville-plein { position: relative; margin: 0 -2px; }
.ville-plein .scene { border-radius: 22px; }
.ville-plein .scene iframe { touch-action: none; }
.ville-retour { position: absolute; left: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.94);
  color: #14130f; display: grid; place-items: center; font-weight: 800; font-size: 18px; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.ville-fiche { position: absolute; left: 10px; right: 10px; bottom: 10px; background: #fff; color: #14130f; border-radius: 20px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.ville-fiche h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.ville-fiche p { margin: 4px 0 12px; font-size: 12.5px; color: #6b7280; line-height: 1.45; }
.ville-fiche .apercu-note { margin: -4px 0 10px; color: #4b5563; }
.btn-ville { display: block; width: 100%; border: 0; border-radius: 999px; padding: 14px; font: inherit; font-weight: 800; font-size: 15px;
  background: var(--or); color: #14130f; box-shadow: 0 6px 18px rgba(232, 182, 30, .35); cursor: pointer; }
.btn-ville.clair { background: #f1ede4; box-shadow: none; }

/* Pour toi : SA ville se reconnaît */
.carte.la-mienne { outline: 2px solid var(--or); }
.carte.la-mienne .vignette::after { content: 'Ta ville · toucher pour y être'; position: absolute; left: 10px; top: 10px; background: var(--or); color: #14130f;
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
