.game-root { min-height: 34rem; }

.echo-num {
  display: inline-block;
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.echo-go {
  min-width: 8.6rem;
  white-space: nowrap;
}

.echo-stage {
  width: min(100%, 30rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  user-select: none;
}

.echo-status {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  text-align: center;
}

.echo-line,
.echo-note {
  margin: 0;
  line-height: 1.35;
  min-height: 1.35em;
}

.echo-line { color: #f4f0e8; }

.echo-note {
  color: #d5ddd6;
  font-size: 0.95rem;
}

.echo-note.is-good { color: #e0b948; }

.echo-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  aspect-ratio: 1;
  padding: 0.8rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #14241e;
  box-shadow:
    inset 0 0 0 1px rgba(232, 217, 168, 0.38),
    inset 0 12px 24px rgba(0, 0, 0, 0.25);
}

.echo-pad {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  min-height: var(--tap-min);
  color: #f4f0e8;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -8px 14px rgba(0, 0, 0, 0.18);
  transition: background-color 80ms linear, color 80ms linear;
}

.echo-pad:disabled {
  opacity: 1;
  color: #f4f0e8;
  cursor: default;
}

.echo-pad.is-lit,
.echo-pad.is-lit:disabled { color: #1d2433; }

.echo-pad:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 3px;
}

.echo-pad[data-pad="green"] { background: #1e5c3d; }
.echo-pad[data-pad="amber"] { background: #9a6412; }
.echo-pad[data-pad="blue"] { background: #1e4578; }
.echo-pad[data-pad="rose"] { background: #7d2e40; }

.echo-pad[data-pad="green"].is-lit { background: #c6ead4; }
.echo-pad[data-pad="amber"].is-lit { background: #ffe6ad; }
.echo-pad[data-pad="blue"].is-lit { background: #c5daf6; }
.echo-pad[data-pad="rose"].is-lit { background: #f6cdd4; }

.echo-pad.is-miss::after {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border: 3px solid currentColor;
  border-radius: 12px;
  pointer-events: none;
}

.echo-mark {
  width: 26%;
  height: 26%;
  overflow: visible;
}

.echo-mark circle,
.echo-mark path,
.echo-mark rect { fill: currentColor; }

.echo-key {
  position: absolute;
  top: 0.5rem;
  left: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
  pointer-events: none;
}

@media (max-width: 640px), (pointer: coarse) {
  .echo-key { display: none; }
  .echo-note.is-keys { visibility: hidden; }
}
