/* The header uses the same proportions and colors as the bot avatar. */
.brand .brand-ball,
body:is([data-screen=game],[data-screen=practice]) .brand .brand-ball,
.landscape-table .brand .brand-ball{display:block;width:34px;height:34px;flex:0 0 34px;border:0;border-radius:50%;background:none;box-shadow:none}

/* Center within Telegram's usable viewport, with one primary action. */
#result-panel{--result-accent:#e8c87e;--result-tint:#26382b;--result-bg:#142820;position:fixed;inset:var(--tg-content-top,env(safe-area-inset-top,0px)) max(16px,var(--tg-content-right,env(safe-area-inset-right,0px))) var(--content-bottom,0px) max(16px,var(--tg-content-left,env(safe-area-inset-left,0px)));transform:none;margin:auto;width:min(336px,calc(100% - 32px));height:fit-content;max-height:calc(var(--viewport-height,100dvh) - var(--tg-content-top,0px) - var(--content-bottom,0px) - 32px);overflow-y:auto;padding:22px 20px 20px;text-align:left;color:#f4efdf;background:linear-gradient(145deg,var(--result-tint),var(--result-bg) 60%);border:1px solid color-mix(in srgb,var(--result-accent) 25%,transparent);border-radius:20px;box-shadow:0 18px 50px #0007}
#result-panel::backdrop{background:#07110ebf;backdrop-filter:blur(2px)}
#result-panel.result-lost{--result-accent:#e4a49b;--result-tint:#342d28;--result-bg:#192924}
#result-panel .result-summary{display:flex;align-items:center;gap:12px}
#result-panel .result-emblem{width:44px;height:44px;flex:none;display:grid;place-items:center;margin:0;border-radius:50%;background:color-mix(in srgb,var(--result-accent) 10%,transparent);color:var(--result-accent);border:1px solid color-mix(in srgb,var(--result-accent) 25%,transparent)}
#result-panel .result-emblem svg{width:22px;height:22px;stroke-width:1.6}
#result-panel .result-loss-icon,#result-panel.result-lost .result-win-icon{display:none}
#result-panel.result-lost .result-loss-icon{display:block}
#result-panel h2{min-width:0;font:650 27px/1.2 'DM Sans',sans-serif;letter-spacing:-.8px;color:#f4efdf;margin:0;overflow-wrap:anywhere}
#result-panel h2:focus{outline:none}
#result-panel #result-reason{font-size:13px;line-height:1.55;color:#bdcdc3;margin:14px 0 0;min-height:0}
#result-panel .result-buttons{margin-top:20px;display:grid;gap:8px}
#result-panel .result-buttons:not(:has(button:not([hidden]))){display:none}
#result-panel .result-buttons:has(#rematch-button:not([hidden])):has(#quit-table-button:not([hidden])){grid-template-columns:1fr 1fr}
#result-panel button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:44px;width:100%;margin:0;padding:10px 8px;border-radius:10px;background:#ffffff04;color:#dce5de;border:1px solid #afc5b52b;font:500 13px/1.35 'DM Sans',sans-serif}
#result-panel #rematch-button,#result-panel.result-anonymous .result-quit{min-height:48px;background:#eee6ce;color:#17271f;border-color:transparent;font-size:14px;font-weight:650}
#result-panel button:not(:disabled):hover{background:#ffffff0a;border-color:#afc5b54d}
#result-panel #rematch-button:not(:disabled):hover,#result-panel.result-anonymous .result-quit:not(:disabled):hover{background:#f5edd7;border-color:transparent}
#result-panel button:focus-visible{outline-offset:2px}
#result-panel .result-secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
#result-panel .result-secondary:has(#result-chat-button[hidden]){grid-template-columns:1fr}
#result-panel .result-secondary button{font-size:12px}
#result-panel .result-chat-unread{display:inline-grid;place-items:center;flex:none;min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:#db7067;color:#fff;font-size:10px;font-weight:700;line-height:1}
#result-panel :is(#result-rematch-status,#result-feedback){font-size:12px;line-height:1.5;color:var(--result-accent);margin:12px 0;padding:10px 12px;border-radius:10px;background:color-mix(in srgb,var(--result-accent) 6%,transparent)}
.result-reopen{position:absolute;bottom:13%;left:50%;transform:translateX(-50%);background:#eee6ce;color:#17271f;padding:12px 18px;white-space:nowrap;border:0;border-radius:20px;font-size:13px;font-weight:600;min-height:44px;z-index:3}
.result-reopen:not(:disabled):active{transform:translateX(-50%) translateY(1px)}
@media(max-width:360px){#result-panel{padding:20px 16px 16px}#result-panel .result-summary{gap:10px}#result-panel h2{font-size:24px}}
@media(max-height:540px){#result-panel{width:min(380px,calc(100% - 32px));padding:16px 18px;border-radius:18px}#result-panel .result-emblem{width:40px;height:40px}#result-panel h2{font-size:25px}#result-panel #result-reason{margin-top:10px}#result-panel .result-buttons{margin-top:14px}}
