@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: "Space Grotesk", sans-serif;
  background: #09051f;
  color: #f9f7ff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --cyan: #00e9ff;
  --pink: #f342ed;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse at 50% 47%, rgba(52, 16, 110, 0.27), transparent 49%),
    #09051f;
}

button,
a {
  color: inherit;
  font: inherit;
}

.game-shell {
  position: relative;
  display: flex;
  width: min(100%, 620px);
  height: 100%;
  min-height: 480px;
  margin: 0 auto;
  flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) 28px max(18px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.top-bar,
.bottom-bar {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark span {
  color: var(--cyan);
}

.best-score,
.bottom-bar p,
.eyebrow {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.best-score {
  color: #9389bb;
}

.best-score strong {
  margin-left: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.game-area {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.score {
  position: absolute;
  z-index: 1;
  top: 8%;
  left: 50%;
  color: #fff;
  font-size: clamp(42px, 12vw, 68px);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 24px rgba(0, 233, 255, 0.2);
  transform: translateX(-50%);
  pointer-events: none;
}

.game-message {
  z-index: 1;
  width: 100%;
  margin-top: 15%;
  text-align: center;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.game-message.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
}

.game-message h1 {
  margin: 0;
  font-size: clamp(38px, 11vw, 58px);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.message-copy {
  margin: 14px 0 22px;
  color: #aaa1c7;
  font-size: 13px;
}

.play-button {
  min-width: 144px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, #00cce9, #8861ff);
  box-shadow: 0 0 30px rgba(0, 225, 255, 0.26);
  color: #09051f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.play-button:hover {
  box-shadow: 0 0 38px rgba(0, 225, 255, 0.42);
  transform: translateY(-2px);
}

.play-button span {
  margin-left: 8px;
  font-size: 16px;
}

.bottom-bar {
  gap: 16px;
}

.switch-button {
  padding: 12px 15px;
  border: 1px solid rgba(0, 233, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 233, 255, 0.06);
  color: #d7faff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.switch-button:hover,
.switch-button:active {
  border-color: var(--cyan);
  background: rgba(0, 233, 255, 0.16);
}

.switch-button span {
  margin-left: 8px;
  color: var(--cyan);
}

.bottom-bar p {
  margin: 0;
  color: #70678f;
  font-size: 9px;
  white-space: nowrap;
}

@media (max-height: 620px) {
  .game-shell {
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .game-message {
    margin-top: 12%;
  }

  .game-message h1 {
    font-size: 40px;
  }

  .message-copy {
    margin: 8px 0 12px;
  }

  .play-button {
    padding: 11px 18px;
  }
}

@media (max-width: 380px) {
  .game-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .bottom-bar p {
    font-size: 8px;
  }
}

@media (max-height: 240px) {
  .game-shell {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .score {
    top: 0;
    font-size: 16px;
  }

  .game-message {
    margin-top: 0;
  }

  .game-message h1,
  .game-message .eyebrow,
  .game-message .message-copy {
    display: none;
  }

  .play-button,
  .switch-button {
    padding: 6px 12px;
  }
}
