body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: url("Fondo.jpg") no-repeat center center fixed;
  background-size: cover;
  color: white;
  text-align: center;
  overflow-x: hidden;
}

/* UI SUPERIOR */
#topUI {
  margin-top: 10px;
}

#score {
  font-size: clamp(20px, 4vw, 28px);
}

#blueScore {
  background: #1976ff;
  padding: 6px 14px;
  border-radius: 6px;
}

#redScore {
  background: #ff3b3b;
  padding: 6px 14px;
  border-radius: 6px;
}

/* CANVAS RESPONSIVE REAL */
canvas {
  display: block;
  margin: 12px auto;
  background: #1e7a3a;
  border: 4px solid #eee;
  border-radius: 10px;
  box-shadow: 0 0 25px black;
  max-width: 98vw;
  max-height: 65vh;
  width: 900px;
  height: 500px;
  aspect-ratio: 900 / 500;
}

/* OVERLAY */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 10;
}

/* MENÚ */
#menu, #final {
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.8;
}

/* CUENTA ATRÁS */
#countdown {
  position: absolute;
  top: 45%;
  width: 100%;
  font-size: clamp(50px, 12vw, 90px);
  font-weight: bold;
}

/* GOL */
#goalMsg {
  position: absolute;
  top: 40%;
  width: 100%;
  font-size: clamp(34px, 8vw, 60px);
  font-weight: bold;
  color: yellow;
  text-shadow: 0 0 15px black;
}

/* SCOREBOARD */
#scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#scoreboard img {
  width: clamp(30px, 5vw, 38px);
  height: clamp(30px, 5vw, 38px);
}

/* INFO */
#controlsInfo {
  width: min(900px, 95%);
  margin: 10px auto;
  font-size: clamp(12px, 2.5vw, 18px);
  background: rgba(0,0,0,0.35);
  padding: 8px;
  border-radius: 10px;
}

/* CONTROLES TÁCTILES */
#mobileControls {
  display: none;
}

@media (max-width: 1024px), (pointer: coarse) {
  #mobileControls {
    display: flex;
    position: fixed;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    justify-content: space-between;
    padding: 0 4vw;
    box-sizing: border-box;
    z-index: 999;
    pointer-events: none;
  }

  #mobileControls button {
    pointer-events: auto;
    width: clamp(55px, 12vw, 85px);
    height: clamp(55px, 12vw, 85px);
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: clamp(22px, 5vw, 34px);
    font-weight: bold;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  }

  .dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 2vw, 12px);
  }

  .middleRow {
    display: flex;
    gap: clamp(6px, 2vw, 12px);
  }

  .actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(12px, 3vw, 20px);
  }

  #shoot {
    background: rgba(255,140,0,0.82);
    width: clamp(75px, 15vw, 100px);
    height: clamp(75px, 15vw, 100px);
  }

  #reset {
    background: rgba(0,150,255,0.78);
  }

  /* BOTONES MENÚ */
  .menuButtons {
    position: fixed;
    top: 20px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
  }

  .menuButtons button {
    width: clamp(50px, 10vw, 75px);
    height: clamp(50px, 10vw, 75px);
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: clamp(22px, 4vw, 30px);
    font-weight: bold;
  }
}