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

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

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

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

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

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

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

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

.shop-line { color: #f4f0e8; }

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

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

.shop-board {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

@container (max-width: 40rem) {
  .shop-board { grid-template-columns: 1fr; }
}

.shop-pad {
  --rule: 1.9rem;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 16rem;
  padding: 0.85rem 0.9rem 0.85rem 1.7rem;
  border-radius: 12px;
  background: #fffdf7;
  color: #1d2433;
  box-shadow:
    inset 0 0 0 1px rgba(138, 98, 48, 0.45),
    0 1px 2px rgba(29, 36, 51, 0.12);
}

.shop-pad::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  left: 1.15rem;
  width: 1px;
  background: #c46a6a;
  pointer-events: none;
}

.shop-pad-title {
  margin: 0;
  min-height: 1.35em;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.shop-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--rule) - 1px),
    rgba(138, 98, 48, 0.22) calc(var(--rule) - 1px),
    rgba(138, 98, 48, 0.22) var(--rule)
  );
}

.shop-item {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  box-sizing: border-box;
  height: var(--rule);
  min-height: var(--rule);
  padding-bottom: 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.15;
}

.shop-item.is-next .shop-box {
  box-shadow: inset 0 0 0 2px #b8923a;
}

.shop-box {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #8a6230;
  background: transparent;
}

.shop-item.is-done .shop-box {
  background: #1f4535;
  box-shadow: inset 0 0 0 1px #1f4535;
}

.shop-item-emoji {
  width: 1.35rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1;
}

.shop-item.is-blank .shop-item-name { color: #8a8175; }

.shop-time {
  min-height: 1.2em;
  margin: auto 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: #6d6456;
  text-align: right;
}

.shop-meter {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(138, 98, 48, 0.18);
  overflow: hidden;
}

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

.shop-ready {
  appearance: none;
  -webkit-appearance: none;
  min-height: var(--tap-min);
  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;
}

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

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

.shop-shelf {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(var(--tap-min), 1fr));
  gap: 0.5rem;
  align-content: start;
  padding: 0.65rem;
  border-radius: 12px;
  background: #3a2a1c;
  box-shadow: inset 0 0 0 1px rgba(224, 185, 72, 0.35);
}

.shop-tile {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: var(--tap-min);
  min-height: 4.75rem;
  margin: 0;
  padding: 0.4rem 0.3rem;
  border: 0;
  border-radius: 12px;
  color: #1d2433;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px rgba(184, 146, 58, 0.45);
  cursor: pointer;
  touch-action: manipulation;
}

.shop-shelf.is-locked .shop-tile { cursor: default; }

.shop-tile.is-covered {
  background: #efe6d4;
  box-shadow: inset 0 0 0 1px rgba(90, 62, 32, 0.35);
  cursor: default;
}

.shop-tile.is-found {
  background: #e7f2ea;
  box-shadow: inset 0 0 0 2px #2e6b4e;
  cursor: default;
}

.shop-tile.is-wrong {
  background: #f6ece8;
  box-shadow: inset 0 0 0 2px #a3302f;
  cursor: default;
}

.shop-tile.is-wrong .shop-name { text-decoration: line-through; }

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

.shop-emoji {
  font-size: 1.65rem;
  line-height: 1;
}

.shop-name {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
