/* TL-09: ตำนานรถยนต์และมอเตอร์ไซค์ยอดฮิตบนท้องถนนเมืองไทย (1960–2025)
   Layout #9: Automotive Driver Cockpit, Sweeping Speedometer/RPM Gauge & Thai Highway Milestone Signs */

:root {
  --bg-primary: #18130f;
  --bg-secondary: #251d16;
  --cockpit-frame: #2e231a;
  --accent: #e8a849;
  --accent-glow: rgba(232, 168, 73, 0.35);
  --highway-green: #0b5d3b;
  --text-main: #f7eedc;
  --text-muted: #c2b092;
  --plate-bg: #111111;
  --plate-border: #e5e5e5;
  --plate-text: #ffffff;
  --era-font: 'Prompt', 'Sarabun', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--era-font);
  overflow: hidden;
  transition: background-color 0.55s ease, color 0.45s ease;
  user-select: none;
}

/* Subtle asphalt & dashboard carbon texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 30% 35%, var(--accent-glow), transparent 55%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 28px
    );
  pointer-events: none;
  z-index: 0;
}

.cockpit-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100vw;
  height: 100vh;
  padding: 10px 16px 10px;
  gap: 10px;
}

/* ============================================================
   1. TOP BAR: OVERHEAD THAI GREEN HIGHWAY SIGNBOARD
   ============================================================ */
.highway-gantry {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #0e6f47 0%, var(--highway-green) 60%, #07472c 100%);
  border: 3px solid #f4f7f5;
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(6, 54, 34, 0.9),
    inset 0 2px 12px rgba(255, 255, 255, 0.18);
}

/* Reflective highway sign corner rivets */
.highway-gantry::before,
.highway-gantry::after {
  content: "•";
  position: absolute;
  top: 4px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  line-height: 1;
}
.highway-gantry::before { left: 8px; }
.highway-gantry::after { right: 8px; }

.gantry-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Thai National Highway Shield Badge */
.highway-shield {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #111111;
  border: 2.5px solid #111111;
  border-radius: 8px 8px 14px 14px;
  padding: 2px 10px 4px;
  min-width: 64px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.shield-crown {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0b5d3b;
  border-bottom: 1.5px solid #111;
  width: 100%;
  text-align: center;
}

.shield-num {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.05;
  color: #111111;
}

.gantry-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gantry-route-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffe066;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gantry-main-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Dynamic Thai License Plate Badge */
.gantry-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thai-license-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  padding: 4px 16px;
  border-radius: 7px;
  background: var(--plate-bg);
  border: 2.5px solid var(--plate-border);
  color: var(--plate-text);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
  position: relative;
}

.plate-screws {
  position: absolute;
  top: 4px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.plate-screws span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.plate-number {
  font-family: 'Sarabun', 'Kanit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.plate-province {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

/* Right Controls on Highway Sign */
.gantry-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gantry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.32);
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gantry-btn:hover {
  background: #ffffff;
  color: #084c30;
  transform: translateY(-1px);
}

.gantry-btn.active {
  background: #ffe066;
  color: #111111;
  border-color: #111111;
  box-shadow: 0 0 14px rgba(255, 224, 102, 0.7);
}

/* ============================================================
   2. MAIN COCKPIT GRID (LEFT/CENTER INSTRUMENT + RIGHT MANUAL)
   ============================================================ */
.cockpit-main {
  display: grid;
  grid-template-columns: 1.28fr 1fr;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

/* LEFT/CENTER ZONE: DRIVER COCKPIT SPEEDOMETER & WINDSHIELD SHOWROOM */
.driver-cluster {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  background: linear-gradient(155deg, var(--bg-secondary) 0%, var(--cockpit-frame) 100%);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 14px;
  box-shadow:
    inset 0 2px 24px rgba(0, 0, 0, 0.65),
    0 10px 28px rgba(0, 0, 0, 0.45);
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.cluster-top-bay {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 14px;
  min-height: 0;
  align-items: stretch;
}

/* Live Sweeping Speedometer / RPM Tachometer Arc Pod */
.tachometer-pod {
  background: radial-gradient(circle at 50% 52%, #191d24 0%, #0b0d11 78%, #050608 100%);
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.95),
    0 4px 16px rgba(0, 0, 0, 0.5);
  position: relative;
}

.tacho-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.gear-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 0 10px var(--accent-glow);
}

.tacho-svg-wrap {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 0.88;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tacho-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

#gaugeNeedleGroup {
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: 120px 125px;
}

#gaugeActiveArc {
  transition: stroke-dashoffset 0.52s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s ease;
}

.tacho-digital-readout {
  text-align: center;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 5px 10px;
  width: 100%;
}

.digital-year-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: 'Chakra Petch', monospace;
}

.digital-ce {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  line-height: 1;
}

.digital-be {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0.9;
}

.digital-sub {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.shift-paddle-row {
  display: flex;
  width: 100%;
  gap: 8px;
  margin-top: 4px;
}

.paddle-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  border-radius: 8px;
  padding: 5px 8px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.paddle-btn:hover {
  background: var(--accent);
  color: #111111;
  border-color: var(--accent);
}

/* Panoramic Windshield / Showroom Stage */
.windshield-stage {
  position: relative;
  background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.55) 100%);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.65);
}

.windshield-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}

.era-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-glow);
}

.scroll-hint-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.vehicle-svg-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  position: relative;
  z-index: 2;
}

.vehicle-svg-canvas svg {
  width: 100%;
  height: 100%;
  max-height: 235px;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.65));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.windshield-stage:hover .vehicle-svg-canvas svg {
  transform: scale(1.02) translateY(-2px);
}

.windshield-caption {
  z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.45) 100%);
  border-left: 4px solid var(--accent);
  padding: 7px 12px;
  border-radius: 0 10px 10px 0;
}

.vehicle-headline {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.vehicle-subline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

/* 4 Performance & Culture Dashboard Pods */
.spec-gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.spec-pod {
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-top: 2.5px solid var(--accent);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.35s ease, transform 0.2s ease;
}

.spec-pod:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.58);
}

.spec-pod-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.spec-pod-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

/* ============================================================
   3. RIGHT ZONE: GARAGE SERVICE MANUAL & ROAD CULTURE LOG
   ============================================================ */
.service-manual-panel {
  background: linear-gradient(165deg, var(--bg-secondary) 0%, rgba(10, 12, 16, 0.92) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.45);
}

.manual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.manual-book-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 0 12px var(--accent-glow);
}

.manual-heading-group h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.manual-heading-group p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.manual-stamp {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  transform: rotate(-2deg);
}

/* Story Log Box */
.manual-story-box {
  background: rgba(0, 0, 0, 0.32);
  border-radius: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.manual-story-text {
  font-size: 0.86rem;
  line-height: 1.62;
  color: var(--text-main);
  text-align: justify;
}

/* Iconic Bumper Sticker / Modification Banner */
.bumper-sticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 7px 12px;
}

.sticker-tag-label {
  background: var(--accent);
  color: #111111;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.sticker-tag-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

/* 3 Road Memory Highlights */
.highlights-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.highlights-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--accent);
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
  line-height: 1.42;
  color: var(--text-main);
}

.hl-bullet {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 800;
  color: var(--accent);
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ============================================================
   4. BOTTOM BAR: THAI HIGHWAY MILEPOST STRIP (16 ERAS)
   ============================================================ */
.highway-milepost-strip {
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 5px;
  align-items: center;
  position: relative;
}

.milepost-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 2px 4px;
  border-radius: 8px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Chakra Petch', sans-serif;
  transition: all 0.22s ease;
}

/* Concrete Thai Kilometer Post Cap */
.milepost-btn::before {
  content: "";
  width: 65%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  margin-bottom: 2px;
}

.milepost-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateY(-2px);
}

.milepost-btn.active {
  background: var(--accent);
  color: #111111;
  border-color: #ffffff;
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-3px);
}

.milepost-btn.active::before {
  background: #111111;
}

.mp-km {
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.85;
  line-height: 1;
}

.mp-year {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
}

.mp-be {
  font-size: 0.58rem;
  opacity: 0.8;
  line-height: 1;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1180px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }
  .cockpit-shell {
    height: auto;
    min-height: 100vh;
  }
  .cockpit-main {
    grid-template-columns: 1fr;
  }
  .highway-milepost-strip {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 760px) {
  .highway-gantry {
    flex-direction: column;
    align-items: stretch;
  }
  .gantry-center {
    justify-content: space-between;
  }
  .cluster-top-bay {
    grid-template-columns: 1fr;
  }
  .spec-gauges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .highway-milepost-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}
