.play {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 96px 20px 22px;
  gap: 14px;
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.stage .mascot-box {
  justify-self: end;
}

.letter-card {
  --accent: #f48fb1;
  position: relative;
  width: clamp(200px, 34vh, 340px);
  aspect-ratio: 1;
  border-radius: 48px;
  background: #fff;
  box-shadow: 0 12px 0 rgba(61, 58, 92, 0.12), 0 24px 50px rgba(61, 58, 92, 0.16);
  border: 10px solid var(--accent);
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.letter-card .big {
  font-size: clamp(130px, 24vh, 240px);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  transform: translateY(6%);
}

.letter-card .small {
  position: absolute;
  right: 22px;
  bottom: 12px;
  font-size: clamp(34px, 6vh, 56px);
  font-weight: 700;
  color: var(--ink-soft);
  opacity: 0.7;
}

.letter-card.enter-in {
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.letter-card.wobble {
  animation: shake 0.45s ease;
}

.letter-card.found {
  background: #f1fff7;
  border-color: var(--mint-deep);
  transform: scale(1.06);
}

.letter-card.found .big {
  color: var(--mint-deep);
}

.letter-card.done {
  transform: scale(1.12) rotate(-4deg);
}

.enter-hint {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
}

.enter-hint[hidden] {
  display: none;
}

.enter-key {
  padding: 14px 30px;
  border-radius: 20px;
  background: var(--butter);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  animation: glow 1.2s ease-in-out infinite, bob 1.2s ease-in-out infinite;
}

.progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 1120px;
}

.progress li {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}

.progress li.now {
  background: #fff;
  color: var(--ink);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--butter-deep);
}

.progress li.ok {
  background: var(--butter-deep);
  color: #fff;
}

.keyboard {
  --gap: 8px;
  --k: min(84px, calc((100vw - 68px - 9 * var(--gap)) / 10));
  --kh: clamp(56px, 8vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  padding: 14px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.kb-row {
  display: flex;
  gap: var(--gap);
}

.key {
  width: var(--k);
  height: var(--kh);
  border-radius: 14px;
  background: #fff;
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  box-shadow: 0 5px 0 #d4d2e6;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.1s ease;
}

.key.press {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #d4d2e6;
}

.key.hint {
  background: var(--butter);
  animation: glow 1.2s ease-in-out infinite;
}

.key.found {
  background: var(--mint-deep);
  color: #fff;
  box-shadow: 0 5px 0 #3fa572;
}

.key.nope {
  background: var(--peach);
}

@media (orientation: portrait), (max-width: 860px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-items: center;
    gap: 8px;
  }
  .stage .mascot-box {
    justify-self: center;
  }
  .stage .mascot-box img {
    width: clamp(90px, 14vw, 130px);
  }
  .bubble {
    margin-bottom: 30px;
  }
  .letter-card {
    width: clamp(200px, min(56vw, 34vh), 420px);
    align-self: center;
  }
  .letter-card .big {
    font-size: clamp(130px, min(40vw, 24vh), 300px);
  }
  .keyboard {
    --kh: clamp(60px, 7vh, 84px);
  }
  .progress {
    display: grid;
    grid-template-columns: repeat(13, auto);
    gap: 8px;
  }
  .progress li {
    width: clamp(34px, 5.4vw, 46px);
    height: clamp(34px, 5.4vw, 46px);
    font-size: clamp(15px, 2.4vw, 20px);
  }
}

@media (orientation: landscape) and (max-height: 640px) {
  .stage .mascot-box img {
    width: 80px;
  }
}
