* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

canvas {
  display: block;
}

#hud {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 640px;
  pointer-events: none;
  z-index: 999;
  font-family: 'Share Tech Mono', monospace;
  display: none;
}

#hud-metros {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  font-size: 16px;
  text-shadow: 0 0 8px #00ffcc;
}

#hud-fuel {
  position: absolute;
  top: 32px;
  left: 10px;
  color: #00ffcc;
  font-size: 14px;
}

#hud-vida {
  position: absolute;
  top: 52px;
  left: 10px;
  color: #ff6666;
  font-size: 14px;
}

#hud-nivel {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #aaaaff;
  font-size: 12px;
  white-space: nowrap;
  letter-spacing: 3px;
  text-shadow: 0 0 6px #aaaaff;
  font-family: 'Orbitron', monospace;
}

#hud-barbg {
  position: absolute;
  top: 12px;
  right: 10px;
  width: 104px;
  height: 14px;
  background: #1a1a2e;
  border: 1px solid #00ffcc44;
  border-radius: 7px;
}

#hud-bar {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 100px;
  height: 10px;
  background: linear-gradient(90deg, #00aa88, #00ffcc);
  transition: width 0.1s;
  border-radius: 5px;
  box-shadow: 0 0 6px #00ffcc88;
}

.panel {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 640px;
  background: linear-gradient(180deg, #04041a 0%, #0a0a2e 60%, #080820 100%);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  color: #fff;
  overflow: hidden;
  gap: 0;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 204, 0.01) 2px,
      rgba(0, 255, 204, 0.01) 4px);
  pointer-events: none;
  z-index: 0;
}

.panel>* {
  position: relative;
  z-index: 1;
}

.panel-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid #00ffcc18;
  pointer-events: none;
  z-index: 2;
}

.panel-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ffcc66, transparent);
}

.panel-border::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00ffcc33, transparent);
}

.fila-titulo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.bloque-titulo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.t1 {
  font-family: 'Orbitron', monospace;
  font-size: 52px;
  font-weight: 900;
  color: #00ffcc;
  letter-spacing: 3px;
  line-height: 1;
  text-shadow: 0 0 12px #00ffcc, 0 0 30px #00ffcc55;
}

.t2 {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 8px;
}

.t3 {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: #2a3a5a;
  letter-spacing: 3px;
  margin-top: 3px;
}

.pj-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: flotar 1s ease-in-out infinite alternate;
}

.pj-body {
  width: 24px;
  height: 34px;
  background: linear-gradient(180deg, #00ffdd, #008866);
  border-radius: 3px 3px 2px 2px;
  position: relative;
  box-shadow: 0 0 14px #00ffcc99;
}

.pj-visor {
  width: 12px;
  height: 8px;
  background: #001a14;
  border-radius: 1px;
  position: absolute;
  top: 5px;
  left: 6px;
  box-shadow: 0 0 4px #00ffcc55;
}

.pj-pack {
  width: 9px;
  height: 16px;
  background: linear-gradient(180deg, #009966, #004433);
  border-radius: 2px;
  position: absolute;
  right: -10px;
  top: 3px;
}

.pj-botas {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.pj-bota {
  width: 9px;
  height: 6px;
  background: #005533;
  border-radius: 0 0 3px 3px;
}

.pj-llama {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 16px solid #ff6600;
  margin-top: 1px;
  animation: llamar 0.12s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 5px #ff6600);
}

@keyframes flotar {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-12px);
  }
}

@keyframes llamar {
  from {
    transform: scaleY(1);
    opacity: 1;
  }

  to {
    transform: scaleY(0.2);
    opacity: 0.4;
  }
}

.s-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.s-form label {
  font-size: 12px;
  color: #556677;
  letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
}

.s-form input {
  font-size: 20px;
  padding: 10px 20px;
  background: #06061a;
  color: #00ffcc;
  border: 1px solid #00ffcc66;
  border-radius: 3px;
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  width: 260px;
  outline: none;
  box-shadow: 0 0 12px #00ffcc11;
  transition: border 0.2s, box-shadow 0.2s;
}

.s-form input:focus {
  border-color: #00ffcc;
  box-shadow: 0 0 20px #00ffcc44;
}

.fila-botones {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.btn-jugar {
  font-size: 15px;
  padding: 12px 40px;
  background: #00ffcc22;
  color: #00ffcc;
  border: 2px solid #00ffcc;
  border-radius: 3px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  text-shadow: 0 0 8px #00ffcc;
  transition: all 0.2s;
}

.btn-jugar:hover {
  background: #00ffcc44;
  color: #fff;
  box-shadow: 0 0 24px #00ffcc66;
}

.btn-ranking {
  font-size: 13px;
  padding: 12px 22px;
  background: #1a1a3a;
  color: #aaaaff;
  border: 2px solid #4444aa;
  border-radius: 3px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ranking:hover {
  background: #2a2a5a;
  color: #ffffff;
  border-color: #8888ff;
}

.creditos {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: #445566;
  letter-spacing: 4px;
  position: absolute;
  bottom: 12px;
}

.creditos em {
  color: #00aa88;
  font-style: normal;
}

#panel-ranking {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 640px;
  background: linear-gradient(180deg, #04041a 0%, #0a0a2e 100%);
  z-index: 1100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  display: none;
}

#panel-ranking h2 {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  color: #aaaaff;
  letter-spacing: 4px;
  text-shadow: 0 0 10px #aaaaff55;
}

#panel-ranking ol {
  list-style: none;
  padding: 0;
  text-align: center;
}

#panel-ranking li {
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  color: #778899;
  line-height: 2.1;
}

#panel-ranking li span {
  color: #00ffcc;
  font-size: 17px;
}

#panel-ranking li.r1 {
  color: #ffcc44;
  font-size: 18px;
}

#panel-ranking li.r2 {
  color: #ccccdd;
  font-size: 17px;
}

#panel-ranking li.r3 {
  color: #cc9955;
  font-size: 16px;
}

.btn-cerrar {
  font-size: 13px;
  padding: 11px 34px;
  background: #1a0a0a;
  color: #ff6666;
  border: 2px solid #ff4444;
  border-radius: 3px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cerrar:hover {
  background: #2a1010;
  color: #fff;
  box-shadow: 0 0 16px #ff444455;
}

.go-h2 {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: #ff4444;
  letter-spacing: 5px;
  text-shadow: 0 0 12px #ff444477;
  margin-bottom: 8px;
}

.go-metros {
  font-family: 'Orbitron', monospace;
  font-size: 42px;
  color: #fff;
  text-shadow: 0 0 14px #ffffff33;
  margin-bottom: 6px;
}

.go-msg {
  font-size: 12px;
  color: #556677;
  letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
  margin-bottom: 20px;
}

.btn-go {
  font-size: 14px;
  padding: 12px 34px;
  background: #00ffcc22;
  color: #00ffcc;
  border: 2px solid #00ffcc;
  border-radius: 3px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  text-shadow: 0 0 8px #00ffcc;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.btn-go:hover {
  background: #00ffcc44;
  color: #fff;
  box-shadow: 0 0 20px #00ffcc55;
}

.btn-volver {
  font-size: 12px;
  padding: 10px 28px;
  background: #1a1a3a;
  color: #aaaaff;
  border: 2px solid #4444aa;
  border-radius: 3px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-volver:hover {
  background: #2a2a5a;
  color: #fff;
  border-color: #8888ff;
}

.rk-go {
  text-align: center;
}

.rk-go h3 {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: #2a3a5a;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.rk-go ol {
  list-style: none;
  padding: 0;
}

.rk-go li {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: #556677;
  line-height: 1.9;
}

.rk-go li span {
  color: #00aa88;
}

.rk-go li.r1 {
  color: #ffcc44;
}

.rk-go li.r2 {
  color: #aaaacc;
}

.rk-go li.r3 {
  color: #cc9955;
}

#panel-capa {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 640px;
  z-index: 1600;
  pointer-events: none;
  display: none;
  overflow: hidden;
}

#panel-capa.activo {
  display: block;
}

.capa-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.22) 0%, rgba(0, 255, 204, 0.10) 35%, rgba(0, 0, 0, 0) 75%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 255, 204, 0.04), rgba(0, 0, 0, 0));
  opacity: 0;
}

#panel-capa.activo .capa-flash {
  animation: capaFlash 0.85s ease-out forwards;
}

.capa-box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 86%;
  transform: translate(-50%, -50%) scale(0.85);
  text-align: center;
  opacity: 0;
  padding: 26px 20px 22px;
  border: 1px solid rgba(0, 255, 204, 0.20);
  background: linear-gradient(180deg, rgba(4, 8, 24, 0.82), rgba(7, 15, 35, 0.62));
  box-shadow:
    0 0 30px rgba(0, 255, 204, 0.10),
    inset 0 0 20px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(2px);
}

#panel-capa.activo .capa-box {
  animation: capaBoxIn 1.15s cubic-bezier(.18, .9, .2, 1) forwards;
}

.capa-mini {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  letter-spacing: 6px;
  color: #7ee7ff;
  text-shadow: 0 0 10px rgba(126, 231, 255, 0.35);
  margin-bottom: 10px;
}

.capa-titulo {
  font-family: 'Orbitron', monospace;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 0 24px rgba(0, 255, 204, 0.24);
  white-space: nowrap;
}

.capa-linea {
  width: 78%;
  height: 2px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.9), transparent);
  box-shadow: 0 0 14px rgba(0, 255, 204, 0.35);
}

@keyframes capaFlash {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes capaBoxIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
    filter: blur(6px);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
    filter: blur(0);
  }

  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.02);
  }
}