/* Word Dome: one circular portrait treatment across People, Pets, Royal,
   computer, and human avatars. Keep the approved picture assets, border
   palette, selection indicators, avatar positions and surrounding panels. */

/* The My Avatars picker deliberately uses the original square frames.
   Its 48 full portraits are styled by avatar-picker-layout.css; do not
   apply game-room circular masks or background zoom to this picker. */

/* Home-page selected avatar and waiting/initial gold-A image. Match the
   existing high-specificity royal-arch frame rules without moving the group. */
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden])
#lobby .avatar-section #avatarPreview,
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden])
#lobby .avatar-section .lobby-avatar-preview,
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden])
#lobby .avatar-section #avatarPreview:not(.avatar-placeholder) {
  border-radius:50%!important;
  overflow:hidden!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-clip:padding-box!important;
}

/* Dome Duel / Dome Blitz live player, opponent and computer portraits.
   This also overrides the later iPhone-only rectangular radius rule. */
body:not(.wd-gate):has(#game:not([hidden]))
#game .game-grid :is(#playerAvatar,#opponentAvatar).score-avatar {
  border-radius:50%!important;
  overflow:hidden!important;
  background-clip:padding-box!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
}
/* The existing desktop portrait is 128px wide but was stretched to 129.28px
   tall. Give the circular photo equal axes without moving its center. */
@media(min-width:700px) {
  body:not(.wd-gate):has(#game:not([hidden]))
  #game .game-grid :is(#playerAvatar,#opponentAvatar).score-avatar {
    height:128px!important;
    min-height:128px!important;
    flex-basis:128px!important;
  }
}

/* Preserve the turn-light color, but round BOTH the inner ring used on phones
   and the larger outer ring used on PCs/tablets. */
body:not(.wd-gate):has(#game:not([hidden]))
#game .game-grid :is(#playerAvatar,#opponentAvatar):is(.wd-active-turn-p1,.wd-active-turn-p2)::after,
body:not(.wd-gate):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-identity:has(>
.score-avatar:is(.wd-active-turn-p1,.wd-active-turn-p2))::after {
  border-radius:50%!important;
}

/* Both games' result portraits; never round the winner's information card. */
:is(#replayModal,#replayDialog) .victory-avatar {
  border-radius:50%!important;
  overflow:hidden!important;
  background-size:cover!important;
  background-position:center!important;
  background-clip:padding-box!important;
}

/* Dome Dynasty only: restore full, uncropped, square portraits on player
   panels. Do not alter Duel/Blitz, the homepage, account photos or results. */
#dynastyRoomStage .player .avatar {
  aspect-ratio:1 / 1!important;
  height:auto!important;
  border-radius:0!important;
  overflow:hidden!important;
  background-size:contain!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-clip:padding-box!important;
}

/* My Account: only the owned-avatar PHOTO becomes a circle, not its card. */
.wd-avatar-card img {
  border-radius:50%!important;
  aspect-ratio:1 / 1;
  object-fit:cover;
  overflow:hidden;
}
