:root {
  color-scheme: dark;
  --ground: #120c1f;
  --glow: #2a1638;
  --ink: #f6ead8;
  --muted: #b3a3c4;
  --teal: #3ee6d2;
  --ember: #ff9e63;
  --edge: #3a2a52;
  --key-top: #2d2145;
  --key-rim: #5a4778;
  --key-side: #0b0710;
  --display: 'Bangers', Impact, 'Arial Black', sans-serif;
  --pixel: 'Silkscreen', ui-monospace, Menlo, Consolas, monospace;
  /* Largest 16:9 stage that still leaves room for the header and key strip. */
  --stage-w: min(100%, 1600px, max(480px, calc((100vh - 150px) * 16 / 9)));
}

@supports (height: 100dvh) {
  :root {
    --stage-w: min(100%, 1600px, max(480px, calc((100dvh - 150px) * 16 / 9)));
  }
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 38%, var(--glow) 0%, var(--ground) 70%) var(--ground);
  color: var(--ink);
  font-family: var(--pixel);
}

.shell {
  box-sizing: border-box;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-inline: 16px;
  padding-block: 14px 18px;
}

.masthead {
  width: var(--stage-w);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px 16px;
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--teal);
}

.tag {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage {
  width: var(--stage-w);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #1d1538;
  box-shadow: 0 0 0 2px var(--edge), 0 28px 80px -28px rgba(255, 140, 90, 0.45);
  transition: box-shadow 0.2s ease;
}

.stage:focus-within {
  box-shadow: 0 0 0 2px var(--teal), 0 28px 80px -28px rgba(255, 140, 90, 0.45);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.keys {
  width: var(--stage-w);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.keys li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

kbd {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--key-rim);
  border-radius: 5px;
  background: var(--key-top);
  box-shadow: 0 3px 0 var(--key-side);
  font-family: var(--pixel);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.touch-note {
  display: none;
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--ember);
}

.touch-note.is-visible {
  display: block;
}

@media (hover: none) and (pointer: coarse) {
  .touch-note {
    display: block;
  }

  .keys {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage {
    transition: none;
  }
}
