.wr-avatar-frame{position:relative;display:block;width:100%;height:100%;overflow:hidden;border-radius:inherit;isolation:isolate;background:#382b21}
.wr-avatar-frame img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.wr-avatar-dialog{width:min(870px,calc(100vw - 32px));max-width:100%;max-height:calc(100dvh - 28px);overflow:auto;margin:auto;padding:0;color:#35271c;border:1px solid #a18456;box-shadow:0 24px 88px #110c09b8,0 0 0 3px #392a20,0 0 0 4px #a4875a;background:#e8dac0;font-family:Georgia,'Times New Roman',serif}
.wr-avatar-dialog::backdrop{background:#18130fd6}
.wr-avatar-layout{padding:clamp(16px,3vw,30px);display:grid;grid-template-columns:minmax(130px,.76fr) minmax(0,2fr);gap:18px 24px;background:repeating-linear-gradient(101deg,transparent 0 7px,#8b6c4410 8px,transparent 10px),radial-gradient(ellipse at 20% 18%,#f6ecd5,#e4d2b0 64%,#cbb58f)}
.wr-avatar-layout header,.wr-avatar-layout footer{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:10px}
.wr-avatar-layout header{border-bottom:1px solid #b09a72;padding-bottom:14px}
.wr-avatar-layout h2,.wr-avatar-layout h3,.wr-avatar-layout p{margin:0}
.wr-avatar-layout h2{color:#3b281e;font:normal clamp(24px,3vw,37px)/1.1 Georgia,serif;letter-spacing:-.035em}
.wr-avatar-layout header p{font:15px/1.35 Georgia,serif;color:#5b4b38;margin-top:7px}
.wr-avatar-layout button{cursor:pointer;color:inherit;font-family:inherit}
.wr-avatar-close{flex:0 0 40px;width:40px;height:40px;align-self:start;border:1px solid #ad9974;border-radius:50%;font:26px/1 Georgia,serif!important;color:#4b3426;background:transparent}
.wr-avatar-close:hover,.wr-avatar-close:focus-visible{background:#d4c09d}
.wr-avatar-preview{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;border-right:1px solid #b09a72;padding-right:clamp(10px,2vw,25px)}
.wr-avatar-bust{width:min(100%,196px);aspect-ratio:4/5;padding:4px;box-sizing:border-box;border:2px solid #654a29;border-radius:49% 49% 43% 43%;background:linear-gradient(135deg,#ddc590,#79603b 45%,#392b1e 53%,#bc9c62);box-shadow:0 4px 9px #49362163,inset 0 0 0 1px #ead3a3}
.wr-avatar-bust>.wr-avatar-frame{border:1px solid #735c3b;box-sizing:border-box}
.wr-avatar-preview small,.wr-avatar-layout footer>span,.wr-attack-caption small{font:600 10px/1.1 Georgia,serif;text-transform:uppercase;letter-spacing:.17em}
.wr-avatar-preview small{margin-top:8px;color:#6c4938}
.wr-avatar-preview h3{font:normal clamp(28px,3.6vw,48px)/1 Georgia,serif;letter-spacing:-.04em}
.wr-avatar-gallery{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-height:min(50dvh,440px);overflow-y:auto;padding:4px;align-content:start;scrollbar-color:#9b815a #e0cfad;scrollbar-width:thin}
.wr-avatar-choice{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;position:relative;padding:3px 2px 5px!important;border:1px solid transparent!important;border-radius:2px;background:transparent!important;min-width:0;line-height:1}
.wr-avatar-choice>.wr-avatar-frame{width:min(100%,58px);height:auto;aspect-ratio:1;border:2px solid #866b42;border-radius:50%;box-sizing:border-box;box-shadow:inset 0 0 0 1px #e7d6af,0 1px 3px #402d1e63}
.wr-avatar-choice>span:last-child{font:normal clamp(12px,1.5vw,15px)/1.15 Georgia,serif}
.wr-avatar-choice[aria-pressed=true]{background:#ceb589!important;border-color:#79603b!important}
.wr-avatar-choice[aria-pressed=true]>.wr-avatar-frame{border-color:#503b24;box-shadow:0 0 0 1px #f3d999}
.wr-avatar-choice:hover{background:#d9c49f!important}
.wr-avatar-layout button:focus-visible{outline:2px solid #6e361f;outline-offset:2px}
.wr-avatar-layout footer{padding-top:14px;border-top:1px solid #b09a72}
.wr-avatar-layout footer>span{color:#685741}
.wr-avatar-equip{min-width:148px;padding:9px 19px;min-height:42px;border:1px solid #533a27;background:linear-gradient(#72513b,#4f3828);color:#f8e9c9!important;box-shadow:inset 0 0 0 2px #8c714c;font:normal 16px/1.15 Georgia,serif}
.wr-avatar-equip:hover{background:#74543b}
/* Each 512 × 448 painting has a different doorway. Map its jambs, lintel and
   sill around the same 220 × 216 opening on the board and in the close-up. */
.wr-shrine-monument {
  --jamb:28.515625%; --lintel:34.151786%; --sill:17.633929%;
  --painting:url("assets/shrine-greek.webp"); --source-cuts:153 123 88 125;
  --opening:polygon(0 0,100% 0,100% 24%,98% 66%,97.5% 78%,94% 81%,94% 84%,98% 87%,98% 100%,2% 100%,2% 87%,6% 84%,6% 81%,2.5% 78%,2% 66%,0 24%);
  position:relative; display:block; isolation:isolate; width:100%; aspect-ratio:8 / 7;
  filter:drop-shadow(0 3px 2px #1c120db8); pointer-events:none;
}
.wr-shrine-monument[data-shrine-pantheon="Norse"] {
  --painting:url("assets/shrine-norse.webp"); --source-cuts:161 142 86 142;
  --opening:polygon(23% 0,77% 0,82% 5%,89% 9%,93% 14%,97% 21%,100% 26%,100% 100%,0 100%,0 26%,3% 21%,7% 14%,11% 9%,18% 5%);
}
.wr-shrine-monument[data-shrine-pantheon="Egyptian"] {
  --painting:url("assets/shrine-egyptian.webp"); --source-cuts:152 160 78 161;
  --opening:polygon(3% 0,97% 0,100% 6%,100% 100%,0 100%,0 6%);
}
.wr-shrine-building {position:absolute;inset:0;width:100%;height:100%;display:block;max-width:none;pointer-events:none}
@supports (border-image-slice:1 fill) {
  .wr-shrine-building {visibility:hidden}
  .wr-shrine-monument:before {
    content:""; position:absolute; inset:0; border:1px solid transparent;
    border-image-source:var(--painting); border-image-slice:var(--source-cuts) fill;
    border-image-width:var(--lintel) var(--jamb) var(--sill); border-image-repeat:stretch;
  }
}
.wr-shrine-monument .wr-shrine-portrait {
  position:absolute;display:block;inset:var(--lintel) var(--jamb) var(--sill);
}
.wr-shrine-portrait>.wr-avatar-frame {clip-path:var(--opening)}
.wr-shrine-monument .wr-avatar-frame:after {
  content:"";position:absolute;inset:0;box-shadow:inset 0 1px 3px #21150ce6;
  background:linear-gradient(to bottom,#26191330,transparent 15%,transparent 84%,#24150d26);pointer-events:none;
}
.wr-shrine-plinth {
  display:inline-flex;align-items:center;justify-content:center;gap:.45em;position:relative;z-index:1;
  width:max-content;max-width:100%;line-height:1;min-height:17px;padding:2px 9px 3px;
  clip-path:polygon(5% 0,95% 0,100% 100%,0 100%);border-block:1px solid #c4a679;
  background:linear-gradient(180deg,#645448,#40372f 55%,#302a25 86%,#574638);color:#fff0d3;
}
.wr-shrine-owner {font:600 clamp(10px,.85vw,13px)/1 Georgia,serif;white-space:nowrap;letter-spacing:.015em}
.wr-shrine-hp {display:inline-flex;align-items:center;gap:3px;border-inline-start:1px solid #b29b757a;padding-inline-start:.45em;color:#fff6de;font:700 clamp(11px,.96vw,14px)/1 system-ui,sans-serif;font-variant-numeric:tabular-nums}
.wr-shrine-hp .icon,.db-shell .wr-shrine-hp .icon {width:.83em;height:.83em;color:#eea29a}
.db-shell .db-seat {width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:center;align-items:center;justify-content:center;justify-items:center;gap:4px 6px}
.db-shell .db-shrine {
  grid-column:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;
  justify-self:center;min-width:0;min-height:0;max-width:100%;width:min(100%,clamp(116px,21.3dvh,193px));
  gap:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;isolation:isolate;text-align:center;outline:none;
}
.db-shrine .wr-shrine-monument {margin-bottom:-2px}
.db-shell .db-self .db-favor {grid-column:1/-1}
.db-shell .db-seat .db-enemy-hand {margin:0;gap:4px;justify-self:start}
.db-shell .db-rival .db-favor {justify-self:end}
.db-seat .db-fan-backs {height:24px}
.db-shell .db-shrine:is(.db-target,:focus-visible) {outline:0;box-shadow:none;animation:none}
.db-shell .db-shrine:is(.db-target,:focus-visible) .wr-shrine-monument {
  filter:drop-shadow(1px 0 0 #fff0ac) drop-shadow(-1px 0 0 #fff0ac) drop-shadow(0 -1px 0 #fff0ac) drop-shadow(0 0 5px #efb444);
}
.db-shell .db-shrine:is(.db-target,:focus-visible) .wr-shrine-plinth {border-color:#fff0ae;background:linear-gradient(#98733b,#553a24);color:#fff7db}
.db-shell .db-shrine.db-target:before,.db-shell .db-shrine:focus-visible:before {content:"";position:absolute;left:2%;right:2%;bottom:7px;height:16%;border:2px solid #ffe095;border-radius:50%;box-shadow:0 0 7px #d99a3a, inset 0 0 7px #d99a3a;z-index:-1}
@media(hover:hover){.db-shell .db-shrine:hover .wr-shrine-monument {filter:drop-shadow(0 1px 3px #f4cd87) brightness(1.08)}}
@media(forced-colors:active){.db-shell .db-shrine:is(.db-target,:focus-visible){outline:2px solid Highlight;outline-offset:2px}}
.wr-shrine-inspection {display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:center;gap:clamp(12px,3vw,24px);padding:8px 2px}
.wr-shrine-inspection .wr-shrine-monument {width:100%;max-width:340px;justify-self:center;filter:drop-shadow(0 5px 4px #583d2359)}
.wr-shrine-record {min-width:0}
.wr-shrine-record small {color:#6c4c33;font:700 10px/1.2 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.14em}
.db-dialog .wr-shrine-record h4 {color:#482f28;line-height:1.1;font-size:clamp(23px,3vw,35px);margin:4px 0 13px}
.wr-shrine-record dl {display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 10px;margin:0 0 12px;color:#3e3023;font-size:14px}
.wr-shrine-record dt {font-weight:600}.wr-shrine-record dd {margin:0;overflow-wrap:anywhere}
.db-dialog .wr-shrine-record p {font-size:14px;line-height:1.34}
@media(max-width:880px){.db-seat .db-fan-backs{display:none}.db-shell .db-seat{gap:2px 4px}.db-seat .db-favor>span{display:none}}
@media(max-width:650px) and (orientation:portrait){
  .db-shell .db-side {--shrine-band:clamp(67px,11.6dvh,110px);grid-template-rows:var(--shrine-band) minmax(0,1fr)}
  .db-shell .db-self {grid-template-rows:minmax(0,1fr) var(--shrine-band)}
  .db-shell .db-seat {display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;padding-inline:3px}
  .db-shell .db-seat .db-shrine {width:auto;min-width:90px;max-width:46%;max-height:100%;flex:0 0 auto}
  .db-shrine .wr-shrine-monument {height:calc(var(--shrine-band) - 18px);width:auto;max-width:100%}
  .db-seat .db-fan-backs{display:flex}.db-shell .db-seat .db-enemy-hand{gap:6px}
}
@media(max-height:505px) and (orientation:landscape){
  .db-shell .db-seat {gap:1px 4px}
  .db-shell .db-seat .db-shrine {width:auto;max-width:100%}
  .db-shrine .wr-shrine-monument {height:clamp(40px,16dvh,78px);width:auto;max-width:100%}
  .db-shrine .wr-shrine-plinth {min-height:13px;padding:1px 6px}
  .db-shrine .wr-shrine-owner {font-size:9px}.db-shrine .wr-shrine-hp {font-size:10px}
  .db-seat .db-fan-backs {display:none}
}
@media(max-width:440px) and (orientation:portrait){
  .wr-shrine-inspection {grid-template-columns:1fr;gap:10px}
  .wr-shrine-inspection .wr-shrine-monument {width:min(88%,max(135px,28dvh))}
}
.db-shell.wr-defender-self .db-self .wr-shrine-portrait:after,.db-shell.wr-defender-rival .db-rival .wr-shrine-portrait:after{content:"";position:absolute;inset:-3px;border:2px solid #f3cb79;border-radius:inherit;box-shadow:0 0 9px #b95930;pointer-events:none;animation:wr-defender-pulse .72s ease-out both}
.wr-attack-cameo{display:flex;align-items:center;gap:7px;position:absolute;z-index:2;pointer-events:none;isolation:isolate;max-width:calc(100% - 12px);border:1px solid #b69658;box-shadow:0 3px 14px #110b07c9,inset 0 0 0 2px #5c4932;box-sizing:border-box;padding:4px 13px 4px 4px;background:linear-gradient(113deg,#5c4931,#382d20 58%,#463727);color:#fff1c8;border-radius:32px 4px 4px 32px;animation:wr-strike-seal 1.08s ease-out both}
.wr-attack-cameo[data-attack-side="1"]{background:linear-gradient(113deg,#6d493c,#462c24 58%,#51372c)}
.wr-attack-cameo>.wr-avatar-frame{width:clamp(36px,4.5vw,57px);height:auto;aspect-ratio:1;border-radius:50%;border:1px solid #d6b573;box-sizing:border-box}
.wr-attack-caption{display:grid;gap:3px}
.wr-attack-caption small{font-size:8px;letter-spacing:.10em;color:#e1c795}
.wr-attack-caption strong{font:normal clamp(15px,2vw,23px)/1 Georgia,serif}
@keyframes wr-strike-seal{0%{opacity:0;transform:translateX(-8px) scale(.94)}18%{opacity:1;transform:translateX(1px) scale(1.035)}30%,78%{opacity:1;transform:none}100%{opacity:0;transform:translateY(-3px)}}
@keyframes wr-defender-pulse{0%{opacity:.95;transform:scale(.93)}45%{opacity:1}100%{opacity:0;transform:scale(1.5)}}
.wr-attack-cameo.wr-still,.db-shell.wr-strike-still .wr-shrine-portrait:after{animation:none}
@media (prefers-reduced-motion:reduce){.wr-attack-cameo,.db-shell .wr-shrine-portrait:after{animation:none!important}}
@media (max-width:600px){
  .wr-avatar-dialog{width:calc(100vw - 18px);max-height:calc(100dvh - 14px)}
  .wr-avatar-layout{grid-template-columns:1fr;gap:10px;padding:14px}
  .wr-avatar-layout header{padding-bottom:9px}
  .wr-avatar-layout header p{font-size:13px}
  .wr-avatar-preview{display:grid;grid-template-columns:58px 1fr;grid-template-rows:auto auto;justify-content:start;align-items:end;gap:4px 11px;border:0;padding:0}
  .wr-avatar-preview .wr-avatar-bust{width:58px;height:58px;border-radius:50%;grid-row:1/3;padding:2px}
  .wr-avatar-preview small{margin:0;grid-column:2}
  .wr-avatar-preview h3{font-size:24px;align-self:start;grid-column:2}
  .wr-avatar-gallery{max-height:clamp(140px,53dvh,410px);gap:4px}
  .wr-avatar-choice>.wr-avatar-frame{width:min(100%,52px)}
  .wr-avatar-layout footer{padding-top:8px}
}
@media(max-width:365px){.wr-avatar-gallery{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-height:480px) and (min-width:601px){.wr-avatar-layout{gap:7px 16px;padding:12px 18px}.wr-avatar-layout header,.wr-avatar-layout footer{padding-block:6px}.wr-avatar-preview .wr-avatar-bust{max-height:115px;max-width:96px}}

.wr-avatar-frame[data-avatar-id="balat"]>img{transform:scale(1.65);transform-origin:54% 5%}
