/* Word Dome game-specific Rules library.
   Uses the exact shipped in-game logo PNG assets without modifications. */
#rulesModal .wd-rules-chooser{
 display:flex!important;flex-direction:column!important;align-items:center!important;
 gap:14px!important;width:min(100%,420px)!important;margin:0 auto!important;
}
#rulesModal .wd-rules-choose-title{
 display:block!important;margin:4px auto 6px!important;
 padding:6px 22px!important;color:#fff2d0!important;
 background:linear-gradient(#123e89,#081e50)!important;
 border:2px double #efba52!important;border-radius:9px!important;
 font:800 clamp(18px,3.3vw,25px)/1.25 Georgia,serif!important;
 text-align:center!important;letter-spacing:.05em!important;
}
#rulesModal .wd-rules-game-link{
 display:flex!important;align-items:center!important;justify-content:center!important;
 flex-direction:column!important;gap:4px!important;
 width:100%!important;min-height:100px!important;
 padding:13px!important;margin:0!important;
 border:2px solid #ca9844!important;border-radius:14px!important;
 background:linear-gradient(155deg,#143c87,#07193f 86%)!important;
 box-shadow:inset 0 1px 0 #fff3,0 5px 12px #0008!important;
 text-decoration:none!important;color:#fff3cf!important;
}
#rulesModal .wd-rules-game-link:hover,
#rulesModal .wd-rules-game-link:focus-visible{
 border-color:#ffe18a!important;outline:2px solid #ffdb77!important;outline-offset:2px!important;
 filter:brightness(1.1)!important;
}
#rulesModal .wd-rules-game-link img{
 display:block!important;width:100%!important;
 max-width:310px!important;height:92px!important;max-height:92px!important;
 margin:auto!important;object-fit:contain!important;
 filter:drop-shadow(0 3px 6px #000a)!important;
}
#rulesModal .wd-rules-game-link .wd-rules-game-hint{
 display:block!important;color:#f6dea4!important;
 text-align:center!important;
 font:600 12px/1.3 Georgia,serif!important;
}
#rulesModal .wd-rules-chooser-note{
 text-align:center!important;color:#d1dcf2!important;
 font:14px/1.4 Georgia,serif!important;margin:4px auto 0!important;
}
@media(max-width:600px){
 #rulesModal .rules-dialog{padding:21px 15px!important}
 #rulesModal .wd-rules-game-link img{height:72px!important;max-height:72px!important}
 #rulesModal .wd-rules-game-link{min-height:92px!important}
}
/* Standalone rules pages; isolated from the existing game stylesheet. */
body.wd-game-rules-page{
 margin:0;padding:24px 15px 46px;min-height:100vh;
 background:radial-gradient(ellipse at 50% 0%,#204e93 0%,#071e4d 55%,#020b1f 100%);
 color:#f2f5ff;font:16px/1.65 Georgia,"Times New Roman",serif;
}
.wd-rule-page-shell{width:min(780px,100%);margin:0 auto}
.wd-rule-page-header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center;margin:0 0 18px}
.wd-rule-page-header a{
 display:inline-flex;align-items:center;justify-content:center;
 padding:7px 15px;border:1px solid #edbf59;border-radius:9px;
 color:#fff0b5;background:linear-gradient(#1a4387,#091c47);
 text-decoration:none;font:bold 13px Georgia,serif;
}
.wd-rule-page-header a:hover,.wd-rule-page-header a:focus-visible{background:#285ab0;outline:2px solid #ffe397;outline-offset:2px}
.wd-rule-page-card{
 background:linear-gradient(160deg,#143a7a,#071b3d 77%);
 border:3px solid #e9b648;border-radius:19px;
 padding:clamp(20px,5vw,42px);box-shadow:0 12px 45px #0008,inset 0 0 0 1px #ffe39877;
}
.wd-rule-page-logo{display:block;width:min(100%,420px);height:145px;max-height:145px;margin:0 auto 5px;object-fit:contain}
.wd-rule-page-card h1{text-align:center;color:#ffe49c;letter-spacing:.07em;font-size:clamp(22px,4vw,30px);margin:0 0 18px}
.wd-rule-page-card h2{
 color:#8bd9ff;font-size:16px;margin:23px 0 4px;
 letter-spacing:.10em;text-transform:uppercase
}
.wd-rule-page-card p{margin:4px 0 10px}
.wd-rule-page-note{border-left:3px solid #e5b74f;padding-left:13px;color:#e1e9fb}
.wd-rule-page-footer{text-align:center;color:#cfdcf1;margin:19px auto 0;font-size:13px}
@media(max-width:520px){.wd-rule-page-logo{height:110px}.wd-rule-page-header a{padding:7px 10px;font-size:12px}}

/* Secondary chooser reached from the individual rules pages. */
.wd-game-rules-index{display:flex;flex-direction:column;gap:20px;align-items:center;margin:4px auto 18px;max-width:470px}
.wd-game-rules-index a{
 display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
 width:100%;padding:12px;border:2px solid #e3b352;border-radius:12px;
 text-decoration:none;background:linear-gradient(#143e89,#061a44);
 color:#ffe8ab;text-align:center;font-weight:700;
}
.wd-game-rules-index a:hover,.wd-game-rules-index a:focus-visible{
 border-color:#ffe5a2;background:#214e95;outline:2px solid #ffe099;outline-offset:2px
}
.wd-game-rules-index img{display:block;width:100%;max-width:350px;height:120px;object-fit:contain}

/* The active game room shows only its own rules, not the home game chooser. */
#rulesModal .wd-rules-chooser[hidden],#rulesModal .wd-room-specific-rules[hidden]{display:none!important}
#rulesModal .wd-room-specific-rules{width:100%;padding-top:28px}
#rulesModal .wd-room-specific-rules .wd-rule-page-card{box-sizing:border-box;padding:clamp(15px,3vw,26px);margin:0;font:15px/1.55 Georgia,serif}
#rulesModal .wd-room-specific-rules .wd-rule-page-card h1{font-size:clamp(18px,3vw,26px);margin-bottom:12px}
#rulesModal .wd-room-specific-rules .wd-rule-page-card p{margin:5px 0 10px}
#rulesModal .wd-room-specific-rules .wd-rule-page-logo{max-height:110px;height:110px}
#rulesModal .wd-room-specific-rules a{color:#ffe5a0}

/* Gold RULES plaque, placed directly beneath each game's approved logo.
   Used by standalone pages and the in-room Duel/Blitz rule books. */
.wd-rule-page-card h1.wd-rule-page-heading{
 display:table;box-sizing:border-box;min-width:175px;max-width:calc(100% - 20px);
 padding:7px 30px;margin:4px auto 18px;
 border:2px solid #ffdc7c;border-radius:10px;
 background:linear-gradient(180deg,#fff0b1 0%,#eab84c 52%,#ba7a24 100%);
 color:#17234d;text-align:center;
 font:900 clamp(20px,3.5vw,28px)/1.25 Georgia,"Times New Roman",serif;
 letter-spacing:.12em;
 box-shadow:inset 0 0 0 1px #fff8d177,0 3px 10px #0007;
}
#rulesModal .wd-room-specific-rules .wd-rule-page-card h1.wd-rule-page-heading{
 margin:4px auto 16px;font-size:clamp(19px,3.3vw,26px);
}
@media(max-width:520px){
 .wd-rule-page-card h1.wd-rule-page-heading{padding:6px 22px;min-width:155px}
}

/* Embedded Duel/Blitz books: prevent global game main sizing from forcing
   a document wider than the rulebook dialog. Standalone rules are unchanged. */
#rulesModal .rules-dialog{
 box-sizing:border-box!important;max-width:calc(100vw - 20px)!important;
 min-width:0!important;overflow-x:hidden!important;overflow-y:auto!important;
}
#rulesModal .wd-room-specific-rules{
 box-sizing:border-box!important;width:100%!important;max-width:100%!important;
 min-width:0!important;overflow-x:hidden!important;overflow-wrap:anywhere!important;
}
#rulesModal .wd-room-specific-rules article.wd-rule-page-card{
 display:block!important;box-sizing:border-box!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 height:auto!important;min-height:0!important;overflow-wrap:break-word!important;
}
#rulesModal .wd-room-specific-rules article.wd-rule-page-card :is(p,h1,h2,li){
 max-width:100%!important;min-width:0!important;white-space:normal!important;
 overflow-wrap:break-word!important;
}
