html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

:root {
  --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);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top, #1d2333 0%, #0d1018 55%, #080a10 100%);
}

.botao-voltar-jogos {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
  color: #e9f5ff;
  background: rgba(17, 26, 42, 0.78);
  border: 1px solid rgba(120, 210, 255, 0.45);
  backdrop-filter: blur(8px);
}

.botao-voltar-jogos .seta-voltar-jogos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 1.08em;
  line-height: 1;
  transform: translateY(-0.02em);
}

.botao-voltar-jogos .texto-voltar-jogos {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.game-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: stretch;
  padding: 0;
  overflow: hidden;
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #070b14;
}

/* Modo tela cheia: preenche toda a viewport, sem barras/margens. */
.game-shell--ratio-lock {
  --game-ratio-w: 16;
  --game-ratio-h: 9;
}

.game-shell--ratio-lock .game-frame {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

@supports not (height: 100dvh) {
  .game-shell {
    height: 100vh;
  }
}

@media (max-width: 640px) {
  .botao-voltar-jogos {
    left: 50%;
    top: calc(env(safe-area-inset-top) + 10px);
    transform: translateX(-50%);
    padding: 11px 22px;
    font-size: 1.05rem;
  }
}
