/* ===== Estilos base (originales) ===== */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1220;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
canvas {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  filter: contrast(1.07) saturate(1.15);
}
.p {
  position: fixed;
  z-index: 5;
  background: rgba(10, 18, 32, 0.62);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 10px 14px;
  pointer-events: none;
  font-weight: 600;
}
#tl {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 10px;
  line-height: 1.5;
  font-size: 15px;
}
#tr {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  text-align: right;
}
#spd {
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
#spd small {
  font-size: 14px;
  opacity: 0.8;
}
.bar {
  width: 140px;
  height: 8px;
  background: #fff3;
  border-radius: 5px;
  margin-top: 6px;
  overflow: hidden;
  margin-left: auto;
}
#dm {
  height: 100%;
  width: 0;
  background: #ff4d4d;
}
#stop {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
}
#msg {
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
  max-width: 80vw;
}
#ov {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: radial-gradient(ellipse at center, #12325fcc, #050a14f2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 10px;
}
#ov h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 52px);
  letter-spacing: 1px;
}
#ov h1 span {
  color: #ffd23f;
}
#ov p {
  max-width: 560px;
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}
#vg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.32) 100%);
}
#par {
  top: calc(env(safe-area-inset-top, 0px) + 62px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(200, 20, 20, 0.85);
  display: none;
  font-size: 20px;
  letter-spacing: 2px;
}
#mb {
  pointer-events: auto;
  cursor: pointer;
  top: calc(env(safe-area-inset-top, 0px) + 112px);
  right: 10px;
  font-size: 14px;
  padding: 8px 12px;
  margin: 0;
  border: 0;
  color: #fff;
}
#ov {
  overflow-y: auto;
}
#ov > :first-child {
  margin-top: auto;
}
#ov > :last-child {
  margin-bottom: auto;
}
#tun {
  max-width: 760px;
}
.pc {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 104px;
  padding: 6px;
  margin: 3px;
  border-radius: 10px;
  background: #ffffff18;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  vertical-align: top;
}
.pc.on {
  border-color: #ffd23f;
  background: #ffd23f33;
}
.pc small {
  opacity: 0.8;
}
.tb {
  padding: 0 8px;
  border-radius: 6px;
  color: #111;
  font-weight: 800;
}
#wb {
  pointer-events: auto;
  cursor: pointer;
  top: calc(env(safe-area-inset-top, 0px) + 156px);
  right: 10px;
  font-size: 20px;
  padding: 6px 12px;
  margin: 0;
  border: 0;
  color: #fff;
}
#gar {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  background: linear-gradient(#10243f, #07111f);
  color: #fff;
}
.gh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #0b1b33;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 20px;
}
.gh button {
  padding: 6px 14px;
  font-size: 18px;
  margin: 0;
}
.gv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 10px;
}
.gv button {
  padding: 10px 16px;
  margin: 0;
}
.gi {
  font-size: 64px;
  text-align: center;
  min-width: 200px;
}
.gi div {
  font-size: 16px;
  font-weight: 700;
}
.gs {
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 16px;
}
.sb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 3px 0;
}
.sb span {
  width: 92px;
}
.sb div {
  position: relative;
  flex: 1;
  height: 10px;
  background: #ffffff22;
  border-radius: 6px;
  overflow: hidden;
}
.sb i,
.sb u {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}
.sb u {
  background: #5fe08a;
}
.sb i {
  background: #ffd23f;
  z-index: 1;
}
.gt {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 8px;
}
.tf {
  padding: 6px 12px;
  font-size: 14px;
  margin: 0;
  color: #111;
}
.tf.on {
  outline: 3px solid #fff;
}
.gg {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px 10px 90px;
}
.gc {
  position: relative;
  width: 142px;
  padding: 8px;
  border: 3px solid;
  border-radius: 14px;
  background: #1a3a63;
  text-align: center;
  font-size: 12px;
}
.gtt {
  position: absolute;
  top: -1px;
  left: -1px;
  padding: 2px 9px;
  border-radius: 12px 0 12px 0;
  color: #111;
  font-weight: 800;
}
.ge {
  font-size: 34px;
  margin-top: 10px;
}
.pp {
  letter-spacing: 2px;
  color: #ffd23f;
  margin: 4px 0;
}
.gc small {
  display: block;
  min-height: 28px;
  opacity: 0.85;
}
.up {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  margin: 6px 0 0;
  border-radius: 10px;
}
.up:disabled {
  opacity: 0.45;
}
select {
  font: inherit;
  padding: 8px;
  border-radius: 8px;
  margin: 4px;
  max-width: 92%;
}
button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: #ffd23f;
  color: #111;
  padding: 14px 34px;
  font-size: 20px;
  cursor: pointer;
  margin-top: 8px;
}
.t {
  position: fixed;
  z-index: 5;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff30;
  border: 2px solid #fff6;
  font-size: 26px;
  display: none;
  align-items: center;
  justify-content: center;
}
@media (pointer: coarse) {
  .t {
    display: flex;
  }
}

/* ===== Capa visual mejorada (solo estilo, misma estructura) ===== */
html,
body {
  font-family:
    "Rubik",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}
canvas {
  filter: contrast(1.06) saturate(1.12);
}
.p {
  background: linear-gradient(160deg, rgba(20, 34, 60, 0.74), rgba(8, 14, 28, 0.64));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border-radius: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
#tl {
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
  letter-spacing: 0.2px;
}
#tr {
  min-width: 150px;
  padding: 10px 16px 12px;
}
#spd {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 54px;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #fff 30%, #ffd86b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
#spd small {
  font-family: "Rubik", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #c9d8f0;
  -webkit-text-fill-color: #c9d8f0;
  opacity: 0.9;
}
#ov {
  justify-content: flex-start;
}
#tr::after {
  content: "";
  display: block;
  height: 5px;
  border-radius: 4px;
  margin-top: 8px;
  background: linear-gradient(90deg, #33d17a, #ffd23f 60%, #ff4d4d);
  clip-path: inset(0 calc(100% - var(--s, 0) * 100%) 0 0 round 4px);
  transition: clip-path 0.08s linear;
}
.bar {
  width: 150px;
  height: 7px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
#dm {
  background: linear-gradient(90deg, #ffb020, #ff3b3b);
  box-shadow: 0 0 8px #ff3b3b;
}
#stop {
  font-size: 14px;
  border-color: rgba(47, 255, 122, 0.35);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(47, 255, 122, 0.12);
}
#stop b {
  color: #6dffa6;
}
#msg {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 23px;
  padding: 12px 22px;
  border-color: rgba(255, 210, 63, 0.45);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.45),
    0 0 26px rgba(255, 210, 63, 0.18);
}
#par {
  background: linear-gradient(180deg, #e0262b, #9c0f14);
  border-color: #ff7b7b;
  animation: pulse 0.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 60, 60, 0.25),
      0 0 28px rgba(255, 40, 40, 0.6);
  }
}
#mb,
#wb {
  transition:
    transform 0.15s,
    background 0.15s;
}
#mb:hover,
#wb:hover {
  transform: translateY(-1px);
  background: linear-gradient(160deg, rgba(40, 64, 104, 0.85), rgba(14, 24, 44, 0.75));
}
#vg {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.38) 100%);
}
#ov {
  background: radial-gradient(ellipse at 50% 25%, rgba(36, 84, 150, 0.55), rgba(6, 12, 26, 0.93) 70%);
}
#ov h1 {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 6.2vw, 72px);
  line-height: 1.02;
  letter-spacing: 0.5px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
}
#ov h1 span {
  background: linear-gradient(180deg, #fff2b0, #ffc61a 55%, #ff9a1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 14px rgba(255, 170, 0, 0.35));
}
#ov p {
  max-width: 640px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 15px;
}
#ov p b {
  color: #ffd86b;
}
#ov h2 {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: clamp(26px, 4vw, 40px);
  margin: 0 0 6px;
}
#ov .cred {
  background: none;
  border: 0;
  font-size: 12px;
  opacity: 0.6;
  padding: 0;
}
button {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #ffe27a, #ffc21a);
  box-shadow:
    0 6px 0 #b8860b,
    0 12px 24px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    filter 0.15s;
}
button:hover {
  filter: brightness(1.07);
}
button:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #b8860b,
    0 6px 14px rgba(0, 0, 0, 0.3);
}
#go {
  font-size: 26px;
  padding: 14px 46px;
  background: linear-gradient(180deg, #7dffb0, #22c463);
  box-shadow:
    0 6px 0 #11823d,
    0 12px 30px rgba(34, 196, 99, 0.35);
}
#go:active {
  box-shadow: 0 2px 0 #11823d;
}
#tg {
  background: linear-gradient(180deg, #d9e6ff, #9db8ea);
  box-shadow:
    0 6px 0 #5a77ad,
    0 12px 24px rgba(0, 0, 0, 0.3);
}
.p#mb,
.p#wb {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  background: linear-gradient(160deg, rgba(20, 34, 60, 0.74), rgba(8, 14, 28, 0.64));
  font-family: "Rubik", sans-serif;
}
.p#mb:active,
.p#wb:active {
  transform: translateY(1px);
}
select {
  background: rgba(10, 20, 38, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
}
select option {
  color: #111;
  background: #fff;
}
.t {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12));
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.t:active {
  transform: scale(0.94);
}
#gar {
  background: radial-gradient(ellipse at 50% 0, #1d3d6b, #07111f 70%);
}
.gh {
  background: rgba(9, 22, 42, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: "Baloo 2", sans-serif;
}
.gc {
  background: linear-gradient(170deg, #21497a, #142c4d);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.gc:hover {
  transform: translateY(-3px);
}
.sb u {
  background: linear-gradient(90deg, #2fbf6a, #7dffb0);
}
.sb i {
  background: linear-gradient(90deg, #e0a800, #ffd23f);
}

/* ===== Persecución policial ===== */
#pol {
  top: calc(env(safe-area-inset-top, 0px) + 110px);
  left: 50%;
  transform: translateX(-50%);
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
  animation: sirena 0.5s steps(1) infinite;
}
@keyframes sirena {
  0% {
    background: linear-gradient(90deg, rgba(214, 40, 40, 0.9), rgba(27, 63, 176, 0.9));
    box-shadow: -10px 0 30px rgba(255, 40, 40, 0.6);
  }
  50% {
    background: linear-gradient(90deg, rgba(27, 63, 176, 0.9), rgba(214, 40, 40, 0.9));
    box-shadow: 10px 0 30px rgba(40, 90, 255, 0.6);
  }
}
.multa-alta {
  color: #ff6b6b;
}
