:root {
  --game-viewport-left: 0px;
  --game-viewport-top: 0px;
  --game-viewport-width: 100vw;
  --game-viewport-height: 100vh;
  --game-safe-top: env(safe-area-inset-top, 0px);
  --game-safe-right: env(safe-area-inset-right, 0px);
  --game-safe-bottom: env(safe-area-inset-bottom, 0px);
  --game-safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
  font-family: "Lucida Grande", "PingFang SC", system-ui, sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: var(--game-viewport-width);
  height: var(--game-viewport-height);
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

body {
  position: fixed;
  top: var(--game-viewport-top);
  left: var(--game-viewport-left);
  color: #fff;
  font-size: 13px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

#game-root {
  position: absolute;
  top: var(--game-safe-top);
  right: var(--game-safe-right);
  bottom: var(--game-safe-bottom);
  left: var(--game-safe-left);
  overflow: hidden;
  container-type: size;
}

.direct-game-window {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  border: 0;
  background: #000;
}

.win-body {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body[data-game="sdvx"] .direct-game-window {
  right: auto;
  left: 50%;
  width: min(100%, 56.05dvh) !important;
  transform: translateX(-50%);
}

@supports (width: 1cqh) {
  body[data-game="sdvx"] .direct-game-window {
    width: min(100cqw, 56.05cqh) !important;
  }
}

#game-error {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--game-safe-top))
    calc(24px + var(--game-safe-right))
    calc(24px + var(--game-safe-bottom))
    calc(24px + var(--game-safe-left));
  color: #dcecff;
  background: radial-gradient(circle at 50% 35%, #101b31, #020409 72%);
  text-align: center;
}

#game-error[hidden] {
  display: none;
}

#game-error h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 20px;
}

#game-error p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

#game-error button {
  margin-top: 16px;
  padding: 6px 18px;
}
