/* =========================================================
   FORTNITE CLASH - estilos base
   El juego se dibuja en <canvas>; aqui solo maquetamos el
   contenedor, el escalado responsive y la capa HUD en HTML.
   ========================================================= */

:root {
  --fc-blue:   #2f7fe0;
  --fc-purple: #6f4bd8;
  --fc-yellow: #ffd23f;
  --fc-dark:   #10162a;
  --fc-panel:  rgba(16, 22, 42, 0.72);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: #fff;
  /* Evita seleccionar texto al hacer clic/arrastrar sobre el juego */
  user-select: none;
  -webkit-user-select: none;
}

/* Contenedor centrado que mantiene la proporcion 16:9 */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1b2a4a 0%, #0b1020 70%);
}

#game-canvas {
  display: block;
  /* El tamano real lo ajusta main.js segun la ventana (mantiene 16:9) */
  background: #7fd0ff;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  image-rendering: auto;
}

/* ---------- Capa HUD en HTML ---------- */
#hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none; /* no bloquea el canvas */
}

#game-title {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* JULEN'S en blanco y FORTNITE en el amarillo de la casa, con un
   degradado y un contorno para que se lea como un logo y no como texto. */
.title-julen {
  color: #ffffff;
  font-size: 0.62em;
  letter-spacing: 3px;
  vertical-align: 0.28em;
  margin-right: 7px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.title-fort {
  background: linear-gradient(180deg, #fff3b0 0%, var(--fc-yellow) 48%, #f0932b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(30, 20, 0, 0.35);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4));
}

/* Se mantiene por si queda algun rotulo viejo por ahi. */
.title-clash { color: #ffffff; margin-left: 6px; }

.title-step {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-top: 2px;
  text-shadow: none;
}

#controls-help {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--fc-panel);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 14px 12px;
  font-size: 13px;
  line-height: 1.55;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

#controls-help.hidden { opacity: 0; }

#controls-help h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fc-yellow);
}

#controls-help ul {
  margin: 0;
  padding-left: 16px;
}

#controls-help b {
  color: var(--fc-yellow);
}

/* En pantallas pequenas encogemos los paneles para no tapar el juego */
@media (max-width: 900px) {
  #game-title   { font-size: 20px; }
  #controls-help { font-size: 11px; padding: 8px 10px; }
}

/* =============================================================
   PORTADA DE CARGA
   Ocupa exactamente lo mismo que el lienzo del juego y va por encima
   de todo, menu incluido. La quita sola js/ui/bootScreen.js.
   ============================================================= */
#boot-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  display: block;
  border-radius: inherit;
  transition: opacity 0.15s linear;
}

/* =============================================================
   CONTROL DE SONIDO (js/ui/audioPanel.js)
   Flota en la esquina de abajo a la derecha, por encima del menu y
   de la partida: se puede tocar siempre.
   ============================================================= */

#audio-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#audio-toggle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(14, 20, 38, 0.82);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

#audio-toggle:hover { transform: scale(1.08); border-color: #5ac8ff; }

#audio-panel.muted #audio-toggle {
  border-color: rgba(255, 90, 90, 0.7);
  opacity: 0.75;
}

#audio-sliders {
  order: -1;                      /* el panel se abre HACIA ARRIBA */
  width: 208px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 20, 38, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#audio-sliders.hidden { display: none; }

#audio-sliders label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #cfe0ff;
  text-transform: uppercase;
}

#audio-sliders label span {
  display: flex;
  justify-content: space-between;
}

#audio-sliders label b { color: #ffd76a; }

#audio-sliders input[type="range"] {
  width: 100%;
  accent-color: #5ac8ff;
  cursor: pointer;
}

#audio-mute {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

#audio-mute:hover { background: rgba(90, 200, 255, 0.22); }
