/*
 * Météo PILS (/friendly) — look commun : couleurs en variables --fr-*, jour (défaut) et nuit (classe fr-night
 * sur <html>), cartes arrondies, gros chiffres lisibles de loin. Icônes et instruments : js/friendly-*.js.
 */
:root {
  --fr-font: 'Nunito', 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
  --fr-bg: linear-gradient(180deg, #CFE8FA 0%, #EEF7FD 60%, #F7FBFE 100%);
  --fr-card: rgba(255, 255, 255, 0.88);
  --fr-card-shadow: 0 6px 24px rgba(40, 90, 140, 0.12);
  --fr-text: #1E3550;
  --fr-muted: #5E7590;
  --fr-line: #D5E2EC;
  --fr-warn: #E8780C;
  --fr-alert: #D93425;
  --fr-ground: #BFE3B0;
  --fr-ground-in: #D3EDC8;
  --fr-mast: #8796A6;
  --fr-glass: #E4EFF8;
  --fr-water: #3AA3E6;
  --fr-dial: #F4F8FB;
  --fr-ring: #FFFFFF;
  --fr-sock-edge: #AEBBC7;
}
.fr-night {
  --fr-bg: linear-gradient(180deg, #0B1630 0%, #13254A 60%, #1A2F57 100%);
  --fr-card: rgba(255, 255, 255, 0.07);
  --fr-card-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --fr-text: #E8F0FA;
  --fr-muted: #9DB0C8;
  --fr-line: #2E4369;
  --fr-warn: #FFA040;
  --fr-alert: #FF6A55;
  --fr-ground: #2D4A3C;
  --fr-ground-in: #365645;
  --fr-mast: #9AA8B8;
  --fr-glass: #22365A;
  --fr-water: #3AA3E6;
  --fr-dial: #1C2E52;
  --fr-ring: #1A2C50;
  --fr-sock-edge: rgba(0, 0, 0, 0.25);
}

html, body { margin: 0; min-height: 100%; }
body {
  background: var(--fr-bg);
  background-attachment: fixed;
  color: var(--fr-text);
  font-family: var(--fr-font);
}

.fr-card {
  background: var(--fr-card);
  border-radius: 24px;
  box-shadow: var(--fr-card-shadow);
  padding: 20px 24px;
}

/* ---- Instruments ---- */
.fr-inst { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fr-inst-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fr-big { font-size: 44px; font-weight: 700; line-height: 1.05; margin-top: 6px; white-space: nowrap; }
.fr-big .fr-u { font-size: 20px; font-weight: 600; color: var(--fr-muted); margin-left: 4px; }
.fr-thermo .fr-big .fr-u { font-size: 44px; font-weight: 700; color: inherit; margin-left: 0; }
.fr-word { font-size: 18px; font-weight: 600; margin-top: 2px; min-height: 1.3em; }
.fr-sub { font-size: 15px; color: var(--fr-muted); margin-top: 2px; line-height: 1.4; min-height: 1.4em; }
.fr-nw { white-space: nowrap; }
.fr-inst .warn { color: var(--fr-warn); font-weight: 700; }   /* orange / rouge : en gras (rafales, pluie) */
.fr-inst .alert { color: var(--fr-alert); font-weight: 700; }

/* Manche à air */
.fr-wind .fr-inst-svg { max-width: 280px; }
.fr-ground { fill: var(--fr-ground); }
.fr-ground-in { fill: var(--fr-ground-in); }
.fr-ground-lab { font-size: 11px; font-weight: 700; fill: var(--fr-muted); }
.fr-mast { stroke: var(--fr-mast); stroke-width: 4; stroke-linecap: round; }
.fr-mast-cap { fill: var(--fr-mast); }
.fr-sock-o { fill: #FF8A3D; }
.fr-sock-o-dark { fill: #E8621A; }
.fr-sock-w { fill: #FFFFFF; }
.fr-sock-w-dark { fill: #D9E1E9; }
.fr-sock-edge { fill: none; stroke: var(--fr-sock-edge); stroke-width: 1; stroke-linejoin: round; }
.fr-sock-shadow { fill: none; stroke: rgba(20, 50, 30, 0.22); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.fr-sock-ring { stroke: #5F6E7D; stroke-width: 3; stroke-linecap: round; }

/* Température */
.fr-thermo .fr-inst-svg { max-width: 300px; }
.fr-ticks line { stroke: var(--fr-muted); stroke-width: 1.2; }
.fr-ticks text { font-size: 10px; fill: var(--fr-muted); }
.fr-face-ring { fill: var(--fr-ring); }

/* Humidité */
.fr-hum .fr-inst-svg { max-width: 110px; }
.fr-empty { fill: var(--fr-glass); }
.fr-wave { fill: var(--fr-water); }
.fr-water { animation: fr-wave 3s linear infinite; }

/* Baromètre */
.fr-baro .fr-inst-svg { max-width: 250px; overflow: hidden; }
.fr-dial { fill: var(--fr-dial); }
.fr-baro .fr-ticks line { stroke-width: 1.5; }
.fr-zone-lab { font-size: 9px; font-weight: 700; fill: var(--fr-text); }
.fr-needle, .fr-ref {
  transform-box: view-box; transform-origin: 100px 100px;
  transition: transform 1.5s ease-in-out;
}
.fr-needle line { stroke: var(--fr-text); stroke-width: 3.2; stroke-linecap: round; }
.fr-needle path { fill: var(--fr-text); }
.fr-ref line { stroke: #C9A227; stroke-width: 2; }
.fr-ref path { fill: #C9A227; }
.fr-hub { fill: var(--fr-text); }

/* Pluviomètre */
.fr-rain .fr-inst-svg { max-width: 120px; }
.fr-funnel { fill: var(--fr-mast); }
.fr-glass { fill: var(--fr-glass); }
.fr-water-fill { fill: var(--fr-water); transition: y 1.5s, height 1.5s; }
.fr-grad line { stroke: var(--fr-muted); stroke-width: 1.2; }
.fr-grad text { font-size: 9px; fill: var(--fr-muted); }
.fr-raindrops path { fill: var(--fr-water); }

/* ---- Animations des icônes (option animate) ---- */
.fr-animated .fr-spin { animation: fr-spin 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.fr-animated .fr-fall { animation: fr-fall 1.4s linear infinite; }
.fr-animated .fr-flake { animation: fr-fall 3.2s linear infinite; }
.fr-animated .fr-twinkle { animation: fr-twinkle 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fr-animated .fr-flash { animation: fr-flash 5s linear infinite; }
.fr-animated .fr-drift { animation: fr-drift 5s ease-in-out infinite alternate; }
.fr-fall-long { animation: fr-fall-long 1.2s linear infinite; }

@keyframes fr-spin { to { transform: rotate(360deg); } }
@keyframes fr-fall {
  0% { transform: translateY(-4px); opacity: 0; }
  20%, 75% { opacity: 1; }
  100% { transform: translateY(6px); opacity: 0; }
}
@keyframes fr-fall-long {
  0% { transform: translateY(-6px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}
@keyframes fr-twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.6); opacity: 0.6; } }
@keyframes fr-flash { 0%, 70%, 74%, 78%, 100% { opacity: 1; } 72%, 76% { opacity: 0.15; } }
@keyframes fr-drift { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes fr-wave { from { transform: translateX(0); } to { transform: translateX(40px); } }

@media (prefers-reduced-motion: reduce) {
  .fr-animated *, .fr-water, .fr-fall-long { animation: none !important; }
}

/* ==== Page ordinateur (index.php) : scène 1920 × 1080 mise à l'échelle de la fenêtre (js/friendly-page.js) ==== */
.fr-wet:not(.fr-night) {
  --fr-bg: linear-gradient(180deg, #B4C3D0 0%, #D3DDE6 60%, #E6ECF1 100%);
  --fr-card: rgba(255, 255, 255, 0.82);
}
:root { --fr-tmin: #2F7FD0; --fr-tmax: #E0582C; --fr-shade: rgba(30, 60, 110, 0.07); }
.fr-night { --fr-tmin: #6FB4F5; --fr-tmax: #FF8A5C; --fr-shade: rgba(0, 0, 0, 0.22); }

html.fr-page, html.fr-page body { height: 100%; overflow: hidden; }
.fr-stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; box-sizing: border-box;
  transform-origin: 0 0; padding: 22px 30px 42px;
  display: grid; grid-template-rows: 58px 376px 350px 1fr; gap: 14px;
}
.fr-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.fr-head h1 { margin: 0; font-size: 42px; font-weight: 800; letter-spacing: 0.5px; }
.fr-head-right { display: flex; align-items: baseline; gap: 22px; }
.fr-advice { flex: 1; min-width: 0; padding: 0 36px; text-align: center; font-size: 27px; font-weight: 700;
  font-style: italic; color: var(--fr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-date { font-size: 28px; font-weight: 600; color: var(--fr-muted); }
.fr-date::first-letter { text-transform: uppercase; }
.fr-time { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fr-status { font-size: 18px; font-weight: 700; color: var(--fr-warn); }
.fr-card h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--fr-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Maintenant : ciel + 5 instruments ; dessins dans une zone de même hauteur, alignés en bas */
.fr-now {
  display: grid; grid-template-columns: 1.15fr 1.15fr 1.3fr 0.75fr 1.05fr 0.85fr; gap: 10px;
  padding: 16px 20px 12px;
}
.fr-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.fr-cell > div:last-child { width: 100%; }
.fr-cap { font-size: 18px; font-weight: 800; color: var(--fr-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.fr-now .fr-inst-svg { height: 180px; width: 100%; max-width: none; }
.fr-now .fr-thermo .fr-inst-svg { height: 180px; padding: 0 8px; box-sizing: border-box;
  position: relative; top: -24px; }   /* réglette plate : remontée au milieu des autres dessins (texte inchangé) */
.fr-now .fr-hum .fr-inst-svg { max-width: 150px; margin: 0 auto; }
.fr-now .fr-rain .fr-inst-svg { max-width: 160px; margin: 0 auto; }
.fr-now .fr-baro .fr-inst-svg { max-width: 290px; margin: 0 auto; }
.fr-now .fr-big { font-size: 52px; }
.fr-now .fr-thermo .fr-big .fr-u { font-size: 52px; }
.fr-now .fr-word { font-size: 20px; }
.fr-now .fr-sub { font-size: 17px; }
.fr-sky-icon { height: 206px; display: flex; align-items: flex-end; justify-content: center; }
.fr-sky-word { font-size: 34px; font-weight: 800; margin-top: 10px; text-align: center; }
.fr-sky .fr-sub { font-size: 16px; text-align: center; }

/* 48 h */
.fr-next { padding: 14px 22px 10px; display: flex; flex-direction: column; }
.fr-next-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
#fr-chart { flex: 1; min-height: 0; }
.fr-chart { width: 100%; height: 100%; display: block; overflow: visible; }
.fr-chart-night { fill: var(--fr-shade); }
.fr-chart-midnight { stroke: var(--fr-line); stroke-width: 2; stroke-dasharray: 4 5; }
.fr-chart-day { font-size: 15px; font-weight: 800; fill: var(--fr-muted); text-transform: uppercase; letter-spacing: 1px; }
.fr-chart-temp { fill: none; stroke: #F7922F; stroke-width: 3.5; stroke-linecap: round; }
.fr-chart-dot { stroke: var(--fr-ring); stroke-width: 2; }
.fr-chart-t { font-size: 20px; font-weight: 800; fill: var(--fr-text); }
.fr-chart-rain { fill: var(--fr-water); }
.fr-chart-base { stroke: var(--fr-line); stroke-width: 1; }
.fr-chart-prob { font-size: 15px; font-weight: 700; fill: var(--fr-water); }
.fr-chart-wind { font-size: 16px; font-weight: 700; fill: var(--fr-text); }
.fr-chart-wind.warn { fill: var(--fr-warn); }
.fr-chart-wind.alert { fill: var(--fr-alert); }
.fr-chart-arrow { fill: var(--fr-muted); }
.fr-chart-hour { font-size: 16px; font-weight: 600; fill: var(--fr-muted); }
.fr-chart-lab { font-size: 12px; font-weight: 700; fill: var(--fr-muted); }
.fr-chart-off { font-size: 26px; font-weight: 700; fill: var(--fr-muted); }

/* Périodes + en bref */
.fr-bottom { display: grid; grid-template-columns: 3fr 1.25fr; grid-template-rows: minmax(0, 1fr); gap: 14px; min-height: 0; }
.fr-periods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; min-height: 0; }
.fr-period { padding: 14px 22px; display: flex; flex-direction: column; min-width: 0; }
.fr-period-off { grid-column: 1 / -1; align-items: center; justify-content: center; font-size: 24px; color: var(--fr-muted); }
.fr-p-row { display: flex; align-items: center; gap: 16px; margin-top: 2px; }
.fr-p-icon { flex: none; width: 92px; height: 92px; }
.fr-p-main { min-width: 0; }
.fr-p-word { font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-p-temps { font-size: 40px; font-weight: 800; line-height: 1.1; }
.fr-tmin { color: var(--fr-tmin); }
.fr-tmax { color: var(--fr-tmax); }
.fr-p-sep { color: var(--fr-muted); font-weight: 400; margin: 0 8px; }
.fr-p-lines { font-size: 18px; color: var(--fr-muted); line-height: 1.45; margin-top: 6px; }
.fr-p-lines .warn { color: var(--fr-warn); font-weight: 700; }
.fr-p-lines .alert { color: var(--fr-alert); font-weight: 700; }
.fr-p-rain { color: var(--fr-water); font-weight: 700; }
/* carte avec la phrase du bulletin : plus compacte (icône plus petite, pluie et rafales à droite de l'icône) */
.fr-period-text { padding: 11px 20px; }
.fr-period-text .fr-p-row { gap: 14px; }
.fr-period-text .fr-p-icon, .fr-period-text .fr-p-icon svg { width: 76px; height: 76px; }
.fr-period-text .fr-p-word { font-size: 19px; }
.fr-period-text .fr-p-temps { font-size: 32px; }
.fr-period-text .fr-p-lines { font-size: 16px; margin-top: 1px; line-height: 1.3; white-space: nowrap; }
.fr-p-text { margin: 7px 0 0; font-size: 16px; line-height: 1.28; }
.fr-brief-card { padding: 14px 22px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.fr-brief { margin: 8px 0 0; font-size: 19px; line-height: 1.4; flex: 1; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--fr-muted) transparent; }   /* trop long : ascenseur */
.fr-brief ul { margin: 0; padding: 0 0 0 20px; }
.fr-brief li { margin-bottom: 6px; }
.fr-bulletin { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.35; }   /* réduit si trop long (fitBrief) */
/* bas de page, comme sur /aero/ (meteo.inc.php, docs/site.md), dans la marge basse de la scène :
   à gauche les crédits (prévision, textes IA, WeeWX ; 2 lignes), à droite version téléphone + affichage du site
   (l'affichage en cours en gras), sur la dernière ligne */
.fr-foot { position: absolute; left: 38px; right: 38px; bottom: 3px; display: flex; justify-content: space-between;
  align-items: flex-end; gap: 24px; font-size: 16px; line-height: 20px; color: var(--fr-muted); }
.fr-foot-credits { font-size: 13px; line-height: 17px; min-width: 0; }
.fr-credit, .fr-weewx { margin: 0; }
.fr-foot-nav { display: flex; gap: 28px; white-space: nowrap; }
.fr-foot .fr-view-link { color: var(--fr-muted); }
.fr-weewx a { color: var(--fr-muted); }
.fr-site a { color: var(--fr-muted); }
.fr-site [aria-current] { font-weight: 700; }
