html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
}

canvas {
  position: absolute;
  image-rendering: pixelated;   /* Chrome / Electron */
  image-rendering: crisp-edges; /* Firefox */
}

/* El cursor se dibuja dentro del juego (pixel art); el del sistema se oculta. */
#game { cursor: none; }

/* La capa de texto no intercepta el mouse. */
#overlay { pointer-events: none; }

/* ---- modo celular (body.movil; ver src/engine/input/Platform.js) ---- */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
#game, #stage { touch-action: none; }

#touch-barra, #touch-rotar { display: none; }
body.movil #touch-barra {
  display: flex; flex-direction: column; gap: 8px;
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 40;
}
body.movil #touch-barra[hidden] { display: none; }
#touch-barra button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ffd16688;
  background: #0b0d14b3; color: #ffd166; font-size: 20px; line-height: 1; padding: 0; touch-action: manipulation;
}
#touch-barra button:active { background: #ffd166; color: #14161f; }
#touch-barra button.on { background: #ffd166; color: #14161f; }
#touch-barra button:disabled { opacity: 0.35; }
body.movil #vista-flotante { display: none; }

/* Retrato: se pide girar el celular (el juego es 16:9 apaisado). */
@media (orientation: portrait) {
  body.movil #touch-rotar {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 100;
    background: #05070d; color: #ffd166; text-align: center; font: 18px/1.5 Consolas, monospace;
  }
  #touch-rotar span { display: block; font-size: 56px; margin-bottom: 12px; }
}

/* ---- pantalla de inicio ---- */
#start {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #121a2e 0%, #05070d 70%);
  color: #c9d1e8;
  font-family: Consolas, "Lucida Console", monospace;
  text-align: center;
  transition: opacity 0.8s ease;
}
#start.hide { opacity: 0; pointer-events: none; }
.start-kicker { letter-spacing: 0.5em; font-size: clamp(11px, 1.6vw, 18px); color: #6b7aa3; }
#start h1 {
  margin: 0.15em 0 0;
  font-size: clamp(34px, 7vw, 92px);
  letter-spacing: 0.14em;
  color: #ffd166;
  text-shadow: 0 0 24px rgba(255, 190, 90, 0.35), 0 0 4px #000;
}
.start-sub { font-size: clamp(14px, 2.4vw, 28px); color: #ff9ecb; margin-top: 0.3em; letter-spacing: 0.12em; }
#start-status { margin-top: 3.2em; font-size: clamp(12px, 1.6vw, 18px); color: #6b7aa3; }
#start-status.ready { color: #e6e9f5; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.fatal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ffd166;
  font: 16px/1.5 Consolas, monospace;
  text-align: center;
  white-space: pre-wrap;
}

#vista-flotante { position: fixed; top: 10px; right: 10px; z-index: 50; display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #ffd16688; background: #0b0d14d9; font: 13px Consolas, monospace; }
#vista-flotante button { padding: 7px 12px; background: transparent; color: #aab3d0; border: 0; cursor: pointer; }
#vista-flotante button + button { border-left: 1px solid #ffd16644; }
#vista-flotante button:hover { color: #fff; }
#vista-flotante button.cheat { background: #2f9e72; color: #fff; font-weight: bold; }
#vista-flotante button.cheat:hover { background: #3fbf8c; }
#vista-flotante button.omitir { color: #ffd166; font-weight: bold; }
#vista-flotante button.omitir:disabled { color: #5a6280; font-weight: normal; cursor: default; }
#vista-flotante button.on { background: #ffd166; color: #14161f; font-weight: bold; }
