:root {
  color-scheme: dark;
  font-family: Inter, ui-rounded, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071525;
}
body {
  display: grid;
  place-items: center;
  touch-action: none;
  overscroll-behavior: none;
}
#gameShell {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b2740;
  box-shadow: 0 0 80px #0008;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
}
#hud {
  position: absolute;
  z-index: 2;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  gap: clamp(8px, 2vw, 22px);
  align-items: center;
  transform: translateX(-50%);
  padding: 8px 15px;
  border: 1px solid #bdf5ff55;
  border-radius: 999px;
  background: #061725cc;
  color: #dffbff;
  font-size: clamp(11px, 1.5vw, 16px);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
#overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(#07182db8, #07182de8);
}
#overlay[hidden] {
  display: none;
}
.card {
  width: min(610px, 92%);
  padding: clamp(22px, 5vw, 42px);
  border: 2px solid #76f7e6;
  border-radius: 28px;
  background: #09223aee;
  text-align: center;
  box-shadow:
    0 22px 80px #0009,
    inset 0 0 40px #6bf6df16;
}
.eyebrow {
  margin: 0;
  color: #ffcf69;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  margin: 6px 0 12px;
  color: #9dffe9;
  font-size: clamp(42px, 9vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  text-shadow: 0 6px #134f68;
}
.keys {
  color: #b8d5e4;
  font-size: 13px;
}
#startButton {
  min-width: 190px;
  min-height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #65f3d2, #5baeff);
  color: #061725;
  font:
    900 17px/1 system-ui,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 #164f69;
}
#startButton:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #164f69;
}
#touchControls {
  position: absolute;
  z-index: 3;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: none;
  grid-template-columns: 62px 62px 1fr 72px;
  gap: 10px;
  pointer-events: none;
}
#touchControls button {
  height: 58px;
  border: 2px solid #dffff9cc;
  border-radius: 17px;
  background: #07182dc9;
  color: #fff;
  font:
    900 26px/1 system-ui,
    sans-serif;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
#touchControls button.pressed {
  background: #51ddc9e8;
  color: #062033;
  transform: translateY(2px);
}
#credit {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 8px;
  color: #c8e7ee99;
  font-size: 10px;
  pointer-events: none;
}
@media (hover: none), (pointer: coarse), (max-width: 720px) {
  #gameShell {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
  }

  #game {
    position: absolute;
    top: 50%;
    width: 100%;
    height: auto;
    transform: translateY(-50%);
  }

  #touchControls {
    display: grid;
  }
  #credit {
    display: none;
  }
  #hud {
    top: max(7px, env(safe-area-inset-top));
    padding: 6px 10px;
  }
}
