:root {
  --police-blue: #0077ff;
  --police-cyan: #00f0ff;
  --police-dark: #070d18;
  --police-gold: #ffb700;
  --police-red: #ff3344;
  --police-green: #00ff88;
  --hud-bg: rgba(7, 13, 24, 0.85);
  --hud-border: rgba(0, 240, 255, 0.4);
  --hud-font: 'Share Tech Mono', monospace;
  --ui-font: 'Chakra Petch', sans-serif;
}

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

button, input, select, .start-btn, .tactical-btn, .scenario-card, .modal-card, .modal-overlay {
  touch-action: manipulation !important;
  pointer-events: auto !important;
  cursor: pointer;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--police-dark);
  font-family: var(--ui-font);
  color: #ffffff;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Photo Capture Flash Overlay */
.photo-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 99;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.photo-flash.hidden {
  opacity: 0;
  display: none !important;
}

/* FLIR / Thermal Overlay Effect */
#thermal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 255, 128, 0.2);
}

#thermal-overlay.hidden {
  display: none;
}

.thermal-scanline {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
}

.thermal-badge {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 255, 128, 0.2);
  border: 1px solid var(--police-green);
  color: var(--police-green);
  padding: 4px 14px;
  font-family: var(--hud-font);
  font-size: 13px;
  letter-spacing: 2px;
  border-radius: 4px;
  text-shadow: 0 0 8px var(--police-green);
}

/* HUD Layer */
#hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 18px;
}

/* Top Telemetry Header */
.hud-top-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* The full desktop button row is about 860px wide. Reserve that space so
     the mission timer can never sit underneath the photo button. */
  width: auto;
  max-width: calc(100% - 900px);
  margin: 0;
  gap: 10px;
  flex-wrap: nowrap;
}

.hud-box {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  padding: 6px 14px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  font-family: var(--hud-font);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.squad-info,
.mission-timer-box,
.battery-box {
  flex: 0 0 auto;
}

.scenario-info {
  flex: 1 1 360px;
  min-width: 0;
}

.scenario-info > div {
  min-width: 0;
  width: 100%;
}

.scenario-info .hud-label,
.scenario-info .hud-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: contain;
  border: 1px solid var(--police-cyan);
}

.hud-label {
  font-size: 10px;
  color: #8fa0b5;
  letter-spacing: 1px;
}

.hud-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--police-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.hud-value.highlight {
  color: var(--police-gold);
}

/* Battery Bar */
.battery-bar-container {
  width: 60px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin: 2px auto;
  border: 1px solid rgba(255,255,255,0.3);
}

.battery-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ff88, #00f0ff);
  transition: width 0.3s ease, background 0.3s ease;
}

.battery-fill.low {
  background: var(--police-red);
}

/* Side Telemetry Panels */
.hud-panel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.left-panel {
  left: 20px;
}

.right-panel {
  right: 20px;
}

.gauge-card {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-left: 3px solid var(--police-cyan);
  padding: 10px 16px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.right-panel .gauge-card {
  border-left: 1px solid var(--hud-border);
  border-right: 3px solid var(--police-cyan);
  text-align: right;
}

.gauge-title {
  font-family: var(--hud-font);
  font-size: 11px;
  color: #9ab0ca;
  letter-spacing: 1px;
}

.gauge-big-num {
  font-family: var(--hud-font);
  font-size: 26px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.gauge-big-num small {
  font-size: 14px;
  color: var(--police-cyan);
}

.gauge-sub {
  font-family: var(--hud-font);
  font-size: 12px;
  color: var(--police-gold);
  margin-top: 2px;
}

/* Gimbal Slider */
.gimbal-slider-container {
  margin-top: 6px;
}

.gimbal-slider-container input[type="range"] {
  width: 100%;
  accent-color: var(--police-cyan);
}

/* Target Lock Box */
.target-box {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px dashed var(--police-red);
  padding: 6px 12px;
  background: rgba(255, 51, 68, 0.18);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pulse-target 1s infinite alternate;
}

.target-box.hidden {
  display: none !important;
}

@keyframes pulse-target {
  from { border-color: var(--police-red); transform: translate(-50%, -50%) scale(1); }
  to { border-color: #ff8899; transform: translate(-50%, -50%) scale(1.06); }
}

.target-tag {
  font-family: var(--hud-font);
  font-size: 11px;
  color: var(--police-red);
  font-weight: bold;
  letter-spacing: 1px;
}

.target-dist {
  font-family: var(--hud-font);
  font-size: 14px;
  color: #ffffff;
  font-weight: bold;
}

/* Compass Bar */
.compass-bar {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 32px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.compass-marker {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--police-gold);
  font-size: 10px;
  z-index: 2;
}

.compass-tape {
  font-family: var(--hud-font);
  font-size: 13px;
  color: var(--police-cyan);
  white-space: nowrap;
  line-height: 32px;
  transition: transform 0.1s linear;
  text-align: center;
}

/* Action Buttons Bar */
.hud-action-buttons {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 55vw;
}

.tactical-btn {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--ui-font);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tactical-btn:hover, .tactical-btn:active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--police-cyan);
  transform: translateY(-2px);
}

.tactical-btn.warning-btn:hover {
  background: rgba(255, 51, 68, 0.3);
  border-color: var(--police-red);
}

.tactical-btn.highlight-btn {
  background: linear-gradient(135deg, rgba(0, 119, 255, 0.6), rgba(0, 240, 255, 0.6));
  border-color: var(--police-cyan);
}

/* On narrower desktops, collapse buttons to icons only so they stay clear of
   the header and never overlap the battery/telemetry boxes. */
@media (min-width: 901px) and (max-width: 1600px) {
  .hud-top-bar {
    max-width: calc(100% - 430px);
  }

  .hud-action-buttons {
    max-width: 400px;
  }

  .tactical-btn .btn-text {
    display: none;
  }
  .tactical-btn {
    padding: 8px 11px;
  }
}

/* Minimap */
.minimap-container {
  position: absolute;
  top: 120px;
  right: 20px;
  width: 130px;
  height: 130px;
  background: var(--hud-bg);
  border: 2px solid var(--police-cyan);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

#minimap-canvas {
  width: 100%;
  height: 100%;
}

.minimap-label {
  position: absolute;
  bottom: 0px;
  width: 100%;
  text-align: center;
  font-family: var(--hud-font);
  font-size: 8px;
  color: var(--police-cyan);
  background: rgba(7, 13, 24, 0.85);
  letter-spacing: 0.5px;
  padding: 2px 0;
}

/* Dual Joysticks Touch Area */
.joystick-zone {
  position: absolute;
  bottom: 30px;
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
  touch-action: none !important;
  overscroll-behavior: contain;
  z-index: 20;
}

#joystick-left-zone {
  left: 20px;
}

#joystick-right-zone {
  right: 20px;
}

.joystick-base {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, rgba(7, 13, 24, 0.6) 80%);
  border: 2px solid rgba(0, 240, 255, 0.4);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.2), 0 4px 20px rgba(0,0,0,0.4);
}

.joystick-handle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--police-cyan) 0%, var(--police-blue) 100%);
  border: 2px solid #ffffff;
  position: absolute;
  box-shadow: 0 0 15px var(--police-cyan);
  transition: transform 0.05s ease-out;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hud-action-buttons {
    top: auto;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    gap: 4px;
  }

  .tactical-btn {
    padding: 7px 9px;
  }

  .tactical-btn .btn-text {
    display: none;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  #hud-layer {
    padding: 6px 8px;
  }

  .hud-top-bar {
    max-width: none;
    gap: 4px;
  }

  .hud-top-bar .squad-info {
    display: none;
  }

  .hud-box {
    padding: 4px 7px;
    gap: 4px;
  }

  .scenario-info {
    flex: 1;
    min-width: 0;
  }

  .hud-label {
    font-size: 8px;
  }

  .hud-value {
    font-size: 11px;
  }

  .battery-bar-container {
    width: 42px;
  }

  .compass-bar {
    top: 48px;
    width: min(300px, 48vw);
    height: 26px;
  }

  .compass-tape {
    font-size: 10px;
    line-height: 26px;
  }

  .hud-panel {
    top: 82px;
    transform: none;
    gap: 6px;
  }

  .left-panel {
    left: max(8px, env(safe-area-inset-left));
  }

  .right-panel {
    right: max(8px, env(safe-area-inset-right));
  }

  .gauge-card {
    min-width: 104px;
    width: 104px;
    padding: 6px 8px;
  }

  .gauge-title {
    font-size: 8px;
  }

  .gauge-big-num {
    font-size: 19px;
  }

  .gauge-big-num small,
  .gauge-sub {
    font-size: 9px;
  }

  .gimbal-slider-container {
    margin-top: 2px;
  }

  .minimap-container {
    display: none;
  }

  .joystick-zone {
    bottom: max(5px, env(safe-area-inset-bottom));
    width: 120px;
    height: 126px;
  }

  #joystick-left-zone {
    left: max(6px, env(safe-area-inset-left));
  }

  #joystick-right-zone {
    right: max(6px, env(safe-area-inset-right));
  }

  .joystick-base {
    width: 108px;
    height: 108px;
  }

  .joystick-handle {
    width: 42px;
    height: 42px;
  }

  .stick-label {
    margin-top: 2px;
    font-size: 8px;
  }

  .tactical-btn {
    min-width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 6px 8px;
  }

  #modal-results {
    padding: 6px;
  }

  #modal-results .evaluation-card {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 12px);
    padding: 8px 12px;
    gap: 6px;
    overflow-y: auto;
  }

  .evaluation-card .modal-logo-small {
    display: none;
  }

  .evaluation-card .modal-header h2 {
    font-size: 16px;
    line-height: 1.2;
  }

  .evaluation-card .modal-header .sub-header {
    font-size: 10px;
  }

  .evaluation-card .eval-body {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
  }

  .evaluation-card .grade-circle {
    width: 62px;
    height: 62px;
    margin: 0;
    font-size: 36px;
    line-height: 62px;
  }

  .evaluation-card .eval-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 0;
  }

  .evaluation-card .stat-item {
    min-width: 0;
    padding: 5px;
  }

  .evaluation-card .stat-label {
    font-size: 8px;
    line-height: 1.2;
  }

  .evaluation-card .stat-val {
    font-size: 12px;
  }

  .evaluation-card .eval-feedback {
    grid-column: 1 / -1;
    padding: 5px 8px;
    font-size: 10px;
    line-height: 1.3;
  }

  .evaluation-card .modal-footer {
    flex-wrap: nowrap;
    gap: 6px !important;
    padding-top: 6px;
  }

  .evaluation-card .start-btn {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
}

.stick-label {
  font-family: var(--hud-font);
  font-size: 10px;
  color: #a0b5ce;
  margin-top: 6px;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 14, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none !important;
}

.modal-card {
  background: linear-gradient(145deg, rgba(11, 20, 38, 0.98), rgba(7, 13, 24, 0.99));
  border: 1px solid var(--police-cyan);
  box-shadow: 0 10px 40px rgba(0, 240, 255, 0.25);
  border-radius: 14px;
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-header h2 {
  font-size: 22px;
  color: #ffffff;
}

.modal-header .sub-header {
  font-size: 13px;
  color: var(--police-cyan);
  letter-spacing: 1px;
}

.modal-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: contain;
  margin-bottom: 8px;
  border: 1px solid var(--police-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.modal-logo-small {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: contain;
  margin-bottom: 6px;
}

.text-center {
  text-align: center;
}

/* Pilot Registration Box */
.pilot-registration-box {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pilot-input-label {
  font-size: 13px;
  color: var(--police-gold);
  font-weight: bold;
}

.pilot-input-field {
  background: rgba(7, 13, 24, 0.9);
  border: 1px solid var(--police-cyan);
  border-radius: 6px;
  color: #ffffff;
  padding: 8px 12px;
  font-family: var(--ui-font);
  font-size: 15px;
  outline: none;
}

.pilot-input-field:focus {
  border-color: var(--police-gold);
  box-shadow: 0 0 10px rgba(255, 183, 0, 0.3);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

.scenario-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.scenario-card:hover, .scenario-card.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--police-cyan);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.25);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 32px;
}

.card-content h3 {
  font-size: 15px;
  color: #ffffff;
  margin-bottom: 4px;
}

.card-content p {
  font-size: 12px;
  color: #a0b5ce;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-tag {
  font-family: var(--hud-font);
  font-size: 11px;
  color: var(--police-gold);
  background: rgba(255, 183, 0, 0.12);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.control-hint {
  font-size: 12px;
  color: #8fa0b5;
  line-height: 1.4;
}

.start-btn {
  background: linear-gradient(135deg, var(--police-blue), #00d0ff);
  color: #ffffff;
  border: none;
  padding: 12px 28px;
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 119, 255, 0.5);
  transition: all 0.2s ease;
}

.start-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 25px rgba(0, 240, 255, 0.6);
}

.start-btn.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.start-btn.disabled-btn {
  opacity: 0.45;
  filter: grayscale(0.6);
  cursor: not-allowed;
  box-shadow: none;
}

.start-btn.disabled-btn:hover {
  transform: none;
  box-shadow: none;
}

.pilot-input-field.input-error {
  border-color: #ff3344;
  box-shadow: 0 0 0 2px rgba(255, 51, 68, 0.45);
  animation: shakeInput 0.4s ease;
}

@keyframes shakeInput {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Evaluation Card */
.evaluation-card {
  max-width: 580px;
  text-align: center;
}

.grade-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--police-gold) 0%, #d49000 100%);
  color: #070d18;
  font-family: var(--hud-font);
  font-size: 52px;
  font-weight: 900;
  line-height: 90px;
  margin: 10px auto;
  box-shadow: 0 0 30px var(--police-gold);
}

.eval-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 15px 0;
}

.stat-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #8fa0b5;
}

.stat-val {
  font-family: var(--hud-font);
  font-size: 18px;
  font-weight: bold;
  color: var(--police-cyan);
}

.eval-feedback {
  font-size: 14px;
  color: #e0e8f5;
  background: rgba(0, 240, 255, 0.08);
  border-left: 3px solid var(--police-cyan);
  padding: 10px 14px;
  border-radius: 6px;
  text-align: left;
}

/* Certificate Card */
.cert-card {
  max-width: 720px;
  border: 2px solid var(--police-gold);
  box-shadow: 0 0 40px rgba(255, 183, 0, 0.25);
}

.cert-logo-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--police-gold);
}

.cert-title {
  font-size: 22px;
  color: var(--police-gold);
  letter-spacing: 1px;
}

.cert-subtitle {
  font-size: 13px;
  color: var(--police-cyan);
}

.cert-pilot-box {
  margin: 14px 0;
}

.cert-pilot-label {
  font-size: 12px;
  color: #8fa0b5;
}

.cert-pilot-name {
  font-size: 20px;
  color: #ffffff;
  font-weight: bold;
}

.cert-table-wrapper {
  margin: 15px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--hud-font);
  font-size: 13px;
}

.cert-table th, .cert-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.cert-table th {
  background: rgba(0, 240, 255, 0.15);
  color: var(--police-cyan);
}

.cert-table tfoot td {
  background: rgba(255, 183, 0, 0.1);
  color: var(--police-gold);
  font-size: 14px;
}

.total-time-val {
  font-weight: bold;
  font-size: 16px;
}

.cert-badge-footer {
  margin-top: 15px;
  font-size: 12px;
  color: var(--police-gold);
}

.cert-seal {
  font-size: 14px;
  font-weight: bold;
}

/* Orientation Hint for Mobile Portrait */
.in-app-browser-warning {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 119, 255, 0.25), transparent 45%),
    rgba(7, 13, 24, 0.99);
}

.in-app-browser-warning.hidden {
  display: none !important;
}

.browser-warning-content {
  width: min(520px, 100%);
  padding: 28px 22px;
  border: 1px solid var(--police-cyan);
  border-radius: 16px;
  background: rgba(11, 20, 38, 0.98);
  box-shadow: 0 12px 45px rgba(0, 240, 255, 0.2);
}

.browser-warning-icon {
  margin-bottom: 10px;
  font-size: 52px;
}

.browser-warning-content h2 {
  margin-bottom: 10px;
  color: var(--police-gold);
  font-size: clamp(22px, 6vw, 32px);
}

.browser-warning-content p {
  color: #b8c8dc;
  line-height: 1.6;
}

.browser-warning-content .browser-warning-primary {
  margin-bottom: 12px;
  color: #ffffff;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
}

.browser-open-steps {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  color: var(--police-cyan);
  line-height: 1.7;
  background: rgba(0, 240, 255, 0.08);
}

.unsupported-in-app-browser #hud-layer,
.unsupported-in-app-browser #modal-scenarios,
.unsupported-in-app-browser #orientation-warning {
  display: none !important;
}

.orientation-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 13, 24, 0.95);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.orientation-warning.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none !important;
}

.warning-content .rotate-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: rotate-phone 2s infinite ease-in-out;
}

@keyframes rotate-phone {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: portrait) and (max-width: 768px) and (hover: none) {
  .orientation-warning:not(.hidden) {
    display: flex;
  }
}

/* Step-by-step basic flight training overlay */
.training-guide {
  position: absolute;
  top: 92px;
  left: 50%;
  width: min(620px, calc(100vw - 40px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid rgba(0, 240, 255, 0.75);
  border-radius: 10px;
  background: rgba(5, 15, 28, 0.92);
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.24);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 22;
}

.training-guide.hidden { display: none; }

.training-guide-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--police-gold);
  font-weight: 700;
  font-size: 14px;
}

.training-step-text {
  margin: 8px 0;
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.55);
}

.training-direction-arrow {
  width: 82px;
  height: 64px;
  margin: 0 auto 5px;
  color: #ffcf33;
  font-size: 56px;
  font-weight: 700;
  line-height: 64px;
  text-align: center;
  transform-origin: center;
  filter: drop-shadow(0 0 12px rgba(255, 207, 51, 0.9));
  animation: training-direction-pulse 0.75s ease-in-out infinite alternate;
}

@keyframes training-direction-pulse {
  from { opacity: 0.35; scale: 0.82; }
  to { opacity: 1; scale: 1.08; }
}
.training-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

.training-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--police-cyan), var(--police-green));
  transition: width 0.25s ease;
}

.mission-direction-guide {
  position: absolute;
  top: 126px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 168px;
  padding: 7px 15px 5px;
  border: 1px solid rgba(255, 183, 0, 0.9);
  border-radius: 10px;
  background: rgba(5, 15, 28, 0.88);
  box-shadow: 0 0 22px rgba(255, 183, 0, 0.32);
  text-align: center;
  pointer-events: none;
  z-index: 22;
}

.mission-direction-guide.hidden {
  display: none;
}

.mission-direction-label {
  color: #fff2b3;
  font-family: var(--hud-font);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.mission-direction-arrow {
  width: 54px;
  height: 49px;
  margin: 0 auto;
  color: var(--police-gold);
  font-size: 45px;
  font-weight: 700;
  line-height: 49px;
  transform-origin: center;
  filter: drop-shadow(0 0 10px rgba(255, 183, 0, 0.95));
  animation: training-direction-pulse 0.65s ease-in-out infinite alternate;
}

.training-card {
  border-color: rgba(0, 255, 136, 0.7) !important;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.12), rgba(0, 119, 255, 0.12)) !important;
}

@media (max-width: 900px) {
  .training-guide { top: 68px; padding: 8px 12px; }
  .training-guide-header { font-size: 11px; }
  .training-step-text { margin: 5px 0; font-size: 14px; }
  .mission-direction-guide { top: 62px; min-width: 138px; padding: 5px 10px 3px; }
  .mission-direction-arrow { height: 39px; font-size: 36px; line-height: 39px; }
}
.tactical-btn.hidden {
  display: none !important;
}

.tactical-btn.sport-btn.highlight-btn {
  border-color: #ff8a1f;
  color: #ffd27a;
  background: rgba(255, 94, 0, 0.22);
  box-shadow: 0 0 18px rgba(255, 112, 24, 0.55);
}
