:root {
  color-scheme: dark;
  background: #030611;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 45%, #0d1c32 0%, #030611 72%);
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#game-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding-top: max(env(safe-area-inset-top), 0px);
  padding-right: max(env(safe-area-inset-right), 0px);
  padding-bottom: max(env(safe-area-inset-bottom), 10px);
  padding-left: max(env(safe-area-inset-left), 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(31, 73, 108, .22) 0 18%, transparent 54%),
    linear-gradient(180deg, #02050d 0%, #071321 50%, #02050d 100%);
}

#game {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
}

@media (min-aspect-ratio: 9 / 16) {
  #game {
    width: auto;
    height: 100%;
  }
}

/* Galaxy S23 class devices: 360×780 CSS px / 1080×2340 physical px. */
@media (max-aspect-ratio: 10 / 19) and (orientation: portrait) {
  #game-shell {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
  }

  #game {
    width: 100%;
    height: auto;
  }
}

#rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  align-content: center;
  justify-items: center;
  gap: 16px;
  background: #050914;
  color: #d9efff;
  text-align: center;
  padding: max(env(safe-area-inset-top), 20px) max(env(safe-area-inset-right), 20px) max(env(safe-area-inset-bottom), 20px) max(env(safe-area-inset-left), 20px);
}

#rotate-hint img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (orientation: landscape) and (max-height: 640px) {
  #game { display: none; }
  #rotate-hint { display: grid; }
}
