.fun-body { padding-bottom: 28px; }
.fun-body main { max-width: 880px; }
.fun-body h1,
.play-body h1 {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 6vw, 2.8rem);
}
.scan {
  position: relative;
}
.scan::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .16) 0 1px,
    transparent 1px 3px
  );
  border-radius: inherit;
  opacity: .45;
}
.fun-body .card {
  border-width: 3px;
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(124, 92, 255, .55);
}
.blurb { max-width: 62ch; }

.play-body {
  padding: 12px 12px 20px;
}
.play-body main { max-width: 920px; }
.play-top {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.play-top h1 { font-size: clamp(1.15rem, 4vw, 1.7rem); margin: 0; }
.hud {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #3ee0d0;
  font-size: .82rem;
  min-height: 1.2em;
  margin: .15rem 0 .35rem;
}
.msgline {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #ffd166;
  font-size: .86rem;
  min-height: 1.3em;
  margin: 0 0 .35rem;
}
.stage-wrap {
  position: relative;
  width: min(100%, 640px);
  margin-inline: auto;
  border: 3px solid rgba(62, 224, 208, .55);
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .35), 6px 6px 0 rgba(11, 16, 32, .4);
  background: #100a22;
  overflow: hidden;
}
.stage-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #100a22;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  padding: 1rem;
  text-align: center;
  background: rgba(11, 16, 32, .82);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.overlay[hidden] { display: none; }
.overlay h2 {
  color: #e8f0ff;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0;
}
.overlay p { font-size: .86rem; margin: 0; max-width: 42ch; }
.overlay .cta, .pad button, .inv button, .mini {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.helpkeys { color: #b4c0dc; font-size: .78rem; line-height: 1.55; }

.inv {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin: .55rem 0 .2rem;
  min-height: 44px;
}
.inv button, .pad button, .mini {
  border: 2px solid rgba(62, 224, 208, .55);
  background: #14102a;
  color: #e8f0ff;
  border-radius: 8px;
  cursor: pointer;
}
.inv button {
  min-width: 76px;
  min-height: 44px;
  padding: .35rem .5rem;
  font-size: .72rem;
  text-transform: uppercase;
}
.inv button.on {
  border-color: #ffd166;
  color: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, .25);
}
.pad {
  display: grid;
  grid-template-columns: 64px 64px 64px 1fr 1fr;
  grid-template-areas:
    ". up . jump use"
    "left down right jump use"
    "drop drop drop drop drop";
  gap: .4rem;
  width: min(100%, 520px);
  margin: .7rem auto 0;
  touch-action: none;
  user-select: none;
}
.pad .drop { grid-area: drop; }
.pad button {
  min-height: 52px;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  background: linear-gradient(180deg, #24184a, #14102a);
}
.pad .up { grid-area: up; }
.pad .down { grid-area: down; }
.pad .left { grid-area: left; }
.pad .right { grid-area: right; }
.pad .jump { grid-area: jump; background: linear-gradient(180deg, #3ee0d0, #1a8f86); color: #0b1020; }
.pad .use { grid-area: use; background: linear-gradient(180deg, #ffd166, #d7a441); color: #0b1020; }
.minirow {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: .55rem;
}
.mini { min-height: 40px; padding: .4rem .8rem; font-size: .75rem; }
@media (max-width: 520px) {
  .pad { grid-template-columns: 56px 56px 56px 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .scan::after { display: none; }
}
