:root {
  color-scheme: dark;
  --text: #f3fbff;
  --muted: #a8bdd0;
  --panel: rgba(9, 22, 34, .72);
  --line: rgba(255, 255, 255, .16);
  --accent: #ffd166;
  --accent-strong: #ff9f1c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #102233;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #102233;
  touch-action: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  z-index: 4;
  top: max(.85rem, env(safe-area-inset-top));
  left: max(.75rem, env(safe-area-inset-left));
  right: max(.75rem, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
}

#start {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

.score {
  grid-column: 2;
  min-width: 3.4rem;
  text-align: center;
  color: #fff8df;
  font-size: clamp(2.6rem, 13vw, 4.4rem);
  line-height: .9;
  text-shadow:
    0 3px 0 rgba(46, 57, 68, .72),
    0 8px 22px rgba(0, 0, 0, .28);
}

.best {
  justify-self: end;
  align-self: start;
  padding: .32rem .48rem;
  border-radius: 8px;
  background: rgba(8, 18, 28, .22);
  color: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .09);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(5, 15, 27, .08), rgba(5, 15, 27, .38));
  pointer-events: none;
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(100%, 340px);
  padding: 1.25rem;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .32);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.panel h1 {
  margin: 0;
  font-size: clamp(2rem, 12vw, 3.3rem);
  line-height: .94;
  letter-spacing: 0;
}

.panel p {
  margin: .75rem 0 1rem;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.35;
}

#start {
  width: 100%;
  min-height: 2.9rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #221300;
  font-weight: 1000;
  cursor: pointer;
}

@media (max-width: 430px) {
  .best {
    font-size: .66rem;
    padding: .28rem .4rem;
  }
}
