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

body {
  background: transparent;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
}

.speedo-container {
  position: relative;
  width: 256px;
}

/* =========================================================
   Speedometer Widget (HUD)
   ========================================================= */
#hud,
.speedometer-widget {
  position: relative;
  width: 256px;
  background-color: #FFF8F2;
  border: 1.5px solid #F6E3D7;
  border-radius: 26px;
  padding: 12px;
  box-shadow: 0 14px 32px -8px rgba(115, 50, 70, 0.14);
  z-index: 1;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#hud.hidden {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

/* =========================================================
   Welcome Overlay (Lifecycle matching cloudflare-speedometer)
   ========================================================= */
#welcome-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-color: #FFF8F2;
  border: 1.5px solid #F6E3D7;
  border-radius: 26px;
  padding: 13px 12px;
  box-shadow: 0 14px 32px -8px rgba(115, 50, 70, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  overflow: hidden;
}

#welcome-overlay.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#welcome-overlay.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.welcome-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  background-color: #F7DEE2;
}

.welcome-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #E68598;
  animation: welcomePulse 1.8s infinite;
}

.welcome-badge-text {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #38242A;
}

.welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 2px 0;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

.welcome-cat-svg {
  width: 108px;
  height: 92px;
  filter: drop-shadow(0 4px 10px rgba(230, 115, 137, 0.18));
  animation: welcomeCatFloat 3s ease-in-out infinite;
}

@keyframes welcomeCatFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.welcome-label {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #D96D80;
  margin-top: 5px;
  text-align: center;
}

.welcome-title {
  font-family: 'Cherry Swash', cursive, serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #38242A;
  margin-top: 3px;
  letter-spacing: -0.1px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.25;
  max-width: 100%;
}

.welcome-title .welcome-cap {
  font-size: 14.5px;
  vertical-align: baseline;
  line-height: 1;
}

.welcome-title .welcome-mid {
  font-size: 10px;
  letter-spacing: 0.1px;
}

.welcome-subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #8C777C;
  letter-spacing: 0.2px;
  margin-top: 2px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.welcome-sparkle {
  color: #F1B646;
  font-size: 11px;
  display: inline-block;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(241, 182, 70, 0.45));
}

.welcome-bar-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  margin-top: 2px;
}

.welcome-bar-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.welcome-bar-svg {
  flex: 1;
  height: 6px;
}

.welcome-bar-fill {
  stroke-dasharray: 186;
  stroke-dashoffset: 186;
  transition: stroke-dashoffset 90ms linear;
}

.welcome-bar-pct {
  font-size: 9px;
  font-weight: 900;
  color: #D96D80;
  width: 28px;
  text-align: right;
  font-family: inherit;
}

.welcome-substatus {
  font-size: 7.5px;
  font-weight: 800;
  color: #8C777C;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
}

@keyframes welcomePulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.45; }
}

.welcome-pulse {
  animation: welcomePulse 1.8s ease-in-out infinite;
}

/* =========================================================
   Speedometer Header Row
   ========================================================= */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flower-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(230, 115, 137, 0.22);
  cursor: pointer;
  animation: avatarFloat 3.2s ease-in-out infinite;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flower-avatar:hover {
  transform: scale(1.12) rotate(4deg);
}

.flower-avatar:active {
  transform: scale(0.92);
}

@keyframes avatarFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-2.5px) rotate(2deg);
  }
}

.profile-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #38242A;
  letter-spacing: -0.4px;
}

.active-badge, .inactive-badge {
  display: flex;
  align-items: center;
  gap: 3.5px;
  padding: 3px 8px;
  border-radius: 9999px;
  background-color: #F7DEE2;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #D96D80;
}

.badge-text {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #38242A;
}

/* =========================================================
   Metrics Bar (Status Icons & LAJU)
   ========================================================= */
.metrics-bar {
  background-color: #FCEDE4;
  border-radius: 13px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  border: 1px solid rgba(248, 223, 210, 0.6);
}

.icons-group {
  display: flex;
  align-items: center;
  gap: 3.5px;
}

.status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F4D1DA;
  color: #38242A;
  transition: all 0.2s ease;
}

.status-icon svg {
  width: 10px;
  height: 10px;
}

.status-icon.icon-active {
  background-color: #F4D1DA;
  color: #38242A;
}

.status-icon.icon-highbeam {
  background-color: #8F81D6;
  color: #FFFFFF;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #F6CBD5;
  color: #38242A;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon svg {
  width: 9px;
  height: 9px;
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 7px;
  font-weight: 700;
  color: #8C777C;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1;
}

.metric-value {
  font-size: 10.5px;
  font-weight: 900;
  color: #38242A;
  line-height: 1.1;
}

/* =========================================================
   Speedometer Dial & Gauge
   ========================================================= */
.dial-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-svg {
  width: 182px;
  height: 182px;
}

#gaugeNeedle {
  transform-origin: 150px 150px;
  transition: transform 0.15s ease-out;
}

.digital-speed {
  position: absolute;
  top: 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#speedValue {
  font-size: 33px;
  font-weight: 900;
  color: #38242A;
  line-height: 1;
}

#speedUnit {
  font-size: 9px;
  font-weight: 800;
  color: #D96D80;
  letter-spacing: 1.2px;
  margin-top: 1px;
}

/* =========================================================
   Bottom Cards (ENGINE & FUEL)
   ========================================================= */
.bottom-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 5px;
}

.bottom-card {
  background-color: #FCEDE4;
  border-radius: 13px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(248, 223, 210, 0.6);
  transition: all 0.3s ease;
}

.bottom-card.low-fuel-alert {
  background-color: #FFDFE5;
  border-color: #F8B6C4;
}

.bottom-card-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #F6CBD5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38242A;
  flex-shrink: 0;
}

.bottom-card-icon svg {
  width: 13px;
  height: 13px;
}

.low-fuel-alert .bottom-card-icon {
  background-color: #F28C9F;
  color: #FFFFFF;
}

.bottom-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-label {
  font-size: 7.5px;
  font-weight: 700;
  color: #8C777C;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 1px;
}

.card-value {
  font-size: 15.5px;
  font-weight: 900;
  color: #38242A;
  line-height: 1;
  letter-spacing: -0.3px;
}

.low-fuel-alert .card-value {
  color: #D0405E;
}

/* =========================================================
   Cat Animations & Transitions
   ========================================================= */
#leftEarGroup {
  transform-origin: 114px 172px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#rightEarGroup {
  transform-origin: 186px 172px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#leftWhiskers {
  transform-origin: 130px 204px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#rightWhiskers {
  transform-origin: 170px 204px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================================
   Turn Signal Blinker Badges
   ========================================================= */
.blinker-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #F4D1DA;
  color: #38242A;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.blinker-left {
  left: 4px;
}

.blinker-right {
  right: 4px;
}

.blinker-badge.blinker-active {
  opacity: 1 !important;
  background-color: #98DEC0 !important;
  color: #1E5740 !important;
  box-shadow: 0 2px 8px rgba(152, 222, 192, 0.5);
  animation: blinkerPulse 0.45s infinite alternate !important;
}

.blinker-active {
  background-color: #98DEC0 !important;
  color: #1E5740 !important;
  animation: blinkerPulse 0.45s infinite alternate !important;
}

@keyframes blinkerPulse {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.15); opacity: 1; }
}
