.play {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 18px);
  padding: 92px 16px 16px;
}

.prompt {
  flex: none;
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
}

.prompt .bubble {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  max-width: min(60vw, 520px);
  text-align: center;
  cursor: pointer;
  font-size: clamp(18px, 3vw, 30px);
}

.prompt .bubble::after {
  left: -12px;
  right: auto;
  bottom: 50%;
  margin-bottom: -12px;
  border: 12px solid transparent;
  border-right-color: var(--card);
  border-left: 0;
}

.owl {
  flex: none;
  width: clamp(56px, 10vw, 130px);
  animation: bob 2.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(61, 58, 92, 0.18));
  cursor: pointer;
}

.numeral {
  position: relative;
  flex: none;
  width: clamp(76px, 12vw, 128px);
  height: clamp(76px, 12vw, 128px);
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: var(--sky-deep);
  color: #fff;
  box-shadow: 0 6px 0 #4a8fcc;
}

.numeral b {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 800;
  line-height: 1;
}

.numeral svg {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.cards {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}

.group {
  --gap: 4px;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  padding: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 6px solid #fff;
  border-bottom: 12px solid var(--butter-deep);
  border-radius: 32px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

.group .pad {
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 0;
  container-type: size;
}

.group .frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: var(--gap);
  --cell: min((100cqw - var(--gap) * 4) / 5, (100cqh - var(--gap) * (var(--rows) - 1)) / var(--rows), 92px);
  grid-template-columns: repeat(5, var(--cell));
  grid-auto-rows: var(--cell);
}

.group .cell {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(61, 58, 92, 0.07);
  box-shadow: inset 0 0 0 2px rgba(61, 58, 92, 0.12);
}

.group .cell img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(61, 58, 92, 0.18));
  pointer-events: none;
  animation: pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}

.group .total {
  position: absolute;
  right: 10px;
  bottom: 14px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--sky-deep);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 #4a8fcc;
  visibility: hidden;
  pointer-events: none;
}

.group .total.show {
  visibility: visible;
  animation: pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@media (hover: hover) {
  .group:hover {
    transform: translateY(-4px);
  }
}

.group.nope {
  animation: shake 0.45s ease;
  border-color: var(--peach);
  border-bottom-color: var(--peach-deep);
}

.group.hint {
  animation: group-glow 1.1s ease-in-out infinite;
}

.group.win {
  background: #f3fff8;
  border-color: var(--mint-deep);
  border-bottom-color: var(--mint-deep);
  transform: scale(1.02);
}

body:not([data-phase="play"]) .group {
  cursor: default;
}

body:not([data-phase="play"]) .group:not(.win):hover {
  transform: none;
}

.round-dots {
  display: flex;
  gap: 10px;
  flex: none;
}

.round-dots i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}

.round-dots i.now {
  box-shadow: 0 0 0 4px var(--butter-deep);
}

.round-dots i.ok {
  background: var(--butter-deep);
}

@keyframes group-glow {
  0%,
  100% {
    box-shadow: var(--shadow), 0 0 0 0 rgba(247, 201, 72, 0.85);
  }
  50% {
    box-shadow: var(--shadow), 0 0 0 18px rgba(247, 201, 72, 0);
  }
}

@media (orientation: landscape) {
  .play {
    padding-top: 84px;
  }
  .cards {
    flex-direction: row;
    align-items: center;
  }
  .group {
    height: 100%;
    max-height: 280px;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .play {
    gap: 8px;
    padding: 72px 12px 12px;
  }
  .prompt {
    gap: 8px;
  }
  .prompt .bubble {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 17px;
    line-height: 1.2;
  }
  .owl {
    width: 52px;
  }
  .numeral {
    width: 72px;
    height: 72px;
    border-radius: 22px;
  }
  .numeral b {
    font-size: 46px;
  }
  .cards {
    gap: 8px;
  }
  .group {
    padding: 6px;
    border-width: 5px;
    border-bottom-width: 10px;
    border-radius: 26px;
  }
  .group .total {
    width: 44px;
    height: 44px;
    font-size: 28px;
    right: 8px;
    bottom: 12px;
  }
  .round-dots {
    gap: 8px;
  }
  .round-dots i {
    width: 14px;
    height: 14px;
  }
}
