:root {
  --bg: #0b1221;
  --game-bg: #19cefc;
  --car-color: #ff0000;
  --police-color: #2e4a8b;
  --police-lights: #ff3030;
  --warning-arrow: #ffaa00;
  --shield-color: #00ffff;
  --boost-color: #ff6a00;
  --car-windows: rgba(11, 205, 240, 0.459);
  --car-wheels: #222;
  --skid-marks: #111;
  --panel: rgba(255,255,255,0.05);
  --accent: #ffb400;
  --muted: rgba(255,255,255,0.6);
}

/* Forzar orientación portrait en móviles */
@media screen and (orientation: landscape) and (max-height: 600px) {
  body {
    transform: rotate(-90deg);
    transform-origin: left top;
    width: 100vh;
    height: 100vw;
    overflow-x: hidden;
    position: absolute;
    top: 100%;
    left: 0;
  }
}

/* Ocultar mensajes del sistema sobre orientación */
@media screen and (orientation: landscape) {
  .orientation-message,
  [class*="orientation"],
  [id*="orientation"] {
    display: none !important;
  }
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}
body {
  background: var(--bg);
  display: flex;
  align-items: stretch;
}
#game-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
#game-canvas {
  background: var(--game-bg);
  width: 100%;
  height: 100%;
  display: block;
}

/* HUD */
#hud {
  position: absolute;
  left: 8px;
  top: 8px;
  color: var(--muted);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#speed, #timer {
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
}

/* Controls - mobile first */
#controls {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 30px;
  z-index: 20;
}

/* Virtual joystick */
#joystick-container {
  position: relative;
}

#joystick-base {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.2);
  position: relative;
  touch-action: none;
}

#joystick-stick {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ctl {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 18px;
  min-width: 60px;
  touch-action: manipulation;
}
.big {
  min-width: 80px;
  padding: 16px 20px;
}

/* Larger screens: show controls as smaller side pad */
@media (min-width: 900px) {
  #controls {
    left: auto;
    right: 18px;
    bottom: 18px;
    width: 300px;
  }
  
  #joystick-base {
    width: 100px;
    height: 100px;
  }
  
  #joystick-stick {
    width: 35px;
    height: 35px;
  }
  
  .ctl {
    font-size: 16px;
    padding: 10px 14px;
  }
}

/* Hide native button focus outlines but keep accessible focus style */
button:focus {
  outline: 2px solid rgba(255, 180, 0, 0.25);
  outline-offset: 2px;
}

/* make canvas container relative for positioning */
#game-wrap {
  position: relative;
}

/* Simple credits */
footer {
  position: fixed;
  right: 8px;
  top: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}
