* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #111;
  color: #fefefe;
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1c2440 0%, #0c0f1a 45%, #070710 100%);
  color: #fefefe;
  z-index: 40;
  transition: opacity 0.6s ease;
}

.loading-screen.loaded {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  padding: 2rem 2.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  min-width: min(90vw, 440px);
}

.loading-title {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.loading-subtitle {
  margin: 0 0 1.2rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8ad3ff;
}

.loading-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d2ff, #3a7bd5);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.6);
}

.loading-percent {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #00d2ff;
}

.loading-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  min-height: 1.2em; /* Evita que o layout pule */
  transition: color 0.3s;
}

#scene-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  z-index: 12;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.image-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.image-overlay > * {
  pointer-events: auto;
}

.info-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #00d2ff, #3a7bd5);
  color: #0b1020;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.info-card {
  margin-top: 0.75rem;
  padding: 1rem 1.15rem;
  width: min(360px, 70vw);
  border-radius: 0.8rem;
  background: rgba(10, 12, 25, 0.92);
  border: 1px solid rgba(0, 210, 255, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  line-height: 1.5;
}

.info-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.info-room {
  margin: 0 0 0.35rem 0;
  color: #8ad3ff;
  font-weight: 600;
}

.info-card p {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
}

.info-credits {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.info-credits-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  margin-right: 0.3rem;
}

.info-credits a {
  color: #8ad3ff;
  text-decoration: underline;
  text-decoration-color: rgba(138, 211, 255, 0.6);
}

.info-credits a:focus,
.info-credits a:hover {
  color: #b7e4ff;
}

.info-card p:last-child {
  margin-bottom: 0;
}

#hud {
  position: fixed;
  top: 1rem;
  left: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 15, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  width: min(240px, 24vw);
  max-width: 240px;
  min-width: 180px;
  font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.9rem);
  line-height: 1.45;
  z-index: 10;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

#hud .hud-toggle {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 12, 25, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  cursor: pointer;
}

#hud.collapsed .responsibility-blurb,
#hud.collapsed ul {
  display: none;
}

#hud.collapsed {
  overflow: hidden;
  width: fit-content;
  max-width: 92vw;
  min-width: 0;
  padding-right: 2.7rem;
}

#hud h1 {
  margin: 0 0 0.5rem 0;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.room-label {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8ad3ff;
}

#hud .responsibility-blurb {
  margin: 0 0 0.75rem 0;
  font-size: clamp(0.78rem, 0.75rem + 0.2vw, 0.86rem);
  color: #b7d4ff;
}

#hud ul {
  padding-left: 1.1rem;
  margin: 0;
}

#telemetry.telemetry-panel {
  position: fixed;
  top: 3.75rem;
  right: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  max-width: min(320px, 40vw);
  font-size: 0.9rem;
  line-height: 1.35;
  z-index: 11;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.telemetry-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #00d2ff, #3a7bd5);
  color: #0b1020;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 12;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.telemetry-toggle:active {
  transform: translateY(1px);
}

.telemetry-toggle:focus-visible {
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

.opinions-button {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  height: 40px;
  border-radius: 999px;
  padding: 0 0.95rem;
  border: 1px solid rgba(0, 210, 255, 0.22);
  background: rgba(10, 12, 25, 0.8);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.opinions-button:active {
  transform: translateY(1px);
}

.opinions-button:focus-visible {
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

.tour-menu-toggle {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  height: 46px;
  border-radius: 999px;
  padding: 0 1.05rem;
  border: 1px solid rgba(0, 210, 255, 0.22);
  background: rgba(10, 12, 25, 0.8);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 12;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.tour-menu-toggle:active {
  transform: translateY(calc(-50% + 1px));
}

.tour-menu-toggle:focus-visible {
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

.minimap-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  height: 44px;
  border-radius: 999px;
  padding: 0 0.95rem;
  border: none;
  background: rgba(10, 12, 25, 0.8);
  border: 1px solid rgba(0, 210, 255, 0.22);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 12;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.minimap-toggle:active {
  transform: translateY(1px);
}

.minimap-toggle:focus-visible {
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

.minimap {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(220px, 42vw);
  padding: 0.9rem 1rem 0.95rem;
  border-radius: 0.75rem;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.22);
  backdrop-filter: blur(6px);
  z-index: 11;
  pointer-events: auto;
}

.minimap.expanded {
  width: min(560px, 86vw);
  max-height: 72vh;
  overflow: auto;
  z-index: 20;
}

.minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.minimap-actions {
  display: inline-flex;
  gap: 0.45rem;
}

.minimap-action {
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(230, 246, 255, 0.92);
  font-weight: 900;
  font-size: 0.75rem;
  cursor: pointer;
}

.minimap-action:active {
  transform: translateY(1px);
}

.minimap-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: #8ad3ff;
}

.minimap-canvas {
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 12, 25, 0.75);
  display: block;
  cursor: pointer;
}

.minimap-legend {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.6rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.82);
}

.minimap-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
  border-radius: 0.35rem;
}

.minimap-legend-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.minimap-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 10px;
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

#telemetry h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.telemetry-copy {
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: #0b1020;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.telemetry-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
}

.telemetry-copy:active {
  transform: translateY(1px);
}

.telemetry-copy:focus-visible {
  outline: 2px solid rgba(0, 210, 255, 0.7);
  outline-offset: 2px;
}

.telemetry-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.telemetry-grid .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9bc9ff;
}

.telemetry-grid .value {
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.95rem;
}

.eniac-mockup-controls {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(155, 201, 255, 0.25);
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.eniac-mockup-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9bc9ff;
}

.eniac-mockup-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(155, 201, 255, 0.82);
}

.eniac-mockup-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.eniac-adjust-btn {
  padding: 0.38rem 0.5rem;
  border-radius: 0.65rem;
}

.eniac-mockup-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: #9bc9ff;
}

.eniac-step-input {
  width: 92px;
  border-radius: 0.45rem;
  border: 1px solid rgba(155, 201, 255, 0.32);
  background: rgba(4, 12, 26, 0.88);
  color: #e9f3ff;
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.28rem 0.42rem;
}

.eniac-mockup-data {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border-radius: 0.55rem;
  border: 1px solid rgba(155, 201, 255, 0.28);
  background: rgba(4, 12, 26, 0.82);
  color: #e9f3ff;
  font-family: 'Roboto Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 0.45rem 0.55rem;
}

.joystick-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  touch-action: none;
}

.joystick-base {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  position: relative;
}

.joystick-thumb {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -22px;
  margin-left: -22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: transform 0.1s ease-out;
}

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0b1020;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: white;
}

.rotate-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.rotate-icon {
  font-size: 4rem;
  animation: rotate-anim 2s infinite ease-in-out;
}

.rotate-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #00d2ff;
}

.rotate-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
}

@keyframes rotate-anim {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-90deg); }
  75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: landscape) {
  .rotate-overlay {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .rotate-overlay {
    display: none !important;
  }
}

/* Fallback: Se não for touch, não mostramos */
@media (pointer: fine) {
  .rotate-overlay {
    display: none !important;
  }
}

/* Otimização de UI para Mobile */
@media (max-width: 768px) {
  #hud {
    top: auto;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(88vw, 280px);
    max-width: 90vw;
    background: rgba(15, 15, 20, 0.85);
    max-height: 42vh;
    overflow: auto;
  }

  .joystick-container {
    bottom: 2rem;
    left: 1rem;
  }

  .tour-ui {
    flex-direction: column;
    bottom: 8rem; /* Sobe para não bater no joystick/hud */
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .tour-status {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .tour-controls {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }

  .tour-control-wide {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .joystick-container {
    transform: scale(0.85);
    left: 0.5rem;
    bottom: 1rem;
  }

  #hud {
    bottom: 1rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    width: min(92vw, 260px);
    max-height: 40vh;
  }

  .tour-ui {
    bottom: 7rem;
  }
}

@media (max-height: 480px) and (pointer: coarse) {
  #hud {
    top: auto;
    bottom: 0.6rem;
    left: 0.6rem;
    transform: none;
    padding: 0.55rem 0.65rem;
    width: min(42vw, 220px);
    max-width: 42vw;
    min-width: 0;
    font-size: 0.72rem;
    max-height: 56vh;
    overflow: auto;
  }

  #hud h1 {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
  }

  #hud .responsibility-blurb,
  #hud ul {
    display: none;
  }

  .telemetry-toggle {
    top: 0.6rem;
    right: 0.6rem;
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .opinions-button {
    top: 3.4rem;
    right: 0.6rem;
    height: 32px;
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }

  .minimap-toggle {
    right: 0.6rem;
    bottom: 0.6rem;
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.85rem;
  }

  .joystick-container {
    width: 96px;
    height: 96px;
    bottom: 0.6rem;
    left: 0.6rem;
  }

  .joystick-base {
    width: 78px;
    height: 78px;
    border-width: 1px;
  }

  .joystick-thumb {
    width: 34px;
    height: 34px;
    margin-top: -17px;
    margin-left: -17px;
  }

  .tour-controls {
    bottom: 0.6rem;
    gap: 0.35rem;
  }

  .tour-controls-main {
    padding: 0.45rem 0.6rem;
    gap: 0.5rem;
  }

  .tour-control {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .tour-control-wide {
    min-width: 110px;
    padding: 0 0.7rem;
    font-size: 0.85rem;
  }

  .tour-status {
    min-width: min(46vw, 280px);
  }

  .tour-station-count {
    font-size: 0.78rem;
  }

  .tour-exit {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

.message {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: #111;
  z-index: 30;
}

.message p {
  max-width: 480px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.start-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 35;
  background: radial-gradient(circle at 20% 20%, rgba(28, 36, 64, 0.85) 0%, rgba(7, 7, 16, 0.92) 70%);
}

.start-menu-card {
  width: min(560px, 92vw);
  padding: 1.6rem 1.65rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
}

.start-menu-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.start-menu-subtitle {
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(230, 246, 255, 0.9);
  margin-bottom: 1.2rem;
}

.start-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.start-menu-section {
  margin-top: 1rem;
}

.start-menu-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(155, 201, 255, 0.9);
  margin-bottom: 0.5rem;
}

.start-menu-route-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.start-menu-select {
  width: 100%;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 25, 0.65);
  color: #fefefe;
  font-weight: 600;
}

.start-menu-button {
  border-radius: 0.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fefefe;
  font-weight: 800;
  cursor: pointer;
}

.start-menu-button.primary {
  border: none;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: #0b1020;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.start-menu-link {
  background: transparent;
  border: none;
  padding: 0;
  color: #8ad3ff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(138, 211, 255, 0.55);
}

.start-menu-howto {
  margin-top: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(10, 12, 25, 0.75);
  border: 1px solid rgba(0, 210, 255, 0.18);
  color: rgba(230, 246, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  line-height: 1.35;
  font-size: 0.95rem;
}

.tour-controls {
  position: fixed;
  left: 50%;
  bottom: 1.05rem;
  transform: translateX(-50%);
  z-index: 16;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: auto;
}

.tour-controls-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.22);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.tour-control {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fefefe;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.tour-control:active {
  background: rgba(0, 198, 255, 0.55);
}

.tour-control-wide {
  width: auto;
  min-width: 140px;
  padding: 0 0.95rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.tour-control-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.tour-control-text {
  font-weight: 900;
  white-space: nowrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.62);
  z-index: 50;
}

.modal-card {
  width: min(520px, 94vw);
  border-radius: 1rem;
  background: rgba(10, 12, 25, 0.94);
  border: 1px solid rgba(0, 210, 255, 0.25);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  padding: 1.2rem 1.25rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e6f6ff;
}

.modal-subtitle {
  margin-top: 0.35rem;
  color: rgba(230, 246, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal-summary {
  margin-top: 0.75rem;
  white-space: pre-line;
  font-size: 0.9rem;
  color: rgba(230, 246, 255, 0.9);
}

.modal-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.modal-list li {
  padding: 0.45rem 0.65rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 800;
  font-size: 0.88rem;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-button {
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 900;
  cursor: pointer;
}

.modal-button:active {
  transform: translateY(1px);
}

.modal-primary {
  border: none;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: #0b1020;
}

.tour-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: min(52vw, 420px);
}

.tour-station-title {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #e6f6ff;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.tour-station-count {
  margin-top: 0.18rem;
  font-size: 0.85rem;
  color: rgba(155, 201, 255, 0.95);
}

.tour-mission {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: rgba(230, 246, 255, 0.78);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-exit {
  align-self: center;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 25, 0.6);
  color: rgba(230, 246, 255, 0.95);
  font-weight: 800;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  z-index: 36;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(10, 12, 25, 0.92);
  border: 1px solid rgba(0, 210, 255, 0.28);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  color: rgba(230, 246, 255, 0.95);
  max-width: min(680px, 92vw);
  text-align: center;
}

.badge-toast {
  position: fixed;
  left: 50%;
  top: 4.2rem;
  transform: translateX(-50%);
  z-index: 36;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(10, 12, 25, 0.92);
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  color: rgba(255, 241, 206, 0.98);
  max-width: min(680px, 92vw);
  text-align: center;
}

.badge-toast-text {
  font-weight: 900;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .start-menu-actions {
    grid-template-columns: 1fr;
  }

  .tour-status {
    min-width: min(58vw, 360px);
  }

  .tour-control-wide {
    min-width: 120px;
    padding: 0 0.75rem;
    font-size: 0.9rem;
  }

  #hud {
    width: min(76vw, 245px);
    max-width: 76vw;
    min-width: 0;
    font-size: 0.82rem;
  }

  #telemetry.telemetry-panel {
    position: static;
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }

  .minimap {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
  }
}
