#game { background: #05050a; }

.screen-wrap {
  position: relative;
  line-height: 0;
  box-shadow: 0 0 0 2px #2a2a3a, 0 0 60px rgba(75,224,255,.12);
}

#screen {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  /* Celočíselná mierka a žiadne vyhladzovanie — pixel musí ostať pixelom. */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0b0b0b;
}

/* Plátno je 832×624; na širokých obrazovkách ho necháme dýchať. */
@media (min-aspect-ratio: 4/3) {
  #screen { height: 100vh; width: auto; }
}
@media (max-aspect-ratio: 4/3) {
  #screen { width: 100vw; height: auto; }
}

/* --- dotykové ovládanie ----------------------------------------------------- */

.touchpad { display: none; }

body.is-touch .touchpad {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;   /* prsty na ploche patria hre, nie panelu */
}

body.is-touch .tbtn {
  position: absolute;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: #f8f0c0;
  background: rgba(10, 6, 20, .55);
  border: 2px solid rgba(255, 75, 168, .5);
  border-radius: 50%;
  /* Prst nemá presnosť myši — nič menšie než ~64 px sa netrafí spoľahlivo. */
  width: 74px; height: 74px;
  font-size: 26px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
body.is-touch .tbtn.is-down { background: rgba(255, 75, 168, .45); transform: scale(.94); }

body.is-touch .tbtn--fire { right: 18px; bottom: 20px; width: 92px; height: 92px; font-size: 32px; }
body.is-touch .tbtn--ability { right: 118px; bottom: 34px; }
body.is-touch .tbtn--build { right: 30px; bottom: 124px; }

/* Plátno nesmie reagovať na gestá prehliadača, inak hra pri ťahu odscrolluje. */
body.is-touch #screen { touch-action: none; }
body.is-touch { overscroll-behavior: none; }

/* --- lišta hry (dotyk) ------------------------------------------------------ */

.gamebar { display: none; }

/*
 * Na dotyku nie je klávesnica. Bez tejto lišty sa po konci kola nedalo
 * spustiť ďalšie ani odísť do menu — hra sa jednoducho zasekla.
 */
body.is-touch .gamebar.is-on {
  display: flex;
  position: absolute;
  left: 0; right: 0; top: 0;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  pointer-events: none;
  z-index: 5;
}

body.is-touch .gbtn {
  pointer-events: auto;
  min-height: 46px;
  padding: 12px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #f0f0f8;
  background: rgba(10, 6, 20, .82);
  border: 2px solid #3a2a58;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* „Ďalej" je to, čo hráč hľadá — patrí do stredu a musí byť najvýraznejšie. */
body.is-touch .gbtn--go {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 60px);
  min-width: 220px;
  min-height: 62px;
  font-size: 18px;
  color: #0b0b12;
  background: #f8d048;
  border-color: #f8d048;
}
body.is-touch .gbtn--go:active { transform: translate(-50%, 60px) scale(.96); }

/* --- pauzové menu ----------------------------------------------------------- */

/*
 * Kreslené na canvase by sa nedalo kliknúť. ESC teraz pauzuje a ponúkne odchod,
 * takže to musí byť skutočný DOM — funguje myšou aj prstom.
 */
.pausemenu {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, .82);
  z-index: 8;
}
.pausemenu[hidden] { display: none; }

.pausemenu__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 34px 40px;
  text-align: center;
  background: rgba(8, 5, 16, .96);
  border: 2px solid #3a2a58;
}
.pausemenu__box h3 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .16em;
  color: #e8e8f0;
}
.pausemenu__box .settings__hint { margin: 6px 0 0; }
