/* Bogotá 2600: asfalto, amarillo de taxi y rojo de TransMilenio. Esquinas rectas, letra condensada
   de señalización. Nada de vidrio esmerilado ni degradados: paneles sólidos con un filo de color. */
:root {
  --asfalto: #141516;
  --asfalto-2: #1f2123;
  --papel: #efece4;
  --gris: #9d9a92;
  --taxi: #f2c21b;
  --tm: #d6252d;
  --bien: #7bd389;
  --rosa: #ff4fa0;
  --letra: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: dark; /* un solo aspecto, oscuro, a propósito: es la pantalla del juego */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--asfalto); color: var(--papel); font-family: var(--letra); }
#lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: var(--letra); }

/* ---------------- carga y título */
#carga {
  position: fixed; inset: 0; z-index: 30; display: grid;
  grid-template-columns: 1fr minmax(260px, 340px); grid-template-rows: 1fr auto;
  padding: 48px 56px; gap: 24px;
  background: linear-gradient(90deg, rgba(20,21,22,.94) 0%, rgba(20,21,22,.78) 55%, rgba(20,21,22,.55) 100%);
  transition: opacity .8s ease;
}
#carga.lista { background: linear-gradient(90deg, rgba(20,21,22,.86) 0%, rgba(20,21,22,.35) 60%, rgba(20,21,22,.15) 100%); }
#carga.fuera { opacity: 0; pointer-events: none; }
#carga .titulo { align-self: end; }
#carga h1 { font-size: clamp(64px, 11vw, 168px); line-height: .82; margin: 0; font-weight: 800; letter-spacing: -1px; }
#carga h1 span { color: var(--taxi); display: block; }
#carga .sub { font-size: 21px; color: var(--gris); margin: 18px 0 0; max-width: 560px; }
.cargador { grid-column: 1; align-self: start; max-width: 560px; }
.cargador .linea { height: 3px; background: #333; margin-top: 8px; }
.cargador .linea i { display: block; height: 100%; width: 0; background: var(--taxi); transition: width .3s; }
#cargaEstado { font-size: 18px; letter-spacing: .5px; text-transform: uppercase; color: var(--papel); margin: 10px 0 2px; }
.dato { color: var(--gris); font-size: 17px; min-height: 48px; line-height: 1.35; max-width: 520px; }
#botonJugar {
  margin-top: 10px; padding: 12px 34px; font-size: 24px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: var(--taxi); color: #111; border: 0; cursor: pointer;
}
#botonJugar:disabled { background: #3a3a3a; color: #888; cursor: wait; }
#botonJugar:not(:disabled):hover { background: #ffd447; }
#botonJugar:focus-visible, #pausa button:focus-visible { outline: 3px solid var(--papel); outline-offset: 2px; }
.credito { font-size: 13px; color: var(--gris); margin-top: 14px; max-width: 520px; }
.controles {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; padding: 18px 20px;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 17px;
  background: rgba(20,21,22,.82); border-left: 3px solid var(--taxi);
}
.controles dt { font-weight: 700; color: var(--taxi); text-align: right; }
.controles dd { margin: 0; color: #d8d4ca; }

/* ---------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ubicacion { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 1px 3px #000; }
#ubicacion b { display: block; font-size: 25px; font-weight: 700; letter-spacing: .3px; }
#ubicacion span { font-size: 16px; color: #d5d1c7; text-transform: uppercase; letter-spacing: 1.5px; }

#estado { position: absolute; top: 18px; right: 22px; text-align: right; text-shadow: 0 1px 3px #000; }
#estado .reloj b { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
#estado .reloj span { display: block; font-size: 15px; color: #d5d1c7; text-transform: uppercase; letter-spacing: 1px; margin-top: -4px; }
#clima { font-size: 16px; color: #d5d1c7; margin-top: 2px; }
#dinero { font-size: 32px; font-weight: 700; color: var(--bien); font-variant-numeric: tabular-nums; margin-top: 6px; }
#altitud { font-size: 14px; color: #bdb9ae; margin-top: 4px; letter-spacing: .5px; }
#busqueda { display: flex; gap: 5px; justify-content: flex-end; margin-top: 6px; height: 22px; }
#busqueda i { width: 18px; height: 22px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25);
  clip-path: polygon(50% 0, 100% 18%, 100% 60%, 50% 100%, 0 60%, 0 18%); }
#busqueda i.on { background: var(--tm); border-color: var(--tm); }
#busqueda.parpadea i.on { animation: titila .6s steps(2) infinite; }
@keyframes titila { 50% { background: rgba(214,37,45,.25); } }

#izquierda { position: absolute; left: 22px; bottom: 22px; }
#minimapa { display: block; width: 232px; height: 232px; border: 2px solid #0d0d0d; outline: 1px solid rgba(255,255,255,.18); background: #1c1d1f; }
.barras { display: grid; grid-template-columns: 2fr 1fr; gap: 4px; margin-top: 4px; }
.barras div { height: 7px; background: rgba(0,0,0,.55); }
.barras i { display: block; height: 100%; width: 100%; transition: width .2s; }
#salud i { background: #5ccf6e; }
#aliento i { background: #5ab0e8; }

#velocidad { position: absolute; right: 22px; bottom: 22px; text-align: right; opacity: 0; transition: opacity .3s; text-shadow: 0 1px 3px #000; }
#velocidad.visible { opacity: 1; }
#velocidad .num b { font-size: 66px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: .9; }
#velocidad .num span { font-size: 18px; color: #cfcabf; margin-left: 4px; }
#velocidad .veh { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 17px; color: #d9d5cb; margin-top: 4px; }
.placa { font-weight: 700; color: #111; padding: 1px 7px; border: 2px solid #111; text-shadow: none; letter-spacing: 1px; }
.placa.particular, .placa.moto { background: #f2c400; }
.placa.publica, .placa.oficial { background: #f4f4f0; }
.placa.oficial { border-color: #0a6a35; }
#radioNombre { font-size: 15px; color: var(--taxi); margin-top: 3px; letter-spacing: .3px; }
#saludVeh { width: 160px; height: 5px; background: rgba(0,0,0,.55); margin: 6px 0 0 auto; }
#saludVeh i { display: block; height: 100%; background: var(--taxi); }

#taximetro { position: absolute; right: 22px; bottom: 160px; display: none; grid-template-columns: auto auto; gap: 0 14px; align-items: baseline;
  background: #0c0c0c; border-left: 3px solid var(--taxi); padding: 8px 14px; font-variant-numeric: tabular-nums; }
#taximetro.visible { display: grid; }
#taximetro span { font-size: 13px; color: var(--gris); letter-spacing: 1px; }
#taximetro b { font-size: 26px; color: #ff6a3a; font-family: "Consolas", monospace; }

#crono, #cuenta { position: absolute; top: 110px; left: 50%; transform: translateX(-50%); display: none; text-align: center; text-shadow: 0 2px 4px #000; }
#crono.visible, #cuenta.visible { display: block; }
#crono b { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
#crono span { display: block; font-size: 16px; color: var(--taxi); }
#crono.tarde b { color: #ff8f6a; }
#cuenta { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
#cuenta.tarde { color: #ff6a5a; }
#cuenta.grande { font-size: 140px; top: 30%; color: var(--taxi); }

#avisos { position: absolute; top: 90px; left: 22px; width: 380px; display: flex; flex-direction: column; gap: 6px; }
.aviso { background: rgba(14,14,15,.9); border-left: 3px solid var(--gris); padding: 8px 12px; font-size: 18px; line-height: 1.25; transition: opacity .7s, transform .7s; }
.aviso.bien { border-color: var(--bien); }
.aviso.alerta { border-color: var(--tm); }
.aviso.fuera { opacity: 0; transform: translateX(-12px); }

#prompt { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); background: rgba(14,14,15,.92); border-bottom: 3px solid var(--taxi);
  padding: 8px 18px; font-size: 20px; display: none; }
#prompt.visible { display: block; }
#objetivo { position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); font-size: 22px; color: #ffd9ec; text-shadow: 0 1px 4px #000; display: none; white-space: nowrap; }
#objetivo.visible { display: block; }
#dialogo { position: absolute; bottom: 168px; left: 50%; transform: translateX(-50%); max-width: 760px; text-align: center; font-size: 22px; line-height: 1.3;
  text-shadow: 0 1px 4px #000, 0 0 12px rgba(0,0,0,.7); opacity: 0; transition: opacity .4s; }
#dialogo.visible { opacity: 1; }
#tituloMision { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); width: min(720px, 90vw); text-align: center; opacity: 0; transition: opacity .6s; }
#tituloMision.visible { opacity: 1; }
#tituloMision h2 { font-size: 54px; margin: 0; font-weight: 800; color: var(--taxi); text-shadow: 0 2px 8px #000; letter-spacing: .5px; }
#tituloMision p { font-size: 21px; margin: 8px auto 0; line-height: 1.35; background: rgba(14,14,15,.85); padding: 10px 16px; }

#postal { position: absolute; left: 22px; top: 50%; transform: translate(-120%, -50%); width: 340px; background: var(--papel); color: #1b1b1b;
  padding: 16px 18px 18px; border-top: 6px solid var(--tm); transition: transform .6s cubic-bezier(.2,.8,.2,1); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#postal.visible { transform: translate(0, -50%) rotate(-1.2deg); }
#postal small { text-transform: uppercase; letter-spacing: 1.5px; color: #7a2128; font-weight: 700; font-size: 13px; }
#postal h3 { font-size: 32px; margin: 2px 0 6px; line-height: 1; }
#postal p { font-size: 17px; margin: 0; line-height: 1.35; font-family: Georgia, "Times New Roman", serif; }

#pantallaFin { position: absolute; inset: 0; display: none; place-content: center; text-align: center; background: rgba(10,10,10,.55); }
#pantallaFin.visible { display: grid; }
#pantallaFin h1 { font-size: 110px; margin: 0; color: var(--tm); font-weight: 800; letter-spacing: 2px; text-shadow: 0 4px 16px #000; }
#pantallaFin p { font-size: 24px; margin: 0; }

/* ---------------- mapa */
#mapaGrande { position: fixed; inset: 0; z-index: 20; display: none; background: #16171a; }
#mapaGrande.visible { display: block; }
#lienzoMapa { width: 100%; height: 100%; display: block; cursor: crosshair; }
.leyenda { position: absolute; left: 20px; bottom: 18px; background: rgba(14,14,15,.92); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 16px;
  max-width: 640px; font-size: 16px; border-left: 3px solid var(--taxi); }
.leyenda i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.leyenda em { flex-basis: 100%; color: var(--gris); font-style: normal; font-size: 14px; }
.l-metro { background: #ff2a3a; height: 4px !important; vertical-align: 3px !important; }
.l-tm { background: #d8414a; height: 3px !important; vertical-align: 4px !important; }
.p-historia { background: var(--rosa); border-radius: 50%; }
.p-carrera { background: #3fb2ff; border-radius: 50%; }
.p-postal { background: var(--taxi); border-radius: 50%; }
.p-gps { background: #ff5fb0; border-radius: 50%; border: 2px solid #fff; }

/* ---------------- pausa */
#pausa { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(12,12,13,.72); place-items: center; }
#pausa.visible { display: grid; }
#pausa .panel { width: min(560px, 92vw); max-height: 90vh; overflow: auto; background: var(--asfalto-2); border-top: 4px solid var(--taxi); padding: 22px 26px; }
#pausa h2 { margin: 0 0 12px; font-size: 40px; font-weight: 800; }
#estadisticas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
#estadisticas div { background: #2a2c2f; padding: 8px 10px; }
#estadisticas b { display: block; font-size: 24px; }
#estadisticas span { color: var(--gris); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.opciones { display: grid; gap: 10px; font-size: 18px; }
.opciones label { display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 12px; }
.opciones label.chk { display: flex; gap: 8px; }
.opciones select, .opciones input[type=range] { width: 100%; font-family: var(--letra); font-size: 17px; background: #2a2c2f; color: var(--papel); border: 1px solid #444; padding: 4px; }
.opciones small { color: var(--taxi); min-height: 1em; }
.acciones { display: flex; gap: 10px; margin: 18px 0 10px; }
#pausa button { padding: 10px 22px; font-size: 20px; font-weight: 700; border: 0; cursor: pointer; background: var(--taxi); color: #111; }
#pausa button.sec { background: #34373a; color: var(--papel); font-weight: 600; }
#pausa details { color: var(--gris); font-size: 16px; }
#pausa summary { cursor: pointer; }
#pausa ul { padding-left: 18px; margin: 8px 0; }
.nota { font-size: 14px; }

@media (max-width: 760px) {
  #carga { grid-template-columns: 1fr; padding: 24px 16px; }
  .controles { display: none; }
  #minimapa { width: 160px; height: 160px; }
  #avisos { width: calc(100vw - 32px); }
}
