:root {
  --bg: #081226;
  --panel: #101e36;
  --accent: #ff9eb0;
  --accent-text: #571e2c;
  --muted: #b8c8de;
  --page-glow: rgba(255, 158, 176, 0.14);
}

body {
  background:
    radial-gradient(circle at 12% 6%, rgba(87, 216, 211, 0.18), transparent 25rem),
    radial-gradient(circle at 86% 12%, rgba(190, 132, 255, 0.13), transparent 23rem),
    linear-gradient(180deg, #0a1730, #050a17);
}

.stage {
  border-color: rgba(179, 223, 255, 0.16);
  background: rgba(11, 24, 44, 0.9);
}

.stage {
  aspect-ratio: 25 / 16;
  min-height: 0;
  box-shadow:
    0 0 0 1px rgba(132, 244, 208, 0.025),
    0 30px 85px rgba(0, 0, 0, 0.32);
}

#game-canvas {
  min-height: 0;
  background: #f2ecf5;
  cursor: pointer;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(255, 129, 154, 0.6);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hop-hud {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.75rem;
  color: #3f3a56;
}

.hop-hud__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hop-stat {
  min-width: 4.7rem;
  border: 1px solid rgba(90, 80, 120, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 18px rgba(90, 80, 120, 0.12);
  padding: 0.42rem 0.62rem;
  backdrop-filter: blur(8px);
}

.hop-stat small {
  display: block;
  color: #8a84a3;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hop-stat strong {
  display: block;
  margin-top: 0.08rem;
  font-size: clamp(0.84rem, 1.7vw, 1.06rem);
  letter-spacing: 0.02em;
}

.hop-stat--combo strong {
  color: #d98a2b;
}

.hud-restart {
  min-height: 2.35rem;
  border: 1px solid rgba(90, 80, 120, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #4a4363;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0 0.72rem;
  pointer-events: auto;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hud-restart:hover {
  border-color: rgba(224, 82, 110, 0.55);
  color: #e0526e;
}

.charge-panel {
  position: absolute;
  right: 0.8rem;
  bottom: 0.75rem;
  left: 0.8rem;
  border: 1px solid rgba(90, 80, 120, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(90, 80, 120, 0.16);
  padding: 0.62rem 0.75rem 0.58rem;
  backdrop-filter: blur(9px);
}

.charge-panel__copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
  color: #4a4363;
  font-size: clamp(0.66rem, 1.35vw, 0.82rem);
  font-weight: 900;
}

.charge-panel__state[data-tone="charging"] {
  color: #c9871f;
}

.charge-panel__state[data-tone="air"] {
  color: #4a86c9;
}

.charge-panel__state[data-tone="perfect"] {
  color: #1ea578;
}

.charge-panel__state[data-tone="danger"] {
  color: #e0526e;
}

.charge-panel__target {
  color: #8a84a3;
  text-align: right;
}

.charge-track {
  position: relative;
  height: 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(90, 80, 120, 0.18);
  border-radius: 999px;
  background: rgba(90, 80, 120, 0.1);
}

.charge-zone,
.charge-perfect-zone,
.charge-fill,
.charge-ideal {
  position: absolute;
  top: 0;
  bottom: 0;
}

.charge-zone {
  z-index: 1;
  border-radius: 999px;
  background: rgba(46, 196, 152, 0.24);
}

.charge-perfect-zone {
  z-index: 2;
  background: rgba(255, 183, 77, 0.5);
}

.charge-fill {
  left: 0;
  z-index: 3;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #56cfe1, #4fd6a8 58%, #ffc84d 82%, #ff819a);
  box-shadow: 0 0 14px rgba(255, 158, 176, 0.4);
  transition: width 35ms linear;
}

.charge-ideal {
  z-index: 4;
  width: 2px;
  background: rgba(74, 67, 99, 0.9);
  box-shadow: 0 0 6px rgba(74, 67, 99, 0.6);
}

.charge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.28rem;
  color: #8a84a3;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.overlay-card {
  width: min(470px, calc(100% - 1.4rem));
  border-color: rgba(90, 80, 120, 0.2);
  background: rgba(255, 252, 247, 0.95);
  color: #56506e;
  backdrop-filter: blur(12px);
}

.overlay-card h1,
.overlay-card h2 {
  color: #3f3a56;
}

.overlay-card p {
  color: #56506e;
}

.overlay-card .eyebrow {
  margin: 0 0 0.42rem;
  color: #e0526e;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.how-to {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin: 1rem 0;
}

.how-to span,
.result-grid > div {
  border: 1px solid rgba(90, 80, 120, 0.15);
  border-radius: 8px;
  background: rgba(90, 80, 120, 0.06);
  padding: 0.58rem 0.35rem;
}

.how-to small,
.result-grid small {
  display: block;
  color: #8a84a3;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.how-to strong,
.result-grid strong {
  display: block;
  margin-top: 0.2rem;
  color: #3f3a56;
  font-size: 0.82rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin: 1rem 0;
}

.overlay-note {
  margin-top: 0.75rem !important;
  margin-bottom: 0 !important;
  font-size: 0.78rem;
  opacity: 0.78;
}

.overlay-button:focus-visible,
.hud-restart:focus-visible,
.home-link:focus-visible {
  outline: 3px solid rgba(224, 82, 110, 0.55);
  outline-offset: 3px;
}

.control-note {
  margin-bottom: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.8rem;
  font-size: 0.81rem;
}

@media (max-width: 980px) {
  .stage {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .stage {
    aspect-ratio: auto;
    min-height: min(500px, calc(100svh - 1rem));
  }

  #game-canvas {
    min-height: 0;
  }

  .hop-hud {
    padding: 0.42rem;
  }

  .hop-hud__stats {
    gap: 0.25rem;
  }

  .hop-stat {
    min-width: 3.7rem;
    padding: 0.3rem 0.4rem;
  }

  .hop-stat small {
    font-size: 0.49rem;
  }

  .hud-restart {
    min-height: 2rem;
    padding-inline: 0.48rem;
  }

  .charge-panel {
    right: 0.45rem;
    bottom: 0.42rem;
    left: 0.45rem;
    padding: 0.46rem 0.52rem;
  }

  .charge-panel__copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.18rem;
  }

  .charge-panel__target {
    text-align: left;
  }

  .overlay-card {
    max-height: calc(100% - 1rem);
    overflow-y: auto;
    padding: 1rem;
    overscroll-behavior: contain;
  }

  .overlay-card p {
    font-size: 0.84rem;
  }

  .how-to {
    gap: 0.25rem;
    margin: 0.72rem 0;
  }

  .how-to span {
    padding-inline: 0.18rem;
  }
}

@media (max-width: 390px) {
  .hop-stat--best {
    display: none;
  }

  .how-to strong {
    font-size: 0.7rem;
  }
}
