/* ============================================================
   ===================== GLOBAL STYLES ========================
============================================================ */

body {
  margin: 0;
  overflow: hidden;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  touch-action: none;
}

/* ============================================================
   ===================== GAME CONTAINER =======================
============================================================ */


#gameWrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
}

/* Canvas scales responsively */
canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #87CEEB;
}

/* Cutscene video overlays canvas */
#cutsceneVideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 5;
}

#gameContainer {
  position: relative;

  width: min(90vw, 90vh * 2);
  height: min(45vw, 90vh);

  max-width: 100%;
  max-height: 100%;

  aspect-ratio: 2 / 1;
}

canvas, #cutsceneVideo {
  width: 100%;
  height: 100%;
  display: block;
}


/* ============================================================
   ===================== TOUCH CONTROLS =======================
============================================================ */

#touchControls {
  position: absolute;
  bottom: 15px;
  width: 100%;
  display: none; /* hidden by default */
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

button {
  font-size: 18px;
  padding: 12px 16px;
  margin: 5px;
  border: none;
  border-radius: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
}

button:active {
  background: rgba(255,255,255,0.3);
}

/* Show touch controls on small screens */
@media (max-width: 900px) {
  #touchControls {
    display: flex;
  }
}
@media (orientation: portrait) {
  body::before {
    content: "Please rotate your device";
    position: fixed;
    inset: 0;
    background: black;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    z-index: 999;
  }
}