/* DIEM HUD — Meta Ray-Ban Display web app.
   600x600 additive display: #000 = transparent (true see-through HUD).
   No external fonts allowed → system sans. Brand tokens from the firmware/Sleek. */

:root {
  --eco:   #39B2FF;
  --trail: #00FF00;
  --boost: #FFA600;
  --off:   #606060;
  --mode:  var(--eco);          /* set live by app.js */
  --track: #2A2A2E;
  --muted: #B0B3B8;
  --fill:  0%;                  /* indicator length, % of full circle */
  --stroke: 34px;
  --ring: 460px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;            /* transparent on the waveguide */
  color: #fff;
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

#hud { position: relative; width: 600px; height: 600px; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.screen[hidden] { display: none; }

/* ── Dashboard ─────────────────────────────────────────────── */
.battery {
  position: absolute; top: 120px; left: 0; right: 0;   /* inside the ring's upper hollow, above speed */
  display: flex; justify-content: center; align-items: center; gap: 7px;
  font-size: 22px; font-weight: 700; color: #fff; z-index: 5;
}
.batt-icon { display: flex; }
.batt-icon svg { width: 28px; height: 28px; display: block; }

/* cadence setpoint badge (left) — white pill, matches firmware/Sleek */
.cadence-badge {
  position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
  background: #fff; color: #000; font-size: 30px; font-weight: 900;
  padding: 4px 16px; border-radius: 10px; line-height: 1.15; z-index: 5;
}

/* mode chip + bluetooth (bottom, in the ring's lower gap) */
.dash-bottom {
  position: absolute; bottom: 92px; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center; gap: 14px; z-index: 5;
}
.mode-chip {
  font-size: 15px; font-weight: 800; color: var(--mode);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 7px 16px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid color-mix(in srgb, var(--mode) 35%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mode) 18%, transparent);
}
.bt-icon { display: flex; color: #fff; }
.bt-icon svg { width: 24px; height: 24px; display: block; }

.ring {
  position: relative;
  width: var(--ring); height: var(--ring); border-radius: 50%;
  /* Matches firmware power_arc: lv_arc_set_bg_angles(135,45) → 270° arc, 90° gap
     centered at bottom. CSS conic 0°=top: start 225°, arc spans 75% (270°). */
  background: conic-gradient(from 225deg,
      var(--mode) 0 var(--fill),
      var(--track) var(--fill) 75%,
      transparent 75% 100%);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - var(--stroke)), #000 calc(100% - var(--stroke)));
          mask: radial-gradient(farthest-side, #0000 calc(100% - var(--stroke)), #000 calc(100% - var(--stroke)));
}

/* rounded caps on the indicator ends (firmware parity) */
.cap { position: absolute; inset: 0; transform: rotate(var(--a, 0deg)); pointer-events: none; }
.cap::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: var(--stroke); height: var(--stroke); margin-left: calc(var(--stroke) / -2);
  border-radius: 50%; background: var(--mode);
}
.cap-end[hidden] { display: none; }
/* grey track ends, rounded to match the colored caps (firmware parity) */
.track-cap::before { background: var(--track); }

/* concentric center content (z-stacked over the ring — the look native can't do) */
.ring-center {
  position: absolute; inset: 0;
  /* the mask clips children of .ring, so render center in a sibling overlay instead */
}
.center-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.speed { display: flex; align-items: baseline; font-weight: 800; line-height: 0.92; letter-spacing: -2px; }
.speed #speedInt { font-size: 150px; }
.speed-dec { font-size: 92px; opacity: 0.7; }
.unit  { font-size: 24px; font-weight: 500; color: #e5e5e5; letter-spacing: 4px; text-transform: uppercase; margin-top: 8px; }

/* ── Navigation (Sleek design — project XDkDDFmCVia, "Navigation" v10) ──────
   Ported from Tailwind to plain CSS, scaled from the 360px Sleek canvas to a
   460px circle in the 600px viewport. Accent = #39B2FF (var --eco). */
#screen-nav { justify-content: center; }
.nav-ring {
  position: absolute; width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);   /* faint frame (Sleek border-zinc-900) */
}
.nav-content {
  position: relative; width: 460px; height: 460px;
  display: flex; align-items: center; justify-content: center;
}

/* speed + thin progress bar, near the top */
.nav-speed-group {
  position: absolute; top: 12%; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
}
.nav-speed { display: flex; align-items: baseline; gap: 5px; }
.nav-speed #navSpeed { font-size: 48px; font-weight: 900; color: #fff; line-height: 1; }
.nav-speed-unit {
  font-size: 14px; font-weight: 900; color: var(--eco);
  text-transform: uppercase; letter-spacing: 2px;
}
.nav-bar {
  width: 64px; height: 5px; margin-top: 8px;
  background: var(--track); border-radius: 3px; overflow: hidden;
}
.nav-bar-fill { height: 100%; background: var(--eco); border-radius: 3px; }

/* big turn arrow + distance / street, centered */
.nav-main { display: flex; align-items: center; gap: 30px; margin-top: 24px; padding: 0 36px; }
.turn {
  width: 148px; height: 148px; flex: none; color: #fff;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));   /* Sleek glow */
}
.turn svg { width: 100%; height: 100%; display: block; }
.nav-text { display: flex; flex-direction: column; align-items: flex-start; padding-top: 8px; }
.nav-dist { display: flex; align-items: baseline; gap: 6px; font-weight: 900; }
.nav-dist-num { font-size: 82px; line-height: 0.9; letter-spacing: -3px; color: #fff; }
.nav-dist-unit { font-size: 32px; color: #71717a; text-transform: uppercase; letter-spacing: -1px; }
.street {
  font-size: 26px; font-weight: 700; color: #d4d4d8; margin-top: 8px;
  text-transform: uppercase; letter-spacing: 0.3px; line-height: 1; max-width: 200px;
}

/* arrive / dist footer stats */
.nav-footer {
  position: absolute; bottom: 15%; left: 0; right: 0;
  display: flex; justify-content: center; gap: 56px;
}
.foot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.foot-label { font-size: 13px; font-weight: 900; color: #71717a; text-transform: uppercase; letter-spacing: 2px; }
.foot-val { font-size: 19px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.foot-val.accent { color: var(--eco); }

/* ── Cadence (transient fade-over overlay, like the display) ──── */
#screen-cadence {
  z-index: 10;
  background: #000;            /* covers the screen beneath at full opacity (black = transparent on glass) */
  opacity: 0;                  /* hidden until a setpoint change; crossfades in/out */
  pointer-events: none;
  transition: opacity 280ms ease;
}
#screen-cadence.show { opacity: 1; }
.cadence-num {
  font-size: 164px; font-weight: 900; line-height: 0.8; letter-spacing: -4px;
  filter: drop-shadow(0 0 25px color-mix(in srgb, var(--mode) 45%, transparent));
}
.cadence-label {
  font-size: 26px; font-weight: 900; color: var(--mode);
  letter-spacing: 7px; text-transform: uppercase; margin-top: 18px;
}

/* ── Messages (Sleek "Messages" v4) ───────────────────────────── */
#screen-messages { justify-content: center; }
.msg-title {
  position: absolute; top: 96px; left: 0; right: 0; text-align: center;
  font-size: 28px; font-weight: 500; color: #fff; opacity: 0.8;
  letter-spacing: 3px; text-transform: uppercase;
}
.msg-body { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.msg-icon { display: flex; color: #3a3a40; }   /* faint (Sleek zinc-800) */
.msg-icon svg { width: 84px; height: 84px; display: block; }
.msg-text { font-size: 30px; font-weight: 500; color: #fff; }

/* ── Chrome (status + dots) ────────────────────────────────── */
.src {
  position: absolute; left: 14px; bottom: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #4a4a50;
}
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; gap: 8px; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3a3a40; }
.dot.on { background: #fff; }
