/* Shared transparent PNG rating plate — 6 November 2026.
 * One unchanged approved asset, under the avatar/name in Duel, Blitz and
 * Dynasty. The transparent center reveals each room's own player-panel
 * background. Numeric rating / tier star are LIVE text, never baked PNGs.
 * Existing public statistics handlers remain the clickable areas. */

:root{
 --wd-ornate-rating-image:url('/Ornate%20Gold%20Rating%20Panel%20Frame.png');
 --wd-ornate-green:#83dc81;
 --wd-ornate-blue:#7eb9ff;
 --wd-ornate-red:#ff7777;
 --wd-ornate-purple:#ce8cff;
 --wd-ornate-gold:#ffd34d;
}

/* Dome Duel and Dome Blitz use the existing account-bar DOM and live badge. */
body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-account-bar:has(> .wd-rating:not([hidden])){
 position:relative!important;
 inset:auto!important;
 left:auto!important;right:auto!important;bottom:auto!important;top:auto!important;
 box-sizing:border-box!important;display:block!important;
 width:96%!important;max-width:96%!important;
 height:auto!important;min-height:0!important;max-height:none!important;
 aspect-ratio:2155 / 803!important;
 flex:0 0 auto!important;
 margin:3px auto 0!important;padding:0!important;
 border:0!important;border-radius:0!important;outline:0!important;
 background:var(--wd-ornate-rating-image) center/100% 100% no-repeat!important;
 background-color:transparent!important;
 box-shadow:none!important;overflow:visible!important;
 isolation:isolate!important;z-index:6!important;
}

/* The image already contains RATING and View Stats lettering. Display the
 * live rating + CSS star in its blank bottom-left interior, not twice. */
body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-account-bar > :is(#playerRatingBadge,#opponentRatingBadge):not([hidden]){
 position:absolute!important;inset:44% auto auto 9%!important;
 transform:none!important;display:flex!important;
 flex:0 0 auto!important;align-items:center!important;justify-content:flex-start!important;
 gap:3px!important;width:42%!important;max-width:42%!important;
 height:34%!important;min-width:0!important;min-height:0!important;
 padding:0!important;margin:0!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 background:transparent!important;background-image:none!important;
 white-space:nowrap!important;overflow:visible!important;
 font:700 clamp(9px,1.12vw,17px)/1 Georgia,'Times New Roman',serif!important;
 color:var(--wd-ornate-tier,#f6e6c3)!important;
 -webkit-text-fill-color:var(--wd-ornate-tier,#f6e6c3)!important;
 text-shadow:0 1px 2px #080309!important;
 text-align:left!important;
}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating-green{--wd-ornate-tier:var(--wd-ornate-green)}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating-blue{--wd-ornate-tier:var(--wd-ornate-blue)}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating-red{--wd-ornate-tier:var(--wd-ornate-red)}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating-purple{--wd-ornate-tier:var(--wd-ornate-purple)}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating-gold{--wd-ornate-tier:var(--wd-ornate-gold)}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar .wd-rating:not(.wd-rating-unrated):not([hidden])::before{
 content:"★"!important;display:inline!important;position:static!important;
 flex:none!important;
 font-size:1.12em!important;
 color:inherit!important;-webkit-text-fill-color:inherit!important;
}

/* The printed View Stats title belongs to the PNG. The button remains a real,
 * keyboard-focusable, accessible control over precisely that image region. */
body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-account-bar > :is(#playerPublicStats,#opponentPublicStats):not([hidden]){
 position:absolute!important;inset:28% 6% auto auto!important;
 transform:none!important;display:block!important;
 box-sizing:border-box!important;flex:none!important;
 width:35%!important;max-width:35%!important;height:48%!important;min-height:0!important;
 padding:0!important;margin:0!important;
 border:0!important;outline:0;box-shadow:none!important;
 background:transparent!important;background-image:none!important;
 color:transparent!important;-webkit-text-fill-color:transparent!important;
 font-size:0!important;text-shadow:none!important;
 cursor:pointer!important;z-index:2!important;
}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar > .wd-stat-button .wd-stats-chart-icon{
 display:none!important;
}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar > .wd-stat-button:focus-visible{
 outline:2px solid #fff4bd!important;outline-offset:1px!important;
 border-radius:4px!important;
}
body:not(.wd-gate):has(#game:not([hidden]))
#game .wd-avatar-account-bar > :is(.wd-rating,.wd-stat-button)[hidden]{
 display:none!important;
}

/* Blitz's identity rows have fixed heights in the approved panel. Reserve
 * the PNG's natural 3:1 frame without crushing its art into the old 39px row.
 * Grow only the card's profile region to avoid overlapping Royal plate. */
@media(min-width:700px){
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game .game-grid :is(#playerCard,#opponentCard){
  height:325px!important;min-height:325px!important;max-height:325px!important;
 }
 body:not(.wd-gate)[data-wd-game-type="blitz"]:has(#game:not([hidden]))
 #game .game-grid > :is(.left-panel,.right-panel){
  grid-template-rows:325px 78px 94px minmax(0,1fr) 38px!important;
 }
}
/* Duel uses shared independent portrait layout; keep its panels sized by
 * their existing parent rules and reserve the plate directly below the name. */

/* Dome Dynasty: same PNG, but its existing purple player panel shows through.
 * Leave the rating text, account permission and View Stats handler untouched. */
#dynastyRoomStage .player .rating-stats:not(.is-computer){
 position:relative!important;display:block!important;
 box-sizing:border-box!important;
 width:100%!important;max-width:100%!important;
 height:auto!important;min-height:0!important;
 aspect-ratio:2155 / 803!important;
 margin:6px auto 0!important;padding:0!important;
 border:0!important;border-radius:0!important;
 background:var(--wd-ornate-rating-image) center/100% 100% no-repeat!important;
 background-color:transparent!important;
 box-shadow:none!important;overflow:visible!important;
}
/* Existing label stays available to assistive tech but is not double-drawn. */
#dynastyRoomStage .player .rating-stats:not(.is-computer) > div:first-child > span{
 position:absolute!important;width:1px!important;height:1px!important;
 overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;
}
#dynastyRoomStage .player .rating-stats:not(.is-computer) > div:first-child > :is(#player1Rating,#player2Rating){
 position:absolute!important;left:9%!important;top:45%!important;
 display:flex!important;align-items:center!important;gap:3px!important;
 width:42%!important;max-width:42%!important;height:31%!important;
 margin:0!important;padding:0!important;line-height:1!important;
 font:700 clamp(9px,1.12vw,17px)/1 Georgia,'Times New Roman',serif!important;
 text-align:left!important;text-shadow:0 1px 2px #080309!important;
 white-space:nowrap!important;z-index:1!important;
}
#dynastyRoomStage .player .rating-stats > div:first-child > .wd-rating-live::before{
 content:"★";font-size:1.12em;color:inherit;flex:none;
}
#dynastyRoomStage .player .rating-stats .record > :is(#player1Stats,#player2Stats):not([hidden]){
 position:absolute!important;display:block!important;
 inset:28% 6% auto auto!important;
 width:35%!important;max-width:35%!important;height:48%!important;min-height:0!important;
 margin:0!important;padding:0!important;
 border:0!important;border-radius:0!important;
 background:transparent!important;box-shadow:none!important;
 color:transparent!important;-webkit-text-fill-color:transparent!important;
 font-size:0!important;text-shadow:none!important;cursor:pointer!important;
}
#dynastyRoomStage .player .rating-stats .record > :is(#player1Stats,#player2Stats):focus-visible{
 outline:2px solid #fff3c7!important;outline-offset:1px!important;
}
#dynastyRoomStage .player .rating-stats .record > :is(#player1Stats,#player2Stats)[hidden]{
 display:none!important;
}
@media(max-width:699px){
 body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
 #game .wd-avatar-account-bar > :is(#playerRatingBadge,#opponentRatingBadge):not([hidden]){
  font-size:clamp(8px,2vw,12px)!important;
 }
 #dynastyRoomStage .player .rating-stats:not(.is-computer) > div:first-child > :is(#player1Rating,#player2Rating){
  font-size:clamp(8px,2vw,12px)!important;
 }
}

/* Approved thin-gold outer frame: match the 1px timer-frame weight while
   retaining the exact approved PNG label + View Stats artwork, source-size
   hit targets, live rating/star positions and card dimensions. The old
   thick outer border is masked out of a decorative underlay ONLY. */
body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-account-bar:has(> .wd-rating:not([hidden])),
#dynastyRoomStage .player .rating-stats:not(.is-computer){
 background:transparent!important;
 background-image:none!important;
 border:0!important;
 box-shadow:inset 0 0 0 1px #cba055!important;
 outline:none!important;
}
body:not(.wd-gate):is([data-wd-game-type="duel"],[data-wd-game-type="blitz"]):has(#game:not([hidden]))
#game .game-grid :is(#playerCard,#opponentCard) > .wd-avatar-account-bar:has(> .wd-rating:not([hidden]))::before,
#dynastyRoomStage .player .rating-stats:not(.is-computer)::before{
 content:""!important;
 display:block!important;
 position:absolute!important;
 inset:0!important;
 width:100%!important;height:100%!important;
 padding:0!important;margin:0!important;
 transform:none!important;
 background:var(--wd-ornate-rating-image) center/100% 100% no-repeat!important;
 -webkit-mask:url('/wd-ornate-rating-content-mask.svg') center/100% 100% no-repeat!important;
 mask:url('/wd-ornate-rating-content-mask.svg') center/100% 100% no-repeat!important;
 pointer-events:none!important;
 z-index:0!important;
 opacity:1!important;
}
