/* result screen styles. Loaded after the shared stylesheets so rules here can override them. */
/* End-of-game result screen (public/result-view.js). Selectors use dialog.result-view.result-screen so they outrank the
   older .result-view rules in homepage.css and themes.css, several of which use !important. */
dialog.result-view.result-screen{--rs-paper:#f6efdf;--rs-card:#fbf7ec;--rs-line:#dccca6;--rs-ink:#20372f;--rs-muted:#5b6259;--rs-green:#0f503a;--rs-gold:#c9a24f;--rs-gold-soft:#ecd79e;position:relative;box-sizing:border-box;width:min(500px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 24px)!important;padding:0!important;margin:auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;background:var(--rs-paper)!important;color:var(--rs-ink)!important;border:1px solid #b69b62!important;outline:0!important;border-radius:16px!important;box-shadow:0 24px 80px rgba(0,0,0,.45);text-align:center;font-size:15px;line-height:1.35}
dialog.result-view.result-screen[open]{display:flex;flex-direction:column;gap:0}
dialog.result-view.result-screen>*{order:0;flex:none}
dialog.result-view.result-screen::backdrop{background:rgba(4,16,12,.62)}
dialog.result-screen .rs-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Header band: tone follows the viewer's outcome. */
dialog.result-screen .rs-header{display:block;position:relative;z-index:1;padding:20px 56px 18px;background:linear-gradient(180deg,#24414a,#1a3038);color:#f4edda;border-bottom:1px solid #b69b62}
dialog.result-screen[data-result-tone=win] .rs-header{background:radial-gradient(120% 150% at 50% 0%,#23825b 0%,#0f503a 55%,#0b3b2b 100%)}
dialog.result-screen[data-result-tone=loss] .rs-header{background:linear-gradient(180deg,#4a585e,#323e43)}
dialog.result-screen[data-result-tone=draw] .rs-header{background:linear-gradient(180deg,#7a6639,#54462a)}
dialog.result-screen .rs-header .result-crest{display:block;width:72px!important;height:72px!important;max-width:none;margin:0 auto 4px!important;object-fit:contain;filter:drop-shadow(0 3px 6px rgba(0,0,0,.35))}
dialog.result-screen[data-result-tone=win] .rs-header .result-crest{filter:drop-shadow(0 0 12px rgba(255,222,140,.75))}
dialog.result-screen[data-result-tone=loss] .rs-header .result-crest{filter:grayscale(.35) drop-shadow(0 3px 6px rgba(0,0,0,.35));opacity:.9}
dialog.result-screen .rs-header .rs-title{margin:0;font:700 30px/1.15 Georgia,'Times New Roman',serif;color:#f4edda;letter-spacing:.01em;overflow-wrap:anywhere}
dialog.result-screen[data-result-tone=win] .rs-header .rs-title{color:#fff3d7;text-shadow:0 1px 0 rgba(0,0,0,.35),0 0 18px rgba(255,214,120,.45)}
dialog.result-screen .rs-header .rs-reason{margin:6px 0 0!important;font-size:15px;font-weight:600;line-height:1.35;color:#dfe6e2!important;overflow-wrap:anywhere}
dialog.result-screen[data-result-tone=win] .rs-header .rs-reason,dialog.result-screen[data-result-tone=draw] .rs-header .rs-reason{color:#f1e5c4!important}

/* Players: white | score | black. */
dialog.result-screen .rs-players{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:stretch;padding:16px 20px 0}
dialog.result-screen .rs-player{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;padding:12px 8px 10px;background:var(--rs-card);border:1px solid var(--rs-line);border-radius:12px;box-sizing:border-box}
dialog.result-screen .rs-player[data-player-result=win]{border-color:var(--rs-gold);box-shadow:0 0 0 1px var(--rs-gold),0 6px 18px rgba(201,162,79,.3)}
dialog.result-screen .rs-player[data-player-result=loss] .rs-portrait{filter:grayscale(.4) brightness(.96)}
dialog.result-screen .rs-portrait{width:56px;height:56px;min-width:56px;flex:none;margin-bottom:2px}
dialog.result-screen .rs-portrait .portrait-initials{font-size:22px}
dialog.result-screen .rs-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;max-width:100%;overflow:hidden;white-space:normal;overflow-wrap:anywhere;font-weight:700;font-size:15px;line-height:1.2;color:var(--rs-ink)}
dialog.result-screen .rs-meta{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px;font-size:12px;color:var(--rs-muted)}
dialog.result-screen .rs-badges{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;max-width:100%}
dialog.result-screen .rs-badges .member-badge{margin-top:2px}
@media (max-width:520px){dialog.result-screen .rs-badges .member-badge{width:20px;padding:0;justify-content:center}dialog.result-screen .rs-badges .member-label{display:none}}
/* Phones: a long name (an AI partner's full name) wraps onto a second line instead of being cut. */
@media (max-width:520px){html body dialog#resultDialog.result-screen .rs-name{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;white-space:normal!important;text-overflow:clip!important;text-align:center;font-size:16px!important;line-height:1.15!important}}
dialog.result-screen .rs-swatch{display:inline-block;width:10px;height:10px;border:1px solid #6f6a5c;border-radius:2px;background:#fff}
dialog.result-screen .rs-player[data-color=black] .rs-swatch{background:#232a2b;border-color:#232a2b}
dialog.result-screen .rs-tag{padding:0 6px;border-radius:999px;background:var(--rs-green);color:#fff3d7;font-size:11px;font-weight:700;line-height:18px}
dialog.result-screen .rs-player:not([data-viewer=true]) .rs-tag{background:#5b6259;color:#fff}
dialog.result-screen .rs-badge{display:inline-block;margin-top:2px;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;line-height:16px;background:#ece6d6;color:#5b5546;border:1px solid #d6cdb6}
dialog.result-screen .rs-player[data-player-result=win] .rs-badge{background:var(--rs-gold-soft);color:#4a3a10;border-color:var(--rs-gold)}
dialog.result-screen .rs-player[data-player-result=draw] .rs-badge{background:#efe3c2;color:#5a4a28;border-color:#d8c58f}
dialog.result-screen .rs-player .rs-elo{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:2px 5px;margin:4px 0 0!important;font-size:14px!important;font-weight:600!important;line-height:1.3;color:var(--rs-ink)!important;font-variant-numeric:tabular-nums}
dialog.result-screen .rs-elo-label{font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--rs-muted)}
dialog.result-screen .rs-before{color:var(--rs-muted)}
dialog.result-screen .rs-arrow{color:#9a8a65}
dialog.result-screen .rs-after{font-weight:800}
dialog.result-screen .rs-delta{padding:0 6px;border-radius:6px;font-size:13px;font-weight:800;background:#ece6d6;color:#5b5546}
dialog.result-screen .rs-delta[data-trend=up]{background:#dff0e4;color:#0d5a37}
dialog.result-screen .rs-delta[data-trend=down]{background:#f6e0dc;color:#9a3328}
dialog.result-screen .rs-score{align-self:center;padding:0 2px;font:800 26px/1 system-ui,'Segoe UI',sans-serif;font-variant-numeric:lining-nums tabular-nums;color:var(--rs-ink);white-space:nowrap}

/* Summary chips and recent moves. */
dialog.result-screen .rs-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:0!important;padding:12px 20px 0;font-size:13px!important}
dialog.result-screen .rs-chip{padding:3px 10px;border-radius:999px;border:1px solid var(--rs-line);background:var(--rs-card);color:#3d4a42;font-size:12.5px;font-weight:600;line-height:18px}
dialog.result-screen .rs-chip-mode[data-mode=rated]{background:#e3efe6;border-color:#9cc3a8;color:#0d4a31}
dialog.result-screen .rs-chip-mode[data-mode=casual],dialog.result-screen .rs-chip-mode[data-mode=practice],dialog.result-screen .rs-chip-mode[data-mode=ratedUnavailable]{background:#efe9db;color:#4f4a3d}
dialog.result-screen .rs-moves{margin:12px 20px 0;padding:8px 12px 10px;background:var(--rs-card);border:1px solid var(--rs-line);border-radius:10px;text-align:left}
dialog.result-screen .rs-moves-title{margin:0 0 4px;font:700 11px/1.3 system-ui,'Segoe UI',sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--rs-muted)}
dialog.result-screen .rs-move-list{display:flex;flex-wrap:wrap;gap:2px 12px;margin:0;padding:0;list-style:none;font-size:14px;line-height:1.6;font-variant-numeric:tabular-nums;color:var(--rs-ink)}
dialog.result-screen .rs-move-list li{display:inline-flex;gap:4px;margin:0;padding:0}
dialog.result-screen .rs-move-no,dialog.result-screen .rs-move-more{color:#8a7d63}
dialog.result-screen .rs-san{font-weight:600}
dialog.result-screen .rs-san[data-last=true]{padding:0 5px;border-radius:4px;background:var(--rs-green);color:#fff3d7}

dialog.result-screen .rs-offer{margin:12px 20px 0!important;padding:8px 12px;border:1px solid #e2c77c;border-radius:10px;background:#fff6dc;color:#4a3a10!important;font-size:14px;font-weight:700}
dialog.result-screen .rs-offer-waiting{border-color:var(--rs-line);background:var(--rs-card);color:var(--rs-muted)!important;font-weight:600}
dialog.result-screen .result-awards{margin:12px 20px 0;padding:10px 0 0;border-top:1px solid var(--rs-line)}
dialog.result-screen .result-awards .result-trophy{width:48px;height:48px}
dialog.result-screen .result-awards h3{margin:4px 0;font-size:13px;color:var(--rs-muted)}
dialog.result-screen .result-awards p{margin:2px 0!important;color:var(--rs-ink)!important;font-weight:700}

/* Actions. */
dialog.result-screen .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:auto;margin:0;padding:16px 20px 20px}
dialog.result-screen .result-actions button{min-height:46px;padding:10px 12px;border-radius:10px;border:1px solid #b9aa8c;background:#fbf7ec;color:#20372f;font-size:15px;font-weight:650;line-height:1.2;white-space:normal;cursor:pointer}
dialog.result-screen .result-actions button:not(.primary):not(.rs-close):hover:not(:disabled){background:#f1e7cf;border-color:#a48f62}
dialog.result-screen .result-actions .primary{grid-column:1/-1;grid-row:auto;background:var(--rs-green)!important;color:#fff3d7!important;border-color:#0b3b2b;font-size:16px;font-weight:750}
dialog.result-screen .result-actions .primary:hover:not(:disabled){background:#146446!important}
dialog.result-screen .result-actions .rs-accept{background:#d8b76c;color:#201c12;border-color:#a8853c;font-weight:750}
dialog.result-screen .result-actions .rs-accept:hover:not(:disabled){background:#e6c77c}
dialog.result-screen .result-actions button:disabled{background:#ece6d6;color:#6c6657;border-color:#d4c8ad;cursor:not-allowed}
dialog.result-screen .result-actions [data-result-action=close]{position:absolute;top:10px;right:10px;z-index:3;width:40px;height:40px;min-height:40px!important;padding:0!important;border:0!important;border-radius:50%;background:transparent!important;color:#f4edda!important;font-size:26px;line-height:1;font-weight:400}
dialog.result-screen .result-actions [data-result-action=close]:hover{background:rgba(255,255,255,.14)!important}
dialog.result-screen .result-actions button:focus-visible{outline:3px solid #176c4e!important;outline-offset:2px}
dialog.result-screen .result-actions [data-result-action=close]:focus-visible{outline:3px solid #ffe6ad!important;outline-offset:0}

/* Winner celebration: a short confetti fall over the header plus a glow on the viewer's card; never shown to the loser.
   homepage.css currently disables every animation site-wide with `body *{animation:none!important}`, so the motion rules
   below are !important with higher specificity. They only apply when the viewer allows motion and the page is not in
   basic render mode, so reduced-motion users get the static glow only. */
dialog.result-screen .rs-confetti{display:none;position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:2}
dialog.result-screen .rs-confetti span{position:absolute;top:-16px;left:50%;width:8px;height:12px;border-radius:2px;background:#e9c86b;opacity:0}
dialog.result-screen .rs-confetti span:nth-child(4n+2){background:#fff3d7;width:6px;height:10px}
dialog.result-screen .rs-confetti span:nth-child(4n+3){background:#6fd3a1;border-radius:50%;width:8px;height:8px}
dialog.result-screen .rs-confetti span:nth-child(4n+4){background:#e8806b;width:7px;height:11px}
dialog.result-screen .rs-confetti span:nth-child(1){left:6%;--rs-drift:18px;--rs-delay:.05s}
dialog.result-screen .rs-confetti span:nth-child(2){left:13%;--rs-drift:-12px;--rs-delay:.3s}
dialog.result-screen .rs-confetti span:nth-child(3){left:20%;--rs-drift:22px;--rs-delay:.15s;--rs-duration:2.1s}
dialog.result-screen .rs-confetti span:nth-child(4){left:27%;--rs-drift:-20px;--rs-delay:.45s}
dialog.result-screen .rs-confetti span:nth-child(5){left:34%;--rs-drift:10px;--rs-delay:0s;--rs-duration:1.7s}
dialog.result-screen .rs-confetti span:nth-child(6){left:41%;--rs-drift:-16px;--rs-delay:.25s}
dialog.result-screen .rs-confetti span:nth-child(7){left:47%;--rs-drift:14px;--rs-delay:.5s;--rs-duration:2.2s}
dialog.result-screen .rs-confetti span:nth-child(8){left:53%;--rs-drift:-8px;--rs-delay:.1s}
dialog.result-screen .rs-confetti span:nth-child(9){left:59%;--rs-drift:20px;--rs-delay:.35s}
dialog.result-screen .rs-confetti span:nth-child(10){left:65%;--rs-drift:-24px;--rs-delay:.2s;--rs-duration:2s}
dialog.result-screen .rs-confetti span:nth-child(11){left:71%;--rs-drift:12px;--rs-delay:.55s}
dialog.result-screen .rs-confetti span:nth-child(12){left:77%;--rs-drift:-14px;--rs-delay:.05s;--rs-duration:1.8s}
dialog.result-screen .rs-confetti span:nth-child(13){left:83%;--rs-drift:16px;--rs-delay:.4s}
dialog.result-screen .rs-confetti span:nth-child(14){left:89%;--rs-drift:-18px;--rs-delay:.15s;--rs-duration:2.1s}
dialog.result-screen .rs-confetti span:nth-child(15){left:94%;--rs-drift:-26px;--rs-delay:.3s}
dialog.result-screen .rs-confetti span:nth-child(16){left:3%;--rs-drift:26px;--rs-delay:.6s}
@keyframes rs-confetti-fall{0%{opacity:1;transform:translate3d(0,0,0) rotate(0deg)}80%{opacity:1}100%{opacity:0;transform:translate3d(var(--rs-drift,0px),290px,0) rotate(600deg)}}
@keyframes rs-enter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes rs-crest-pop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}100%{transform:scale(1)}}
@keyframes rs-glow{0%,100%{box-shadow:0 0 0 1px #c9a24f,0 6px 18px rgba(201,162,79,.3)}50%{box-shadow:0 0 0 2px #e2bf6a,0 0 26px rgba(226,191,106,.75)}}
@keyframes rs-attention{0%,100%{box-shadow:0 0 0 0 rgba(216,183,108,0)}50%{box-shadow:0 0 0 5px rgba(216,183,108,.45)}}
@media (prefers-reduced-motion:no-preference),(scripting:enabled){
 html:not([data-render-mode=basic]) dialog.result-view.result-screen[open]{animation:rs-enter .22s ease-out!important}
 html:not([data-render-mode=basic]) dialog.result-screen .rs-confetti{display:block}
 html:not([data-render-mode=basic]) dialog.result-screen .rs-confetti span{animation:rs-confetti-fall var(--rs-duration,1.9s) cubic-bezier(.25,.6,.45,1) var(--rs-delay,0s) both!important}
 html:not([data-render-mode=basic]) dialog.result-screen[data-result-tone=win] .rs-header .result-crest{animation:rs-crest-pop .6s cubic-bezier(.2,1.4,.4,1) both!important}
 html:not([data-render-mode=basic]) dialog.result-screen[data-result-tone=win] .rs-player[data-viewer=true]{animation:rs-glow 1.6s ease-in-out .35s 2!important}
 html:not([data-render-mode=basic]) dialog.result-screen .result-actions .rs-accept{animation:rs-attention 1.4s ease-in-out .4s 3!important}
}

/* Phones. */
@media (max-width:480px){
 dialog.result-view.result-screen{width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px)!important;font-size:14px}
 dialog.result-screen .rs-header{padding:16px 48px 14px}
 dialog.result-screen .rs-header .result-crest{width:56px!important;height:56px!important}
 dialog.result-screen .rs-header .rs-title{font-size:26px}
 dialog.result-screen .rs-header .rs-reason{font-size:14px}
 dialog.result-screen .rs-players{gap:6px;padding:12px 12px 0}
 dialog.result-screen .rs-player{padding:10px 4px 8px}
 dialog.result-screen .rs-portrait{width:46px;height:46px;min-width:46px}
 dialog.result-screen .rs-portrait .portrait-initials{font-size:18px}
 dialog.result-screen .rs-name{font-size:14px}
 dialog.result-screen .rs-player .rs-elo{font-size:13px!important}
 dialog.result-screen .rs-score{font-size:20px}
 dialog.result-screen .rs-chips{padding:10px 12px 0}
 dialog.result-screen .rs-moves,dialog.result-screen .rs-offer,dialog.result-screen .result-awards{margin-left:12px!important;margin-right:12px!important}
 dialog.result-screen .result-actions{padding:14px 12px 14px}
 dialog.result-screen .result-actions button{font-size:14px}
 dialog.result-screen .result-actions .primary{font-size:15px}
 dialog.result-screen .result-actions [data-result-action=close]{top:6px;right:6px}
}
@media (max-width:340px){dialog.result-screen .result-actions{grid-template-columns:1fr}}
/* Short screens (landscape phones): drop the crest and the move strip (the chips keep the move count), shrink the cards
   and put the buttons on one row so everything fits without scrolling. */
@media (max-height:560px){
 dialog.result-view.result-screen{width:min(620px,calc(100vw - 20px))!important;max-height:calc(100dvh - 16px)!important}
 dialog.result-screen .rs-header .result-crest,dialog.result-screen .rs-moves{display:none}
 dialog.result-screen .rs-header{padding-top:10px;padding-bottom:8px}
 dialog.result-screen .rs-header .rs-title{font-size:24px}
 dialog.result-screen .rs-header .rs-reason{margin-top:2px!important;font-size:13px}
 dialog.result-screen .rs-players{padding-top:8px}
 dialog.result-screen .rs-player{gap:2px;padding:6px 6px 6px}
 dialog.result-screen .rs-portrait{width:36px;height:36px;min-width:36px}
 dialog.result-screen .rs-portrait .portrait-initials{font-size:15px}
 dialog.result-screen .rs-chips{padding-top:8px}
 dialog.result-screen .rs-offer{margin-top:8px!important;padding:4px 10px}
 dialog.result-screen .result-actions{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));padding-top:10px;padding-bottom:10px}
 dialog.result-screen .result-actions .primary{grid-column:auto}
 dialog.result-screen .result-actions button{min-height:44px}
}

/* Result screen, dark emerald and gold (Jay's design): large emblem, serif title, players either side of the score,
   one-line game facts, the moves folded under "View moves", and gold primary action. Overrides the parchment look. */
dialog#resultDialog.result-screen{--rs-paper:#0d2a2d;--rs-card:rgba(255,255,255,.04);--rs-line:rgba(215,180,90,.4);--rs-ink:#f4ead2;--rs-muted:#b9c8c1;--rs-green:#0f503a;--rs-gold:#d7b45a;--rs-gold-soft:#f3d68b;
 width:min(560px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 24px);padding:0!important;overflow:auto;border:1px solid #c9a54e!important;border-radius:16px!important;
 background:radial-gradient(130% 80% at 50% 0%,#174a44 0%,#0d2a2d 55%,#0a2023 100%)!important;color:var(--rs-ink)!important;
 box-shadow:inset 0 0 0 6px #0b2326,inset 0 0 0 7px rgba(215,180,90,.45),0 26px 70px rgba(0,0,0,.6)!important}
dialog#resultDialog.result-screen::before,dialog#resultDialog.result-screen::after{content:"";position:absolute;width:34px;height:34px;pointer-events:none;z-index:2;border:2px solid #d7b45a}
dialog#resultDialog.result-screen::before{top:12px;left:12px;border-right:0;border-bottom:0;border-top-left-radius:8px}
dialog#resultDialog.result-screen::after{bottom:12px;right:12px;border-left:0;border-top:0;border-bottom-right-radius:8px}
dialog#resultDialog.result-screen::backdrop{background:rgba(3,12,15,.72)}
dialog#resultDialog.result-screen .rs-header,dialog#resultDialog.result-screen[data-result-tone] .rs-header{padding:26px 56px 6px!important;background:none!important;border:0!important;text-align:center}
dialog#resultDialog.result-screen .rs-header .result-crest{width:112px!important;height:112px!important;margin:0 auto 4px!important;filter:drop-shadow(0 6px 16px rgba(0,0,0,.55)) drop-shadow(0 0 14px rgba(215,180,90,.35))!important}
dialog#resultDialog.result-screen[data-result-tone=loss] .rs-header .result-crest{filter:grayscale(.2) drop-shadow(0 6px 16px rgba(0,0,0,.55))!important;opacity:.95}
dialog#resultDialog.result-screen .rs-header .rs-title{font:700 46px/1.05 Georgia,'Noto Serif KR','Times New Roman',serif!important;letter-spacing:.01em;color:#fff1cc!important;background:linear-gradient(180deg,#fff6dc 10%,#e7c672 90%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;text-shadow:none!important}
dialog#resultDialog.result-screen[data-result-tone=loss] .rs-header .rs-title{background:linear-gradient(180deg,#f1f3f1 10%,#aab7b2 90%);-webkit-background-clip:text;background-clip:text}
dialog#resultDialog.result-screen .rs-header .rs-reason{margin:6px 0 0!important;font:500 18px/1.35 system-ui,sans-serif!important;color:#e3dccb!important}
dialog#resultDialog.result-screen .rs-header::after{content:"◆";display:flex;align-items:center;justify-content:center;gap:10px;margin:14px auto 0;width:min(320px,80%);font-size:9px;color:#d7b45a;background:linear-gradient(90deg,transparent,#d7b45a 30%,transparent 46%,transparent 54%,#d7b45a 70%,transparent) center/100% 1px no-repeat}
dialog#resultDialog.result-screen .rs-players{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:center!important;gap:8px!important;margin:0!important;padding:14px 26px 8px!important;background:none!important;border:0!important}
dialog#resultDialog.result-screen .rs-player,dialog#resultDialog.result-screen .rs-player[data-player-result]{display:flex!important;flex-direction:column;align-items:center;gap:5px;min-width:0;padding:0!important;background:none!important;border:0!important;box-shadow:none!important;text-align:center}
dialog#resultDialog.result-screen .rs-portrait{width:84px!important;height:84px!important;min-width:84px!important;border:3px solid #d7b45a!important;box-shadow:0 0 0 4px rgba(215,180,90,.16),0 8px 18px rgba(0,0,0,.45)!important}
dialog#resultDialog.result-screen .rs-player[data-player-result=loss] .rs-portrait{filter:saturate(.75);border-color:#9fb0aa!important}
dialog#resultDialog.result-screen .rs-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 18px/1.2 system-ui,sans-serif!important;color:#fff3d7!important}
dialog#resultDialog.result-screen .rs-meta{display:flex!important;align-items:center;justify-content:center;gap:7px;font:500 15px/1 system-ui,sans-serif!important;color:#e3dccb!important}
dialog#resultDialog.result-screen .rs-swatch{width:15px!important;height:15px!important;border-radius:50%!important;background:#f6f1e3!important;border:1px solid #f6f1e3!important;box-shadow:none!important}
dialog#resultDialog.result-screen .rs-player[data-color=black] .rs-swatch{background:transparent!important;border:2px solid #e3dccb!important}
dialog#resultDialog.result-screen .rs-tag{padding:3px 9px!important;border-radius:999px!important;background:#1d6b4c!important;color:#e9fff3!important;font:700 12px/1.2 system-ui,sans-serif!important;border:0!important}
dialog#resultDialog.result-screen .rs-player:not([data-viewer=true]) .rs-tag{background:rgba(255,255,255,.12)!important}
dialog#resultDialog.result-screen .rs-badge{margin-top:2px;padding:3px 12px!important;border-radius:999px!important;font:800 11px/1.3 system-ui,sans-serif!important;letter-spacing:.08em;text-transform:uppercase;background:rgba(215,180,90,.14)!important;color:#f3d68b!important;border:1px solid rgba(215,180,90,.55)!important}
dialog#resultDialog.result-screen .rs-player[data-player-result=win] .rs-badge{background:rgba(87,192,137,.16)!important;color:#9ff0c4!important;border-color:rgba(87,192,137,.6)!important}
dialog#resultDialog.result-screen .rs-player[data-player-result=loss] .rs-badge{background:rgba(255,255,255,.06)!important;color:#c6d0cc!important;border-color:rgba(255,255,255,.2)!important}
dialog#resultDialog.result-screen .rs-player .rs-elo{margin-top:3px!important;color:#e3dccb!important;font:600 14px/1.3 system-ui,sans-serif!important}
dialog#resultDialog.result-screen .rs-elo-label{color:#b9c8c1!important}
dialog#resultDialog.result-screen .rs-after{color:#fff3d7!important;font-weight:800}
dialog#resultDialog.result-screen .rs-delta[data-trend=up]{color:#7fe0aa!important}
dialog#resultDialog.result-screen .rs-delta[data-trend=down]{color:#f0a294!important}
dialog#resultDialog.result-screen .rs-score{display:flex;align-items:center;justify-content:center;min-width:110px;padding:0 6px!important;background:none!important;border:0!important}
dialog#resultDialog.result-screen .rs-score-value{display:inline-flex;align-items:center;gap:12px;font:700 46px/1 Georgia,'Times New Roman',serif!important;color:#f3d68b!important;text-shadow:0 2px 10px rgba(0,0,0,.4);letter-spacing:.02em}
dialog#resultDialog.result-screen .rs-half{display:inline-grid;grid-template-rows:auto auto;justify-items:center;line-height:1}
dialog#resultDialog.result-screen .rs-num,dialog#resultDialog.result-screen .rs-den{font:700 26px/1 Georgia,'Times New Roman',serif;color:#f3d68b;padding:0 4px}
dialog#resultDialog.result-screen .rs-num{padding-bottom:4px;border-bottom:3px solid #d7b45a}
dialog#resultDialog.result-screen .rs-den{padding-top:4px}
dialog#resultDialog.result-screen .rs-dash{font-size:34px;color:#d7b45a}
dialog#resultDialog.result-screen .rs-chips{display:flex!important;flex-wrap:wrap;justify-content:center;align-items:center;gap:0!important;margin:6px 26px 0!important;padding:12px 0 0!important;border-top:1px solid rgba(215,180,90,.3)}
dialog#resultDialog.result-screen .rs-chip,dialog#resultDialog.result-screen .rs-chip-mode[data-mode]{padding:2px 14px!important;border:0!important;border-radius:0!important;background:none!important;color:#e9e2cf!important;font:600 15px/1.3 system-ui,sans-serif!important}
dialog#resultDialog.result-screen .rs-chip+.rs-chip{border-left:1px solid rgba(215,180,90,.55)!important}
dialog#resultDialog.result-screen .rs-chip-mode[data-mode=rated]{color:#9ff0c4!important}
dialog#resultDialog.result-screen .rs-elo-note{margin:10px 26px 0!important;text-align:center;color:#b9c8c1!important;font:500 14px/1.45 system-ui,sans-serif}
dialog#resultDialog.result-screen .rs-elo-note .rs-elo-value{color:#f3d68b;font-weight:800}
dialog#resultDialog.result-screen .rs-moves{margin:14px 26px 0!important;padding:0!important;border:1px solid rgba(215,180,90,.4)!important;border-radius:12px!important;background:rgba(255,255,255,.04)!important}
dialog#resultDialog.result-screen .rs-moves-title{display:flex!important;align-items:center;gap:10px;margin:0!important;padding:13px 16px!important;list-style:none;cursor:pointer;font:600 16px/1.2 system-ui,sans-serif!important;color:#f4ead2!important;text-transform:none!important;letter-spacing:0!important}
dialog#resultDialog.result-screen .rs-moves-title::-webkit-details-marker{display:none}
dialog#resultDialog.result-screen .rs-moves-title::before{content:"";width:18px;height:14px;flex:none;background:linear-gradient(#d7b45a,#d7b45a) 0 0/18px 2px no-repeat,linear-gradient(#d7b45a,#d7b45a) 0 6px/18px 2px no-repeat,linear-gradient(#d7b45a,#d7b45a) 0 12px/18px 2px no-repeat}
dialog#resultDialog.result-screen .rs-moves-count{margin-left:auto;color:#b9c8c1;font-size:14px;font-weight:500}
dialog#resultDialog.result-screen .rs-moves-title::after{content:"";width:9px;height:9px;border-right:2px solid #d7b45a;border-bottom:2px solid #d7b45a;transform:rotate(45deg) translateY(-3px);transition:transform .15s}
dialog#resultDialog.result-screen .rs-moves[open] .rs-moves-title::after{transform:rotate(-135deg) translateY(-3px)}
dialog#resultDialog.result-screen .rs-move-list{margin:0!important;padding:0 16px 14px!important;color:#e9e2cf!important}
dialog#resultDialog.result-screen .rs-move-list li,dialog#resultDialog.result-screen .rs-move-no{color:#b9c8c1!important}
dialog#resultDialog.result-screen .rs-san{color:#f4ead2!important}
dialog#resultDialog.result-screen .rs-san[data-last=true]{background:#d7b45a!important;color:#1b1a10!important}
dialog#resultDialog.result-screen .rs-offer{margin:14px 26px 0!important;padding:11px 14px!important;border:1px solid #d7b45a!important;border-radius:12px!important;background:rgba(215,180,90,.14)!important;color:#fff3d7!important;font:700 15px/1.35 system-ui,sans-serif!important;text-align:center}
dialog#resultDialog.result-screen .rs-offer-waiting{border-color:rgba(255,255,255,.2)!important;background:rgba(255,255,255,.05)!important;color:#d6dfdb!important;font-weight:600!important}
dialog#resultDialog.result-screen .result-awards{margin:14px 26px 0!important;background:rgba(215,180,90,.1)!important;border:1px solid rgba(215,180,90,.45)!important;color:#f4ead2!important}
dialog#resultDialog.result-screen .result-awards h3,dialog#resultDialog.result-screen .result-awards p{color:#f4ead2!important}
dialog#resultDialog.result-screen .result-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;margin:0!important;padding:16px 26px 26px!important;background:none!important;border:0!important}
dialog#resultDialog.result-screen .result-actions button{min-height:52px!important;padding:10px 14px!important;border-radius:11px!important;border:1px solid rgba(215,180,90,.65)!important;background:rgba(255,255,255,.03)!important;color:#f4ead2!important;font:700 16px/1.2 system-ui,sans-serif!important;box-shadow:none!important}
dialog#resultDialog.result-screen .result-actions button:not(.primary):not([data-result-action=close]):hover:not(:disabled){background:rgba(215,180,90,.14)!important}
dialog#resultDialog.result-screen .result-actions .primary{grid-column:1/-1;min-height:56px!important;border:0!important;background:linear-gradient(180deg,#ecd07c,#c99d3e)!important;color:#1d1a0e!important;font:800 19px/1.2 system-ui,sans-serif!important;box-shadow:0 4px 0 #8a6a25,0 10px 22px rgba(0,0,0,.35)!important}
dialog#resultDialog.result-screen .result-actions .primary:hover:not(:disabled){filter:brightness(1.06)}
dialog#resultDialog.result-screen .result-actions .rs-accept{border:0!important;background:linear-gradient(180deg,#2c8a63,#1b6648)!important;color:#fff!important;animation:rs-attention 1.6s ease-in-out 2}
dialog#resultDialog.result-screen .result-actions button:disabled{opacity:.6}
dialog#resultDialog.result-screen .result-actions [data-result-action=close]{position:absolute!important;top:16px!important;right:16px!important;width:38px!important;height:38px!important;min-height:38px!important;padding:0!important;border-radius:50%!important;border:1px solid rgba(255,255,255,.22)!important;background:rgba(0,0,0,.25)!important;color:#f4ead2!important;font:400 24px/1 system-ui,sans-serif!important}
dialog#resultDialog.result-screen .rs-wager{margin:12px 26px 0!important}
@media (max-width:520px){
 dialog#resultDialog.result-screen .rs-header{padding:22px 48px 4px!important}
 dialog#resultDialog.result-screen .rs-header .result-crest{width:88px!important;height:88px!important}
 dialog#resultDialog.result-screen .rs-header .rs-title{font-size:38px!important}
 dialog#resultDialog.result-screen .rs-header .rs-reason{font-size:16px!important}
 dialog#resultDialog.result-screen .rs-players{padding:12px 14px 6px!important}
 dialog#resultDialog.result-screen .rs-portrait{width:64px!important;height:64px!important;min-width:64px!important}
 dialog#resultDialog.result-screen .rs-name{font-size:16px!important}
 dialog#resultDialog.result-screen .rs-score{min-width:76px}
 dialog#resultDialog.result-screen .rs-score-value{font-size:34px!important;gap:6px}
 dialog#resultDialog.result-screen .rs-num,dialog#resultDialog.result-screen .rs-den{font-size:20px}
 dialog#resultDialog.result-screen .rs-chips,dialog#resultDialog.result-screen .rs-moves,dialog#resultDialog.result-screen .rs-offer,dialog#resultDialog.result-screen .rs-elo-note{margin-left:14px!important;margin-right:14px!important}
 dialog#resultDialog.result-screen .rs-chip{padding:2px 9px!important;font-size:14px!important}
 dialog#resultDialog.result-screen .result-actions{padding:14px 14px 20px!important;grid-template-columns:1fr!important}
}
/* Short windows (a 768-pixel screen leaves the page about 650 pixels): the result pop-up compacts so it always fits
   without scrolling. Tall screens keep the full-size design above. */
@media (max-height:800px){
html body #resultDialog.result-screen .rs-header,html body dialog#resultDialog.result-screen[data-result-tone] .rs-header{padding:12px 52px 2px!important}
html body #resultDialog.result-screen .rs-header .result-crest{width:58px!important;height:58px!important;margin:0 auto 2px!important}
html body #resultDialog.result-screen .rs-title{font-size:34px!important;line-height:1.1!important}
html body #resultDialog.result-screen .result-reason{margin-top:2px!important;font-size:14px!important}
html body #resultDialog.result-screen .rs-players{padding:8px 22px 2px!important}
html body #resultDialog.result-screen .rs-player,html body dialog#resultDialog.result-screen .rs-player[data-player-result]{gap:3px!important}
html body #resultDialog.result-screen .rs-portrait{width:58px!important;height:58px!important;min-width:58px!important;border-width:2px!important}
html body #resultDialog.result-screen .rs-name{font-size:16px!important}
html body #resultDialog.result-screen .rs-chips{margin-top:4px!important;padding-top:7px!important}
html body #resultDialog.result-screen .rs-chip,html body dialog#resultDialog.result-screen .rs-chip-mode[data-mode]{font-size:14px!important}
html body #resultDialog.result-screen .rs-elo-note{margin-top:5px!important;font-size:13px!important;line-height:1.35!important}
html body #resultDialog.result-screen .rs-moves{margin-top:8px!important}
html body #resultDialog.result-screen .rs-moves-title{padding:8px 14px!important;font-size:15px!important}
html body #resultDialog.result-screen .result-actions{padding:10px 22px 14px!important;gap:8px!important}
html body #resultDialog.result-screen .result-actions button{min-height:42px!important;padding:7px 12px!important;font-size:15px!important}
html body #resultDialog.result-screen .result-actions .primary{min-height:46px!important;font-size:17px!important}
html body #resultDialog.result-screen .result-actions [data-result-action=close]{top:10px!important;right:10px!important;width:34px!important;height:34px!important;min-height:34px!important}
/* The gold corner frame sits in the margin, clear of the buttons. */
html body dialog#resultDialog.result-screen::before,html body dialog#resultDialog.result-screen::after{width:24px;height:24px}
html body dialog#resultDialog.result-screen::before{top:6px;left:6px}
html body dialog#resultDialog.result-screen::after{bottom:6px;right:6px}
html body #resultDialog.result-screen .result-actions{padding-bottom:20px!important}
}
/* Very short windows: smaller still, and the crest steps aside. */
@media (max-height:620px){
html body #resultDialog.result-screen .rs-header .result-crest{display:none!important}
html body #resultDialog.result-screen .rs-header,html body dialog#resultDialog.result-screen[data-result-tone] .rs-header{padding-top:14px!important}
html body #resultDialog.result-screen .rs-title{font-size:30px!important}
html body #resultDialog.result-screen .rs-portrait{width:48px!important;height:48px!important;min-width:48px!important}
html body #resultDialog.result-screen .rs-badge{padding:2px 9px!important}
html body #resultDialog.result-screen .result-actions button{min-height:38px!important}
html body #resultDialog.result-screen .result-actions .primary{min-height:42px!important}
}
/* Phones: the two secondary buttons share a row. */
@media (max-width:500px) and (max-height:800px){
html body #resultDialog.result-screen .result-actions{grid-template-columns:1fr 1fr!important;padding:10px 14px 20px!important}
html body #resultDialog.result-screen .result-actions .primary{grid-column:1/-1}
html body #resultDialog.result-screen .result-actions button{font-size:14px!important;padding:6px 8px!important}
html body #resultDialog.result-screen .rs-players{padding-left:10px!important;padding-right:10px!important}
}
/* Phones: room for an AI partner's full name and country line, so the pop-up never scrolls inside. */
@media (max-width:520px) and (max-height:900px){
html body #resultDialog.result-screen .rs-header .result-crest{width:64px!important;height:64px!important;margin:0 auto 2px!important}
html body #resultDialog.result-screen .rs-header,html body dialog#resultDialog.result-screen[data-result-tone] .rs-header{padding-top:16px!important}
html body #resultDialog.result-screen .rs-title{font-size:34px!important;line-height:1.1!important}
}
@media (max-width:520px) and (max-height:700px){
html body #resultDialog.result-screen .rs-header .result-crest{display:none!important}
html body #resultDialog.result-screen .rs-title{font-size:30px!important}
html body #resultDialog.result-screen .rs-portrait{width:50px!important;height:50px!important;min-width:50px!important}
html body #resultDialog.result-screen .rs-players{padding-top:6px!important}
}
/* Narrow phones: the title ("You lost", "패배했습니다") stays on one line and never breaks inside a word. */
@media (max-width:400px){
html body #resultDialog.result-screen .rs-header,html body dialog#resultDialog.result-screen[data-result-tone] .rs-header{padding-left:44px!important;padding-right:44px!important}
html body #resultDialog.result-screen .rs-title{font-size:28px!important;word-break:keep-all}
}
/* An AI practice partner's country and AI level, under its AI tag. */
.rs-ai{display:block;margin-top:1px;color:#b9cbc2;font-size:11px;line-height:1.3;text-align:center}
