:root {
  --wr-vh: 1vh;
  --wr-safe-top: env(safe-area-inset-top, 0px);
  --wr-safe-right: env(safe-area-inset-right, 0px);
  --wr-safe-bottom: env(safe-area-inset-bottom, 0px);
  --wr-safe-left: env(safe-area-inset-left, 0px);
  --wr-frame-width: min(100vw, calc(100dvh * 2 / 3), 400px);
  --wr-frame-height: min(100dvh, calc(100vw * 3 / 2), 600px);
  --wr-font-scale: 1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
  background: #071117;
}

body {
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: #f5f7f8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  touch-action: none;
}

button,
input,
[tabindex] {
  font: inherit;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

input,
.panel-scroll {
  user-select: text;
  -webkit-user-select: text;
}

#game-container {
  position: relative;
  width: var(--wr-frame-width);
  height: var(--wr-frame-height);
  max-width: 400px;
  max-height: 600px;
  min-width: 240px;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  background: #081921;
  border-radius: clamp(0px, 2.4vmin, 18px);
  contain: layout paint style;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #081921;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding:
    max(14px, var(--wr-safe-top))
    max(14px, var(--wr-safe-right))
    max(14px, var(--wr-safe-bottom))
    max(14px, var(--wr-safe-left));
  color: #fff;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.wr-filter-defs {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden],
[inert] {
  pointer-events: none;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 3px solid #ffe17d;
  outline-offset: 3px;
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --wr-frame-width: min(calc(100dvh * 2 / 3), 400px);
    --wr-frame-height: min(100dvh, 600px);
  }
}

@media (max-width: 270px), (max-height: 400px) {
  #game-container {
    min-width: 0;
    min-height: 0;
    border-radius: 0;
  }
}
