/* Game-only player stack reorder; no markup or gameplay handlers changed.
   Score -> Timer -> (human controls) -> Turn -> Bonus. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .left-panel,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .right-panel{
  display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:flex-start!important;gap:7px!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .left-panel > *,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .right-panel > *{
  flex-shrink:0!important;margin-top:0!important;margin-bottom:0!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > #playerCard,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > #opponentCard{
  order:1!important;width:85%!important;min-height:252px!important;
  display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > #clock,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > #opponentClock{order:2!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .rack-actions{order:3!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > #turnCard,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > #opponentTurnCard{order:4!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .bonus-card,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > .bonus-card{order:5!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > #roomBanner{order:6!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > :not(#playerCard):not(#clock):not(.rack-actions):not(#turnCard):not(.bonus-card):not(#roomBanner),
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > :not(#opponentCard):not(#opponentClock):not(#opponentTurnCard):not(.bonus-card){order:7!important}
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .rack-actions{
  width:100%!important;max-width:100%!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .bonus-card,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > .bonus-card,
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .turn-card,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > .turn-card,
 body:not(.wd-gate):has(#game:not([hidden])) .left-panel > .timer-card,
 body:not(.wd-gate):has(#game:not([hidden])) .right-panel > .timer-card{
  width:85%!important;
 }
}

/* Align both score-card top edges with the center message board.
   Fixed column offset is independent of whether #status has a message. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .left-panel,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid > .right-panel{
  padding-top:12px!important;
  box-sizing:border-box!important;
 }
}

/* Game board: timer and turn boxes reduced another 50% from 50px to 25px. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid .timer-card,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid .turn-card{
  height:25px!important;min-height:25px!important;max-height:25px!important;
  box-sizing:border-box!important;padding-top:3px!important;padding-bottom:3px!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
 }
}

/* Game header only: Goal, Mode, Rules boxes at half their prior height.
   Keep widths, colors, border styling, and other game elements unchanged. */
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal,
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode,
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .rules-button{
  height:45.6px!important;min-height:45.6px!important;max-height:45.6px!important;
  box-sizing:border-box!important;padding-top:0!important;padding-bottom:0!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
}
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal strong,
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode strong{
  font-size:17px!important;line-height:1!important;
}
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal span,
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode span{
  font-size:9px!important;line-height:1!important;
}
@media(max-width:699px){
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal,
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode,
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .rules-button{
  height:26.4px!important;min-height:26.4px!important;max-height:26.4px!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal,
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode{
  flex-direction:row!important;gap:4px!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal strong,
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode strong{
  font-size:13px!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-goal span,
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode span{
  font-size:8px!important;
 }
 body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .rules-button{
  font-size:11px!important;line-height:1!important;
 }
}

/* Ensure the visible timer and turn cards are approximately half the
   previous rendered height. ID selectors override legacy #clock minimums. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #clock,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #opponentClock,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #turnCard,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #opponentTurnCard{
  height:48px!important;min-height:48px!important;max-height:48px!important;
  box-sizing:border-box!important;padding-top:2px!important;padding-bottom:2px!important;
  overflow:hidden!important;
 }
}

/* Reduce only YOUR TURN / WAITING status text by 30% (21px -> 14.7px). */
body:not(.wd-gate):has(#game:not([hidden])) .game-grid #turnCard > strong,
body:not(.wd-gate):has(#game:not([hidden])) .game-grid #opponentTurnCard > strong{
 font-size:14.7px!important;
}

/* Turn boxes only: a further 15% taller than 55.2px; preserve all text styling. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #turnCard,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #opponentTurnCard{
  height:63.48px!important;min-height:63.48px!important;max-height:63.48px!important;
 }
}

/* Player/computer turn cards: 10% taller than 63.48px; text unchanged. */
@media (min-width:700px){
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #turnCard,
 body:not(.wd-gate):has(#game:not([hidden])) .game-grid #opponentTurnCard{
  height:69.828px!important;min-height:69.828px!important;max-height:69.828px!important;
 }
}
/* Remove only the blue divider above the computer's last move (beneath WAITING). */
body:not(.wd-gate):has(#game:not([hidden])) #opponentTurnCard #opponentLastMove{
 border-top:none!important;
}

/* Match the computer turn card: remove only the player's last-move divider. */
body:not(.wd-gate):has(#game:not([hidden])) #turnCard #playerLastMove{
 border-top:none!important;
}

/* Keep long online room names within the existing center header box.
   Computer matches show three stars instead of a room code. */
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo .top-mode #modeDisplay{
 display:block!important;max-width:100%!important;min-width:0!important;
 overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}

/* Gold-framed royal-blue center header: style only, never resize/reposition.
   The center remains empty in computer games; two-player room text is gold. */
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode{
 border-color:#f5c54f!important;
 background:linear-gradient(180deg,#225ab6 0%,#123f91 47%,#08285f 100%)!important;
 box-shadow:inset 0 1px 0 #ffe7a733,0 0 12px #e5af3777!important;
}
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode > :is(#centerRoomHeading,#modeDisplay){
 color:#ffda63!important;
 text-shadow:0 1px 2px #06183e,0 0 4px #e3aa3866!important;
}

/* The existing gold-framed royal-blue center box shows three gold stars
   for computer matches. Two-player matches retain their ROOM and room name.
   The center box's dimensions, position, and gradient are unchanged. */
body:not(.wd-gate):has(#game:not([hidden])) #gameTopInfo > .top-mode #modeDisplay.wd-center-computer-stars{
 color:#ffdf67!important;
 font-size:24px!important;
 line-height:1!important;
 letter-spacing:4px!important;
 font-weight:900!important;
 text-shadow:0 1px 2px #082354,0 0 7px #ffd76c88!important;
}
