/* 1:1 port of trackidol-webapp app-telemetry-hud (lime-neon trapezoid). */

.telemetry-hud-host {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: transparent;
  opacity: 1;
  transition: opacity 0.25s ease;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.telemetry-hud-shell {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  overflow: hidden;
}

.telemetry-hud {
  --lime: #c8ff00;
  --lime-dim: rgba(200, 255, 0, 0.45);
  --lime-glow: rgba(200, 255, 0, 0.55);
  --panel: rgba(6, 8, 12, 0.88);
  --purple: #b44cff;
  --white: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.72);

  position: absolute;
  left: 0;
  top: 0;
  width: 1500px;
  height: 260px;
  display: grid;
  grid-template-columns: 210px minmax(520px, 1fr) 126px 200px;
  gap: 14px;
  align-items: end;
  transform-origin: 0 0;
  will-change: transform;
  color: var(--white);
  font-family: 'Rajdhani', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  font-style: italic;
  background: transparent;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.telemetry-hud--with-track {
  grid-template-columns: 148px 210px minmax(430px, 1fr) 126px 200px;
}

/* —— Track follow-cam (same language as speed card, more transparent) —— */
.track-card {
  position: relative;
  width: 148px;
  height: 148px;
  padding: 10px 10px 22px;
  box-sizing: border-box;
  background: rgba(6, 8, 12, 0.52);
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.track-card__smudge {
  position: absolute;
  top: 0;
  left: 18%;
  width: 42%;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 35%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.45) 65%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.track-card__svg {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 58%, transparent 88%);
  mask-image: radial-gradient(circle at 50% 46%, #000 58%, transparent 88%);
}

.track-card__path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-card__path--past {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 2.4;
}

.track-card__path--future {
  stroke: var(--lime);
  stroke-width: 2.6;
  filter: drop-shadow(0 0 3px var(--lime-glow));
}

.track-card__halo {
  fill: rgba(200, 255, 0, 0.18);
  stroke: rgba(200, 255, 0, 0.45);
  stroke-width: 1.2;
}

.track-card__marker {
  fill: var(--lime);
  stroke: #0b1220;
  stroke-width: 0.8;
  filter: drop-shadow(0 0 4px rgba(200, 255, 0, 0.9));
}

.track-card__label {
  position: absolute;
  left: 10px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--lime);
  text-shadow: 0 0 8px var(--lime-glow);
}

/* —— Speed / Gear (left) — soft panel, no neon border —— */
.speed-gear {
  position: relative;
  height: 148px;
  padding: 22px 24px 20px;
  background: rgba(6, 8, 12, 0.78);
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Soft right fade so it blends into the video */
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
}

.speed-gear__smudge {
  position: absolute;
  top: 0;
  left: 18%;
  width: 42%;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 35%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.45) 65%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.speed-gear__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.speed-gear__speed,
.speed-gear__gear {
  font-size: 64px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  color: var(--white);
}

.speed-gear__unit,
.speed-gear__gear-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--lime);
  text-shadow: 0 0 8px var(--lime-glow);
  transform: translateY(-2px);
}

.speed-gear__rule {
  height: 1px;
  width: 58%;
  margin: 14px 0 16px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(230, 255, 160, 0.35) 12%,
    rgba(220, 255, 120, 0.85) 45%,
    rgba(200, 255, 0, 0.55) 70%,
    transparent 100%
  );
  box-shadow: 0 0 6px rgba(200, 255, 0, 0.35);
}

.speed-gear--speed-only {
  justify-content: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.speed-gear--speed-only .speed-gear__speed {
  font-size: 72px;
}

/* —— Center stack —— */
.center-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.rpm-trap {
  position: relative;
  height: 108px;
}

.trap-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.trap-fill--rpm,
.trap-fill--lap {
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
}

.rpm-trap__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 16px 52px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
}

.rpm-dots {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 4px;
  align-items: center;
}

.rpm-dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  opacity: 0.35;
  box-shadow: none;
  transition: background 70ms linear, opacity 70ms linear, box-shadow 70ms linear;
}

.rpm-dot.active {
  opacity: 1;
}

.rpm-dot.active[data-zone='white'] {
  background: #b8ff2a;
  box-shadow: 0 0 6px rgba(184, 255, 42, 0.85);
}

.rpm-dot.active[data-zone='yellow'] {
  background: #ffd000;
  box-shadow: 0 0 6px rgba(255, 208, 0, 0.8);
}

.rpm-dot.active[data-zone='red'] {
  background: #ff2a2a;
  box-shadow: 0 0 7px rgba(255, 40, 40, 0.85);
}

.rpm-foot {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.rpm-numbers {
  flex: 1;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 600;
}

.rpm-caption {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

/* Compact lap card — same trap as RPM, inset underneath */
.lap-trap {
  position: relative;
  height: 70px;
  width: 90%;
  align-self: center;
}

.lap-trap__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 8px 40px;
  display: grid;
  grid-template-columns: 0.85fr 1.25fr 1.25fr;
  gap: 0;
  align-items: center;
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
}

/* Neon tube border — continuous path with soft bloom (matches reference) */
.neon-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.neon-frame__glow,
.neon-frame__stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.neon-frame__glow {
  stroke: var(--lime);
  stroke-width: 5;
  opacity: 0.35;
  filter: blur(3.5px);
}

.neon-frame__stroke {
  stroke: var(--lime);
  stroke-width: 2.25;
  filter: drop-shadow(0 0 4px var(--lime-glow));
}

.lap-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 18px;
  min-width: 0;
}

.lap-col + .lap-col::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16%;
  bottom: 16%;
  width: 1.5px;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime-glow);
  opacity: 0.75;
}

.lap-col--lap {
  align-items: flex-start;
  text-align: left;
}

.lap-col--current,
.lap-col--best {
  align-items: center;
  text-align: center;
}

.lap-col__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.92);
}

.lap-col__value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lap-col__accent {
  color: var(--lime);
  text-shadow: 0 0 8px var(--lime-glow);
}

.lap-col__muted {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78em;
  font-weight: 700;
}

.lap-col__time {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lap-col__sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.78);
}

.lap-col--best .lap-col__time,
.lap-col--best .lap-col__sub {
  color: var(--purple);
  text-shadow: 0 0 8px rgba(180, 76, 255, 0.45);
}

/* —— G meter (40% smaller than original 210px) —— */
.g-panel {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 40% 35%, rgba(30, 34, 40, 0.98), rgba(4, 5, 8, 0.96) 70%);
  border: 2px solid var(--lime-dim);
  box-shadow:
    0 0 12px var(--lime-glow),
    0 8px 22px rgba(0, 0, 0, 0.55),
    inset 0 0 0 4px rgba(0, 0, 0, 0.55),
    inset 0 0 0 5px rgba(200, 255, 0, 0.25);
}

.g-svg {
  width: 92%;
  height: 92%;
  display: block;
}

.g-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
}

.g-ring--outer {
  stroke: rgba(200, 255, 0, 0.35);
  stroke-width: 2.2;
}

.g-cross {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.4;
}

.g-dot {
  fill: var(--lime);
  filter: drop-shadow(0 0 4px rgba(200, 255, 0, 0.9));
}

.g-center {
  fill: #fff;
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: 'Rajdhani', 'Arial Narrow', sans-serif;
}

.g-axis {
  fill: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: 'Rajdhani', 'Arial Narrow', sans-serif;
}

/* —— Throttle — same soft panel language as speed card —— */
.throttle-panel {
  position: relative;
  height: 148px;
  padding: 16px 20px 14px;
  background: rgba(6, 8, 12, 0.78);
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Soft left fade toward center (mirror of speed card) */
  -webkit-mask-image: linear-gradient(270deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(270deg, #000 72%, transparent 100%);
}

.throttle-smudge {
  position: absolute;
  top: 0;
  left: 28%;
  width: 42%;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 35%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.45) 65%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.throttle-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  flex-shrink: 0;
}

.throttle-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.throttle-value {
  display: flex;
  align-items: flex-start;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.throttle-value__num {
  font-size: 36px;
  font-weight: 800;
  color: var(--white);
}

.throttle-value__pct {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
  margin-left: 1px;
  color: var(--white);
}

.throttle-meter {
  flex: 1 1 auto;
  min-height: 58px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  align-content: end;
  gap: 3px;
  transform: skewX(-14deg);
  transform-origin: bottom center;
}

.throttle-seg {
  display: block;
  width: 100%;
  min-height: 8px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 1px;
  transition: background 70ms linear, box-shadow 70ms linear;
}

.throttle-seg.active {
  background: linear-gradient(180deg, #e8ff66, #c8ff00);
  box-shadow: 0 0 6px rgba(200, 255, 0, 0.65);
}

/* Narrow video panes (phones, hero phone). Keep laptop HUD 1:1 with the app. */
.telemetry-hud-host--narrow .throttle-title {
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.telemetry-hud-host--narrow .throttle-value__num {
  font-size: 26px;
}

.telemetry-hud-host--narrow .throttle-value__pct {
  font-size: 13px;
  margin-top: 2px;
}

.telemetry-hud-host--narrow .throttle-head {
  gap: 0;
}

.telemetry-hud-host--narrow .throttle-panel {
  padding: 10px 12px 10px;
  gap: 4px;
}

