/* Painted surfaces are decorative. Text, controls and chart data are HTML or SVG. */
#dlgStat {
  width:min(820px,max(555px,calc((100dvh - 8px)*.82)),calc(100vw - 8px));
  max-width:calc(100vw - 8px); max-height:calc(100dvh - 8px); margin:auto; padding:0;
  box-sizing:border-box; border:0; border-radius:3%; background:#090620;
  box-shadow:0 12px 48px #020111cc; overflow:hidden; isolation:isolate; container-type:inline-size;
  color:#fff9ff; font-family:"Golos Text",system-ui,sans-serif; text-shadow:0 1px 3px #08031f;
}
#dlgStat[open] {display:flex;flex-direction:column}
#dlgStat::backdrop {background:#070419c4;backdrop-filter:blur(2px)}
#dlgStat :where(h2,h3,h4,p){margin:0}
#dlgStat .dlgHead,#dlgStat .ms-totals,#dlgStat .ms-fortune,#dlgStat .ms-months {
  position:relative;box-sizing:border-box;flex:none;width:100%;background:center top / 100% 100% no-repeat;
}
#dlgStat .dlgHead {aspect-ratio:1136/174;padding:0;border:0;background-image:url('royal-header.webp')}
#dlgStat .dlgHead h2 {
  position:absolute;inset:38% 21% 9% 18.5%;display:flex;align-items:center;margin:0;
  font:700 5.45cqw/1 Georgia,"Times New Roman",serif;letter-spacing:-.02em;color:#ffdd85;
  text-shadow:0 1px #8f4819,0 2px 3px #26070c;
}
#dlgStat .dlgHead button {
  position:absolute;inset:44% 5.8% 12% 79%;display:grid;place-items:center;min-width:0;min-height:0;
  padding:0;border:0;border-radius:4cqw;background:transparent;box-shadow:none;
  color:#fff9ff;font:bold 2.45cqw/1.1 Georgia,serif;text-shadow:0 1px 3px #060019;cursor:pointer;
}
#dlgStat .dlgHead button:focus-visible {outline:2px solid #fff4ad;outline-offset:1px}
#dlgStat .dlgHead button:hover {color:#ffe0a1}
#dlgStat #statBody {
  padding:0;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;
  scrollbar-width:none;text-align:center;line-height:1.15;background:#08051b;
}
#dlgStat #statBody::-webkit-scrollbar {display:none}
#dlgStat .ms-totals {
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;
  aspect-ratio:1136/212;padding:8.85% 6.15% 0 7.65%;background-image:url('royal-totals.webp');
}
#dlgStat .ms-total,#dlgStat .ms-luck-card {min-width:0;display:grid;align-content:center;justify-items:center;gap:.22cqw}
#dlgStat .ms-icon,#dlgStat .ms-scale {display:none}
#dlgStat .ms-total b,#dlgStat .ms-luck-card b {
  color:#ffdd80;font:bold 4.85cqw/1 Georgia,serif;font-variant-numeric:tabular-nums;letter-spacing:-.025em;
  text-shadow:0 1px #a66326,0 0 .65cqw #f7af3f3d;
}
#dlgStat .ms-total>span:last-child,#dlgStat .ms-luck-card>span,#dlgStat .ms-luck-card small {
  font:550 2.04cqw/1.15 "Golos Text",system-ui,sans-serif;max-width:100%;
}
#dlgStat .ms-fortune {aspect-ratio:1136/357;background-image:url('royal-luck.webp')}
#dlgStat .ms-band {
  position:absolute;left:34%;right:34%;top:1%;height:16%;display:grid;place-content:center;
  margin:0;padding:0;color:#fff4ea;font:bold 3.08cqw/1.05 Georgia,serif;
}
#dlgStat .ms-luck {position:absolute;inset:37.2% 8.3% 24% 8.6%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2.6%}
#dlgStat .ms-luck-card {align-self:stretch;padding:0 1.1cqw;gap:.35cqw}
#dlgStat .ms-verdict {padding-top:1.3cqw}
#dlgStat .ms-verdict small {max-width:18ch}
#dlgStat .ms-verdict[data-tone=down] b {color:#ff818a}
#dlgStat .ms-verdict[data-tone=up] b {color:#8cffb5}
#dlgStat .ms-note {
  position:absolute;inset:80% 10.1% 2.6% 10.1%;display:flex;align-items:center;justify-content:center;gap:1cqw;
  margin:0;padding:0 1cqw;font:500 1.88cqw/1.16 "Golos Text",system-ui,sans-serif;
}
#dlgStat .ms-note>span:first-child {
  flex:none;display:grid;place-items:center;width:3.3cqw;height:3.3cqw;border:1px solid #ffd372;border-radius:50%;
  background:#080921;color:#ffe08c;font:bold 2.25cqw/1 Georgia,serif;
}
#dlgStat .ms-months {aspect-ratio:1136/642;background-image:url('royal-months.webp')}
#dlgStat .ms-months .ms-band {inset:.3% 36% 90% 36%;height:auto;font-size:2.98cqw}
#dlgStat .ms-months h4,#dlgStat .ms-caption {position:absolute;display:grid;align-content:center;text-align:center;margin:0}
#dlgStat .ms-months h4 {inset:10% 22% 82% 22%;color:#ffdd80;font:bold 3.88cqw/1.04 Georgia,serif}
#dlgStat .ms-caption {inset:18.2% 12% 75.5%;font:600 2.34cqw/1.15 Georgia,serif}
#dlgStat .ms-plot {position:absolute;inset:26.8% 8.9% 33.2% 11%;display:grid;grid-template-columns:minmax(0,1fr) 34.8%;align-items:center;gap:2%}
#dlgStat .ms-chart {display:block;width:100%;height:auto;overflow:visible;color:#f8f2ff;font-variant-numeric:tabular-nums}
#dlgStat .ms-chart text {font:600 12px "Golos Text",system-ui,sans-serif;fill:currentColor}
#dlgStat .ms-chart rect {stroke:#fff8bc9c;stroke-width:.7;filter:drop-shadow(0 0 2.3px #dce5ff84)}
#dlgStat .ms-gridline {fill:none;stroke:#a08bff6b;stroke-width:.6;stroke-dasharray:3 3}
#dlgStat .ms-axis {fill:none;stroke:#dedaff;stroke-width:1}
#dlgStat .ms-recap {min-width:0;padding:0 8.5%;display:grid;gap:1.1cqw;font-variant-numeric:tabular-nums;text-align:start}
#dlgStat .ms-recap strong {font:bold 2.8cqw/1.1 Georgia,serif;color:#ffe08e}
#dlgStat .ms-recap div {display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.8cqw;font:550 2.02cqw/1.1 "Golos Text",system-ui,sans-serif}
#dlgStat .ms-recap b {color:#fff3cb}
#dlgStat .ms-key {display:inline-block;width:1.8cqw;height:1.85cqw;flex:none;border-radius:22%;background:linear-gradient(#ffeb7a,#ff9700);box-shadow:inset 0 1px 1px #fffd}
#dlgStat .ms-key.won {background:linear-gradient(#9aff6b,#00ba33 65%,#008954)}
#dlgStat .ms-key.lost {background:linear-gradient(#ff986b,#ff315d 65%,#c21461)}
#dlgStat .ms-legend {position:absolute;inset:67% 29% 21.6%;display:flex;align-items:center;justify-content:center;gap:3.5cqw;font-size:2cqw}
#dlgStat .ms-legend span {display:inline-flex;align-items:center;gap:.7cqw}
#dlgStat .ms-empty {padding:2cqw;font-size:max(12px,2.1cqw);color:#e6daf7}
@container(max-width:510px) {
  #dlgStat .dlgHead {height:76px;aspect-ratio:auto;background-size:100% 100%}
  #dlgStat .dlgHead h2 {inset:37% 24% 12% 17.5%;font-size:clamp(16px,5.25cqw,26px)}
  #dlgStat .dlgHead button {inset:30% 3% 6% 77%;font-size:clamp(12px,3.55cqw,16px);
    background:linear-gradient(#301443,#0b071f 55%,#38143a);border:1px solid #ffd477;box-shadow:inset 0 0 4px #ffb34e;align-self:center;min-height:36px}
  #dlgStat #statBody {padding:3px 3.7% 15px;scrollbar-width:thin;scrollbar-color:#794d9b #10091f;
    background:linear-gradient(#090820a8,#0e0828ae),url('../season-result/space.webp') center/cover}
  #dlgStat .ms-totals {aspect-ratio:auto;padding:0;gap:4px;grid-template-columns:1fr 1fr;background:none}
  #dlgStat .ms-total {aspect-ratio:234/195;box-sizing:border-box;padding:40% 4% 5%;gap:2px}
  #dlgStat .ms-total b,#dlgStat .ms-luck-card b {font-size:clamp(23px,7.3cqw,37px)}
  #dlgStat .ms-total>span:last-child,#dlgStat .ms-luck-card>span,#dlgStat .ms-luck-card small {font-size:clamp(12px,3.5cqw,16px)}
  #dlgStat .ms-fortune,#dlgStat .ms-months {display:grid;gap:8px;aspect-ratio:auto;padding:10px 0 0;background:none}
  #dlgStat .ms-band,#dlgStat .ms-months .ms-band {position:static;height:auto;min-width:52%;justify-self:center;min-height:32px;
    padding:3px 18px;font-size:clamp(17px,4.7cqw,23px);border:1px solid #ffcf6a;border-radius:24px;
    background:linear-gradient(#602459,#120c24 32%,#0a081d 66%,#492039);box-shadow:inset 0 0 4px #c3892e}
  #dlgStat .ms-luck {position:static;display:grid;grid-template-columns:1fr 1fr;gap:5px}
  #dlgStat .ms-luck-card {box-sizing:border-box;aspect-ratio:315/231;padding:27% 4% 4%;gap:1px}
  #dlgStat .ms-verdict {grid-column:1/-1;grid-row:2;justify-self:center;width:58%;aspect-ratio:315/222}
  #dlgStat .ms-note {position:static;gap:7px;border:1px solid #b78a58;border-radius:13px;
    background:#0b0824d9;padding:8px 9px;font-size:12px;line-height:1.3;text-align:start}
  #dlgStat .ms-note>span:first-child {width:23px;height:23px;font-size:16px}
  #dlgStat .ms-months {margin:14px auto 0;padding:10px 6px 12px;border:1px solid #bb8b52;border-radius:18px;
    background:radial-gradient(ellipse at bottom left,#11215180,transparent 55%),#100922e8}
  #dlgStat .ms-months h4,#dlgStat .ms-caption {position:static}
  #dlgStat .ms-months h4 {font-size:clamp(19px,5.8cqw,27px)}
  #dlgStat .ms-caption {font-size:14px}
  #dlgStat .ms-plot {position:static;grid-template-columns:minmax(0,1fr);gap:10px}
  #dlgStat .ms-chart {max-height:190px}
  #dlgStat .ms-recap {width:84%;box-sizing:border-box;margin:auto;padding:14px 10%;gap:5px;color:#fffaee}
  #dlgStat .ms-recap strong {font-size:18px}
  #dlgStat .ms-recap div {font-size:14px;gap:7px}
  #dlgStat .ms-key {width:12px;height:12px}
  #dlgStat .ms-legend {position:static;justify-self:center;gap:12px;font-size:12px}
  #dlgStat .ms-empty {min-height:60px;display:grid;place-content:center;font-size:14px}
}

@container(max-width:510px) {
  #dlgStat .ms-total:nth-child(1) {background-image:url('royal-totals.webp');background-repeat:no-repeat;background-size:471.36929% 106.53266%;background-position:9.83240% 38.46154%}
  #dlgStat .ms-total:nth-child(2) {background-image:url('royal-totals.webp');background-repeat:no-repeat;background-size:463.67347% 106.53266%;background-position:37.37374% 38.46154%}
  #dlgStat .ms-total:nth-child(3) {background-image:url('royal-totals.webp');background-repeat:no-repeat;background-size:481.35593% 106.53266%;background-position:64.77778% 38.46154%}
  #dlgStat .ms-total:nth-child(4) {background-image:url('royal-totals.webp');background-repeat:no-repeat;background-size:473.33333% 106.53266%;background-position:92.07589% 38.46154%}
  #dlgStat .ms-luck-card:first-child {background-image:url('royal-luck.webp');background-repeat:no-repeat;background-size:366.45161% 155.89520%;background-position:10.89588% 37.50000%}
  #dlgStat .ms-luck-card:last-child {background-image:url('royal-luck.webp');background-repeat:no-repeat;background-size:361.78344% 155.89520%;background-position:89.90268% 37.50000%}
  #dlgStat .ms-verdict {background-image:url('royal-luck.webp');background-repeat:no-repeat;background-size:352.79503% 162.27273%;background-position:50.24570% 45.25547%}
  #dlgStat .ms-recap {background-image:url('royal-months.webp');background-repeat:no-repeat;background-size:347.40061% 304.26540%;background-position:88.13350% 42.69142%}
}
