/* Approved Oct 31 Word Dome blue-and-gold profile PNG.
   Player name, rating, selected avatar and Royal status are live account data;
   artwork never supplies another player's identity or an unconditional crest.
   Scope all changes to the signed-in, logo-only homepage only. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card{
 --wd-regal-width:clamp(440px,41vw,700px);
 --wd-regal-height:calc(var(--wd-regal-width) * .341615);
 /* The crown PNG has a transparent margin below its actual gold pixels.
    Bring the whole PROFILE to 1% of its prior visible-artwork gap (99% closer).
    The gold bottom ends ~1.0274% above the 25dvh fitted logo image box bottom.
    Preserve the logo, profile dimensions and horizontal center. */
 --wd-regal-left:calc(50vw - var(--wd-regal-width) / 2);
 --wd-regal-top:calc(35dvh - 25dvh * .01017126 + .0024px - var(--wd-regal-height) * .000006);
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card::before{
 content:''!important;display:block!important;position:absolute!important;
 z-index:0!important;pointer-events:none!important;
 /* Enlarge ONLY the existing decorative outer selector panel by another 3%
    in both dimensions, while retaining its original top edge and center.
    All live name, rating, crest, avatar and entrance layouts continue using
    the unchanged --wd-regal-* base values. */
 top:var(--wd-regal-top)!important;
 left:calc(var(--wd-regal-left) - var(--wd-regal-width) * .03045)!important;
 width:calc(var(--wd-regal-width) * 1.0609)!important;
 height:calc(var(--wd-regal-height) * 1.071509)!important;
 margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
 box-shadow:none!important;clip-path:none!important;transform:none!important;
 background:transparent url('/Word_Dome_Player_Profile_Transparent_Background.png?v=profile-20261031') center / 100% 100% no-repeat!important;
}
/* The approved oval rating badge is baked into the profile PNG.
   No additional square frame, masking or decorative overlay is necessary. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card::after{
 content:none!important;display:none!important;
}
/* Left column: real username over the blue-and-gold baked EMPTY rating well. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .wd-home-identity-row{
 display:flex!important;flex-direction:column!important;
 justify-content:space-between!important;align-items:center!important;
 position:absolute!important;z-index:5!important;pointer-events:auto!important;
 top:calc(var(--wd-regal-top) + var(--wd-regal-height) * .24)!important;
 left:calc(var(--wd-regal-left) + var(--wd-regal-width) * .055)!important;
 width:calc(var(--wd-regal-width) * .285)!important;
 height:calc(var(--wd-regal-height) * .47)!important;
 min-height:0!important;max-width:none!important;
 padding:0!important;margin:0!important;gap:0!important;
 background:none!important;box-shadow:none!important;border:0!important;
 transform:none!important;translate:none!important;scale:1!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card .wd-home-identity-row #name{
 display:block!important;position:relative!important;inset:auto!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 height:calc(var(--wd-regal-height) * .205)!important;min-height:0!important;
 flex:none!important;margin:0!important;padding:0 2px!important;
 background:transparent!important;border:0!important;box-shadow:none!important;
 text-align:center!important;text-overflow:ellipsis!important;
 color:#ffe4a5!important;-webkit-text-fill-color:#ffe4a5!important;
 font:900 clamp(13px,2vw,31px)/1.2 Georgia,serif!important;
 text-shadow:0 2px 3px #00173f!important;
 transform:none!important;translate:none!important;scale:1!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card .wd-home-identity-row #lobbyPlayerRating:not([hidden]){
 display:flex!important;position:relative!important;inset:auto!important;
 flex:none!important;align-items:center!important;justify-content:center!important;
 width:81%!important;max-width:81%!important;min-width:0!important;
 height:calc(var(--wd-regal-height) * .148)!important;min-height:0!important;
 margin:0!important;padding:0 3px!important;
 border:0!important;border-radius:0!important;
 outline:none!important;outline-offset:0!important;
 background:transparent!important;box-shadow:none!important;
 color:#fff1c5!important;-webkit-text-fill-color:#fff1c5!important;
 font:800 clamp(10px,1.15vw,18px)/1.1 Georgia,serif!important;
 white-space:nowrap!important;text-align:center!important;
 /* Match the enlarged baked-in oval: it grew 6.09% in width around its
    center and 7.1509% downward while the live label stayed unscaled.
    Shift ONLY rating text; keep the badge, player name and other UI fixed. */
 transform:translate(calc(var(--wd-regal-width) * -.018),calc(var(--wd-regal-height) * .05))!important;
 translate:none!important;scale:1!important;
}
/* Right-hand tile is already framed in gold in the artwork.
   Live avatar images cover just the inner blue tile, not its gold frame.
   With no chosen avatar, reveal the PNG's original gold A. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section{
 display:block!important;position:absolute!important;z-index:6!important;
 top:calc(var(--wd-regal-top) + var(--wd-regal-height) * .153)!important;
 left:calc(var(--wd-regal-left) + var(--wd-regal-width) * .676)!important;
 width:calc(var(--wd-regal-width) * .264)!important;
 height:calc(var(--wd-regal-height) * .61)!important;
 max-width:none!important;min-width:0!important;min-height:0!important;
 margin:0!important;padding:0!important;
 border:0!important;background:none!important;box-shadow:none!important;
 text-align:center!important;overflow:visible!important;
 transform:none!important;translate:none!important;scale:1!important;
 pointer-events:auto!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section::before{
 content:none!important;display:none!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section #avatarPreview{
 display:block!important;position:absolute!important;z-index:2!important;
 top:calc(var(--wd-regal-height) * .018)!important;
 left:50%!important;right:auto!important;bottom:auto!important;
 width:calc(var(--wd-regal-width) * .107)!important;
 height:calc(var(--wd-regal-width) * .107)!important;
 max-width:none!important;max-height:none!important;
 min-width:0!important;min-height:0!important;
 margin:0!important;padding:0!important;
 border:0!important;outline:0!important;border-radius:7px!important;
 background-position:center!important;background-size:cover!important;
 box-shadow:none!important;background-clip:padding-box!important;
 transform:translateX(-50%)!important;translate:none!important;scale:1!important;
 overflow:hidden!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section #avatarPreview.avatar-placeholder{
 visibility:hidden!important;pointer-events:none!important;
}
/* The real button overlays the artwork's exact gold-framed button.
   Its label and frame are already printed on the PNG, but it stays clickable. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section .avatar-pick-buttons{
 display:flex!important;position:absolute!important;z-index:4!important;
 top:calc(var(--wd-regal-height) * .403)!important;
 left:50%!important;right:auto!important;
 width:calc(var(--wd-regal-width) * .24)!important;
 min-width:0!important;height:auto!important;min-height:0!important;
 margin:0!important;padding:0!important;
 justify-content:center!important;align-items:center!important;
 transform:translateX(-50%)!important;translate:none!important;scale:1!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card #chooseAvatar{
 display:flex!important;position:relative!important;inset:auto!important;
 flex:none!important;align-items:center!important;justify-content:center!important;
 width:100%!important;max-width:100%!important;
 height:max(30px,calc(var(--wd-regal-width) * .056))!important;
 min-height:0!important;margin:0!important;padding:0!important;
 border:0!important;border-radius:20px!important;
 background:transparent!important;box-shadow:none!important;
 color:transparent!important;-webkit-text-fill-color:transparent!important;
 text-shadow:none!important;font-size:0!important;cursor:pointer!important;
 transform:none!important;translate:none!important;scale:1!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card #chooseAvatar:focus-visible{
 outline:2px solid #fff2ba!important;outline-offset:3px!important;
}
/* Only verified Royal members receive a separately rendered Royal crest. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdRoyalMemberPreview:not([hidden]){
 display:flex!important;position:absolute!important;z-index:5!important;
 top:calc(var(--wd-regal-top) + var(--wd-regal-height) * .12)!important;
 left:calc(var(--wd-regal-left) + var(--wd-regal-width) * .35)!important;
 width:calc(var(--wd-regal-width) * .30)!important;
 height:calc(var(--wd-regal-height) * .76)!important;
 max-width:none!important;max-height:none!important;
 min-height:0!important;align-items:center!important;justify-content:center!important;
 margin:0!important;padding:0!important;
 border:0!important;background:none!important;box-shadow:none!important;
 transform:none!important;translate:none!important;scale:1!important;
 pointer-events:none!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdRoyalMemberPreview[hidden]{
 display:none!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card #wdRoyalMemberPreview > img{
 display:block!important;width:100%!important;height:100%!important;
 max-width:100%!important;max-height:100%!important;
 object-fit:contain!important;
 transform:none!important;translate:none!important;scale:1!important;
}
/* Responsive: preserve artwork's 805:275 geometry on phones and tablets. */
@media(max-width:850px){
 html:not(.wd-home-flow-test)
 body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card{
  --wd-regal-width:min(95vw,620px);
  /* Compensate for the 128px logo's transparent lower pixels. Preserve
     just 1% of the previous visible gold-to-panel gap. */
  --wd-regal-top:calc(60dvh - 129.29952128px - var(--wd-regal-height) * .000006);
  --wd-regal-left:calc(50vw - var(--wd-regal-width) / 2);
 }
}
@media(max-width:480px){
 html:not(.wd-home-flow-test)
 body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card{
  --wd-regal-width:96vw;
  --wd-regal-left:calc(50vw - var(--wd-regal-width) / 2);
  --wd-regal-top:calc(60dvh - 129.29952128px - var(--wd-regal-height) * .000006);
 }
 html:not(.wd-home-flow-test)
 body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card .wd-home-identity-row #name{
  font-size:clamp(11px,3.3vw,16px)!important;
 }
 html:not(.wd-home-flow-test)
 body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card .wd-home-identity-row #lobbyPlayerRating:not([hidden]){
  font-size:clamp(8px,2.2vw,11px)!important;
 }
}
/* Preserve the existing account-owned avatar picker on the logo-only page. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #avatarModal.avatar-modal:not([hidden]){
 display:grid!important;place-items:center!important;visibility:visible!important;
 opacity:1!important;position:fixed!important;inset:0!important;
 width:100vw!important;height:100dvh!important;z-index:25000!important;
 pointer-events:auto!important;overflow:hidden!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #avatarModal.avatar-modal[hidden]{
 display:none!important;visibility:hidden!important;
}


/* Keep the old animated doorway available to the game-flow tests, but use
   the approved royal-blue doors for the signed-in homepage. Enlarge ONLY
   the entrance's visible/hitbox artwork to 30% above its original size around its top center. */
#wdGrandEntrance .wd-home-royal-entrance-art{display:none}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdGrandEntrance{
 --wd-grand-simple-link:1;
 display:block!important;visibility:visible!important;opacity:1!important;
 position:absolute!important;z-index:30!important;
 top:calc(var(--wd-regal-top) + var(--wd-regal-height) + 8px)!important;
 bottom:auto!important;left:50%!important;right:auto!important;
 width:min(calc(var(--wd-regal-width) * .88),610px)!important;
 height:auto!important;min-height:0!important;aspect-ratio:2078/757!important;
 max-width:calc(100vw - 18px)!important;
 max-height:max(100px,calc(100dvh - var(--wd-regal-top) - var(--wd-regal-height) - 28px))!important;
 margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
 background:transparent!important;box-shadow:none!important;filter:none!important;
 /* Raise only the entrance by 20% of its rendered height.
    Independent scale 1.30 multiplies the percentage Y translation too,
    so -20% shifts the artwork upward by precisely 20% of its shown height.
    The X position and 30% size enlargement remain unchanged. */
 transform:translate(-38.461538%,-20%)!important;translate:none!important;scale:1.30!important;
 transform-origin:center top!important;zoom:1!important;
 cursor:pointer!important;pointer-events:auto!important;overflow:visible!important;touch-action:manipulation!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdGrandEntrance > .wd-home-royal-entrance-art{
 display:block!important;visibility:visible!important;
 position:absolute!important;inset:0!important;z-index:1!important;
 width:100%!important;height:100%!important;max-width:none!important;
 object-fit:contain!important;object-position:center!important;
 margin:0!important;padding:0!important;border:0!important;background:transparent!important;
 box-shadow:none!important;pointer-events:none!important;user-select:none!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdGrandEntrance :is(.wd-grand-entrance-art,.wd-grand-open-interior,.wd-grand-leaf){
 display:none!important;visibility:hidden!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdGrandEntrance .wd-entrance-screenreader{
 position:absolute!important;clip-path:inset(50%)!important;width:1px!important;
 height:1px!important;overflow:hidden!important;white-space:nowrap!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > #wdGrandEntrance:hover > .wd-home-royal-entrance-art{
 filter:brightness(1.07)!important;
}

/* Approved Oct 31 signed-in HOME wallpaper. Keep the sign-in gate,
   Grand Hall lobby and all three game rooms on their existing backgrounds.
   This stylesheet loads last so older Royal Rotunda rules cannot override it. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]){
 background:#061638 url('/Celestial%20Dome%20Royal%20Rotunda.png?v=home-signin-night-20261031') center top / cover no-repeat!important;
}

/* A 30%-larger doorway may extend below short desktop viewports. Allow
   vertical homepage scrolling instead of cutting off the gold steps.
   No change to the sign-in, Grand Hall interior, or any game room. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) main{
 overflow-x:hidden!important;overflow-y:auto!important;
}


/* Homepage profile photo and rating registration, 2026-11-02.
   The baked-in 805x275 gold panel was reduced to 90% by the later homepage
   perspective layer, but its dynamic rating text and avatar stayed at the
   original coordinates. Recenter these two LIVE overlays only. Do not alter
   the panel PNG, name, crest, door, or avatar selection mechanics. */
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card .wd-home-identity-row #lobbyPlayerRating:not([hidden]){
 /* Match the painted oval's center after the 90%-sized frame; prevent the
    text from hanging over its left rim, and lift its baseline into the well. */
 transform:translate(calc(var(--wd-regal-width) * .014),calc(var(--wd-regal-height) * .025))!important;
}
html:not(.wd-home-flow-test)
body:not(.wd-gate):has(#lobby:not([hidden])):has(#game[hidden]) #lobby.card > .avatar-section #avatarPreview:not(.avatar-placeholder){
 /* Match the reduced decorative panel's gold square: shift the LIVE photo
    slightly left and down without resizing the square, changing avatar data,
    or moving the badge/crest/selector button. */
 top:calc(var(--wd-regal-height) * .055)!important;
 left:calc(50% - var(--wd-regal-width) * .012)!important;
 /* Fill the painted gold holder using the selected original image.
    Do not sharpen through CSS filters or enlarge via transforms. */
 background-size:cover!important;
 background-position:center center!important;
 background-repeat:no-repeat!important;
 background-color:#086cbb!important;
 image-rendering:auto!important;
 filter:none!important;
}
