/* POPEX v124 — a single final bubble, with full-page blur independent of
   the iOS fixed-layer height bugs encountered by earlier New Game dialogs. */
body.pw124-ending{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
/* Blur the REAL game surface (including the board and rack), not a shortened
   WebKit backdrop-filter rectangle. The overlay itself is one uniform tint. */
body.pw124-ending main.moonlit-app{
  /* The underlying scene must reach the actual display bottom, even in iOS
     standalone mode where -webkit-fill-available can be shorter. */
  min-height:100vh!important;
  min-height:100dvh!important;
  filter:blur(9px) brightness(.62) saturate(.85)!important;
  -webkit-filter:blur(9px) brightness(.62) saturate(.85)!important;
  pointer-events:none!important;
}
#gameoverModal.pw124-end-layer{
  position:fixed!important;
  top:0!important;right:0!important;bottom:0!important;left:0!important;
  inset:0!important;
  z-index:1400!important;
  width:auto!important;height:auto!important;
  min-height:0!important;max-height:none!important;
  display:flex!important;justify-content:center!important;align-items:center!important;
  padding:calc(12px + env(safe-area-inset-top,0px)) 14px calc(12px + env(safe-area-inset-bottom,0px))!important;
  box-sizing:border-box!important;
  border:0!important;overflow:hidden!important;
  background:rgba(7,15,35,.42)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  touch-action:manipulation!important;
  overscroll-behavior:contain!important;
}
#gameoverModal.pw124-end-layer::before,
#gameoverModal.pw124-end-layer::after{content:none!important;display:none!important}
#pw124EndBubble{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  flex:none!important;
  gap:5px!important;
  width:clamp(180px,55vw,235px)!important;
  height:clamp(180px,55vw,235px)!important;
  padding:19px 16px!important;
  box-sizing:border-box!important;
  border-radius:50%!important;
  border:1.5px solid rgba(238,245,255,.66)!important;
  background:
    radial-gradient(circle at 26% 14%,rgba(255,255,255,.28) 0%,transparent 15%),
    radial-gradient(ellipse at 30% 21%,rgba(255,255,255,.20) 0%,transparent 37%),
    linear-gradient(155deg,rgba(158,174,226,.61),rgba(85,103,174,.55) 57%,rgba(47,69,138,.57))!important;
  -webkit-backdrop-filter:blur(7px) saturate(116%)!important;
  backdrop-filter:blur(7px) saturate(116%)!important;
  box-shadow:
    inset 0 5px 15px rgba(255,255,255,.30),
    inset 0 -13px 21px rgba(19,35,82,.26),
    0 17px 48px rgba(2,9,26,.36),
    0 0 18px rgba(134,166,237,.10)!important;
  color:#f9fbff!important;
  text-align:center!important;
  font-family:var(--pw-cartoon,ui-rounded,system-ui,sans-serif)!important;
  cursor:pointer!important;
  text-shadow:0 1px 5px rgba(16,30,75,.27)!important;
  transition:none!important;
  animation:pw124-bubble-float 2.9s ease-in-out infinite!important;
  -webkit-tap-highlight-color:transparent;
}
#pw124EndBubble::before{
  content:"";position:absolute;inset:7%;border:1px solid rgba(248,251,255,.13);
  border-radius:50%;pointer-events:none;
}
#pw124EndBubble:focus-visible{outline:2px solid rgba(252,254,255,.8);outline-offset:7px}
#pw124EndBubble .pw124-crown{
  position:relative;
  width:clamp(56px,16vw,74px)!important;
  height:clamp(42px,12vw,59px)!important;
  margin-bottom:3px!important;
  overflow:visible!important;
  filter:drop-shadow(0 4px 6px rgba(77,54,44,.23));
  transform:rotate(-7deg);
}
#pw124EndBubble .pw124-end-label{
  font-size:clamp(11px,3.2vw,13px)!important;
  font-weight:950!important;
  letter-spacing:2px!important;
  color:#ffe7b1!important;
}
#pw124EndBubble .pw124-end-title{
  font-size:clamp(24px,7.2vw,32px)!important;
  font-weight:1000!important;
  line-height:1.04!important;
  letter-spacing:.3px!important;
  max-width:100%;
}
#pw124EndBubble.is-record .pw124-end-title{font-size:clamp(20px,6vw,28px)!important}
#pw124EndBubble .pw124-end-score{
  font-size:clamp(23px,6.8vw,30px)!important;
  line-height:1.06!important;
  font-weight:950!important;
  font-variant-numeric:tabular-nums;
}
#pw124EndBubble.is-game-over .pw124-end-title{
  font-size:clamp(28px,8.4vw,38px)!important;
  letter-spacing:1px!important;
}
#gameoverModal.pw124-end-layer.is-popping #pw124EndBubble{
  animation:pw124-bubble-burst .24s cubic-bezier(.2,.1,.4,1) forwards!important;
}
@keyframes pw124-bubble-float{
  0%,100%{transform:translateY(0) rotate(-1deg) scale(1)}
  50%{transform:translateY(-5px) rotate(1.2deg) scale(1.018)}
}
@keyframes pw124-bubble-burst{
  0%{opacity:1;transform:scale(1)}
  36%{opacity:1;transform:scale(1.12)}
  100%{opacity:0;transform:scale(1.45)}
}
@media (max-height:630px){
 #pw124EndBubble{width:clamp(160px,40vh,205px)!important;height:clamp(160px,40vh,205px)!important}
}
@media (prefers-reduced-motion:reduce){
 #pw124EndBubble{animation:none!important}
 #gameoverModal.pw124-end-layer.is-popping #pw124EndBubble{animation:none!important;opacity:0!important}
}
/* Prevent the retired leaderboard 'clickable' score treatment. */
#bestStat,#bestStat.scoreboard-ready{cursor:default!important}

/* v124: only actual announcements get glass cards. All score/combo/board
   reaction messages return to unboxed animated cartoon typography. */
#gameStage .popup,
#gameStage .popup.warn,
#gameStage .popup.ready,
#gameStage .popup.combo,
#gameStage .popup.chain,
#gameStage .popup.color-streak,
#gameStage .popup.board-clear,
#gameStage .popup.perfect,
#gameStage .popup.challenge-win,
#gameStage .popup.story-intro,
#gameStage .popup.story-intro.story-colored,
#gameStage .popup.story-nervous,
#gameStage .popup.story-nervous.story-colored,
#gameStage .popup.rainbow{
  min-height:0!important;
  min-width:0!important;
  width:max-content!important;
  max-width:min(91%,450px)!important;
  height:auto!important;
  padding:5px 9px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:none!important;
  color:#f8faff!important;
  font-size:clamp(20px,5.5vw,32px)!important;
  font-weight:900!important;
  line-height:1.13!important;
  letter-spacing:.15px!important;
  text-shadow:0 2px 3px rgba(17,25,61,.90),0 4px 19px rgba(11,17,47,.75)!important;
  text-align:center!important;
  white-space:pre-line!important;
  overflow-wrap:break-word!important;
}
#gameStage .popup::before,#gameStage .popup::after{content:none!important;display:none!important;animation:none!important}
#gameStage .popup.combo,#gameStage .popup.perfect{color:#fff2c8!important}
#gameStage .popup.chain,#gameStage .popup.challenge-win{color:#dffff0!important}
#gameStage .popup.rainbow{color:#fff2c1!important}
#gameStage .popup.story-intro,#gameStage .popup.story-intro.story-colored{font-size:clamp(23px,6vw,32px)!important}
#gameStage .popup.challenge-win .ch-win-heading{color:#e6fff2!important;font-size:clamp(20px,5.2vw,28px)!important;text-shadow:0 2px 9px #15294d!important}
#gameStage .popup.challenge-win .ch-win-detail{color:#ffedcc!important;font-size:clamp(13px,3.6vw,18px)!important;margin-top:4px!important;text-shadow:0 2px 9px #15294d!important}

/* Cartoon-marker treatment for top-row actions. The containers stay the same. */
.bloop-header .pw124-hand-icon{width:100%;height:100%;overflow:visible;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 0 rgba(255,255,255,.10))}
.bloop-header .pw124-hand-gear{transform:rotate(-6deg)}
.bloop-header .pw124-hand-restart{transform:rotate(5deg)}
