:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #fff1cd;
  background: #0b1521;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  justify-items: center;
}

#game {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
  background: #102336;
}

@media (min-width: 1024px) and (min-aspect-ratio: 4/3) and (pointer: fine) {
  #game { width: min(100%, 50dvh); }
}

#game[data-scrollable] {
  touch-action: none;
}

canvas, .controls {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.controls { pointer-events: none; }
.controls > * {
  position: absolute;
  margin: 0;
  appearance: none;
  background: transparent;
  color: transparent;
  border: 0;
  border-radius: .35rem;
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}
.controls input[type="range"] { opacity: .001; touch-action: pan-y; }
#game[data-flow-state="preparation"] .controls button { -webkit-tap-highlight-color: transparent; }
.controls button:focus-visible { outline: 2px solid #ffdf83; outline-offset: 2px; }
.controls:focus-within input[type="range"]:focus-visible { opacity: .24; }

.boot {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 86%;
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: #082240 var(--frame) center / 100% 100%;
  border-radius: .6rem;
}

.boot h1 { margin: 0; font-size: clamp(1.1rem, 5vi, 1.5rem); }
.boot p:empty, .preferences-feedback:empty { display: none; }
.boot p { margin: .75rem 0 0; font-size: .9rem; line-height: 1.45; }

.boot button {
  min-width: 7rem;
  min-height: 2.75rem;
  margin-top: 1rem;
  padding: .38rem .9rem;
  border: 0;
  border-radius: .36rem;
  color: #102741;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  background: #f5d36e var(--button) center / 100% 100%;
  cursor: pointer;
}

.preferences-feedback {
  position: absolute;
  inset: auto 1rem max(1rem, env(safe-area-inset-bottom)) 1rem;
  pointer-events: none;
  margin: 0;
  padding: .5rem .7rem;
  text-align: center;
  font-size: .85rem;
  background: #102336;
  border-radius: .4rem;
}
