:root {
  --bg-a: #07131f;
  --bg-b: #132f46;
  --ink: #fff9df;
  --muted: rgba(255, 249, 223, .72);
  --hot: #ffcf56;
  --pink: #ff647c;
  --blue: #63d9ff;
  --green: #78ffb4;
  --panel: rgba(255, 255, 255, .09);
  --edge: rgba(255, 255, 255, .2);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(99, 217, 255, .28), transparent 28rem),
    radial-gradient(circle at 80% 18%, rgba(255, 100, 124, .24), transparent 24rem),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
  color: var(--ink);
  font-family: ui-rounded, "Trebuchet MS", "Avenir Next", Verdana, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  opacity: .42;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 36px 36px;
  transform: rotate(-7deg);
}

.shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.phone-stage {
  position: relative;
  width: min(100%, 460px);
  height: min(100svh - 28px, 820px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: clamp(24px, 7vw, 44px);
  background: rgba(7, 19, 31, .45);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .12);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.hud {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.hud > div {
  min-width: 88px;
  padding: 10px 13px;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: rgba(4, 12, 20, .42);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 2px;
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
  background: radial-gradient(circle at 50% 43%, rgba(7, 19, 31, .28), rgba(7, 19, 31, .76) 66%);
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(58px, 17vw, 104px);
  line-height: .82;
  letter-spacing: -.08em;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .2), 0 0 34px rgba(255, 207, 86, .34);
}

.intro {
  max-width: 330px;
  margin: 20px 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 16px 24px;
  color: #1b1300;
  background: linear-gradient(135deg, var(--hot), #ffef9c);
  box-shadow: 0 14px 0 #9e5d16, 0 24px 42px rgba(0, 0, 0, .36);
  font: inherit;
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
  transform: translateY(0);
}

button:active {
  transform: translateY(8px);
  box-shadow: 0 6px 0 #9e5d16, 0 16px 32px rgba(0, 0, 0, .28);
}

.controls {
  margin: 24px 0 0;
  color: rgba(255, 249, 223, .58);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-height: 620px) {
  .phone-stage { min-height: 0; height: 100svh; border-radius: 0; }
  .shell { padding: 0; }
  .intro { margin-block: 14px 18px; }
}
