/* Dome Blitz end-of-match rematch placement, 2026-11-09.
   The live dialog moves immediately after #board in the center column.
   The game board, last play, winner rail, side panels, and page brightness
   remain unchanged. Duel's fullscreen overlay and Dynasty's flow stay intact. */

/* Override the original viewport-wide 82%-black celebration backdrop only
   when the Blitz rematch dialog has been reparented after the board. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #replayModal.wd-unified-victory {
 position:relative!important;
 inset:auto!important;
 top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
 transform:none!important;
 display:flex!important;
 align-items:center!important;justify-content:center!important;
 box-sizing:border-box!important;
 width:100%!important;max-width:100%!important;
 min-height:0!important;height:0!important;
 margin:0 auto!important;padding:0!important;
 border:0!important;border-radius:0!important;
 background:transparent!important;background-image:none!important;
 box-shadow:none!important;
 pointer-events:auto!important;
 z-index:21!important;
 overflow:visible!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #replayModal.wd-unified-victory[hidden] {
 display:none!important;
}

/* Question and two live YES/NO buttons, with an inset midnight-blue card and
   polished mahogany wood frame. No scoreboard/avatars inside this card. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #replayModal.wd-unified-victory .replay-dialog {
 position:absolute!important;top:clamp(18px,2vw,28px)!important;left:0!important;right:0!important;
 box-sizing:border-box!important;
 width:100%!important;max-width:100%!important;
 height:auto!important;max-height:none!important;
 min-height:146px!important;
 margin:0 auto!important;
 border:6px solid #67321e!important;
 border-radius:20px!important;
 outline:2px solid #b78349!important;
 outline-offset:-4px!important;
 background:radial-gradient(ellipse 85% 80% at 45% 18%,#193b72 0%,#0b2255 50%,#071437 100%)!important;
 box-shadow:inset 0 0 0 2px #d4a46b,inset 0 0 0 5px #32150f,0 5px 0 #34170f,0 9px 19px #0009!important;
 padding:20px clamp(10px,2.5vw,24px)!important;
 overflow:visible!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel:has(> #replayModal.wd-unified-victory:not([hidden])) > :is(.rack-panel,.wd-royal-controls) {
 visibility:hidden!important;
 pointer-events:none!important;
}
/* Preserve scroll access and usable button sizes on portrait iPad and phone. */
@media(max-width:699px){
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game .center-panel > #replayModal.wd-unified-victory .replay-dialog {
  min-height:132px!important;
  padding:14px 9px!important;
 }
}


/* Dynasty-scale Blitz winner presentation. The winner banner is a single
   mahogany-framed, gold-backed card positioned over the opponent tile row;
   it can overlap the header and the upper edge of the concealed tile row,
   but the remainder of the opponent backs must stay visible at endgame.
   Raise stacking only while the winner exists, never move the board, rack,
   player panels, header, controls, or the beneath-board rematch dialog. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .game-grid:has(#opponentRackPanel > #winnerFlash:not([hidden])){
 position:relative!important;
 z-index:2000!important;
 overflow:visible!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel:has(> #opponentRackPanel > #winnerFlash:not([hidden])){
 position:relative!important;
 z-index:2001!important;
 overflow:visible!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #opponentRackPanel:has(> #winnerFlash:not([hidden])){
 position:relative!important;
 z-index:2002!important;
 overflow:visible!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game #opponentRackPanel > #winnerFlash:not([hidden]){
 position:absolute!important;
 inset:auto!important;
 top:0!important;left:50%!important;right:auto!important;bottom:auto!important;
 /* Shift the banner upward without changing its dimensions. The previous
    -40% offset covered nearly all of the compact 8-tile row. -88% allows
    only a small overlap at the top, leaving the tile backs visible below. */
 transform:translate(-50%,-88%)!important;
 box-sizing:border-box!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:max-content!important;min-width:min(72%,370px)!important;
 max-width:min(96%,560px)!important;
 height:auto!important;min-height:80px!important;max-height:none!important;
 margin:0!important;padding:12px clamp(16px,2.1vw,34px)!important;
 z-index:2003!important;pointer-events:none!important;
 overflow:visible!important;
 border:5px solid #642d1c!important;border-radius:10px!important;
 background:linear-gradient(180deg,#f7d980 0%,#e9bd55 55%,#c18e29 100%)!important;
 background-image:linear-gradient(180deg,#f7d980 0%,#e9bd55 55%,#c18e29 100%)!important;
 box-shadow:0 0 0 2px #b47b33,0 12px 25px #260d0880,0 0 15px #e4ae4180!important;
}
/* The real concealed opponent backs remain visible through the terminal
   winner/replay state. This does NOT change their count, width, geometry,
   seat-specific artwork, or layout at any screen size. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game #opponentRackPanel:has(> #winnerFlash:not([hidden])) > #opponentRack{
 visibility:visible!important;
 opacity:1!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game #opponentRackPanel > #winnerFlash .winner-flash-text{
 display:block!important;
 width:auto!important;max-width:100%!important;
 margin:0!important;padding:0!important;
 color:#542818!important;
 -webkit-text-fill-color:#542818!important;
 font:900 clamp(27px,3.3vw,44px)/1.07 Georgia,'Times New Roman',serif!important;
 letter-spacing:.01em!important;text-align:center!important;
 white-space:nowrap!important;
 overflow-wrap:normal!important;
 -webkit-text-stroke:.35px #542818!important;
 animation:none!important;
 text-shadow:0 1px 0 #fae7b6!important;
}
@media(max-width:699px){
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game #opponentRackPanel > #winnerFlash:not([hidden]){
  min-width:min(68%,260px)!important;
  min-height:58px!important;
  padding:9px 12px!important;
  border-width:4px!important;
 }
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game #opponentRackPanel > #winnerFlash .winner-flash-text{
  font-size:clamp(18px,4.1vw,29px)!important;
  white-space:normal!important;text-wrap:balance!important;
  overflow-wrap:break-word!important;
 }
}
/* Winner takes precedence even if an older cached notice script sends a
   TIME EXPIRED notice before the final game state arrives. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game #opponentRackPanel:has(> #winnerFlash:not([hidden])) > #wdGameEventNotices{
 display:none!important;
}

/* Dome Blitz rematch: restore the SERVER-AUTHORITATIVE 20-second decision
   countdown that the shared question-only stylesheet hides. Keep Duel and
   Dynasty intact, and keep the timer between the question and YES/NO. */
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #replayModal.wd-unified-victory .replay-dialog{
 gap:10px!important;
}
body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
#game .center-panel > #replayModal.wd-unified-victory #replayCountdown{
 display:block!important;
 visibility:visible!important;
 position:static!important;
 grid-area:auto!important;
 flex:0 0 auto!important;
 order:0!important;
 align-self:center!important;
 box-sizing:border-box!important;
 width:100%!important;
 max-width:100%!important;
 margin:0!important;
 padding:0!important;
 text-align:center!important;
 color:#ffe6a5!important;
 -webkit-text-fill-color:#ffe6a5!important;
 font:700 clamp(14px,1.6vw,18px)/1.2 Georgia,'Times New Roman',serif!important;
 font-variant-numeric:tabular-nums!important;
 white-space:nowrap!important;
 text-shadow:0 1px 2px #07152c!important;
}
@media(max-width:699px){
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game .center-panel > #replayModal.wd-unified-victory .replay-dialog{
  gap:8px!important;
 }
}
