/* ==========================================================================
   Test drive — clean tank HUD over a full-screen 3D field.
   ========================================================================== */

.page-drive {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  background: #7f93a3;
  color: #e3e9ee;
  font-size: 14px;
}
.td-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}

.td-top {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: var(--z-hud);
  display: flex;
  align-items: center;
  gap: 14px;
}
.td-exit {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(140, 165, 185, 0.35);
  background: rgba(18, 26, 33, 0.82);
  color: #e3e9ee;
  text-decoration: none;
}
.td-exit:hover {
  background: rgba(40, 54, 68, 0.9);
}
.td-title {
  display: grid;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.td-title b {
  font-weight: 600;
  font-size: 16px;
}
.td-title span {
  color: #c9d3dc;
  font-size: 12px;
}

.td-help {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: var(--z-hud);
  width: 220px;
  padding: 8px 12px 10px;
  border: 1px solid rgba(140, 165, 185, 0.3);
  background: rgba(18, 26, 33, 0.78);
  font-size: 13px;
}
.td-help[hidden] {
  display: none;
}
.td-help__title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 600;
}
.td-help__title span {
  color: #8b9aa7;
  font-weight: 400;
  font-size: 12px;
}
.td-help dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}
.td-help dt {
  color: #f0b640;
  font-weight: 600;
}
.td-help dd {
  color: #c9d3dc;
}

.td-cross {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}
.td-gunmark {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}
.td-gunmark span {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border: 2px solid #f0b640;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}
.td-gunmark.is-reloading span {
  border-color: rgba(240, 182, 64, 0.35);
}
.td-hit {
  position: fixed;
  left: 50%;
  top: calc(50% + 70px);
  z-index: 5;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.td-hit.is-on {
  opacity: 1;
  transition: none;
}
.td-hit.is-kill {
  color: #f0b640;
}

.td-status {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: var(--z-hud);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.td-status__dial {
  width: 110px;
  height: 110px;
}
.td-status__text {
  display: grid;
  gap: 1px;
  padding-bottom: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.td-status__text div {
  display: flex;
  gap: 8px;
}
.td-status__text dt {
  width: 44px;
  color: #c9d3dc;
}
.td-status__text dd {
  font-weight: 600;
}

.td-ammo {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: var(--z-hud);
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}
.td-slot {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  width: 128px;
  padding: 5px 8px 8px;
  border: 1px solid rgba(140, 165, 185, 0.3);
  background: rgba(18, 26, 33, 0.75);
  font-size: 12px;
}
.td-slot b {
  grid-row: 1 / span 2;
  color: #8b9aa7;
}
.td-slot__count {
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.td-slot.is-active {
  border-color: #e3e9ee;
  background: rgba(40, 54, 68, 0.85);
}
.td-slot__reload {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}
.td-slot__reload i {
  display: block;
  width: 100%;
  height: 100%;
  background: #f0b640;
}

.td-map {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: var(--z-hud);
  width: 170px;
  height: 170px;
  border: 1px solid rgba(200, 215, 225, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.td-lock {
  position: fixed;
  left: 50%;
  top: 34%;
  z-index: 6;
  padding: 8px 16px;
  background: rgba(18, 26, 33, 0.82);
  border: 1px solid rgba(140, 165, 185, 0.35);
  color: #e3e9ee;
  transform: translateX(-50%);
  pointer-events: none;
}
.td-lock[hidden] {
  display: none;
}

.td-touch {
  display: none;
}

.td-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: #0d1318;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.td-loader.is-done {
  opacity: 0;
  visibility: hidden;
}
.td-loader__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
}
.td-loader__bar {
  width: min(360px, 70vw);
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}
.td-loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b8261d, #ee6a1f);
  transition: width 0.3s ease;
}
.td-loader__label {
  color: #8b9aa7;
  font-size: 13px;
}

/* ---------- touch devices ---------- */
@media (pointer: coarse) {
  .td-help,
  .td-lock,
  .td-status__dial {
    display: none;
  }
  .td-touch {
    display: block;
  }
  .td-stick {
    position: fixed;
    left: 22px;
    bottom: 96px;
    z-index: var(--z-hud);
    width: 120px;
    height: 120px;
    border: 2px solid rgba(230, 235, 238, 0.4);
    border-radius: 50%;
    background: rgba(18, 26, 33, 0.35);
    touch-action: none;
  }
  .td-stick span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border-radius: 50%;
    background: rgba(230, 235, 238, 0.75);
  }
  .td-fire {
    position: fixed;
    right: 22px;
    bottom: 200px;
    z-index: var(--z-hud);
    width: 78px;
    height: 78px;
    border: 2px solid #e27a66;
    border-radius: 50%;
    background: rgba(184, 38, 29, 0.75);
    color: #fff;
    font-weight: 600;
    touch-action: none;
  }
  .td-map {
    width: 120px;
    height: 120px;
  }
  .td-ammo {
    bottom: 10px;
  }
  .td-slot {
    width: 104px;
  }
  .td-status {
    bottom: 10px;
  }
}
@media (max-width: 600px) {
  .td-ammo {
    left: auto;
    right: 150px;
    transform: none;
    flex-direction: column;
  }
  .td-title span {
    display: none;
  }
}
