:root {
  --fond: #0e1117;
  --carte: #171b24;
  --carte-2: #1e2330;
  --bord: #2a3140;
  --texte: #e8ecf3;
  --texte-faible: #97a1b3;
  --accent: #ff8a3d;
  --accent-2: #58a6ff;
  --vert: #3fb950;
  --orange: #d29922;
  --gris: #6e7681;
  --rayon: 14px;
  --ombre: 0 6px 18px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 60% at 50% 0%, #182031 0%, var(--fond) 55%) no-repeat, var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding: 0 0 env(safe-area-inset-bottom);
}

h1 { font-size: 1.35rem; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: 1rem; margin: 0; }
p { margin: 0; }
a { color: var(--accent-2); }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- en-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  padding: calc(env(safe-area-inset-top) + .7rem) 1rem .7rem;
  background: rgba(14, 17, 23, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: .7rem; max-width: 720px; margin: 0 auto; }
.logo {
  font-size: 1.5rem; width: 2.6rem; height: 2.6rem; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2a3446, #161b25);
  border: 1px solid var(--bord); border-radius: 50%;
}
.sous-titre { color: var(--texte-faible); font-size: .82rem; margin-top: .15rem; }

main { max-width: 720px; margin: 0 auto; padding: 1rem; display: grid; gap: .8rem; }

/* ---------- cartes ---------- */
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: .9rem;
}

/* ---------- recherche ---------- */
.champ-ville { position: relative; }
#ville {
  width: 100%; padding: .85rem .9rem; font-size: 1rem;
  color: var(--texte); background: var(--carte-2);
  border: 1px solid var(--bord); border-radius: 10px;
}
#ville:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }

.suggestions {
  position: absolute; inset: calc(100% + 4px) 0 auto 0; z-index: 20;
  list-style: none; margin: 0; padding: .25rem;
  background: #111621; border: 1px solid var(--bord); border-radius: 10px;
  box-shadow: var(--ombre); max-height: 15rem; overflow: auto;
}
.suggestions li { padding: .6rem .6rem; border-radius: 8px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--carte-2); }
.suggestions .s-cp { color: var(--texte-faible); font-size: .8rem; }

.actions-recherche { display: flex; gap: .5rem; margin-top: .6rem; }
.btn {
  flex: 1 1 0; padding: .8rem .9rem; font-size: .95rem; font-weight: 600;
  border-radius: 10px; border: 1px solid var(--bord); cursor: pointer;
  background: var(--carte-2); color: var(--texte); min-height: 46px;
}
.btn:active { transform: scale(.99); }
.btn-principal { background: var(--accent); border-color: var(--accent); color: #201206; }
.btn-secondaire { background: var(--carte-2); }
.btn[disabled] { opacity: .5; }

.aide { color: var(--texte-faible); font-size: .75rem; margin-top: .5rem; }

/* ---------- filtres ---------- */
.filtre { margin-top: .85rem; }
.etiquette { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-faible); margin-bottom: .35rem; }
.puces { display: flex; flex-wrap: wrap; gap: .4rem; }
.puces button {
  padding: .5rem .75rem; min-height: 40px;
  background: var(--carte-2); color: var(--texte);
  border: 1px solid var(--bord); border-radius: 999px;
  font-size: .88rem; cursor: pointer;
}
.puces button.actif {
  background: color-mix(in srgb, var(--accent-2) 22%, var(--carte-2));
  border-color: var(--accent-2);
  color: #dbeafe;
}
.puces-types button.actif {
  background: color-mix(in srgb, var(--accent) 20%, var(--carte-2));
  border-color: var(--accent); color: #ffe0c2;
}

.types { margin-top: .85rem; }
.types summary {
  cursor: pointer; font-size: .85rem; color: var(--texte-faible);
  padding: .35rem 0; list-style: none;
}
.types summary::-webkit-details-marker { display: none; }
.types summary::before { content: "▸ "; }
.types[open] summary::before { content: "▾ "; }
.pastille {
  background: var(--carte-2); border: 1px solid var(--bord);
  border-radius: 999px; padding: .05rem .45rem; font-size: .72rem; margin-left: .3rem;
}
.puces-types { margin-top: .5rem; }

/* ---------- état ---------- */
.etat { display: flex; align-items: center; gap: .6rem; color: var(--texte-faible); font-size: .9rem; }
.etat.erreur { color: #ffb4a2; border-color: #6b2b22; background: #1e1512; }
.rondeur {
  width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--bord); border-top-color: var(--accent);
  animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rondeur { animation-duration: 2.4s; } }

/* ---------- résultats ---------- */
.resultats { display: grid; gap: .8rem; }
.groupe { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.groupe > header {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .8rem .9rem; background: var(--carte-2); border-bottom: 1px solid var(--bord);
}
.groupe > header .g-emoji { font-size: 1.15rem; }
.groupe > header h2 { flex: 1 1 auto; }
.groupe > header .g-compte { color: var(--texte-faible); font-size: .82rem; }
.groupe .avertissement { padding: .55rem .9rem; color: var(--orange); font-size: .78rem; border-bottom: 1px solid var(--bord); }
.groupe .vide { padding: .9rem; color: var(--texte-faible); font-size: .88rem; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li + li { border-top: 1px solid var(--bord); }

.item { padding: .8rem .9rem; }
.item-tete { display: flex; align-items: baseline; gap: .6rem; }
.item-nom { flex: 1 1 auto; font-weight: 600; }
.item-dist { color: var(--accent-2); font-variant-numeric: tabular-nums; font-size: .85rem; white-space: nowrap; }
.item-meta { color: var(--texte-faible); font-size: .82rem; margin-top: .2rem; }
.item-pied { display: flex; align-items: center; gap: .6rem; margin-top: .55rem; flex-wrap: wrap; }

.badge-prix {
  font-size: .76rem; padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid var(--bord); white-space: nowrap;
}
.badge-prix.gratuit { color: #b7f0c0; border-color: #275c33; background: #12251a; }
.badge-prix.payant { color: #ffd9a8; border-color: #6a4a1c; background: #251c10; }
.badge-prix.inconnu { color: var(--texte-faible); }
.badge-prix .approx { opacity: .65; font-size: .9em; }

.item-liens { margin-left: auto; display: flex; gap: .4rem; }
.item-liens a {
  font-size: .8rem; text-decoration: none; padding: .35rem .6rem;
  border: 1px solid var(--bord); border-radius: 8px; background: var(--carte-2); color: var(--texte);
}
.item-liens a:active { transform: scale(.98); }

/* ---------- pied ---------- */
.pied {
  max-width: 720px; margin: 1.5rem auto 0; padding: 1rem;
  border-top: 1px solid var(--bord); color: var(--texte-faible); font-size: .78rem;
}
.pied nav { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .5rem; }

/* ---------- pages légales ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: 1rem; }
.legal h1 { font-size: 1.3rem; margin-bottom: .8rem; }
.legal h2 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.legal p, .legal li { color: #cbd3df; font-size: .9rem; }
.legal ul { padding-left: 1.1rem; }
.placeholder {
  background: #3a2a12; border: 1px dashed #8a6a2a; color: #ffd9a8;
  padding: .1rem .35rem; border-radius: 6px; font-size: .85em; white-space: nowrap;
}
.retour { display: inline-block; margin-bottom: 1rem; }

/* ---------- ambiances & idée du moment ---------- */
.puces-ambiances button { border-color: #3a4557; }
.puces-ambiances button.actif {
  background: linear-gradient(120deg, #2a3a55, #22303f);
  border-color: var(--accent); color: #ffe0c2;
}

.idee { border-color: #5a4a22; background: linear-gradient(160deg, #1d2030, var(--carte)); }
.idee-tete { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.idee h2 { margin: .3rem 0 .15rem; font-size: 1.15rem; }
.idee .item-pied { margin-top: .6rem; }
.lien-bouton {
  font-size: .8rem; padding: .35rem .6rem; border: 1px solid var(--bord);
  border-radius: 8px; background: var(--carte-2); color: var(--texte); cursor: pointer;
  font-family: inherit;
}

@media (min-width: 560px) {
  .item { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; }
  .item-tete { grid-column: 1; }
  .item-meta { grid-column: 1 / -1; }
  .item-pied { grid-column: 1 / -1; }
}
