.boop-game {
  --game-ink: #244136;
  --game-gold: #f5df9d;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: clamp(335px, 30vw, 402px);
  margin-top: 26px;
  padding-inline: clamp(28px, 5.8vw, 84px) clamp(14px, 3vw, 48px);
  color: var(--game-ink);
  background: #fae8af;
  border: 1px solid #e4ca89;
  border-radius: 20px;
  overflow: hidden;
}
.boop-game::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .24;
  background-image: radial-gradient(#967441 0.55px, transparent .8px);
  background-size: 4px 4px;
  pointer-events: none;
}
.boop-game-copy { padding-block: 36px; position: relative; z-index: 2; }
.boop-game h1 {
  color: var(--game-ink);
  font-size: clamp(60px, 6.9vw, 105px);
  line-height: .98;
  letter-spacing: -.078em;
  font-weight: 720;
}
.boop-game h1 em {
  color: #994629;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -.045em;
}
.boop-game-line { min-height: 2.7em; max-width: 32em; margin-top: 18px; font-size: clamp(15px, 1.3vw, 19px); line-height: 1.35; }
.boop-score { display: flex; gap: 16px; align-items: center; }
.boop-word { display: inline-flex; align-items: center; font-size: 29px; font-weight: 850; letter-spacing: -.065em; line-height: 1; }
.boop-word [data-boop-letter] {
  display: grid;
  place-items: center;
  width: 1.12em;
  height: 1.26em;
  margin-inline-start: 4px;
  border: 1.5px solid #8c774c;
  border-radius: 6px;
  background: #fff4d2;
  box-shadow: 0 2px #c7aa6d;
  transition: background-color .15s, color .15s;
}
.boop-word .is-lit { color: #fff7d7; border-color: var(--game-ink); background: var(--game-ink); box-shadow: 0 2px #446456; }
.boop-count { font: 650 13px/1 "DM Sans", sans-serif; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: #625533; }
.boop-stage { position: relative; align-self: stretch; display: grid; justify-items: center; align-items: center; }
.boop-oval {
  position: absolute;
  width: min(84%, 445px);
  height: 79%;
  top: 10%;
  border-radius: 50%;
  background: #a7cbb8;
  transform: rotate(-9deg);
  box-shadow: 0 0 0 8px #ffedba, 0 0 0 9px #cab77e;
}
.boop-oval::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(#285b471f .7px, transparent 1px);
  background-size: 3px 3px;
}
.boop-pup {
  position: relative;
  aspect-ratio: 580 / 689;
  width: clamp(230px, 22.9vw, 307px);
  max-width: 80%;
  margin-block: 11px 5px;
}
.boop-pup-art, .boop-pup-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.boop-pup-art { transform-origin: 50% 85%; pointer-events: none; }
.boop-pup-happy { opacity: 0; }
.boop-game-nose {
  position: absolute;
  z-index: 2;
  left: 51%; top: 34.7%;
  width: max(22%, 46px); height: max(15%, 46px);
  transform: translate(-50%, -50%);
  border: 0; padding: 0; border-radius: 48%;
  background: transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.boop-game-nose:focus-visible { outline: 3px dashed #fff2be; outline-offset: 3px; box-shadow: 0 0 0 7px #934929; }
.boop-spark { position: absolute; width: 31px; height: 40px; background: #45735a; clip-path: polygon(50% 0, 60% 36%, 100% 50%, 60% 60%, 50% 100%, 39% 62%, 0 50%, 39% 39%); }
.spark-one { left: 7%; top: 17%; transform: rotate(-15deg); }
.spark-two { right: 4%; top: 36%; width: 22px; height: 28px; transform: rotate(14deg); background: #ae5d2d; }
.spark-three { left: 18%; bottom: 15%; width: 13px; height: 19px; transform: rotate(10deg); }
.boop-pop { position: absolute; right: -10%; top: 11%; font: italic 400 clamp(27px, 3vw, 46px)/1 "Instrument Serif", Georgia, serif; color: #793a27; transform: rotate(10deg); opacity: 0; pointer-events: none; }
.boop-game.is-booping .boop-pop { opacity: 1; animation: boop-pop .68s ease-out both; }
.boop-game.is-booping .boop-pup-art { animation: boop-sniff .62s ease-out; }
.boop-game.is-booping .boop-pup-ready { opacity: 0; }
.boop-game.is-booping .boop-pup-happy { opacity: 1; }
.boop-game.is-booping[data-reaction="happy"] .boop-pup-art { animation-name: boop-wiggle; }
@keyframes boop-sniff { 0%,100% { transform: none; } 24% { transform: translateY(3px) scale(.98,.96); } 56% { transform: translateY(-2px) scale(1.01); } }
@keyframes boop-wiggle { 0%,100% { transform: none; } 23% { transform: rotate(-4deg) translateY(-3px); } 54% { transform: rotate(3deg); } 78% { transform: rotate(-1deg); } }
@keyframes boop-pop { 0% { opacity: 0; transform: translateY(6px) scale(.8) rotate(5deg); } 24%,75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px) rotate(10deg); } }
@media (max-width: 750px) {
  .boop-game { padding-inline: 24px 10px; min-height: 272px; }
  .boop-game h1 { font-size: clamp(48px, 7.5vw, 61px); }
  .boop-pup { width: 210px; max-width: 82%; }
}
@media (max-width: 550px) {
  .boop-game { grid-template-columns: 1fr; padding: 0 18px 8px; min-height: 0; margin-top: 16px; border-radius: 15px; }
  .boop-game-copy { padding: 21px 0 0; text-align: center; }
  .boop-game h1 { font-size: clamp(43px, 12.4vw, 64px); }
  .boop-game-line { margin: 8px auto 0; min-height: 2.65em; font-size: 15px; }
  .boop-score { justify-content: center; margin: 0; gap: 10px; }
  .boop-word { font-size: 23px; }
  .boop-count { font-size: 12px; }
  .boop-stage { margin-top: 6px; }
  .boop-pup { width: clamp(158px, 47vw, 207px); margin-block: 6px 1px; }
  .boop-oval { width: min(78%, 266px); }
  .boop-pop { right: -13%; }
}
@media (prefers-reduced-motion: reduce) {
  .boop-game *, .boop-game *::before, .boop-game *::after { animation: none !important; transition: none !important; }
}
