/* Météores · Arzon — la palette vient de l'icône : indigo du ciel de nuit, orangé du couchant, bleu de la mer. */
:root {
  --fond: #f3f5fa;
  --carte: #ffffff;
  --encre: #141833;
  --doux: #5a6180;
  --trait: #dfe3ee;
  --indigo: #2b2f73;
  --nuit: #1b1f4a;
  --mer: #1f6fb2;
  --vague: #23a3c4;
  --soleil: #f08a24;
  --chaud: #e0662c;
  --froid: #2f7fd1;
  --vert: #2e9a6a;
  --alerte: #c2410c;
  --ombre: 0 1px 2px rgba(20, 24, 51, .06), 0 4px 16px rgba(20, 24, 51, .05);
  --rayon: 16px;
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0d1030;
    --carte: #171b44;
    --encre: #eceefa;
    --doux: #a3a9cc;
    --trait: #2a2f63;
    --indigo: #9aa1ff;
    --mer: #5aa9ec;
    --vague: #4cc3e0;
    --soleil: #f6a14a;
    --chaud: #f08a5a;
    --froid: #6aa8f0;
    --vert: #4cc08c;
    --alerte: #f59e6b;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 400 16px/1.5 var(--police);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--mer); }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--doux); font-weight: 600; }
.discret { color: var(--doux); font-size: .85rem; }
.chiffre { font-family: var(--chiffres); font-variant-numeric: tabular-nums; }

/* ---------- en-tête ---------- */
.entete {
  background: linear-gradient(180deg, var(--nuit) 0%, #2b2f73 70%, #3c3778 100%);
  color: #fff; padding: max(14px, env(safe-area-inset-top)) 16px 2px;
}
.barre-onglets {
  position: sticky; top: 0; z-index: 10; background: #3c3778; padding: 0 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}
.entete-haut { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; }
.logo { border-radius: 10px; flex: none; }
.titres h1 { font-size: 1.25rem; margin: 0; line-height: 1.2; }
.lieu-titre { color: #f6b26b; font-weight: 600; }
.sous-titre { margin: 0; font-size: .82rem; color: #c8cbef; }
.onglets {
  display: flex; gap: 4px; max-width: 1100px; margin: 0 auto; overflow-x: auto; scrollbar-width: none;
}
.onglets::-webkit-scrollbar { display: none; }
.onglets a {
  flex: none; color: #d6d9f7; text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 9px 12px 11px; border-bottom: 3px solid transparent; white-space: nowrap;
  display: flex; align-items: center; gap: 7px;
}
.onglets a svg { width: 19px; height: 19px; flex: none; }
.onglets .court { display: none; }
.onglets a.actif { color: #fff; border-bottom-color: #f6a14a; }

/* ---------- contenu ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.chargement, .erreur { text-align: center; color: var(--doux); padding: 40px 0; }
.erreur { color: var(--alerte); }
/* une carte par rangée, toute la largeur : les contenus côte à côte se font dans la carte (.colonnes) */
.grille { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.carte {
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; min-width: 0;
}
.carte.large { grid-column: 1 / -1; }
.carte header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.carte header h2 { margin: 0; }
.carte header .note { font-size: .8rem; color: var(--doux); text-align: right; }
.colonnes { display: grid; gap: 6px 20px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.colonnes h3 { margin-top: .2rem; }
.legende { font-size: .8rem; color: var(--doux); margin: .6rem 0 0; }
.ligne { margin: .35rem 0; }

/* cartes au fond animé (le ciel, la mer) : texte clair par-dessus */
.carte.anime { position: relative; overflow: hidden; color: #fff; background: #23406e; }
.carte.anime > :not(.fond-anime) { position: relative; z-index: 1; }
.carte.anime .fond-anime { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.carte.anime .note, .carte.anime .detail, .carte.anime .legende, .carte.anime .discret, .carte.anime .mesure .l,
.carte.anime h3, .carte.anime .maree .type { color: rgba(255, 255, 255, .78); }
.carte.anime .mesure, .carte.anime .maree { background: rgba(10, 14, 40, .28); backdrop-filter: blur(2px); }
.carte.anime a { color: #cfe4ff; }
.carte.anime .heros .temp, .carte.anime .ciel { text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.coupe { display: block; width: 100%; height: 96px; border-radius: 10px; margin-top: 10px; background: rgba(10, 14, 40, .25); }

/* le temps qu'il fait */
.heros { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.heros .icone-ciel { width: 72px; height: 72px; flex: none; }
.heros .temp { font: 600 3.2rem/1 var(--chiffres); letter-spacing: -.03em; }
.heros .ciel { font-size: 1.1rem; font-weight: 600; }
.heros .detail { color: var(--doux); font-size: .9rem; }
.mesures { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.mesure { background: color-mix(in srgb, var(--fond) 70%, var(--carte)); border-radius: 12px; padding: 10px 12px; }
.mesure .v { font: 600 1.25rem/1.2 var(--chiffres); }
.mesure .l { font-size: .8rem; color: var(--doux); }
.fleche { display: inline-block; transition: transform .3s; }

/* heures et jours */
.bande { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.heure {
  flex: none; width: 66px; text-align: center; background: color-mix(in srgb, var(--fond) 70%, var(--carte));
  border-radius: 12px; padding: 8px 4px; scroll-snap-align: start; font-size: .85rem;
}
.heure .h { color: var(--doux); font-size: .78rem; }
.heure svg { width: 30px; height: 30px; display: block; margin: 4px auto; }
.heure .t { font: 600 1rem var(--chiffres); }
.heure .p { color: var(--froid); font-size: .75rem; min-height: 1.1em; }
.jours { display: grid; gap: 8px; }
.jour {
  display: grid; grid-template-columns: 92px 34px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--trait); font-size: .92rem;
}
.jour:last-child { border-bottom: 0; }
.jour .nom { font-weight: 600; }
.jour .nom small { display: block; color: var(--doux); font-weight: 400; font-size: .78rem; }
.jour svg { width: 32px; height: 32px; }
.jour .info { color: var(--doux); font-size: .82rem; }
.jour .temps { font: 600 1rem var(--chiffres); white-space: nowrap; }
.jour .temps .min { color: var(--froid); }
.jour .temps .max { color: var(--chaud); }

/* marées */
.marees-jour { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.maree { border-radius: 12px; padding: 8px 10px; background: color-mix(in srgb, var(--fond) 70%, var(--carte)); }
.maree .type { font-size: .78rem; color: var(--doux); }
.maree .quand { font: 600 1.15rem var(--chiffres); }
.coef { display: inline-block; font: 600 .78rem var(--chiffres); padding: 1px 7px; border-radius: 999px; background: var(--trait); }
.coef.ge { background: #f6d9c2; color: #8a3a0a; }
.coef.ve { background: #d7e8f8; color: #134a7c; }
.coef.me { background: var(--trait); color: var(--doux); }
@media (prefers-color-scheme: dark) {
  .coef.ge { background: #5a3216; color: #ffd4b0; }
  .coef.ve { background: #173a5e; color: #cfe4fb; }
}
table.tableau { width: 100%; hyphens: auto; border-collapse: collapse; font-size: .9rem; }
table.tableau th { text-align: left; color: var(--doux); font-weight: 600; font-size: .78rem; padding: 6px 4px; border-bottom: 1px solid var(--trait); }
table.tableau td { padding: 6px 4px; border-bottom: 1px solid var(--trait); font-variant-numeric: tabular-nums; }
table.tableau tr:last-child td { border-bottom: 0; }
table.tableau td.chiffre { white-space: nowrap; }
.defile { overflow-x: auto; }
.modele { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--alerte); border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; vertical-align: middle; }

/* l'année de marées */
.nav-annee { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.nav-annee button { font: inherit; border: 0; border-radius: 8px; background: var(--trait); color: var(--encre); width: 40px; height: 32px; cursor: pointer; }
.nav-annee button:disabled { opacity: .35; cursor: default; }
.nav-annee strong { font-size: 1.15rem; }
.barre-fenetre { position: sticky; top: 46px; z-index: 5; padding: 10px 14px; }
.barre-fenetre .segments { margin-bottom: 4px; }
.lien-fort { font-weight: 600; text-decoration: none; }

/* graphiques */
.graphe { position: relative; height: 220px; }
.graphe.haut { height: 280px; }
.graphe.bas { height: 160px; }

/* choix (segments) */
.segments { display: inline-flex; background: color-mix(in srgb, var(--fond) 70%, var(--carte)); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 10px; flex-wrap: wrap; }
.segments button {
  font: inherit; font-size: .85rem; border: 0; background: transparent; color: var(--doux); padding: 5px 10px; border-radius: 8px; cursor: pointer;
}
.segments button.actif { background: var(--carte); color: var(--encre); font-weight: 600; box-shadow: var(--ombre); }

/* statistiques : rubriques */
.rubriques { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.rubrique {
  text-align: left; font: inherit; color: inherit; background: var(--carte); border: 0; border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;   /* titres alignés en haut */
}
.rubrique .titre { font-weight: 700; }
.rubrique .chiffre { font-weight: 600; margin-top: 2px; }
.rubrique .contenu { font-size: .78rem; color: var(--doux); margin-top: 4px; }
.rubrique.active { outline: 2px solid var(--soleil); }
.retour { font: inherit; border: 0; background: none; color: var(--mer); cursor: pointer; padding: 0; margin-bottom: 10px; font-weight: 600; }
.progression { color: var(--doux); font-size: .9rem; padding: 12px 0; }

/* radar et webcam */
.carte-radar { position: relative; overflow: hidden; border-radius: 12px; background: #aad3df; }
.carte-radar .tuile { position: absolute; width: 256px; height: 256px; max-width: none; }
.couche-radar { position: absolute; inset: 0; opacity: .8; }
.anim-carte { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; }
.carte-radar .repere-lieu, .carte-radar .attribution { z-index: 2; }
.repere-lieu { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #e0662c; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.repere-lieu span { position: absolute; left: 14px; top: -5px; font: 700 .78rem var(--police); color: #141833; text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.attribution { position: absolute; right: 0; bottom: 0; font-size: .68rem; background: rgba(255,255,255,.8); color: #333; padding: 1px 6px; border-top-left-radius: 6px; }
.attribution a { color: #1f4f8a; }
.commandes-radar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.commandes-radar input { flex: 1; }
.commandes-radar button { font: inherit; border: 0; border-radius: 8px; background: var(--trait); color: var(--encre); width: 40px; height: 32px; cursor: pointer; }
.panorama { overflow-x: auto; border-radius: 12px; }
.panorama-image { position: relative; display: inline-block; height: 240px; }
.panorama-image img { height: 100%; width: auto; display: block; max-width: none; }
.repere-pano { position: absolute; bottom: 8px; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: #fff;
  background: rgba(20,24,51,.55); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }

/* rose des vents */
.rose-boite { max-width: 340px; margin: 6px auto; color: var(--doux); }
.rose { width: 100%; height: auto; display: block; }
.rose text { font: 600 10px var(--police); text-anchor: middle; dominant-baseline: middle; }
.rose .rose-pc { font-size: 8px; fill: var(--doux); font-weight: 400; }
.rose .rose-cap { fill: var(--doux); font-size: 11px; }
.legende-rose { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: .78rem; color: var(--doux); margin: 4px 0 8px; }
.legende-rose i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Terre, Lune et Soleil */
.lune-anim { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); gap: 14px; align-items: center; }
.schema-lune { max-width: 100%; height: auto; display: block; margin: 0 auto; color: var(--doux); }
.schema-lune text { fill: currentColor; font-family: var(--police); }
.schema-lune .sch-petit { font-size: 9px; }
.schema-lune .sch-nom { font-size: 11px; font-weight: 600; }
.schema-lune .sch-phase { font-size: 10px; font-weight: 600; }
.schema-lune .sch-titre { font-size: 12px; font-weight: 700; fill: var(--encre); }
.lune-vue { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.lune-vue .ciel { font-weight: 700; font-size: 1.05rem; }
.lune-vue .detail { color: var(--doux); font-size: .88rem; }
@media (max-width: 640px) { .lune-anim { grid-template-columns: 1fr; } }

/* Lune */
.lune-dessin { flex: none; }

/* pied */
.pied { max-width: 1100px; margin: 10px auto 30px; padding: 0 16px; font-size: .85rem; color: var(--doux); }
.pied p { margin: .6rem 0; }

@media (max-width: 520px) {
  .sous-titre { display: none; }
  .logo { width: 32px; height: 32px; }
  /* comme la barre d'onglets de l'app : les cinq rubriques sur une ligne, l'icône au-dessus d'un libellé court */
  .barre-onglets { padding: 0 4px; }
  .onglets { gap: 0; overflow: visible; }
  .onglets a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: .68rem; font-weight: 600; }
  .onglets a svg { width: 23px; height: 23px; }
  .onglets .long { display: none; }
  .onglets .court { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  main { padding: 12px; }
  .carte { padding: 14px; }
  .heros .temp { font-size: 2.8rem; }
  .jour { grid-template-columns: 78px 30px 1fr auto; gap: 8px; }
}

/* l'« À propos » */
.lien-apropos { margin-left: auto; font-size: .85rem; color: inherit; opacity: .85; text-decoration: none; border: 1px solid currentColor; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.lien-apropos:hover { opacity: 1; }
.apropos p { line-height: 1.55; max-width: 72ch; }
.apropos-tete { display: flex; align-items: center; gap: 14px; margin-bottom: .4rem; }
.apropos-tete img { border-radius: 26px; flex: none; width: 120px; height: 120px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.apropos-tete { gap: 20px; }
@media (max-width: 480px) { .apropos-tete img { width: 88px; height: 88px; border-radius: 20px; } }
.apropos-tete h2 { margin: 0; font-size: 1.5rem; }
.apropos-tete p { margin: .1rem 0 0; }
.marque { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.marque:hover .logo { transform: scale(1.05); }
.logo { transition: transform .15s; }
.lien-carte { display: flex; align-items: center; gap: 14px; margin-top: .9rem; padding: 12px 14px; border: 1px solid var(--trait);
  border-radius: 14px; color: inherit; text-decoration: none; line-height: 1.45; font-size: .92rem; }
.lien-carte:hover { border-color: var(--mer); }
.lien-carte strong { color: var(--mer); }
.pastille-logo { flex: none; background: #fff; border-radius: 10px; padding: 8px 10px; display: flex; }
.pastille-logo img { display: block; width: 72px; height: auto; }
.fleche-lien { color: var(--mer); font-weight: 700; }
@media (max-width: 480px) { .lien-carte { align-items: flex-start; } .pastille-logo img { width: 56px; } }
