dialog.pxn-game-result {
  --outcome-accent:#b9f078;--outcome-field:#222f25;
  position:fixed; inset:0; box-sizing:border-box; width:min(420px,calc(100vw - 28px)); height:fit-content;
  max-width:calc(100vw - 28px); max-height:calc(100vh - 24px); max-height:calc(100dvh - max(24px,env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  margin:auto; padding:0; border:1px solid #526277; border-top:3px solid var(--outcome-accent);
  border-radius:16px; color:#f4f5f6; background:#182028; box-shadow:0 22px 75px #0009;
  font:500 16px/1.4 Rubik,Arial,sans-serif; text-align:center; color-scheme:dark;
  overflow:auto; overscroll-behavior:contain; z-index:100;
}
dialog.pxn-game-result:not([open]) {display:none!important;}
dialog.pxn-game-result[open] {display:block;}
dialog.pxn-game-result::backdrop {background:#070c14cd;}
dialog.pxn-game-result[data-kind=loss],dialog.pxn-game-result[data-kind=respawn] {--outcome-accent:#ffbd9d;--outcome-field:#3a302d;}
dialog.pxn-game-result[data-kind=draw] {--outcome-accent:#9ddffd;--outcome-field:#223646;}
.pxn-game-result .pxn-result-panel {box-sizing:border-box;padding:clamp(18px,5vw,30px);display:flex;flex-direction:column;align-items:stretch;gap:12px;}
.pxn-game-result .pxn-result-emblem {margin:0 auto;width:50px;height:50px;display:grid;place-items:center;
  color:var(--outcome-accent);background:var(--outcome-field);border:1px solid #ffffff26;border-radius:14px;}
.pxn-game-result .pxn-result-emblem svg {width:27px;height:27px;}
.pxn-game-result h2.pxn-result-heading {margin:0;padding:0;color:#fff;font:750 clamp(24px,6vw,36px)/1.12 Rubik,Arial,sans-serif;overflow-wrap:anywhere;letter-spacing:0;}
.pxn-game-result h2.pxn-result-heading:focus {outline:0;}
.pxn-game-result p.pxn-result-summary,.pxn-game-result p.pxn-result-feedback {margin:0;padding:0;font:500 15px/1.5 Rubik,Arial,sans-serif;color:#dae4eb;overflow-wrap:anywhere;}
.pxn-game-result p.pxn-result-feedback {font-size:14px;color:var(--outcome-accent);}
.pxn-game-result dl.pxn-result-scores {display:flex;flex-wrap:wrap;gap:0;margin:2px 0;padding:8px 0;border-block:1px solid #ffffff24;}
.pxn-game-result .pxn-result-scores>div {display:flex;flex-direction:column;flex:1 1 30%;min-width:78px;align-items:center;padding:3px;gap:2px;}
.pxn-game-result .pxn-result-scores dt,.pxn-game-result .pxn-result-scores dd {margin:0;line-height:1.25;}
.pxn-game-result .pxn-result-scores dt {font-size:13px;color:#bbc8d1;}
.pxn-game-result .pxn-result-scores dd {font:700 20px/1.2 Rubik,Arial,sans-serif;color:#fff;overflow-wrap:anywhere;}
.pxn-game-result .pxn-result-actions {display:grid;gap:8px;margin:2px 0 0;}
.pxn-game-result .pxn-result-actions button {position:static;display:flex;justify-content:center;align-items:center;gap:9px;
  box-sizing:border-box;width:100%;height:auto;min-height:44px;margin:0;padding:8px 12px;
  color:#f4f6f7;background:#273540;border:1px solid #647481;border-radius:9px;box-shadow:none;transform:none;
  font:650 15px/1.35 Rubik,Arial,sans-serif;cursor:pointer;touch-action:manipulation;}
.pxn-game-result .pxn-result-actions [data-result-action=restart] {color:#152114;background:var(--outcome-accent);border-color:transparent;}
.pxn-game-result .pxn-result-actions button:disabled {opacity:.58;cursor:default;}
.pxn-game-result .pxn-result-actions button:focus-visible {outline:3px solid #fff;outline-offset:2px;}
.pxn-game-result .pxn-result-actions button svg {display:block;width:19px;height:19px;flex-shrink:0;}
.pxn-game-result [hidden] {display:none!important;}
@media(max-height:440px) and (orientation:landscape) {
 .pxn-game-result .pxn-result-panel {padding:12px 20px;gap:7px;}
 .pxn-game-result .pxn-result-emblem {display:none;}
 .pxn-game-result .pxn-result-actions {display:flex;flex-wrap:wrap;}
 .pxn-game-result .pxn-result-actions button {flex:1 1 98px;}
 .pxn-game-result h2.pxn-result-heading {font-size:24px;}
}

#game.room-ended {background:linear-gradient(140deg,#172632,#283e44);touch-action:auto}
#game.room-ended > :not(.pxn-game-result):not(.room-ended-art) {display:none!important}
#game.room-ended > .room-ended-art {display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;pointer-events:none}
#game.room-ended > .pxn-game-result::backdrop {background:linear-gradient(120deg,#08111bbd,#08111b80 54%,#08111bc7)}

.pxn-game-result .pxn-result-scores dt {max-width:100%;overflow-wrap:anywhere;unicode-bidi:plaintext}
@media (max-width:420px), (max-height:500px) {
  dialog.pxn-game-result {width:min(420px,calc(100% - 16px));max-width:calc(100% - 16px)}
  .pxn-game-result .pxn-result-panel {gap:8px;padding:14px}
  .pxn-game-result .pxn-result-emblem {width:34px;height:34px;border-radius:10px}
  .pxn-game-result .pxn-result-emblem svg {width:22px;height:22px}
  .pxn-game-result .pxn-result-actions {display:flex;flex-wrap:wrap;gap:6px}
  .pxn-game-result .pxn-result-actions button {flex:1 1 110px;min-width:0}
}
