/* WS40 HUD — restyle (glass cards + terminal header). */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&display=swap');

.ws40-hud{font-family:'DM Mono',ui-monospace,monospace;background:#070a11;border-radius:20px;padding:20px;position:relative;overflow:hidden;border:1px solid rgba(255,255,255,.05);color:#e6edf5}
.ws40-hud::before{content:'';position:absolute;top:-120px;left:-80px;width:380px;height:380px;background:radial-gradient(circle,rgba(45,212,191,.16),transparent 70%);pointer-events:none}
.ws40-hud::after{content:'';position:absolute;bottom:-140px;right:-60px;width:420px;height:420px;background:radial-gradient(circle,rgba(99,102,241,.14),transparent 70%);pointer-events:none}

/* Header (classes consumed by hud.js — keep names) */
.ws40-hud__header{display:flex;justify-content:space-between;align-items:center;font-size:12px;letter-spacing:1px;color:#8595a8;padding:2px 4px 16px;position:relative;z-index:1;gap:10px;flex-wrap:wrap}
.ws40-hud__title{color:#c6d2e0;font-weight:500}
.ws40-hud__meta{display:flex;align-items:center;gap:14px}
.ws40-hud__time{color:#7e8da0}
.ws40-hud__status{display:flex;align-items:center;gap:6px;font-size:11px;letter-spacing:1px}
.ws40-hud__status--online{color:#34d399}
.ws40-hud__status--offline{color:#fb7185}
.ws40-hud__status--updating{color:#fbbf24}
.ws40-hud__dot{width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 8px currentColor;animation:ws40hudpulse 2s infinite}
@keyframes ws40hudpulse{50%{opacity:.35}}

/* Grid */
.ws40-hud__grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-flow:row dense;gap:12px;position:relative;z-index:1}

/* Cards */
.ws40-hud__card{position:relative;background:rgba(255,255,255,.022);border:1px solid rgba(255,255,255,.06);border-radius:16px;padding:16px 17px;overflow:hidden}
.ws40-hud__card::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;background:linear-gradient(90deg,var(--ac,#3b82f6),transparent 80%)}
.ws40-hud__card::after{content:'';position:absolute;top:-40px;left:-40px;width:130px;height:130px;background:radial-gradient(circle,var(--gl,transparent),transparent 70%);pointer-events:none}
.ws40-hud__card--feat{grid-column:span 2;grid-row:span 2;display:flex;flex-direction:column}
.ws40-hud__card--wide{grid-column:span 2}
.ws40-hud__card--ins{border-left:3px solid var(--ac,#3b82f6)}
.ws40-hud__card--ins::before{display:none}

.ws40-hud__lbl{display:flex;align-items:center;gap:8px;font-size:10.5px;letter-spacing:1.6px;color:#7e8da0;margin-bottom:12px;text-transform:uppercase}
.ws40-hud__dotc{width:9px;height:9px;border-radius:3px;background:var(--ac,#3b82f6);box-shadow:0 0 9px var(--ac,#3b82f6);flex:0 0 auto}
.ws40-hud__opt{margin-left:auto;font-size:8.5px;letter-spacing:1px;color:#5b6b80;border:1px solid #2a3647;border-radius:6px;padding:1px 6px}

.ws40-hud__big{font-weight:500;color:#eef3f9;line-height:1;font-size:clamp(1.7rem,4.4vw,2.5rem);letter-spacing:-.5px}
.ws40-hud__card--feat .ws40-hud__big{font-size:clamp(2.9rem,8vw,4rem)}
.ws40-hud__big--s{font-size:clamp(1.4rem,3.6vw,1.9rem)}
.ws40-hud__unit{font-size:.4em;color:#7e8da0;font-weight:400;margin-left:4px;letter-spacing:0}
.ws40-hud__card--feat .ws40-hud__unit{font-size:.28em}
.ws40-hud__txt{font-weight:500;color:#eef3f9;font-size:1.4rem;letter-spacing:-.3px}

.ws40-hud__sub{font-size:11px;color:#8090a3;margin-top:11px;line-height:1.6}
.ws40-hud__sub .ws40-hud__hi,.ws40-hud__hi{color:#aebdcf}
.ws40-hud__sub small{color:#6b7a8d;margin-left:6px}

.ws40-hud__flow{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.ws40-hud__sep{color:#5f6f84;font-size:1.4rem}

.ws40-hud__tri{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.ws40-hud__k{font-size:10px;letter-spacing:1px;color:#748497;text-transform:uppercase}
.ws40-hud__v{font-weight:500;color:#e6edf5;font-size:1.2rem;margin-top:4px}
.ws40-hud__v small{font-size:.55em;color:#7e8da0;margin-left:2px}

.ws40-hud__quad{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin-top:2px}

.ws40-hud__spark{display:block;width:100%;height:60px;margin-top:14px;opacity:.95}
.ws40-hud__spark--sm{height:38px;margin-top:10px}
/* In the hero (feat) card the temperature sparkline grows to fill the leftover
   vertical space instead of leaving a gap below it. The sub block (Feels/Dew,
   max/min) stays compact at the top; the chart takes the rest. */
.ws40-hud__card--feat .ws40-hud__sub{margin-bottom:4px}
.ws40-hud__card--feat .ws40-hud__spark{flex:1 1 auto;height:auto;min-height:72px;margin-top:16px}

.ws40-hud__scale{letter-spacing:.04em}
.ws40-hud__band{color:#6b7a8d}
.ws40-hud__band.is-active{color:var(--ac,#fbbf24);font-weight:500}
.ws40-hud__cond{color:#6b7a8d;letter-spacing:.03em}
.ws40-hud__cond.is-active{color:var(--ac,#aebdcf);font-weight:500}

.ws40-hud__card--empty{opacity:.55}
.ws40-hud__nodata{margin-top:14px;font-size:13px;color:#6b7a8d;letter-spacing:.04em}

.ws40-hud__moonphase{font-size:11px;color:#8090a3;margin-top:2px;letter-spacing:.03em}

.ws40-hud__updated{font-size:11px;color:#6b7a8d;letter-spacing:.03em;white-space:nowrap}

.ws40-hud__trend--up{color:#fb7185}
.ws40-hud__trend--down{color:#60a5fa}
.ws40-hud__trend--flat{color:#aebdcf}

.ws40-hud__card--ins{min-height:120px}

.ws40-hud__scan{position:absolute;left:0;right:0;top:0;height:2px;z-index:2;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(245,165,36,.55),transparent);box-shadow:0 0 8px rgba(245,165,36,.35);opacity:0;animation:ws40hudscan 5s linear infinite}
@keyframes ws40hudscan{0%{top:0;opacity:0}6%{opacity:.85}94%{opacity:.85}100%{top:100%;opacity:0}}
@media(prefers-reduced-motion:reduce){.ws40-hud__scan{display:none}}

@media(max-width:560px){
  .ws40-hud__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ws40-hud__card--feat{grid-column:span 2;grid-row:auto}
  .ws40-hud__card--wide{grid-column:span 2}
}

/* Live data badge (Meteobridge push) */
.ws40-hud__live-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    vertical-align: middle;
    color: #9aa4b2;
    border: 1px solid currentColor;
    opacity: .65;
}
.ws40-hud__live-badge.is-active {
    color: #3fb950;
    opacity: 1;
}

/* Webcam card (optional, hero — mirrors the Temperature card). Inside the HUD
   show ONLY the cam image: strip the shortcode frame (border/background/padding)
   and hide its caption/label — the place name already lives in the station title.
   Scoped to .ws40-hud__cam so the webcam shortcode is untouched everywhere else. */
.ws40-hud__card--cam{display:flex;flex-direction:column}
.ws40-hud__card--cam .ws40-hud__cam{flex:1 1 auto;position:relative;min-height:180px;border-radius:12px;overflow:hidden;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.02)}
.ws40-hud__card--cam .ws40-hud__cam .ws40-webcam-wrap{border:0!important;background:transparent!important;padding:0!important;margin:0!important;box-shadow:none!important;border-radius:12px!important;width:100%!important;height:100%!important}
.ws40-hud__card--cam .ws40-hud__cam .ws40-webcam-wrap>:not(img){display:none!important}
.ws40-hud__card--cam .ws40-hud__cam .ws40-webcam-img,
.ws40-hud__card--cam .ws40-hud__cam img{width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;display:block!important;border-radius:12px!important}

/* ── Forecast band (full-width, under Temperature + Webcam) ───────────── */
.ws40-hud__fcband{grid-column:1/-1;position:relative;background:rgba(255,255,255,.022);border:1px solid rgba(255,255,255,.06);border-radius:16px;padding:16px 17px;overflow:hidden}
.ws40-hud__fcband::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;background:linear-gradient(90deg,var(--ac,#9cc6ee),transparent 80%)}
.ws40-hud__fcband::after{content:'';position:absolute;top:-40px;left:-40px;width:130px;height:130px;background:radial-gradient(circle,var(--gl,transparent),transparent 70%);pointer-events:none}
/* Re-skin the [ws40_forecast] widget to the dark HUD aesthetic */
.ws40-hud__fcband .ws40-forecast{background:transparent;border:0;margin:0;padding:0;color:#cdd9ea;font-family:inherit}
.ws40-hud__fcband .ws40-forecast *{font-family:inherit}
.ws40-hud__fcband .ws40-forecast__title{display:none}
.ws40-hud__fcband .ws40-forecast__grid{gap:10px;background:transparent;justify-content:center}
.ws40-hud__fcband .ws40-forecast__grid{justify-content:safe center}
.ws40-hud__fcband .ws40-forecast__card{background:rgba(8,16,28,.45);border:1px solid rgba(156,198,238,.10);border-radius:12px;box-shadow:none;color:#cdd9ea}
.ws40-hud__fcband .ws40-forecast__card:hover{border-color:rgba(156,198,238,.22);transform:none}
.ws40-hud__fcband .ws40-forecast__day{color:#8aa0bb;letter-spacing:1px}
.ws40-hud__fcband .ws40-forecast__date{color:#6b7a8d}
.ws40-hud__fcband .ws40-forecast__desc{color:#7d8ca3}
.ws40-hud__fcband .ws40-forecast__max{color:#eaf2fc}
.ws40-hud__fcband .ws40-forecast__min,.ws40-hud__fcband .ws40-forecast__sep{color:#7d8ca3}
.ws40-hud__fcband .ws40-forecast__extra{color:#8aa0bb}
.ws40-hud__fcband .ws40-forecast__moon-name{color:#8aa0bb}
.ws40-hud__fcband .ws40-forecast__skeleton{background:rgba(156,198,238,.06)}
.ws40-hud__fcband .ws40-forecast__error{color:#e6a0a0}

/* AIR · PM — EEA air-quality badge + 6-level bar */
.ws40-hud__aqi { margin-top: 14px; }
.ws40-hud__aqi-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 11px; border-radius: 999px; color: var(--aqc, #8ea0bd); border: 1px solid var(--aqc, #2b3a52); }
.ws40-hud__aqi-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aqc, #8ea0bd); }
.ws40-hud__aqi-bar { display: flex; gap: 4px; margin-top: 9px; }
.ws40-hud__aqi-seg { flex: 1; height: 6px; border-radius: 3px; background: var(--sc, #2b3a52); opacity: .25; transition: opacity .2s; }
.ws40-hud__aqi-seg.is-on { opacity: 1; }
