.play {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 92px 20px 16px;
}

.side {
  width: clamp(170px, 19vw, 250px);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.side .bubble {
  margin-bottom: 0;
  max-width: 100%;
  text-align: center;
  cursor: pointer;
}

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

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

.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.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);
}

@media (orientation: portrait) {
  .play {
    flex-direction: column;
    gap: clamp(8px, 1.6vh, 20px);
    padding: 92px 16px 20px;
  }
  .side {
    width: auto;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 22px;
  }
  .side .bubble {
    max-width: min(62vw, 520px);
    font-size: clamp(20px, 3.2vw, 30px);
  }
  .side .bubble::after {
    left: -12px;
    bottom: 18px;
    margin-left: 0;
    border: 12px solid transparent;
    border-right-color: var(--card);
    border-left: 0;
  }
  .owl {
    width: clamp(84px, 14vw, 140px);
  }
  .stage {
    gap: clamp(14px, 2.4vh, 32px);
  }
}

.board {
  --hole: min(20vw, 36vh);
  display: grid;
  grid-template-columns: repeat(3, var(--hole));
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 40px;
  box-shadow: var(--shadow);
}

.board[data-n="6"] {
  --hole: min(17vw, 23vh);
}

.hole {
  position: relative;
  width: var(--hole);
  height: var(--hole);
  padding: 0;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 28px;
  box-shadow: inset 0 0 0 4px var(--sky);
}

.hole svg {
  width: 84%;
  height: 84%;
  overflow: visible;
  fill: #ecebf4;
  stroke: #b3b1cc;
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hole.filled svg {
  fill: var(--c);
  stroke: #fff;
  stroke-width: 4;
  stroke-dasharray: none;
  filter: drop-shadow(0 5px 0 rgba(61, 58, 92, 0.16));
  animation: snap 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.hole.filled {
  box-shadow: inset 0 0 0 4px var(--mint-deep);
  cursor: default;
}

.hole.nope {
  animation: shake 0.45s ease;
}

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

.hole.hint svg {
  stroke: var(--butter-deep);
  fill: var(--butter);
}

body.kbd .hole.focus,
body.kbd .slot.focus {
  outline: 6px solid var(--butter-deep);
  outline-offset: 3px;
}

.tray {
  --piece: min(13vw, 18vh);
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.tray[data-n="6"] {
  --piece: min(9.5vw, 14vh);
}

.slot {
  position: relative;
  width: var(--piece);
  height: var(--piece);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.slot i {
  position: absolute;
  left: -4px;
  top: -6px;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 0 3px 0 #e0a92a;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
  pointer-events: none;
}

.slot.empty i {
  opacity: 0.35;
}

.piece {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
  transition: transform 0.3s cubic-bezier(0.3, 1.2, 0.5, 1);
  animation: pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}

.piece svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--c);
  stroke: #fff;
  stroke-width: 4;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 0 rgba(61, 58, 92, 0.16));
  pointer-events: none;
}

.piece.sel {
  transform: translateY(-10px) scale(1.12);
}

.piece.sel svg {
  filter: drop-shadow(0 8px 6px rgba(61, 58, 92, 0.25));
  stroke: var(--butter-deep);
}

.piece.dragging {
  z-index: 30;
  transition: none;
  cursor: grabbing;
}

.piece.fly {
  z-index: 30;
}

.piece.gone {
  visibility: hidden;
  pointer-events: none;
}

@keyframes snap {
  0% {
    transform: scale(1.3);
  }
  60% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes home-glow {
  0%,
  100% {
    box-shadow: inset 0 0 0 4px var(--butter-deep), 0 0 0 0 rgba(247, 201, 72, 0.8);
  }
  50% {
    box-shadow: inset 0 0 0 4px var(--butter-deep), 0 0 0 16px rgba(247, 201, 72, 0);
  }
}

@media (orientation: portrait) {
  .board {
    --hole: min(27.5vw, 26vh);
    gap: 12px;
    padding: 12px;
  }
  .board[data-n="6"] {
    --hole: min(27.5vw, 21vh);
  }
  .tray {
    --piece: min(22vw, 14vh);
    gap: 14px;
    padding: 14px;
  }
  .tray[data-n="6"] {
    --piece: min(13.2vw, 12vh);
    gap: 8px;
    padding: 12px 10px;
  }
}

@media (orientation: portrait) {
  .play {
    justify-content: center;
  }
  .stage {
    flex: none;
  }
}
