/* WIOW is coming for us..: black sky, the title on top, scores under its right end, Game start at
   the bottom (sketch IMG_0498). */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #f2f2f2;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
  touch-action: none; /* The stick and laser button, not page scrolling or zooming */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sky {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- title and scores ---------- */

.top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  padding: max(22px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
  text-align: center;
}

.top__inner {
  display: inline-block;
  max-width: 100%;
}

.title {
  margin: 0;
  font-family: 'Bungee', system-ui, sans-serif;
  font-size: clamp(26px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.scores {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.score {
  margin: 0;
  padding: 6px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* "Speed up!" every 20 seconds */
.banner {
  position: fixed;
  top: 30%;
  left: 0;
  right: 0;
  margin: 0;
  color: #ffd60a;
  font-family: 'Bungee', system-ui, sans-serif;
  font-size: clamp(22px, 3.4vw, 36px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.banner.is-shown {
  opacity: 1;
}

/* ---------- start / game over ---------- */

.menu {
  position: fixed;
  bottom: max(9vh, 36px);
  left: 50%;
  width: min(92vw, 520px);
  transform: translateX(-50%);
  text-align: center;
}

.menu__over {
  margin: 0 0 6px;
  color: #ff5a5a;
  font-family: 'Bungee', system-ui, sans-serif;
  font-size: clamp(20px, 3vw, 28px);
}

.menu__help {
  margin: 0 0 16px;
  color: #9aa0a8;
  font-size: 14px;
}

.menu__start {
  padding: 14px 36px;
  border: 1.5px solid #fff;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.menu__start:hover,
.menu__start:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- phone controls ---------- */

.pad__stick {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.pad__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.pad__laser {
  position: fixed;
  bottom: calc(max(28px, env(safe-area-inset-bottom)) + 22px);
  left: calc(50% - 60px - 20px - 76px); /* Left of the stick */
  width: 76px;
  height: 76px;
  padding: 0;
  border: 2px solid #ff3b3b;
  border-radius: 50%;
  background: rgba(255, 40, 40, 0.16);
  color: #ff8a8a;
  font-family: 'Bungee', system-ui, sans-serif;
  font-size: 12px;
}

.pad__laser.is-on {
  background: rgba(255, 40, 40, 0.45);
  color: #fff;
}
