.game-root {
  min-height: 40rem;
  display: flex;
  flex-direction: column;
}

.game-root.is-filled {
  overflow: auto;
  min-height: 0;
}

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

.pm-num.is-low { color: var(--danger); }

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

.pm-stage {
  width: min(100%, 36rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  user-select: none;
  flex: 1 1 auto;
  min-height: 0;
}

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

.pm-line,
.pm-note,
.pm-ask,
.pm-name,
.pm-time {
  margin: 0;
  line-height: 1.35;
  min-height: 1.35em;
}

.pm-line { color: #f4f0e8; }

.pm-note,
.pm-ask {
  color: #d5ddd6;
  font-size: 0.95rem;
}

.pm-note.is-good,
.pm-name {
  color: #e0b948;
}

.pm-ask {
  color: #f4f0e8;
  font-size: 1.35rem;
}

.pm-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.pm-prompt {
  min-height: 9.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
}

.pm-time {
  min-height: 1.2em;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: #d5ddd6;
}

.pm-meter {
  width: min(100%, 12rem);
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.2);
  overflow: hidden;
}

.pm-meter-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #e0b948;
  transform: scaleX(0);
  transform-origin: left center;
}

.pm-ready {
  appearance: none;
  -webkit-appearance: none;
  min-height: var(--tap-min);
  min-width: 8rem;
  margin: 0;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 10px;
  font: 600 1rem/1 var(--font-sans);
  color: #1d2433;
  background: #fffdf7;
  box-shadow: inset 0 0 0 2px rgba(184, 146, 58, 0.95);
  cursor: pointer;
  touch-action: manipulation;
}

.pm-ready.is-held {
  visibility: hidden;
  pointer-events: none;
}

.pm-ready:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 2px;
}

.pm-board {
  min-height: calc(5 * var(--tap-min) + 4 * 0.45rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm-grid {
  --gap: 0.45rem;
  display: grid;
  grid-template-columns: repeat(var(--side, 4), minmax(var(--tap-min), 1fr));
  gap: var(--gap);
  width: min(100%, calc(var(--side) * 5.25rem + (var(--side) - 1) * var(--gap)));
}

.pm-cell {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #efe6d4;
  box-shadow: inset 0 0 0 1px rgba(90, 62, 32, 0.35);
  color: #1d2433;
  cursor: pointer;
  touch-action: manipulation;
  font: inherit;
}

.pm-grid.is-locked .pm-cell { cursor: default; }

.pm-cell.is-shown {
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px rgba(184, 146, 58, 0.55);
}

.pm-cell.is-hole {
  background: #1a2c24;
  box-shadow: inset 0 0 0 1px rgba(224, 185, 72, 0.28);
  cursor: default;
}

.pm-cell.is-found {
  background: #fffdf7;
  box-shadow: inset 0 0 0 2px #2e6b4e;
  cursor: default;
}

.pm-cell.is-flash {
  background: #fffdf7;
  box-shadow: inset 0 0 0 3px #e0b948;
}

.pm-cell:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 2px;
}

.pm-emoji {
  font-size: clamp(1.45rem, 2.8vw, 2.5rem);
  line-height: 1;
}

@container (min-width: 30rem) {
  .pm-board {
    min-height: calc(5 * 5.25rem + 4 * 0.45rem);
  }
}
