:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-rounded,
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #542c63;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, #ff8c67 0, transparent 30%),
    radial-gradient(circle at 85% 90%, #7c4cc4 0, transparent 35%),
    linear-gradient(150deg, #f95a4c, #5a3270);
}

button {
  min-width: 11rem;
  min-height: 3rem;
  padding: 0.8rem 1.25rem;
  border: 0;
  border-radius: 999px;
  color: #43233a;
  background: #fff3c7;
  box-shadow: 0 0.5rem 1.5rem rgb(48 19 50 / 35%);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:focus-visible {
  outline: 0.2rem solid #fff;
  outline-offset: 0.25rem;
}

[hidden] {
  display: none !important;
}

.game-shell {
  position: relative;
  width: min(100vw, calc(100vh / 1.5));
  max-width: 40rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  isolation: isolate;
  background: #8fe6ef;
  box-shadow: 0 1.5rem 4rem rgb(38 15 47 / 45%);
  touch-action: none;
  user-select: none;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.5rem, 7vw, 3rem);
  text-align: center;
  color: #fff;
  background:
    linear-gradient(rgb(43 29 71 / 28%), rgb(43 29 71 / 62%)),
    radial-gradient(circle at 50% 15%, #ffbb67, transparent 42%);
  text-shadow: 0 0.15rem 0.3rem rgb(38 15 47 / 45%);
}

.screen h1,
.screen p {
  margin: 0;
}

.screen h1 {
  max-width: 10ch;
  font-size: clamp(2.4rem, 11vw, 4.7rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.screen > p:not(.eyebrow):not(.controls) {
  max-width: 26rem;
  font-size: clamp(1rem, 3.6vw, 1.3rem);
  line-height: 1.5;
}

.eyebrow {
  font-size: clamp(0.72rem, 2.7vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.controls {
  max-width: 24rem;
  color: #fff7de;
  font-size: clamp(0.78rem, 2.8vw, 0.95rem);
  line-height: 1.4;
}

.loading progress {
  width: min(18rem, 80%);
  height: 0.8rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 25%);
}

.loading progress::-webkit-progress-bar {
  background: rgb(255 255 255 / 25%);
}

.loading progress::-webkit-progress-value {
  background: #fff3c7;
}

.loading progress::-moz-progress-bar {
  background: #fff3c7;
}

.game-over {
  background: rgb(50 25 61 / 80%);
  backdrop-filter: blur(0.4rem);
}

.final-score strong {
  display: block;
  margin-top: 0.2rem;
  color: #fff3c7;
  font-size: clamp(3rem, 15vw, 6rem);
  line-height: 1;
}

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