:root {
  --ink: #0d1633;
  --bg-deep: #070a1a;
  --cyber-yellow: #ffd000;
  --cyber-gold: #ffaa00;
  --neon-cyan: #00f0ff;
  --neon-pink: #ff2a85;
  --neon-green: #39ff74;
  --card-bg: #fffdf5;
  --hud-bg: rgba(13, 22, 51, 0.85);
  --border-line: rgba(13, 22, 51, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.cyber-bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(0, 240, 255, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(255, 208, 0, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 20% 70%, rgba(255, 42, 133, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.game-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 24px;
}

/* Header & Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.2s ease;
}

.nav-back:hover {
  background: var(--cyber-yellow);
  color: var(--ink);
  transform: translateX(-2px);
}

.back-arrow {
  font-size: 16px;
}

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

.game-badge {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--cyber-yellow);
  margin-bottom: 2px;
}

.game-title {
  font-size: clamp(22px, 3.8vw, 32px);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 208, 0, 0.45);
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.pill-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Stage & HUD */
.stage-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.dashboard-hud {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr 1.1fr;
  gap: 12px;
}

.hud-box {
  background: var(--card-bg);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(13, 22, 51, 0.65);
  margin-bottom: 2px;
}

.speed-box {
  background: #fff8d6;
  border-color: #0d1633;
}

.speed-readout {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.speed-readout strong {
  font-size: 28px;
  font-weight: 900;
  color: #0d1633;
  line-height: 1;
}

.speed-readout .unit {
  font-size: 12px;
  font-weight: 800;
  color: #0d1633;
}

.speed-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--cyber-yellow);
}

.speed-tag.jet-speed {
  background: #ff1f6d;
  color: #ffffff;
  animation: pulseTag 0.5s infinite alternate;
}

.speed-tag.stopped {
  background: #dc2626;
  color: #ffffff;
  animation: pulseTag 0.5s infinite alternate;
}

@keyframes pulseTag {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.boost-meter-box {
  background: #ecfcff;
}

.boost-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.boost-ready {
  font-size: 10px;
  font-weight: 900;
  color: #0088cc;
  letter-spacing: 0.08em;
}

.boost-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(13, 22, 51, 0.12);
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--ink);
}

.boost-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d0ff, #ffd000);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.boost-bar-fill.boosting {
  background: linear-gradient(90deg, #ff1f6d, #ffd000);
}

.stat-box strong {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
}

.passengers-box strong {
  color: #0a70ff;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Canvas Viewport */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: min(580px, 65vh);
  background: #080c1f;
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

#cyber-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#cyber-canvas:active {
  cursor: grabbing;
}

/* Supersonic Jet Notice Banner */
.jet-notice {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff0055, #ffaa00);
  border: 3px solid #ffffff;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(255, 0, 85, 0.85), 0 8px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 10;
  animation: bannerPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jet-notice.hidden {
  display: none;
}

.jet-icon {
  font-size: 24px;
}

.jet-notice strong {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.jet-notice small {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.9;
  letter-spacing: 0.06em;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

@keyframes bannerPop {
  from { transform: translateX(-50%) scale(0.7); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Obstacle / Autopilot Emergency Braking Notice */
.obstacle-notice {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(220, 20, 60, 0.95);
  border: 3px solid #ffffff;
  color: #ffffff;
  box-shadow: 0 0 26px rgba(255, 0, 60, 0.9), 0 8px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 12;
  animation: obstaclePulse 0.4s infinite alternate;
}

.obstacle-notice.hidden {
  display: none;
}

.stop-icon {
  font-size: 22px;
}

.obstacle-notice-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.obstacle-notice-text strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.obstacle-notice-text small {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.95;
  letter-spacing: 0.05em;
  color: #fff3f3;
}

@keyframes obstaclePulse {
  from { transform: translateX(-50%) scale(0.97); }
  to { transform: translateX(-50%) scale(1.03); }
}

/* Modal Overlay Screens */
.game-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 31, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 20;
  padding: 10px;
  overflow-y: auto;
}

.game-modal.hidden {
  display: none !important;
}

.modal-card {
  width: min(420px, 94%);
  max-height: calc(100% - 16px);
  overflow-y: auto;
  background: var(--card-bg);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 16px 20px 14px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 6px 8px 0 rgba(0, 0, 0, 0.45);
  position: relative;
  animation: modalEnter 0.25s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-card.mini {
  width: min(320px, 90%);
  padding: 18px 16px;
}

@keyframes modalEnter {
  from { transform: translateY(12px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.badge-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cyber-yellow);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 2px 2px 0 rgba(13, 22, 51, 0.25);
  margin-bottom: 8px;
}

.modal-cybercab-img {
  width: min(85%, 240px);
  height: 90px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 12px rgba(223, 160, 24, 0.4));
  animation: cabFloat 2s ease-in-out infinite alternate;
}

.modal-cybercab-img.robotaxi-photo {
  width: min(92%, 260px);
  height: clamp(80px, 16vh, 110px);
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--ink);
  box-shadow: 0 8px 16px rgba(223, 160, 24, 0.35);
  margin: 0 auto 8px;
}

.cab-hero-avatar {
  font-size: 48px;
  margin-bottom: 6px;
  filter: drop-shadow(0 6px 10px rgba(255, 208, 0, 0.4));
  animation: cabFloat 2s ease-in-out infinite alternate;
}

@keyframes cabFloat {
  from { transform: translateY(0) rotate(-1.5deg); }
  to { transform: translateY(-5px) rotate(1.5deg); }
}

.modal-card h2 {
  font-size: clamp(20px, 3.2vw, 24px);
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.15;
}

.modal-sub {
  font-size: 13px;
  line-height: 1.3;
  color: rgba(13, 22, 51, 0.75);
  margin-bottom: 8px;
}

.quick-tips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  width: 100%;
}

.quick-chip {
  background: #ffffff;
  border: 2px solid rgba(13, 22, 51, 0.14);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: #ffffff;
  border: 2px solid rgba(13, 22, 51, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.feat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink);
}

.feat-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 310px;
  padding: 13px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00d0ff, #0066ff);
  color: #ffffff;
  border: 3px solid var(--ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 5px 0 var(--ink), 0 0 16px rgba(0, 150, 255, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
  animation: startPulse 1.6s ease-in-out infinite alternate;
}

@keyframes startPulse {
  0% { transform: scale(1); box-shadow: 0 5px 0 var(--ink), 0 0 10px rgba(0, 150, 255, 0.3); }
  100% { transform: scale(1.03); box-shadow: 0 6px 0 var(--ink), 0 0 20px rgba(0, 208, 255, 0.65); }
}

.launch-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 7px 0 var(--ink), 0 0 22px rgba(0, 208, 255, 0.8);
  background: linear-gradient(135deg, #2ae0ff, #0077ff);
}

.launch-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 2px 0 var(--ink);
}

.controls-hint {
  font-size: 11px;
  color: rgba(13, 22, 51, 0.65);
  margin-top: 8px;
  font-weight: 600;
}

/* Trip Summary Box */
.trip-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.summary-card {
  background: #ffffff;
  border: 2px solid rgba(13, 22, 51, 0.12);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
}

.summary-card span {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(13, 22, 51, 0.6);
  margin-bottom: 4px;
}

.summary-card strong {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}

.summary-card.highlight {
  background: #fff8cc;
  border-color: var(--cyber-yellow);
}

.summary-card.highlight strong {
  color: #d97706;
}

/* Touch Controls Bar */
.touch-controls {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.35fr 1fr 0.9fr;
  gap: 8px;
  margin-top: 4px;
}

.ctrl-btn {
  height: 64px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: all 0.1s ease;
  user-select: none;
}

.ctrl-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.steer-btn {
  background: #ffffff;
  color: var(--ink);
}

.brake-btn {
  background: linear-gradient(135deg, #ff2a4b, #d90429);
  color: #ffffff;
  border-color: var(--ink);
  font-size: 14px;
}

.brake-btn.stopped {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 0 #065f46, 0 0 16px rgba(16, 185, 129, 0.6);
  animation: drivePulse 1.2s infinite alternate ease-in-out;
}

.brake-btn.stopped:active {
  background: #047857;
  box-shadow: 0 1px 0 #065f46;
}

@keyframes drivePulse {
  from { transform: scale(0.97); }
  to { transform: scale(1.03); }
}

.brake-btn:active {
  background: #a3001b;
}

.honk-btn {
  background: #e6f7ff;
  color: #0077b6;
}

.boost-btn {
  background: linear-gradient(135deg, #ffd000, #ff8800);
  color: var(--ink);
  font-size: 16px;
  border-color: var(--ink);
}

/* Desktop Footer Tips */
.footer-tips {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.footer-tips b {
  color: var(--cyber-yellow);
  font-weight: 800;
}

.footer-tips .dot {
  opacity: 0.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-nav {
    height: 64px;
  }
  .nav-brand {
    display: none;
  }
  .dashboard-hud {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .canvas-wrapper {
    height: min(480px, 58vh);
    border-radius: 20px;
  }
  .touch-controls {
    gap: 8px;
  }
  .ctrl-btn {
    height: 56px;
    font-size: 13px;
  }
  .boost-btn {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .game-shell {
    width: calc(100% - 16px);
  }
  .dashboard-hud {
    grid-template-columns: 1fr 1fr;
  }
  .hud-box {
    padding: 8px 12px;
  }
  .speed-readout strong {
    font-size: 22px;
  }
  .canvas-wrapper {
    height: 52vh;
  }
  .touch-controls {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .honk-btn {
    display: none;
  }
}
