/* ==========================================================================
   Surf Carcans — feuille de style « instrument de marine »
   Fond blanc, encre noire, traits épais. Seules couleurs = information.
   ========================================================================== */
:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --vert: #0a8a3d;   /* Vas-y   */
  --orange: #e06a00; /* Ça passe */
  --rouge: #c41200;  /* Bof / Laisse */
  --marine: #0e2a3b; /* chrome d'instrument, jamais porteur d'info */
  --trait: 3px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  /* Lisibilité plein soleil : jamais de gris pâle, tout en contraste max */
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

/* --- Barre d'onglets jour (zones tactiles ≥ 44px) --------------------- */
.jours { display: flex; gap: 8px; margin-bottom: 14px; }
.jours button {
  flex: 1; min-height: 48px; padding: 8px 4px;
  font-family: var(--sans); font-size: 15px; font-weight: 800;
  color: var(--ink); background: var(--paper);
  border: var(--trait) solid var(--ink); border-radius: 0;
  cursor: pointer; letter-spacing: 0.5px; text-transform: uppercase;
}
.jours button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.jours button .sub { display: block; font-size: 11px; font-weight: 600; opacity: 0.85; }

/* --- 1. Verdict ------------------------------------------------------- */
.verdict { border-top: 10px solid var(--ink); padding-top: 10px; margin-bottom: 8px; }
.verdict .mot {
  font-size: clamp(56px, 20vw, 104px); line-height: 0.92;
  font-weight: 900; letter-spacing: -2px; margin: 0;
}
.verdict .note {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  margin-top: 4px; letter-spacing: 1px;
}
.v-vert   .mot, .v-vert   .note { color: var(--vert); }
.v-orange .mot, .v-orange .note { color: var(--orange); }
.v-rouge  .mot, .v-rouge  .note { color: var(--rouge); }
.v-vert   { border-top-color: var(--vert); }
.v-orange { border-top-color: var(--orange); }
.v-rouge  { border-top-color: var(--rouge); }

/* --- 2. Phrase pourquoi ---------------------------------------------- */
.pourquoi { font-size: 18px; line-height: 1.35; font-weight: 600; margin: 6px 0 18px; }
.pourquoi .frein { font-weight: 800; }
.v-vert .frein { color: var(--vert); }
.v-orange .frein { color: var(--orange); }
.v-rouge .frein { color: var(--rouge); }

/* --- 3. Meilleur créneau --------------------------------------------- */
.creneau {
  border: var(--trait) solid var(--ink); padding: 12px 14px; margin-bottom: 18px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.creneau .lbl { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.creneau .big { font-family: var(--mono); font-size: 42px; font-weight: 800; line-height: 1; }
.creneau .win { font-family: var(--mono); font-size: 19px; font-weight: 700; }

/* --- 4. Courbe de marée (pièce centrale) ------------------------------ */
.maree-bloc { margin-bottom: 20px; }
.maree-bloc h2, .section h2 {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  margin: 0 0 8px; border-bottom: var(--trait) solid var(--ink); padding-bottom: 6px;
}
.maree-svg { width: 100%; height: auto; display: block; border: var(--trait) solid var(--ink); }
.maree-svg .courbe { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.maree-svg .bonfond { fill: var(--vert); opacity: 0.15; }
.maree-svg .axe { stroke: var(--ink); stroke-width: 1.5; }
.maree-svg .now { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 2 4; }
.maree-svg .extr { fill: var(--ink); }
.maree-svg text { font-family: var(--mono); fill: var(--ink); font-weight: 700; }
.maree-legende { display: flex; gap: 16px; font-size: 12px; font-weight: 700; margin-top: 6px; flex-wrap: wrap; }
.maree-legende .k { display: inline-flex; align-items: center; gap: 6px; }
.maree-legende .swatch { width: 16px; height: 12px; background: var(--vert); opacity: 0.3; border: 1.5px solid var(--vert); }

/* --- 5. Top 3 heures -------------------------------------------------- */
.top3 { display: flex; gap: 8px; margin-bottom: 20px; }
.top3 .h {
  flex: 1; border: var(--trait) solid var(--ink); padding: 10px 4px; text-align: center;
}
.top3 .h .hh { font-family: var(--mono); font-size: 22px; font-weight: 800; }
.top3 .h .nn { font-family: var(--mono); font-size: 15px; font-weight: 700; margin-top: 2px; }
.top3 .h.vert   { border-color: var(--vert); }   .top3 .h.vert   .nn { color: var(--vert); }
.top3 .h.orange { border-color: var(--orange); } .top3 .h.orange .nn { color: var(--orange); }
.top3 .h.rouge  { border-color: var(--rouge); }  .top3 .h.rouge  .nn { color: var(--rouge); }

/* --- 6. Valeurs brutes ----------------------------------------------- */
.brut { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: var(--trait) solid var(--ink); margin-bottom: 20px; }
.brut .cell { padding: 12px 14px; border-right: var(--trait) solid var(--ink); border-bottom: var(--trait) solid var(--ink); }
.brut .cell:nth-child(2n) { border-right: none; }
.brut .cell:nth-last-child(-n+2) { border-bottom: none; }
.brut .cell .k { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.brut .cell .v { font-family: var(--mono); font-size: 26px; font-weight: 800; margin-top: 4px; }
.brut .cell .u { font-size: 14px; font-weight: 700; }

/* --- 7. Checklist ---------------------------------------------------- */
.section { margin-bottom: 20px; }
.regles { list-style: none; margin: 0; padding: 0; }
.regles li {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  font-size: 16px; font-weight: 600; border-bottom: 1.5px solid var(--ink); padding: 4px 0;
}
.regles li:last-child { border-bottom: none; }
.regles .box {
  flex: 0 0 28px; width: 28px; height: 28px; border: var(--trait) solid var(--ink);
  display: grid; place-items: center; font-size: 20px; font-weight: 900; font-family: var(--mono);
}
.regles li.ok .box { background: var(--vert); color: var(--paper); border-color: var(--vert); }
.regles li.no .box { background: var(--paper); color: var(--rouge); border-color: var(--rouge); }
.regles li.no { color: var(--ink); }

/* --- Pied : horodatage / hors-ligne ---------------------------------- */
.pied { font-family: var(--mono); font-size: 12px; font-weight: 700; border-top: var(--trait) solid var(--ink); padding-top: 10px; }
.pied .offline { color: var(--rouge); font-weight: 800; }
.pied button {
  margin-top: 8px; min-height: 44px; width: 100%; font-family: var(--sans); font-weight: 800;
  font-size: 14px; text-transform: uppercase; letter-spacing: 1px;
  background: var(--paper); color: var(--ink); border: var(--trait) solid var(--ink); cursor: pointer;
}

.etat-chargement { font-family: var(--mono); font-weight: 700; padding: 40px 0; text-align: center; }

/* Respect de prefers-reduced-motion : pas de transitions par défaut.
   On n'en ajoute qu'en dehors de reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .jours button, .pied button { transition: background 0.12s ease, color 0.12s ease; }
}
