/*
========================================
GENERAL
========================================
*/
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  overflow:hidden;
  background:#000;
  font-family:Arial, sans-serif;
  user-select: none;
}

/*
========================================
CANVAS & HUD (IZQUIERDA - ALTURA MANDOS)
========================================
*/
#gameCanvas{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index: 1;
}

#hud{
  position:fixed;
  left:20px;
  bottom:20px; 
  width:190px;
  display:flex;
  flex-direction: column;
  gap:10px;
  z-index:20;
}

.hud-box{
  background:rgba(0,0,0,.75);
  border:2px solid #ffe44d;
  color:#fff;
  padding:12px 15px;
  border-radius:14px;
  font-weight:bold;
  backdrop-filter:blur(6px);
  box-shadow: 0 0 15px rgba(255,228,77,.3);
  text-align: left;
}

/*
========================================
EFECTOS VISUALES
========================================
*/
#effectText{
  position:fixed;
  top:40%;
  left:50%;
  transform: translate(-50%,-50%);
  color:#fff;
  font-size:60px;
  font-weight:bold;
  text-shadow: 0 0 25px gold;
  z-index:30;
  pointer-events:none;
  opacity:0;
  transition:.3s;
  text-align: center;
}

/*
========================================
CONTROLES LATERALES (DERECHA)
========================================
*/
#controls{
  position:fixed;
  right:20px;
  bottom:20px;
  width:220px;
  background: rgba(0,0,0,.65);
  border: 2px solid #00ffc8;
  border-radius:20px;
  padding:18px;
  backdrop-filter:blur(8px);
  z-index:20;
  box-shadow: 0 0 20px rgba(0,255,200,.45);
}

.control-group{
  margin-bottom:18px;
}

.control-group h3{
  color:#ffe44d;
  margin-bottom:10px;
  font-size:16px;
  text-align: center;
}

.buttons-row{
  display:flex;
  gap:10px;
}

.buttons-row button{
  flex:1;
}

/*
========================================
BOTONES DEL JUEGO
========================================
*/
button{
  border:none;
  border-radius:12px;
  padding:14px;
  background:#12e5c2;
  color:#000;
  font-weight:bold;
  font-size:20px;
  cursor:pointer;
  transition:.2s;
}

button:active{
  transform:scale(.94);
}

#shootBtn{
  width:100%;
  background:#ff5b1f;
  color:#fff;
  font-size:26px;
  margin-top:10px;
}

.meter{
  width:100%;
  height:14px;
  background:#111;
  border-radius:30px;
  overflow:hidden;
  margin-top:12px;
}

#powerFill{
  width:50%;
  height:100%;
  background: linear-gradient(90deg, #00ffc8, #ffe44d);
  transition: width 0.1s ease;
}

/*
========================================
POPUPS INTERACTIVOS (MODALES)
========================================
*/
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.popup-content {
  position: relative;
  width: 90%;
  max-width: 450px;
  text-align: center;
}

.popup-bg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: 0 0 35px rgba(0, 255, 200, 0.4);
}

.popup-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 30px;
  padding: 14px 40px;
  font-size: 24px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.btn-start { background: #ffe44d; color: #000; }
.btn-restart { background: #ff5b1f; color: #fff; }

.popup-form {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -30%);
  width: 80%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-form input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #00ffc8;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
}

.popup-form input::placeholder {
  color: #aaa;
}

.popup-form button {
  background: #00ffc8;
  color: #000;
  font-size: 18px;
  padding: 12px;
  margin-top: 5px;
  box-shadow: 0 0 10px rgba(0,255,200,0.5);
}

#formResponse {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  color: #00ffc8;
  font-weight: bold;
  font-size: 18px;
  background: rgba(0,0,0,0.8);
  padding: 10px 20px;
  border-radius: 10px;
}

.hidden {
  display: none !important;
}

/*
========================================
RESPONSIVE
========================================
*/
@media(max-width:768px){
  #hud { left: 10px; bottom: 10px; width: 130px; gap: 5px; }
  .hud-box { font-size: 12px; padding: 8px 10px; }
  #controls { width: 160px; right: 10px; bottom: 10px; padding: 10px; }
  button { font-size: 15px; padding: 8px; }
  #shootBtn { font-size: 18px; }
  #effectText { font-size: 38px; }
  .popup-form { width: 85%; top: 42%; }
  .popup-form input { padding: 10px; font-size: 14px; }
}