/* Windchaser: camp de vent, nombre gran, rosa i línia de temps. Només fosc. */
@font-face { font-family: "Boldonse"; src: url("fonts/boldonse.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #061528;
  --deep: #0b2a4a;
  --aux: #0a3345;
  --salt: #eef3f1;
  --spray: #9fc9d9;
  --fog: rgba(238, 243, 241, 0.56);
  --line: rgba(238, 243, 241, 0.14);
  --good: #7fe0c2;
  --neutral: #ffd24a;
  --off: #ff3d7f;
  --sun: #ffd68a;
  --band: var(--spray);
  --heat: 0;
  --display: "Boldonse", Impact, sans-serif;
  --body: "Switzer", -apple-system, system-ui, sans-serif;
  color-scheme: dark;
}

/* El color de l'aigua segons l'spot (data-water a <html>, vegeu setWater a app.js): la Mediterrània és
   la d'abans; l'Atlàntic, més verd i gris; una llacuna, més clara i turquesa. Registrats com a color
   perquè canviïn d'un a l'altre amb una transició (1 s) */
@property --ink { syntax: "<color>"; inherits: true; initial-value: #061528; }
@property --deep { syntax: "<color>"; inherits: true; initial-value: #0b2a4a; }
@property --aux { syntax: "<color>"; inherits: true; initial-value: #0a3345; }
:root { transition: --ink 1s, --deep 1s, --aux 1s; }
:root[data-water="atlantic"] { --ink: #071a22; --deep: #0f3340; --aux: #0d3a3c; }
:root[data-water="lagoon"] { --ink: #072029; --deep: #0f3d49; --aux: #10434b; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  color: var(--salt);
  font: 400 16px/1.45 var(--body);
  font-feature-settings: "ss01", "tnum";
  background:
    radial-gradient(120% 80% at 80% 0%, color-mix(in oklab, var(--deep), #3a1d4a calc(var(--heat) * 60%)) 0%, transparent 60%),
    radial-gradient(90% 70% at 0% 100%, var(--aux) 0%, transparent 65%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1s;
}

#sea, #field, #crew {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
}
/* En canviar d'spot, els windsurfistes s'esvaeixen amb la sorra */
#crew { transition: opacity .35s; }
#land {
  position: fixed; left: 0; top: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity .35s;
}
/* L'ombra dels núvols: una graella de poques cel·les que el navegador escala amb suavitat,
   per sobre de la sorra i dels windsurfistes i per sota de la interfície. La boira, igual */
#shade, #fog {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  visibility: hidden;
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  position: relative; z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 20px 48px;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--band); outline-offset: 3px; border-radius: 6px; }

/* ---------- Barra ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--salt); text-decoration: none;
  font-weight: 600; letter-spacing: -0.01em;
}
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--band); stroke-width: 2.4; stroke-linecap: round; transition: stroke .8s; }
.thr {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(10px);
  transition: border-color .2s, background .2s;
}
.thr:hover { border-color: rgba(238, 243, 241, .3); background: rgba(238, 243, 241, .06); }
.thr svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--fog); stroke-width: 2; stroke-linecap: round; }
.thr output { font-weight: 500; font-size: 14px; white-space: nowrap; }

.actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--fog); transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--salt); background: rgba(238, 243, 241, .06); }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  margin: 16px 0 0; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 60%, transparent); backdrop-filter: blur(10px);
  font-size: 14px; color: var(--fog);
}
.notice.warn { color: var(--neutral); border-color: color-mix(in srgb, var(--neutral) 40%, transparent); }
.notice[hidden] { display: none; }

/* ---------- Spots ---------- */
.spots-bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 4px;
  margin: 26px -20px 0; padding-right: 14px;
}
/* «Els meus» queda fix a l'esquerra i la resta fa scroll al costat */
.spots-home { flex: none; display: flex; padding: 0 0 6px 20px; }
.spots {
  position: relative; flex: 1; min-width: 0;
  display: flex; gap: 26px;
  padding: 0 14px 6px 22px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-inline: 22px 20px;
  --fade-l: 0px; --fade-r: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.spots-bar.more-l .spots { --fade-l: 36px; }
.spots-bar.more-r .spots { --fade-r: 44px; }
.spots::-webkit-scrollbar { display: none; }
.spots-edit {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--fog);
  background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, background .2s;
}
.spots-edit:hover { color: var(--salt); border-color: rgba(238, 243, 241, .3); background: rgba(238, 243, 241, .06); }
.spots-edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.spots button, .spots-home button {
  position: relative; flex: none;
  padding: 4px 0 10px;
  font-size: 15px; font-weight: 500; color: var(--fog);
  white-space: nowrap; scroll-snap-align: start;
  transition: color .3s;
}
.spots button::after, .spots-home button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--band); transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), background .8s;
}
.spots button[aria-pressed="true"], .spots-home button[aria-pressed="true"] { color: var(--salt); }
.spots button[aria-pressed="true"]::after, .spots-home button[aria-pressed="true"]::after { transform: scaleX(1); }
/* A «Tots», l'spot que es mostra a la lectura */
.spots button.shown { color: color-mix(in srgb, var(--salt) 80%, transparent); }
.spots button.shown::after { transform: scaleX(1); opacity: .35; }
.spots button .dot {
  display: inline-block; width: 6px; height: 6px; margin-left: 7px; vertical-align: 2px;
  border-radius: 50%; background: var(--good);
}

/* ---------- Veredicte del dia ---------- */
/* Va abans de la franja del recomanador: ve de renderDayVerdict a app.js. Els xips, a dalt i sempre al
   mateix lloc; la frase, a sota, és la resposta del xip marcat */
.dv { display: none; }
.dv:not([hidden]) {
  position: relative; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  margin: 8px 0 0; font-size: 14px; line-height: 1.35; color: var(--salt);
}
.dv-line { margin: 0; min-width: 0; }
.dv-s { display: inline; padding: 4px 0; margin-right: 6px; font: inherit; color: inherit; text-align: left; }
/* Només es pot tocar el tros que porta a un altre moment: subratllat de punts */
button.dv-s { text-decoration: underline dotted rgba(238, 243, 241, .55); text-underline-offset: 4px; }
button.dv-s:hover { text-decoration-style: solid; }
.dv-mute { color: var(--fog); }
.dv-spot { font-weight: 600; }
/* Si no hi caben, llisquen de costat: no salten mai de línia */
.dv-chips { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dv-chips::-webkit-scrollbar { display: none; }
.dv-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border: 1px solid rgba(238, 243, 241, .22); border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: rgba(238, 243, 241, .82); background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, background .2s;
}
.dv-chip:hover { color: var(--salt); border-color: rgba(238, 243, 241, .4); }
.dv-chip.on { color: var(--salt); border-color: var(--salt); background: rgba(238, 243, 241, .16); }
/* El color de l'escala de la millor sessió del xip; sense sessió, sense punt */
.dv-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }

/* ---------- La direcció amb la costa i la matriu d'spots × dies ---------- */
.coast { display: inline-flex; align-items: center; gap: 5px; }
.coast-ico { flex: none; width: 15px; height: 15px; overflow: visible; }
.coast-ico .sand { fill: currentColor; opacity: .3; }
.coast-ico .wind { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wx-coast .coast-ico { vertical-align: -3px; margin-right: 4px; }
.wx-coast { font-size: 13px; color: var(--fog); }

.matrix { display: none; }
.matrix:not([hidden]) { display: block; margin-top: 56px; }
/* El títol i la targeta, com «Ara mateix» i les estacions */
.matrix h2 { margin: 0 0 18px; font: 400 clamp(26px, 5vw, 40px)/1.2 var(--display); letter-spacing: -0.02em; }
.mx-card {
  overflow: hidden; padding: 14px 0 12px 14px;
  border-radius: 18px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mx-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 14px 2px 2px; }
.mx-scroll::-webkit-scrollbar { display: none; }
.mx { width: max-content; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.mx th, .mx td { padding: 0; font-weight: 400; }
.mx-s {
  position: sticky; left: 0; z-index: 2; width: 94px; min-width: 94px; max-width: 94px; padding: 0 8px 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13px; color: var(--salt);
  /* El mateix to que la targeta, perquè les caselles que llisquen passin per sota sense fer una làmina */
  background: linear-gradient(90deg, var(--ink) 84%, color-mix(in srgb, var(--ink) 0%, transparent));
}
.mx-h { padding: 0 0 8px; text-align: center; vertical-align: bottom; color: var(--fog); line-height: 1.25; cursor: help; }
.mx-h.wide { width: 56px; min-width: 56px; }
.mx-h.far { width: 32px; min-width: 32px; font-size: 11px; opacity: .8; }
.mx-d { display: block; white-space: nowrap; }
.mx-rel { display: inline-flex; gap: 2px; margin-top: 4px; }
.mx-rel i { width: 4px; height: 4px; border-radius: 50%; background: rgba(238, 243, 241, .2); }
.mx-rel.l3 i, .mx-rel.l2 i:nth-child(-n+2), .mx-rel.l1 i:first-child { background: var(--band); }
.mx-rel.l0 i { background: none; box-shadow: inset 0 0 0 1px rgba(238, 243, 241, .35); }
.mx td { padding: 1px 2px; }
/* El cap de setmana, al dia de la capçalera: res de franges quadrades dins la targeta */
.mx th.wknd .mx-d { color: var(--salt); font-weight: 600; }
.mx td.off, .mx th.off { opacity: .4; }
.mx-r.dim td, .mx-r.dim .mx-s { opacity: .5; }
.mx-reg .mx-s { padding-top: 14px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fog); }
.mx-c {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 48px; border-radius: 12px; color: var(--salt);
  background: rgba(var(--c, 238, 243, 241), 0);
}
.mx-c b { font: 600 16px/1 var(--body); color: rgb(var(--c)); }
.mx-bar { display: block; width: 68%; height: 3px; margin-top: 6px; border-radius: 2px; overflow: hidden; background: rgba(238, 243, 241, .14); }
.mx-bar u { display: block; height: 100%; background: rgb(var(--c)); }
.mx-ico { position: absolute; top: 3px; right: 3px; color: var(--fog); line-height: 0; }
.mx-ico .coast-ico { width: 11px; height: 11px; }
.mx-q { position: absolute; top: 4px; left: 4px; display: flex; gap: 2px; }
.mx-q i { width: 3px; height: 3px; border-radius: 50%; background: rgb(var(--c)); }
.mx-c.t0 { background: rgba(var(--c), .06); }
.mx-c.t1 { background: rgba(var(--c), .13); }
.mx-c.t2 { background: rgba(var(--c), .22); }
.mx-c.t3 { background: rgba(var(--c), .34); }
.mx-c.offshore {
  background-image: repeating-linear-gradient(135deg, rgba(255, 61, 127, .38) 0 2px, transparent 2px 7px);
}
.mx-c.offshore .mx-ico { color: var(--off); }
.mx-c.best { box-shadow: inset 0 0 0 1.5px var(--salt); }
.mx-c[aria-current="true"] { box-shadow: 0 0 0 2px var(--band); }
.mx-c.best[aria-current="true"] { box-shadow: inset 0 0 0 1.5px var(--salt), 0 0 0 2px var(--band); }
.mx-c:hover { background-color: rgba(238, 243, 241, .08); }
.mx-c.far { height: 36px; }
.mx-c.far b { font-size: 12px; font-weight: 500; }
.mx-c.far.offshore b { opacity: .8; }
.mx-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(238, 243, 241, .22); }
@media (min-width: 860px) {
  .mx-h.wide { width: 84px; min-width: 84px; }
  .mx-h.far { width: 46px; min-width: 46px; }
  .mx-s { width: 150px; min-width: 150px; max-width: 150px; }
}
.mx-note { margin: 8px 0 0; font-size: 13px; color: var(--fog); }
.mx-note[hidden] { display: none; }

/* ---------- Recomanador de zona ---------- */
/* Una línia fina sota la barra d'spots (renderReco a app.js). Ocupa part del marge de dalt de
   l'escenari, perquè la lectura i la rosa no baixin més del just */
.reco {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 12px; min-width: 0;
  margin: 4px 0 0; padding: 0 2px 0 0; height: 30px;
  font-size: 13px; line-height: 1; color: var(--fog); white-space: nowrap;
  cursor: pointer;
}
.reco[hidden] { display: none; }
.reco-ico { flex: none; width: 15px; height: 15px; margin-right: -5px; fill: none; stroke: var(--band); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .8s; }
.reco-zone { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
/* Cada dia: «Avui:», l'spot (que s'escurça si no hi cap) i l'alternativa */
.reco-day { flex: 0 1 auto; display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.reco-day + .reco-day::before { content: "·"; margin-right: 7px; opacity: .6; }
.reco-when { flex: none; }
.reco-day.none { flex-shrink: 20; color: color-mix(in srgb, var(--salt) 38%, transparent); }
.reco-none { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.reco-spot { min-width: 0; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.reco-spot:hover { text-decoration: underline; text-underline-offset: 3px; }
.reco-alt { flex: none; color: color-mix(in srgb, var(--salt) 42%, transparent); }
.reco .short { display: none; }
@media (max-width: 859px) {
  .reco .full { display: none; }
  .reco .short { display: inline; }
}
/* Al mòbil no hi cap el nom de la zona: queda la icona (i el títol del full) */
@media (max-width: 520px) {
  .reco { gap: 10px; }
  .reco-zone { display: none; }
  .reco-ico { margin-right: -3px; }
}
.reco-more {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-left: auto;
  border: 1px solid var(--line); border-radius: 50%; color: var(--fog);
  background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, background .2s;
}
.reco:hover .reco-more { color: var(--salt); border-color: rgba(238, 243, 241, .3); }
.reco-more svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.reco:not([hidden]) + .stage { padding-top: max(6px, calc(4vh - 34px)); min-height: calc(min(58vh, 560px) - 34px); }
@media (max-width: 859px) { .reco:not([hidden]) + .stage .rose { top: max(10px, calc(5.2vh - 34px)); } }

/* El full del recomanador: el mateix patró que les opcions */
.reco-sheet .pf-scroll { margin-top: 14px; }
.rs-day .pf-head { margin-bottom: 8px; }
.rs-conf { font-size: 13px; color: var(--fog); }
.rs-conf.high { color: var(--good); }
.rs-conf.low { color: color-mix(in srgb, var(--salt) 38%, transparent); }
.rs-spot { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.rs-spot.none { color: var(--fog); font-weight: 500; font-size: 17px; }
.rs-pick { padding: 0; font-weight: 600; text-align: left; }
.rs-pick:hover { text-decoration: underline; text-underline-offset: 4px; }
.rs-alt { display: inline-block; white-space: nowrap; font-size: 15px; font-weight: 400; color: var(--fog); }
.rs-pick.alt { font-weight: 500; }
.rs-scn { margin: 6px 0 0; font-weight: 500; }
.rs-why { margin: 2px 0 0; font-size: 14px; color: var(--fog); }
.rs-hours { margin: 8px 0 0; font-size: 14px; }
.rs-warn { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rs-warn li {
  padding: 8px 12px; border-radius: 10px; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--neutral) 35%, transparent);
  background: color-mix(in srgb, var(--neutral) 8%, transparent); color: var(--neutral);
}
.rs-warn li.no_solo { border-color: color-mix(in srgb, var(--off) 55%, transparent); background: color-mix(in srgb, var(--off) 14%, transparent); color: var(--salt); font-weight: 500; }
.rs-inds { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.rs-ind-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.rs-ind-l { color: var(--fog); }
.rs-ind-top b { font-weight: 500; white-space: nowrap; }
.rs-bar { position: relative; height: 4px; margin: 8px 0 16px; }
.rs-seg { position: absolute; top: 0; bottom: 0; background: rgba(238, 243, 241, .12); }
.rs-seg.on { background: rgba(238, 243, 241, .38); }
.rs-th { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.rs-th span { position: absolute; font-style: normal; top: 12px; left: 50%; transform: translateX(-50%); font-size: 10px; color: color-mix(in srgb, var(--salt) 40%, transparent); }
.rs-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--salt); box-shadow: 0 0 0 3px var(--ink); }
.rs-ind-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 2px; font-size: 12px; color: var(--fog); }
.rs-ind.plain .rs-ind-foot { margin-top: 2px; }
.rs-src { color: color-mix(in srgb, var(--salt) 38%, transparent); }
.rs-run { margin: 14px 0 0; font-size: 12px; color: color-mix(in srgb, var(--salt) 38%, transparent); }
#reco-how { text-decoration: none; }

/* ---------- Escenari ---------- */
.stage {
  touch-action: pan-y;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: min(58vh, 560px);
  padding: 4vh 0 3vh;
}

/* min-width: 0 perquè la línia de lloc (sense salts) no eixampli la columna i es pugui escurçar */
.reading { position: relative; min-width: 0; }
/* Lloc: on és el que es veu, en una sola línia. Si no hi cap, s'escurça primer la regió */
.place {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px; min-width: 0;
  margin: 0 0 6px; font-size: 15px; line-height: 1.3; color: var(--fog); white-space: nowrap;
}
.place[hidden] { display: none; }
.place svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--band); stroke-width: 2; transition: stroke .8s; }
.place b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--salt); font-weight: 600; }
.place span { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.place-pick { font-size: 13px; }
.place-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 4px 10px 4px 8px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; font-size: 13px; color: var(--salt); text-decoration: none;
}
.place-go:hover { border-color: rgba(255, 255, 255, .4); }
.place .place-go svg { width: 14px; height: 14px; stroke-linejoin: round; }
.place-region + .place-pick::before { content: "· "; }
.when { position: relative; z-index: 1; margin: 0 0 clamp(18px, 3vw, 34px); font-size: clamp(17px, 2vw, 22px); color: var(--fog); }
.when b { color: var(--salt); font-weight: 500; }
.kn {
  margin: 0; display: flex; align-items: baseline; gap: .12em;
  font: 400 clamp(110px, min(34vw, 34vh), 300px)/1.05 var(--display);
  letter-spacing: -0.04em;
  color: var(--salt);
  text-shadow: 0 0 60px color-mix(in srgb, var(--band) 35%, transparent);
  /* La caixa del Boldonse puja molt per sobre de la xifra i tapava les pestanyes */
  pointer-events: none;
}
#kn { display: inline-block; font-variant-numeric: tabular-nums; transition: color .6s; }
.kn small {
  font: 500 clamp(18px, 3.4vw, 26px)/1 var(--body);
  letter-spacing: 0; color: var(--band); transition: color .8s;
}
/* Al costat del número: el Beaufort a sobre de «kn», fora del flux perquè «kn» faci la línia de base */
.kn-u { position: relative; display: inline-block; }
.kn-u .bft { position: absolute; left: 0; bottom: calc(100% + 8px); }
/* La fitxa: el vent a tot l'ample i, a sota, el cel i la mar en dues targetes */
.wx { max-width: 440px; margin: 12px 0 0; font-size: 15px; color: var(--fog); }
.wx b { color: var(--salt); font-weight: 600; }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wx-dir { display: inline-flex; align-items: center; gap: 6px; color: var(--salt); }
.wx-arrow { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--band); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .8s; }
.wx-gf { font-size: 13px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.wx-gf.g2 { color: var(--off); border-color: color-mix(in srgb, var(--off) 45%, transparent); }
/* La barra: la mateixa llengua que la línia de temps (vent ple, ràfega a l'ombra, llindar puntejat) */
.wx-bar { position: relative; height: 10px; margin: 16px 0 0; }
.wx-bar.up { margin-top: 30px; }
.wx-bar > span { position: absolute; top: 0; height: 100%; }
.wx-track { left: 0; right: 0; border-radius: 5px; background: rgba(238, 243, 241, .08); }
.wx-shadow { border-radius: 0 5px 5px 0; background: color-mix(in srgb, var(--band) 28%, transparent); transition: background .8s; }
.wx-range { border-radius: 5px; background: var(--band); transition: background .8s; }
.wx-bar > .wx-thr { width: 0; top: -5px; height: 20px; border-left: 1.5px dashed rgba(238, 243, 241, .55); }
.wx-bar > .wx-mean { width: 3px; top: -4px; height: 18px; margin-left: -1.5px; border-radius: 2px; background: var(--salt); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 70%, transparent); }
.wx-bar > .wx-gmark { width: 9px; height: 9px; top: .5px; margin-left: -4.5px; transform: rotate(45deg); border-radius: 2px; background: color-mix(in srgb, var(--band) 70%, transparent); }
.wx-bar > .wx-glbl { top: -24px; height: auto; transform: translateX(-50%); font-size: 13px; white-space: nowrap; }
.wx-under { position: relative; height: 18px; margin: 7px 0 0; font-size: 13px; }
.wx-under span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.wx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.wx-tiles:empty { display: none; }
.wx-tile {
  display: grid; grid-template-columns: auto 1fr; align-content: start; column-gap: 8px; min-width: 0; padding: 10px 11px;
  border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(10px);
}
.wx-ico { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--salt); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-sky.sun .wx-ico, .wx-sky.clear .wx-ico { stroke: var(--sun); }
.wx-main { align-self: center; margin: 0; color: var(--salt); font-size: 14px; font-weight: 600; line-height: 1.25; }
.wx-sub { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.wx-sub .nw { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wx-sub .wx-arrow { width: 12px; height: 12px; stroke: var(--fog); }
.wx-drop { flex: none; width: 13px; height: 13px; margin-right: 4px; fill: none; stroke: var(--fog); stroke-width: 1.6; }
.wet .wx-drop { fill: #7fb8ff; stroke: #7fb8ff; }
.wet .wx-sub { color: var(--salt); }
.bft {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px;
  border-radius: 6px; background: var(--band); color: var(--ink);
  font: 600 13px/1 var(--body); letter-spacing: 0; transition: background .8s;
}
.bft:empty { display: none; }
.verdict {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 22px 0 0; padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  font-size: 14px;
}
.verdict:empty { display: none; }

/* Finestra: on, quan, quant falta i quant dura */
.win {
  margin: 22px 0 0; padding: 14px 16px 12px; max-width: 440px;
  border-radius: 18px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(10px);
  font-size: 14px; color: var(--fog);
}
.win[hidden] { display: none; }
.win.warn { border-color: color-mix(in srgb, var(--off) 50%, transparent); }
.win b { color: var(--salt); font-weight: 600; }
.win-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.win-time { flex: 0 1 auto; min-width: 0; color: var(--salt); font-weight: 600; font-size: 17px; }
.win-say { margin: 2px 0 0; color: var(--fog); font-size: 14px; }
/* El dia de la sessió: una barra per hora de llum, com a la línia de temps */
.win-day { margin: 14px 0 2px; }
.win-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.win-bars > span { flex: 1; border-radius: 2px 2px 0 0; background: rgba(238, 243, 241, .14); }
.win-bars > span.in { background: var(--c); }
.win-bars > span.past { opacity: .35; }
.win-span { position: absolute; bottom: -4px; height: 2px; border-radius: 1px; background: var(--salt); }
.win-thr { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(238, 243, 241, .45); }
.win-now { position: absolute; top: -6px; bottom: -4px; width: 0; border-left: 2px solid var(--salt); }
.win-now b { position: absolute; top: -16px; left: 0; transform: translateX(-50%); font: 600 11px/1 var(--body); color: var(--salt); }
.win-ticks { position: relative; height: 16px; margin-top: 8px; font-size: 12px; color: var(--fog); }
.win-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.win-ticks span:first-child[style^="left:0.00"] { transform: none; }
.win-ticks span[style^="left:100.00"] { transform: translateX(-100%); }
.win-ticks .edge { color: var(--salt); font-weight: 600; }
.win-share { flex: none; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--fog); }
.win-share:hover { color: var(--salt); border-color: var(--fog); }
.win-note { margin: 8px 0 0; color: var(--off); font-size: 13px; }
.win:not(.warn) .win-note { color: var(--fog); }
.win-tz { margin: 8px 0 0; color: var(--fog); font-size: 13px; }
.win-far { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fog); }
.back {
  display: block; margin: 12px 0 0; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--fog);
}
.back:hover { color: var(--salt); border-color: var(--fog); }
.back[hidden] { display: none; }
.verdict i { width: 9px; height: 9px; border-radius: 50%; background: var(--fog); flex: none; }
.verdict.on i { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 1.8s infinite; }
.verdict.warn i { background: var(--off); }
.verdict.warn { border-color: color-mix(in srgb, var(--off) 50%, transparent); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.rose {
  position: relative;
  position: absolute; top: 5.2vh; right: 0;
  width: 34vw; max-width: 150px;
  overflow: visible;
}
.rose .ring { fill: color-mix(in srgb, var(--ink) 35%, transparent); stroke: var(--line); }
.rose .ticks line { stroke: rgba(238, 243, 241, .22); stroke-width: 1; }
.rose .ticks line.major { stroke: rgba(238, 243, 241, .5); stroke-width: 1.5; }
.rose .cardinals text { fill: var(--fog); font: 600 12px var(--body); text-anchor: middle; }
.rose #rose-sectors path { fill: none; stroke-width: 7; stroke-linecap: butt; }
.rose .s-good { stroke: var(--good); }
.rose .s-neutral { stroke: rgba(238, 243, 241, .18); }
.rose .s-offshore { stroke: var(--off); opacity: .8; }
.rose .needle { fill: var(--band); transition: fill .8s; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--band) 60%, transparent)); }
.rose #rose-coast > path { fill: rgba(196, 178, 146, .16); stroke: rgba(222, 206, 176, .45); stroke-width: 1.5; }
.rose #rose-coast .land { fill: rgba(196, 178, 146, .16); stroke: none; }
.rose #rose-coast .shore { fill: none; stroke: rgba(222, 206, 176, .4); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rose .hub { fill: var(--ink); stroke: var(--salt); stroke-width: 2; }
/* El cel i la mar de l'hora (drawRoseData a app.js). Traç fi i constant a totes les mides
   (non-scaling-stroke), perquè la rosa del mòbil és la meitat de la de l'escriptori */
.rose #rose-sky, .rose #rose-swell, .rose #rose-tide, .rose #rose-wx { transition: opacity .8s; }
.rose #rose-swell.off, .rose #rose-tide.off, .rose #rose-wx.off { opacity: 0; }
.rose .sun-path { fill: none; stroke: var(--sun); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 0 4.5; opacity: .55; vector-effect: non-scaling-stroke; transition: opacity .8s; }
.rose #rose-sky.night .sun-path { opacity: .22; }
.rose .sun { opacity: 0; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s; }
.rose .sun-core { fill: var(--sun); }
.rose #rose-sun-glow stop { stop-color: var(--sun); }
.rose .sun-glow { fill: url(#rose-sun-glow); }
.rose #rose-wx > * { transition: opacity 1.2s; }
.rose #rose-clouds ellipse { fill: url(#rose-cloud-fill); opacity: 0; transition: opacity 1.2s; }
.rose #rose-cloud-fill stop { stop-color: var(--salt); }
.rose #rose-wx .overcast { fill: var(--salt); opacity: 0; }
.rose #rose-wx .fog { fill: url(#rose-fog-fill); opacity: 0; }
.rose #rose-fog-fill stop { stop-color: #c6d2d7; }
.rose #rose-rain circle { fill: none; stroke: var(--salt); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; }
.rose .swell-turn { transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.rose .swell-run { fill: none; stroke: var(--spray); stroke-linecap: round; opacity: var(--swell, .6); animation: rose-swell 9s linear infinite; }
.rose .swell-run path { vector-effect: non-scaling-stroke; }
@keyframes rose-swell { to { transform: scale(var(--q, 1)); } }
/* Amb el fons aturat o a mig ritme (vegeu «Ritme» a docs/fons-animat.md) les animacions sense fi
   també paren: una de sola ja fa compondre la pàgina sencera a cada fotograma */
.still .rose .swell-run, .still .verdict.on i, .still .cam-live::before,
.calm .rose .swell-run, .calm .verdict.on i { animation-play-state: paused; }
.rose #rose-tide .wet { fill: rgba(176, 156, 122, .3); transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.rose #rose-tide .tide-run { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.rose #rose-tide .edge { stroke: var(--spray); stroke-width: 1.2; opacity: .8; vector-effect: non-scaling-stroke; }
.rose #rose-tide .lo { stroke: rgba(222, 206, 176, .3); stroke-width: 1; stroke-dasharray: 1 3; vector-effect: non-scaling-stroke; }
.rose #rose-tide .trend { fill: none; stroke: var(--spray); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: transform .5s, opacity .5s; }

.stage.from-r { animation: from-r .35s cubic-bezier(.2, .8, .2, 1); }
.stage.from-l { animation: from-l .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes from-r { from { opacity: .3; transform: translateX(40px); } }
@keyframes from-l { from { opacity: .3; transform: translateX(-40px); } }

/* ---------- Línia de temps ---------- */
.timeline {
  position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5;
  margin-top: 18px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--ink) 62%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.scrub { position: relative; height: 84px; touch-action: none; cursor: ew-resize; }
.scrub canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.range {
  position: absolute; top: 0; bottom: 16px; border-radius: 6px; pointer-events: none;
  background: color-mix(in srgb, var(--band) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--band) 45%, transparent);
  transition: left .5s cubic-bezier(.2, .8, .2, 1), width .5s cubic-bezier(.2, .8, .2, 1);
}
.range[hidden] { display: none; }
.head {
  position: absolute; top: -4px; bottom: 16px; left: 0; width: 2px; margin-left: -1px;
  background: var(--salt); border-radius: 2px; pointer-events: none;
  box-shadow: 0 0 12px rgba(238, 243, 241, .7);
}
.head span {
  position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--salt);
}

.empty { padding: 22px 0; color: var(--fog); border-top: 1px solid var(--line); }
.far-go { padding: 0; text-align: left; color: inherit; text-decoration: underline; text-decoration-color: rgba(238, 243, 241, .3); text-underline-offset: 3px; cursor: pointer; }
.far-go:hover { color: var(--salt); text-decoration-color: currentColor; }

/* ---------- Ara mateix ---------- */
.live { margin-top: 56px; }
.live[hidden] { display: none; }
.live h2 { margin: 0 0 18px; font: 400 clamp(26px, 5vw, 40px)/1.2 var(--display); letter-spacing: -0.02em; }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.stations:empty { display: none; }
.st {
  position: relative; margin: 0; padding: 16px 18px;
  border-radius: 18px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 45%, transparent); backdrop-filter: blur(8px);
}
.st p { margin: 0; }
.st a { color: inherit; text-decoration: none; }
.st a:hover { text-decoration: underline; }
.st-name { font-weight: 500; font-size: 15px; padding-right: 56px; }
.st-name span, .st figcaption span { display: block; color: var(--fog); font-weight: 400; font-size: 13px; }
.st-spot { display: block; font-size: 12px; font-weight: 500; color: var(--fog); }
.st .st-kn { margin: 10px 0 4px; font: 400 44px/1 var(--display); letter-spacing: -0.03em; }
.st-kn small { font: 500 14px var(--body); color: var(--fog); margin-left: 4px; letter-spacing: 0; }
.st-facts { color: var(--fog); font-size: 14px; }
.st .st-note { margin-top: 6px; color: var(--fog); font-size: 13px; }
.st .st-cmp { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.st svg { position: absolute; top: 14px; right: 16px; width: 44px; height: 44px; }
.st svg circle { fill: none; stroke: var(--line); }
.st svg path { fill: currentColor; }
.st.old .st-kn { color: var(--fog) !important; }
.st.old svg { opacity: .4; }
.st-chart figcaption { font-weight: 500; font-size: 15px; margin-bottom: 10px; }
/* Gràfic blanc de Cumulus girat a fosc */
.st-chart img { display: block; width: 100%; height: auto; filter: invert(1) hue-rotate(180deg) saturate(1.4); mix-blend-mode: screen; }

.cams {
  list-style: none; display: flex; gap: 12px;
  margin: 12px -20px 0 0; padding: 0 20px 0 0;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.cams::-webkit-scrollbar { display: none; }
.cams:empty { display: none; }
.cams li { flex: none; width: min(80vw, 340px); scroll-snap-align: start; }
.cam {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--deep), var(--ink));
}
.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.cam img.gone { visibility: hidden; }
.cam:hover img { transform: scale(1.03); }
.cam::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 85%, transparent)); }
.cam-name { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 11px; text-align: left; font-size: 14px; font-weight: 500; }
.cam-name b { display: block; font-size: 12px; font-weight: 500; color: var(--fog); }
.cam.has-map .cam-name { right: 46px; }
.cams li { position: relative; }
/* On és la càmera: discret al racó, sobre el degradat, sense tocar la mida de la targeta */
.cam-map {
  position: absolute; z-index: 2; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--fog);
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(6px);
  transition: color .2s, background .2s;
}
.cam-map:hover, .cam-map:focus-visible { color: var(--salt); background: color-mix(in srgb, var(--ink) 80%, transparent); }
.cam-map svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cam-live {
  position: absolute; z-index: 1; top: 10px; left: 10px; padding: 3px 9px 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 70%, transparent); backdrop-filter: blur(6px); font-size: 12px; font-weight: 600;
}
.cam-live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px;
  border-radius: 50%; background: var(--off); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .3; } }

.viewer {
  width: min(1100px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: var(--ink); color: var(--salt);
}
.viewer::backdrop { background: rgba(3, 10, 20, .8); backdrop-filter: blur(6px); }
.viewer-top { display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px; }
.viewer-top p { flex: 1; margin: 0; font-weight: 500; }
.viewer-top p b { font-weight: 400; color: var(--fog); margin-right: 6px; }
.viewer-top a { color: var(--fog); font-size: 14px; text-decoration: none; }
.viewer-top a:hover { color: var(--salt); }
.viewer-top button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.viewer-top button:hover { background: rgba(238, 243, 241, .08); }
.viewer-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.viewer-frame { aspect-ratio: 16 / 9; max-height: calc(100dvh - 90px); background: #000; }
.viewer-frame.photo { aspect-ratio: auto; }
.viewer-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.viewer-frame img { display: block; width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; }

/* ---------- Els meus spots ---------- */
.picker {
  width: min(460px, calc(100vw - 32px)); max-width: none; max-height: min(720px, calc(100dvh - 32px)); padding: 8px 0 18px;
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  background: var(--ink); color: var(--salt);
}
.picker[open] { display: flex; flex-direction: column; }
/* Les opcions i la llista d'spots sempre són més llargues que la pantalla. L'alçada surt de les vores
   (16 px de dalt i de baix, com a molt 720 px, centrat), sense dvh ni l'alçada del contingut: a
   l'iPhone el full quedava plegat al títol i només es podia tancar */
.prefs[open] { inset: 16px 0; height: auto; max-height: 720px; margin: auto; }
.picker::backdrop { background: rgba(3, 10, 20, .8); backdrop-filter: blur(6px); }
.picker-top { display: flex; align-items: center; gap: 16px; padding: 8px 10px 0 22px; }
.picker-top h2 { flex: 1; margin: 0; font: 400 22px/1.2 var(--display); }
.picker-top button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--fog); }
.picker-top button:hover { background: rgba(238, 243, 241, .08); color: var(--salt); }
.picker-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.picker .lede { margin: 10px 22px 14px; color: var(--fog); font-size: 14px; }
.picker-tools { display: flex; gap: 8px; margin: 0 22px 14px; }
.picker-tools[hidden] { display: none; }
.picker-tools input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(238, 243, 241, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef3f1' stroke-opacity='.56' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-4.5-4.5'/%3E%3C/svg%3E") 13px 50% / 17px no-repeat;
  color: var(--salt); font: inherit; font-size: 15px; outline: none;
}
.picker-tools input::placeholder { color: var(--fog); }
.picker-tools input:focus { border-color: var(--band); }
.picker-tools input::-webkit-search-cancel-button { -webkit-appearance: none; }
.picker-tools button { flex: none; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--fog); }
.picker-tools button:hover { color: var(--salt); border-color: rgba(238, 243, 241, .3); }
.picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.picker-list.empty::after { content: "Cap spot amb aquest nom"; display: block; padding: 22px; color: var(--fog); font-size: 14px; text-align: center; }
.pk-group[hidden] { display: none; }
.pk-group ul { margin: 0; padding: 0; list-style: none; }
.pk-group li { border-bottom: 1px solid var(--line); }
.pk-group li:last-child { border-bottom: 0; }
.pk-group li[hidden] { display: none; }
.pk-grp {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 16px 22px 8px;
  background: var(--ink); color: var(--fog); text-align: left;
}
.pk-group + .pk-group .pk-grp { border-top: 1px solid var(--line); }
.pk-rname { flex: 1; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pk-count { font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-grp[aria-pressed="true"] .pk-count, .pk-grp[aria-pressed="mixed"] .pk-count { color: var(--good); }
.pk-grp:hover .pk-rname { color: var(--salt); }
/* L'interruptor amagat és absolut: sense l'etiqueta posicionada, el seu bloc és el diàleg i, en
   tocar-lo, el navegador feia scroll del diàleg sencer per ensenyar-lo (els spots de baix) */
.picker-list label { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 22px; cursor: pointer; }
.picker-list label:hover { background: rgba(238, 243, 241, .04); }
.picker-list input { position: absolute; opacity: 0; pointer-events: none; }
.pk-name { flex: 1; font-weight: 500; }
.pk-has { font-size: 12px; color: var(--good); }
.pk-sw {
  position: relative; display: block; flex: none; width: 42px; height: 24px; border-radius: 999px;
  background: rgba(238, 243, 241, .14); transition: background .25s;
}
.pk-sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--fog); transition: transform .25s cubic-bezier(.2, .8, .2, 1), background .25s;
}
.picker-list input:checked ~ .pk-sw { background: var(--good); }
.picker-list input:checked ~ .pk-sw::after { transform: translateX(18px); background: var(--ink); }
.picker-list input:focus-visible ~ .pk-sw { outline: 2px solid var(--band); outline-offset: 3px; }

/* ---------- Opcions ---------- */
/* El full d'opcions: vent mínim, dies, spots i avisos. La llista d'spots és una segona vista */
.pf-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.pf-view[hidden] { display: none; }
.pf-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-top: 10px; border-bottom: 1px solid var(--line); }
.pf-scroll > .lede[hidden] { display: none; }
.pf-scroll > .lede { margin-top: 4px; }
.pf-sec { padding: 18px 22px; border-top: 1px solid var(--line); }
.pf-sec[hidden] { display: none; }
.pf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pf-head h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fog); }
.pf-val { font-weight: 500; text-align: right; }
.pf-hint { margin: 10px 0 0; color: var(--fog); font-size: 13px; }
.pf-hint a { color: inherit; }
.pf-chips, .pf-days { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 6px; }
.pf-chip, .pf-day {
  height: 40px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--fog); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: color .2s, background .2s, border-color .2s;
}
.pf-chip:hover, .pf-day:hover { color: var(--salt); border-color: rgba(238, 243, 241, .3); }
.pf-days { --n: 7; }
.pf-chip:disabled { opacity: .3; pointer-events: none; }
.pf-gears { --n: 4; }
.pf-chip.pf-gear { --c: var(--salt); font-size: 13px; padding: 0 2px; }
.pf-chip.none[aria-checked="true"] { font-size: 18px; }
/* El vent mínim triat, amb el color d'aquell vent a la línia de temps */
.pf-chip[aria-checked="true"] { background: var(--c); border-color: var(--c); color: var(--ink); font-weight: 600; }
.pf-day[aria-pressed="true"] { background: rgba(238, 243, 241, .12); border-color: rgba(238, 243, 241, .32); color: var(--salt); }
.pf-sec:has(.pf-row) { padding: 0; }
.pf-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 18px 16px 18px 22px; text-align: left; }
.pf-row:hover { background: rgba(238, 243, 241, .04); }
.pf-row-l { flex: none; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fog); }
.pf-row-v { flex: 1; min-width: 0; text-align: right; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row svg, .pf-back svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--fog); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.picker-top .pf-back { margin-left: -12px; margin-right: -10px; }
.picker-top .pf-back[hidden] { display: none; }
.pf-switch { position: relative; display: block; align-self: center; cursor: pointer; }
.pf-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pf-switch input:checked ~ .pk-sw { background: var(--good); }
.pf-switch input:checked ~ .pk-sw::after { transform: translateX(18px); background: var(--ink); }
.pf-switch input:focus-visible ~ .pk-sw { outline: 2px solid var(--band); outline-offset: 3px; }
.pf-switch input:disabled ~ .pk-sw { opacity: .5; }
.pf-sec .al-steps { margin: 12px 0 0; }
.al-test { margin-top: 12px; padding: 0; font-size: 14px; color: var(--good); }
.al-test:disabled { color: var(--fog); cursor: default; }
#pf-alerts .al-status { margin: 10px 0 0; }
#pf-pick .lede { margin-top: 10px; }
.picker-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px 0; }
.picker-share { font-size: 14px; color: var(--fog); }
.picker-share:hover { color: var(--salt); }
.picker-done { margin-left: auto; padding: 10px 22px; border-radius: 999px; background: var(--salt); color: var(--ink); font-weight: 600; }
.picker-done:disabled { background: rgba(238, 243, 241, .14); color: var(--fog); cursor: default; }

/* ---------- Avisos ---------- */
.bell { position: relative; }
.bell.on { color: var(--salt); }
.bell.on::after {
  content: ""; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 2px var(--ink);
}
.al-steps { margin: 0 22px 8px; padding-left: 20px; font-size: 15px; }
.al-steps li { margin-bottom: 8px; }
.al-steps b { font-weight: 600; }
.al-status { min-height: 1.4em; margin: 12px 22px 0; font-size: 14px; color: var(--fog); }
.al-status:empty { display: none; }

/* ---------- Instal·lació ---------- */
.sheet {
  position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 420px; margin: 0 auto; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  font-size: 15px;
  animation: sheet-in .5s cubic-bezier(.2, .8, .2, 1);
}
.sheet[hidden] { display: none; }
.sheet-head { display: flex; gap: 14px; align-items: flex-start; }
.sheet-head img { flex: none; width: 48px; height: 48px; border-radius: 12px; }
.sheet-title { margin: 2px 0 4px; font: 400 16px/1.25 var(--display); text-wrap: balance; }
.sheet-lede { margin: 0; color: var(--fog); font-size: 14px; }
.sheet-steps { margin: 14px 0 0; padding: 12px 0 0 20px; border-top: 1px solid var(--line); }
.sheet-steps[hidden] { display: none; }
.sheet-steps li { margin-bottom: 6px; }
.sheet-steps b { font-weight: 600; }
.sheet .glyph { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--good); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.sheet-foot [hidden] { display: none; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@media (min-width: 860px) { .sheet { left: auto; right: 24px; bottom: 24px; width: 380px; } }

@media (display-mode: standalone) {
  .app { padding-top: calc(env(safe-area-inset-top) + 8px); }
}

.foot { margin-top: 40px; font-size: 13px; color: var(--fog); }
.foot a { color: inherit; }
.foot p { margin: 0 0 6px; }
.foot .late { color: var(--neutral); }

/* ---------- Mòbil ---------- */
/* Amb la campana, el llindar i (a l'iPhone) la instal·lació, el nom no hi cap: queda el logo */
@media (max-width: 520px) {
  .brand span { display: none; }
  .top { gap: 10px; }
  .actions { gap: 2px; }
  .icon-btn { width: 38px; height: 38px; }
  .thr { padding: 0 12px 0 10px; gap: 6px; }
}
/* Amb les cinc icones (la instal·lació i la campana visibles), a 360 px no hi cabien */
@media (max-width: 400px) {
  .actions { gap: 0; }
  .icon-btn { width: 34px; height: 38px; }
  .thr { padding: 0 10px 0 9px; gap: 5px; }
  .thr svg { width: 14px; height: 14px; }
}
/* ---------- Mòbil ---------- */
@media (max-width: 859px) {
  .spots { gap: 22px; }
  .spots button { min-width: 34px; text-align: center; }
  .spots button .full { display: none; }
  /* L'actiu, amb el nom sencer (si no hi cap, amb punts suspensius) */
  .spots button[aria-pressed="true"] .full { display: inline-block; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
  .spots button[aria-pressed="true"] .short { display: none; }
  /* Que el text no passi per sota de la rosa */
  .when, .place { padding-right: calc(min(34vw, 150px) + 12px); }
  /* Al mòbil, «Com arribar-hi» és només la icona, perquè el nom hi càpiga */
  .place-go { padding: 5px; }
  .place-go span { display: none; }
  /* Al mòbil la regió no hi cap: el nom de l'spot va primer i la tria («el millor dels teus») s'escurça */
  .place-region { display: none; }
  .place-pick::before { content: none; }
  .place b { flex-shrink: 0; max-width: 100%; }
}

/* ---------- Escriptori ---------- */
@media (min-width: 860px) {
  .spots button .short { display: none; }
  .app { padding-left: 40px; padding-right: 40px; }
  .spots-bar { margin-left: 0; margin-right: 0; padding-right: 0; }
  .spots-home { padding-left: 0; }
  .spots { padding-left: 34px; gap: 34px; scroll-padding-inline: 34px 0; }
  /* La primera pantalla és la lectura i la línia de temps, sense que es trepitgin. La línia de
     temps va al seu lloc (no enganxada a baix, que tapava la finestra) i el número s'encongeix
     amb l'alçada perquè tot hi càpiga. L'escenari té l'alçada fixa: en passar de la finestra a
     l'hora triada, la línia de temps no es mou sota el dit */
  .stage { grid-template-columns: 1fr 340px; min-height: min(calc(100svh - 280px), 760px); }
  .reco:not([hidden]) + .stage { min-height: calc(min(calc(100svh - 280px), 760px) - 34px); }
  .kn { font-size: clamp(120px, 84svh - 500px, 300px); }
  .rose { position: relative; top: auto; width: 320px; max-width: none; margin: 0; }
  .timeline { position: relative; bottom: auto; padding: 12px 20px; }
  .scrub { height: 96px; }
  .cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-right: 0; padding-right: 0; overflow: visible; }
  .cams li { width: auto; }
}

/* ---------- L'escena s'explica: rètol, mode escena i targeta de la primera vegada ---------- */
/* El rètol i la targeta pengen de la línia de temps, sobre l'aigua */
.place-scene {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; color: var(--salt);
}
/* La maqueta: només on hi ha ulleres de realitat mixta (xr.js posa la classe) */
.place .place-xr { display: none; }
.xr .place .place-xr { display: grid; }
.place-scene:hover { border-color: rgba(255, 255, 255, .4); }
.place .place-scene svg { width: 15px; height: 15px; stroke: currentColor; stroke-linejoin: round; }
.scene-tag {
  position: absolute; right: 8px; bottom: calc(100% + 10px); z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 16px);
  padding: 5px 12px 5px 10px; border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--ink) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 13px; font-weight: 500; color: var(--fog); white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s;
}
.scene-tag.on { opacity: 1; visibility: visible; transition: opacity .25s; }
.scene-tag::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--band); transition: background .8s; }
.scene-tag span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.scene-tag b { font-weight: 600; color: var(--salt); }
.scene-card {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 7;
  padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 96%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: scene-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
.scene-card[hidden] { display: none; }
.scene-card p { margin: 0; font-size: 14px; line-height: 1.45; color: rgba(238, 243, 241, .8); }
.scene-card p b { font-weight: 600; color: var(--salt); }
.sc-btns { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 12px; }
.sc-go { padding: 8px 18px; border-radius: 999px; background: var(--salt); color: var(--ink); font-size: 14px; font-weight: 600; }
.sc-ok { font-size: 14px; color: var(--fog); }
.sc-ok:hover { color: var(--salt); }
@keyframes scene-rise { from { opacity: 0; transform: translateY(10px); } }
/* Al mòbil, el rètol va a l'aigua de sota la rosa, a la dreta del número: pot fer dues línies */
@media (max-width: 859px) {
  .stage > .scene-tag {
    display: block; top: calc(5.2vh + min(34vw, 150px) + 16px); bottom: auto; right: 0; max-width: 46vw;
    white-space: normal; border-radius: 14px; text-align: right; line-height: 1.35;
  }
  .stage > .scene-tag::before { display: inline-block; margin-right: 7px; vertical-align: 1px; }
  .stage > .scene-tag span { overflow: visible; }
}
@media (min-width: 860px) {
  .scene-card { left: auto; width: 340px; }
  .stage > .scene-tag, .stage > .scene-card { right: 0; bottom: calc(50% + 176px); }
  .stage > .scene-tag { right: 10px; }
}
.scene-close {
  display: none; position: fixed; z-index: 8; top: max(14px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; place-items: center; border-radius: 50%; color: var(--salt);
  background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
}
.scene-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* Mode escena: tot s'amaga amb una transició curta, menys la línia de temps (fixa a baix) i el rètol (que no es fon) */
.scene .app > :not(.timeline) { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility 0s .3s; }
.scene, .scene body { overflow: hidden; }
.scene .timeline { position: fixed; left: 20px; right: 20px; bottom: max(10px, env(safe-area-inset-bottom)); max-width: 1140px; margin: 0 auto; padding: 10px 14px; }
.scene .scrub { height: 84px; }
.scene .scene-close { display: grid; }
@media (prefers-reduced-motion: reduce) {
  .scene-tag, .scene-tag.on { transition: none; }
  .scene-card { animation: none; }
  .scene .app > :not(.timeline) { transition: none; }
}

/* ---------- Entrada ---------- */
.intro .reading > *, .intro .rose, .intro .timeline, .intro .spots-bar, .intro .reco { opacity: 0; }
.ready .reading > *, .ready .rose, .ready .timeline, .ready .spots-bar, .ready .reco {
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.ready .reading > :nth-child(2) { animation-delay: .04s; }
.ready .reading > :nth-child(3) { animation-delay: .08s; }
.ready .reading > :nth-child(4) { animation-delay: .2s; }
.ready .reading > :nth-child(5) { animation-delay: .3s; }
.ready .reading > :nth-child(6) { animation-delay: .36s; }
.ready .reading > :nth-child(7) { animation-delay: .4s; }
.ready .reading > :nth-child(8) { animation-delay: .44s; }
.ready .rose { animation: spin-in 1.4s cubic-bezier(.2, .8, .2, 1) .1s both; }
.ready .timeline { animation-delay: .45s; }
.ready .reco { animation-delay: .06s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }
@keyframes spin-in { from { opacity: 0; transform: rotate(-120deg) scale(.7); } }


/* ---------- «Ara mateix» plegat, el material i retocs ---------- */
.spots button .dot.kn {
  width: auto; height: auto; margin-left: 5px; vertical-align: baseline; background: none;
  font: 600 11px var(--body); font-variant-numeric: tabular-nums;
}
.mx-c.over {
  background-image: repeating-linear-gradient(135deg, rgba(238, 243, 241, .16) 0 2px, transparent 2px 6px);
}
.mx-c.over b { color: var(--fog); font-weight: 500; }
.mx-c.over.far b { opacity: .8; }
.live-fold, .live-go { display: none; }
.live-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.live-head h2 { margin: 0; }
.live:not(.lv-top) h2 { cursor: pointer; }
.live:not(.lv-top) h2::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 0 4px 14px;
  border: solid var(--fog); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .25s;
}
.live:not(.lv-top):not(.lv-fold) h2::after { transform: rotate(-135deg); margin-bottom: -2px; }
.live-go:not([hidden]) { display: inline; font-size: 14px; color: var(--fog); text-decoration: underline; text-underline-offset: 3px; }
.live-go:hover { color: var(--salt); }
.live.lv-top { margin-top: 30px; }
.live.lv-fold { margin-top: 30px; }
.live.lv-fold .live-head { margin-bottom: 12px; }
.live.lv-fold .stations, .live.lv-fold .cams { display: none; }
.live.lv-fold .live-fold {
  display: flex; gap: 8px; margin: 0 -20px 0 0; padding: 0 20px 0 0;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.live.lv-fold .live-fold::-webkit-scrollbar { display: none; }
.lv-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--salt);
  background: color-mix(in srgb, var(--ink) 45%, transparent);
}
.lv-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.lv-pill.old { color: var(--fog); }
.lv-pill.old i { opacity: .4; }
.lv-mk { font-weight: 600; color: var(--fog); }
.lv-cams { color: var(--fog); }
.lv-cams:hover, .lv-pill:hover { border-color: rgba(238, 243, 241, .32); }
.st.mini { padding: 10px 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st.mini .st-name { padding-right: 0; font-size: 14px; }
.st.mini .st-name span { display: inline; margin-left: 6px; font-size: 12px; }
.st.mini .st-facts, .st.mini .st-cmp, .st.mini .st-note, .st.mini svg { display: none; }
.st.mini .st-kn { margin: 0; font-size: 22px; }
