:root {
  --void: #070b12;
  --asphalt: #101820;
  --crimson: #c4122f;
  --ember: #ff4d3a;
  --steel: #9eb0c4;
  --ice: #e8f1ff;
  --neon: #3de0c8;
  --panel: rgba(8, 14, 24, 0.82);
  --font-display: "Orbitron", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--ice);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(196, 18, 47, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(61, 224, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #0a101a 0%, #05070c 100%);
}

.frame {
  width: min(100vw - 1.5rem, 460px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 0 1.25rem;
}

.brand {
  text-align: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  letter-spacing: 0.18em;
  color: var(--ice);
  text-shadow: 0 0 24px rgba(196, 18, 47, 0.45);
}

.brand-sub {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--steel);
}

.stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(158, 176, 196, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.55);
  background: var(--asphalt);
  aspect-ratio: 420 / 720;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 0.85rem;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
  z-index: 2;
}

.hud > span {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ice);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(61, 224, 200, 0.35);
}

.boost-wrap {
  width: min(78%, 240px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(8, 14, 24, 0.72);
  border: 1px solid rgba(158, 176, 196, 0.22);
}

.boost-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: #ffb347;
}

.boost-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(158, 176, 196, 0.25);
}

.boost-fill {
  height: 100%;
  width: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a18 0%, #ffb347 55%, #ffe29a 100%);
  box-shadow: 0 0 10px rgba(255, 158, 40, 0.5);
  transition: none;
}

.boost-fill.low {
  background: linear-gradient(90deg, #8a0d22 0%, #c4122f 45%, #ff4d3a 100%);
  box-shadow: 0 0 10px rgba(196, 18, 47, 0.55);
}

.boost-fill.empty {
  width: 0% !important;
  background: transparent;
  box-shadow: none;
}

.boost-pct {
  font-family: var(--font-display);
  font-size: 0.72rem;
  min-width: 2.2rem;
  text-align: right;
  color: #ffd166;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(5, 8, 14, 0.35), rgba(5, 8, 14, 0.72));
  backdrop-filter: blur(2px);
  z-index: 3;
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(88%, 300px);
  padding: 1.6rem 1.35rem 1.4rem;
  border-radius: 16px;
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(158, 176, 196, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.panel h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.65rem;
}

.panel p {
  color: var(--steel);
  line-height: 1.45;
  font-size: 0.95rem;
}

.best {
  margin-top: 0.75rem;
  color: var(--neon) !important;
  font-weight: 500;
}

#start {
  margin-top: 1.15rem;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ice);
  cursor: pointer;
  background: linear-gradient(135deg, var(--crimson), #8a0d22 55%, #5c0917);
  box-shadow: 0 8px 24px rgba(196, 18, 47, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

#start:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#start:active {
  transform: translateY(1px);
}

.hint {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(158, 176, 196, 0.75);
}

@media (max-width: 480px) {
  .frame {
    width: 100vw;
    padding: 0.5rem 0 1rem;
    gap: 0.6rem;
  }

  .stage {
    border-radius: 0;
  }

  .brand-sub,
  .hint {
    padding: 0 1rem;
  }
}
