:root {
  color-scheme: dark;
  --ink: #edf7ff;
  --muted: #8ba7b6;
  --panel: #111820;
  --panel-2: #17222c;
  --accent: #64f4c8;
  --danger: #ff4d6d;
  --gold: #ffd166;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 18%, rgba(100, 244, 200, 0.16), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(255, 209, 102, 0.12), transparent 24%),
    linear-gradient(160deg, #071017 0%, #10141c 44%, #1a161f 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
kbd {
  font: inherit;
}

.shell {
  width: min(1160px, 100%);
}

.hud,
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hud {
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

p {
  margin: 0;
  color: var(--muted);
}

.meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
  width: min(520px, 100%);
}

.meters span {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(237, 247, 255, 0.12);
  background: rgba(17, 24, 32, 0.72);
}

.meters b,
.meters small {
  display: block;
}

.meters b {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 1.45rem;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.meters small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(237, 247, 255, 0.14);
  background: #060c12;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: min(74vh, 760px);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
  background: linear-gradient(180deg, rgba(6, 12, 18, 0.1), rgba(6, 12, 18, 0.74));
}

.overlay.hidden {
  display: none;
}

.mark {
  color: rgba(237, 247, 255, 0.92);
  font-size: 7rem;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(100, 244, 200, 0.46);
}

button {
  min-width: 148px;
  min-height: 48px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #06100e;
  cursor: pointer;
  font-weight: 800;
}

button:hover,
button:focus-visible {
  background: #9cffdf;
  outline: 3px solid rgba(100, 244, 200, 0.32);
  outline-offset: 3px;
}

.bar {
  min-height: 58px;
  padding-top: 12px;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

kbd {
  min-width: 42px;
  padding: 6px 9px;
  border: 1px solid rgba(237, 247, 255, 0.18);
  background: rgba(237, 247, 255, 0.07);
  color: var(--ink);
  text-align: center;
}

@media (max-width: 760px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .mark {
    font-size: 3.5rem;
  }

  .hud,
  .bar {
    align-items: stretch;
    flex-direction: column;
  }

  .meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bar {
    gap: 10px;
  }
}
