/* Google font (UI in afara canvas-ului). 
   Daca vrei sa-l folosesti si in Phaser text, e ok doar ca Phaser nu asteapta fontul.
*/

/* ================================
   RESET + BASE
================================ */
:root {
  --bg: #1a1a1a;
  --warning-bg: rgba(0,0,0,0.92);
  --warning-accent: #ff4500;
  --text: #ffffff;

  /* Safe area (notch) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* In unele browsere mobile, 100vh “sare”.
   100dvh e mai stabil (dar pastram si fallback).
*/
body {
  min-height: 100vh;
  min-height: 100dvh;

  /* Sa nu faca highlight/selection */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;

  /* Important pt gameplay: nu lasa browser-ul sa interpreteze gesture-uri */
  touch-action: none;

  font-family: 'Press Start 2P', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Safe area padding (pentru overlay / UI html) */
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

/* ================================
   GAME CONTAINER
================================ */
#game-container {
  position: fixed;
  inset: 0; /* top/right/bottom/left: 0 */
  width: 100%;
  height: 100%;
  display: block;
}

/* Phaser injecteaza un <canvas> in container.
   Vrem pixel art sharp + fara stretching urat.
*/
#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;

  /* Pixel art crisp */
  image-rendering: pixelated;
  image-rendering: crisp-edges;

  /* Daca vrei sa nu ai blur la scale */
  -ms-interpolation-mode: nearest-neighbor;
}

/* Optional: daca ai overlay-uri HTML peste joc, le poti pune aici */
#game-container,
#orientation-warning {
  overscroll-behavior: none;
}

/* ================================
   ORIENTATION WARNING OVERLAY
================================ */
#orientation-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;

  padding: calc(24px + var(--safe-top)) calc(16px + var(--safe-right))
           calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));

  background: var(--warning-bg);

  /* center */
  align-items: center;
  justify-content: center;
  text-align: center;
}

.warning-content {
  width: min(520px, 92vw);
  padding: 24px 18px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 18px;

  background: rgba(20,20,20,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}

.warning-content h1 {
  margin: 0 0 14px 0;
  color: var(--warning-accent);
  font-size: 22px;
  line-height: 1.35;
}

.warning-content p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.92;
}

/* Un mic hint vizual (optional) */
.warning-content::after {
  content: "↻";
  display: block;
  margin: 16px auto 0;
  font-size: 26px;
  opacity: 0.85;
}

/* ================================
   PORTRAIT RULE
================================ */
/* Daca e portrait, arata overlay si ascunde jocul */
@media (orientation: portrait) {
  #orientation-warning { display: flex; }
  #game-container { display: none; }
}

/* ================================
   REDUCE MOTION (accesibilitate)
================================ */
@media (prefers-reduced-motion: reduce) {
  .warning-content {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}