* { box-sizing: border-box; }

html,
body,
#root {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #040506;
}

body {
  color: #eef3ff;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.dashboard-root {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

.v5 {
  position: relative;
  width: calc(50vw - 4px);
  height: 100%;
  color: #eef3ff;
  padding: 6px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #0a0a0b 0%, #08090b 45%, #050506 100%);
  border: 1px solid #2a1f15;
  box-shadow: 3px 0 0 #10151f;
  overflow: hidden;
}

.v5::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0), rgba(6, 7, 10, 0.95));
  pointer-events: none;
  z-index: 20;
}

.shiftbar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.light {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 150, 50, 0.2);
}

.light.active {
  background: #ff9a2f;
  box-shadow: 0 0 8px rgba(255, 154, 47, 0.55);
}

.light.active.hot {
  background: #ff7a2b;
  box-shadow: 0 0 9px rgba(255, 122, 43, 0.6);
}

.light.active.red {
  background: #ff4f4f;
  box-shadow: 0 0 10px rgba(255, 79, 79, 0.75);
}

.blink .light.active.red {
  animation: flash 0.25s steps(1, end) infinite;
}

@keyframes flash {
  50% { opacity: 0.25; }
}

.topline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 9px;
  color: #c6b6a0;
  margin-bottom: 5px;
}

.brand {
  letter-spacing: 0.35px;
  color: #ffb45b;
  font-weight: 600;
  padding-top: 2px;
  font-size: 9px;
  max-width: 100%;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pills {
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  margin-top: 0;
  max-width: 100%;
}

.pill {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #564029;
  border-radius: 999px;
  font-size: 8px;
  color: #ffc989;
}

.pill.ok {
  color: #77ebb2;
  border-color: #2e845e;
}

.pill.warn {
  color: #ffd88c;
  border-color: #9a7a39;
}

.pill.bad {
  color: #ff9fb1;
  border-color: #a0465c;
}

.shell {
  height: calc(100% - 37px);
  display: grid;
  grid-template-rows: 32% 8% 60%;
  gap: 6px;
}

.top-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1.05fr;
  gap: 6px;
}

.card {
  border-radius: 12px;
  border: 1px solid #372a1d;
  background: linear-gradient(180deg, rgba(255, 148, 43, 0.14), rgba(20, 21, 25, 0.74));
  box-shadow: inset 0 0 0 1px rgba(255, 173, 94, 0.05);
}

.gauge {
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.gl {
  font-size: 11px;
  color: #f0c68d;
}

.dial {
  width: 92px;
  height: 92px;
  margin: auto;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 50% 50%, #101116 47%, #281f17 48%, #4a3522 53%, #2a2119 58%, transparent 58%),
    conic-gradient(from -130deg, rgba(255, 175, 88, 0.95) 0deg, rgba(255, 175, 88, 0.22) 182deg, rgba(255, 120, 80, 0.95) 183deg, rgba(255, 80, 80, 0.9) 230deg, rgba(70, 45, 33, 0.9) 231deg);
}

.dial::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: #0b0f18;
  border: 1px solid #4b3a27;
}

.needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 38px;
  transform-origin: 50% 92%;
  background: linear-gradient(180deg, #ffe0ab 0%, #ff9f45 100%);
  box-shadow: 0 0 10px rgba(255, 168, 82, 0.75);
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 50%;
  background: #ffbb66;
  box-shadow: 0 0 10px rgba(255, 187, 102, 0.8);
}

.g-val {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  z-index: 2;
  font-size: 28px;
  line-height: 0.95;
  font-weight: 700;
}

.g-unit {
  display: block;
  font-size: 11px;
  color: #cfb38d;
  font-weight: 500;
  margin-top: 3px;
}

.coolant {
  padding: 7px 9px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 5px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #394b64;
  background: radial-gradient(140% 130% at 15% 0%, rgba(59, 178, 255, 0.14), rgba(11, 17, 28, 0) 60%),
    linear-gradient(180deg, #0e1728 0%, #090f1b 100%);
}

.coolant-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.coolant-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8ec9ff;
}

.coolant-state {
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 7px;
  border: 1px solid #446282;
  color: #c8e0ff;
  background: rgba(70, 106, 145, 0.22);
}

.coolant-body {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  min-height: 0;
}

.coolant-value {
  font-family: "Orbitron", monospace;
  font-size: 46px;
  line-height: 0.9;
  font-weight: 700;
  color: #e8f3ff;
  text-shadow: 0 0 14px rgba(96, 186, 255, 0.24);
}

.coolant-unit {
  font-size: 16px;
  color: #8fb7ea;
}

.coolant-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.coolant-fill {
  height: 100%;
  width: 55%;
  border-radius: 999px;
  background: linear-gradient(90deg, #43b7ff 0%, #4ce0db 70%, #8cff9c 100%);
  box-shadow: 0 0 12px rgba(76, 224, 219, 0.45);
}

.coolant-scale {
  display: flex;
  justify-content: space-between;
  color: #86a8d4;
  font-size: 8px;
}

.coolant.ok {
  border-color: #2e5e8d;
  box-shadow: inset 0 0 0 1px rgba(105, 173, 255, 0.18);
}

.coolant.ok .coolant-state {
  border-color: #2f7f5a;
  color: #96f0c2;
  background: rgba(47, 127, 90, 0.22);
}

.coolant.warn {
  border-color: #c18a3b;
  box-shadow: inset 0 0 0 1px rgba(255, 198, 108, 0.26);
}

.coolant.warn .coolant-state {
  border-color: #b98a3c;
  color: #ffe0a9;
  background: rgba(185, 138, 60, 0.22);
}

.coolant.warn .coolant-fill {
  background: linear-gradient(90deg, #61c0ff 0%, #ffd166 72%, #ffb347 100%);
}

.coolant.bad {
  border-color: #c84a4a;
  box-shadow: inset 0 0 0 1px rgba(255, 124, 124, 0.34), 0 0 10px rgba(255, 76, 76, 0.24);
}

.coolant.bad .coolant-state {
  border-color: #d35d5d;
  color: #ffc3c3;
  background: rgba(211, 93, 93, 0.22);
}

.coolant.bad .coolant-fill {
  background: linear-gradient(90deg, #6fc4ff 0%, #ff9f6b 60%, #ff5f6d 100%);
}

.mini-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
}

.chip {
  padding: 1px 5px;
  border-radius: 9px;
  border: 1px solid #3b2e20;
  background: linear-gradient(180deg, rgba(255, 145, 30, 0.14), rgba(16, 18, 22, 0.72));
}

.ck {
  font-size: 9px;
  color: #d6b58f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv2 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cu {
  font-size: 10px;
  color: #c7aa89;
  margin-left: 2px;
}

.dtc-strip {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid #523a22;
  background: linear-gradient(180deg, rgba(49, 39, 27, 0.74), rgba(14, 15, 19, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 186, 110, 0.12);
  padding: 7px;
}

.dtc-strip.alert {
  border-color: #ff6a52;
  box-shadow: inset 0 0 0 1px rgba(255, 106, 82, 0.6), 0 0 14px rgba(255, 106, 82, 0.28);
}

.dtc-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.dtc-hdr .t {
  font-size: 24px;
  font-weight: 800;
  color: #ffba63;
  line-height: 1;
}

.dtc-hdr .m {
  font-size: 11px;
  color: #d0b089;
}

.ev {
  margin: 0 0 6px 0;
  border: 1px solid #7b5528;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 10px;
  color: #ffd6a4;
  background: linear-gradient(90deg, rgba(255, 173, 94, 0.2), rgba(255, 173, 94, 0.06));
}

.ev.alert {
  border-color: #ff6a52;
  color: #ffb8aa;
  background: linear-gradient(90deg, rgba(255, 106, 82, 0.24), rgba(255, 106, 82, 0.08));
}

.dtc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
  min-width: 0;
  padding-right: 2px;
}

.dtc-item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #432f1f;
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(13, 12, 14, 0.55);
  font-size: 12px;
  line-height: 1.25;
  color: #f4ece3;
  overflow-wrap: anywhere;
}

.dtc-item .code {
  font-weight: 700;
  margin-right: 4px;
}

.sev-critical .code {
  color: #ff8ea5;
}

.sev-warning .code {
  color: #ffcf86;
}

.sev-info .code {
  color: #ffc989;
}

.logo-watermark {
  position: absolute;
  z-index: 22;
  right: 10px;
  bottom: 8px;
  width: 54px;
  height: 54px;
  opacity: 0.36;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 168, 82, 0.4));
}

.race-pane {
  position: relative;
  width: 50vw;
  height: 100%;
  background: #06080c;
  border-left: 2px solid #10151f;
  overflow: hidden;
}

.map {
  width: 100%;
  height: 100%;
  filter: saturate(1.2) contrast(1.05) brightness(0.92);
}

.race-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.35), rgba(6, 8, 12, 0.88));
  border: 1px solid rgba(255, 154, 47, 0.35);
  border-radius: 12px;
  padding: 8px;
  backdrop-filter: blur(3px);
}

.race-title {
  color: #ffb45b;
  font-size: 11px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 700;
}

.race-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
}

.race-k {
  color: #9fb1c7;
  font-size: 11px;
}

.race-v {
  color: #ecf4ff;
  font-size: 12px;
  font-family: "Orbitron", monospace;
}

.race-v2 {
  color: #96a7bb;
  font-size: 10px;
}

@media (max-width: 1100px) {
  html,
  body,
  #root,
  .dashboard-root {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  .dashboard-root {
    flex-direction: column;
  }

  .v5,
  .race-pane {
    width: 100%;
  }

  .v5 {
    min-height: 680px;
  }

  .race-pane {
    min-height: 55vh;
  }
}
