:root {
  color: #102131;
  background: #edf4f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "DSEG7";
  src: url("./fonts/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #edf4f7;
}

.record-shell {
  width: min(1240px, 94vw);
  margin: 0 auto;
  padding: 28px 0 42px;
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-title img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.brand-title p {
  margin: 0 0 6px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  color: #b91c1c;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(31, 56, 76, .08);
}

.live-badge span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .14);
}

.live-badge.is-live {
  color: #047857;
}

.live-badge.is-live span {
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, .16);
}

.live-badge.is-stale {
  color: #b91c1c;
}

.hero-grid {
  display: block;
}

.map-layout {
  display: grid;
  gap: 14px;
}

.map-card,
.progress-card,
.telemetry-panel {
  border: 1px solid #d6e2e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 56, 76, .08);
}

.map-card {
  position: relative;
  min-height: 680px;
  overflow: hidden;
}

#recordMap {
  position: relative;
  width: 100%;
  min-height: 560px;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: grab;
  background: #8cb9ca;
}

#recordMap:active {
  cursor: grabbing;
}

.custom-map-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.map-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 7px;
  z-index: 2;
}

.map-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 33, 49, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: #102131;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(15, 33, 49, .12);
  cursor: pointer;
}

.map-controls button:hover {
  background: #fff;
}

.map-coordinate-readout {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 33, 49, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  color: #102131;
  font-family: "Orbitron", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: center;
  box-shadow: 0 8px 20px rgba(15, 33, 49, .12);
}

.telemetry-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: auto;
  min-width: 118px;
  display: grid;
  gap: 0;
  align-content: start;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
  box-shadow: 0 6px 18px rgba(15, 33, 49, .08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #607586;
  font-size: 12px;
  font-weight: 850;
}

.boat-title {
  display: grid;
  gap: 5px;
  padding-bottom: 11px;
  border-bottom: 1px solid #d6e2e8;
}

.boat-title span {
  font-size: 19px;
  font-weight: 950;
}

.boat-title small {
  color: #0f766e;
  font-weight: 850;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.metric-grid article {
  display: grid;
  gap: 3px;
  justify-items: end;
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
}

.metric-grid span,
.progress-label span {
  color: rgba(7, 25, 35, .72);
  font-size: 12px;
  font-weight: 850;
}

.metric-grid span {
  font-family: "Orbitron", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .08em;
}

.metric-grid strong {
  color: #071923;
  font-size: 26px;
  line-height: 1.15;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .75),
    0 0 10px rgba(255, 255, 255, .72);
}

.metric-grid strong,
.panel-head strong,
.progress-label strong {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.metric-grid strong {
  font-family: "DSEG7", "Orbitron", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.boat-title span {
  font-family: "Orbitron", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .03em;
}

.route-progress {
  display: grid;
  gap: 9px;
  padding-top: 8px;
}

.map-progress {
  width: 100%;
  padding: 16px 22px 18px;
  background: transparent;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}


.gate-markers {
  position: relative;
  height: 78px;
  margin: 6px 0 0;
}

.gate-marker {
  position: absolute;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 112px;
  color: #607586;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  transform: translateX(-50%);
}

.gate-marker.is-low {
  top: 34px;
}

.gate-marker:first-child {
  transform: translateX(0);
}

.gate-marker:last-child {
  transform: translateX(-100%);
}

.gate-marker span {
  display: block;
  max-width: 112px;
  white-space: normal;
}

.gate-marker i {
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
}

.gate-marker.passed {
  color: #0f766e;
}

.gate-marker.passed i {
  border-color: #0f766e;
  background: #0f766e;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #d6e2e8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #0f766e;
}

@media (max-width: 900px) {
  .record-header,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .record-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-card {
    min-height: 0;
  }

  #recordMap {
    min-height: 520px;
    height: 520px;
  }

  .telemetry-panel {
    top: 10px;
    right: 10px;
    width: auto;
  min-width: 116px;
  padding: 4px 5px;
    background: rgba(255, 255, 255, .5);
  }

  .metric-grid {
    gap: 7px;
  }

  .metric-grid strong {
    font-size: 24px;
  }

  .metric-grid span {
    font-size: 11px;
  }

  .gate-marker {
    width: 92px;
    font-size: 9px;
  }

  .gate-marker span {
    max-width: 92px;
  }
}
