/* Scoped result tools: a normal header row; no floating controls over gameplay. */
#topbar { flex-wrap: wrap; }
#topbar > .ab-results-tools { flex: 0 0 100%; display: flex; justify-content: flex-end; margin-top: -2px; }
.ab-results-trigger { border: 1px solid #34394b; border-radius: 9px; padding: 6px 10px;
  background: #1b2030; color: #c9d3ec; font: 600 11px/1.35 system-ui, sans-serif; cursor: pointer; }
.ab-results-trigger:disabled { opacity: .5; cursor: default; }
.ab-results-dialog { color-scheme: dark; box-sizing: border-box; width: min(460px, calc(100vw - 24px));
  max-width: none; max-height: min(82vh, 760px); margin: auto; padding: 0; overflow: hidden;
  border: 1px solid #363e55; border-radius: 20px; background: #141927; color: #eff3fc;
  box-shadow: 0 24px 80px #0009; font: 14px/1.45 system-ui, sans-serif; }
.ab-results-dialog::backdrop { background: #050813bc; }
.ab-results-dialog *, .ab-results-dialog *::before, .ab-results-dialog *::after { box-sizing: border-box; }
.ab-results-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 19px 18px 15px; border-bottom: 1px solid #2b3246; }
.ab-results-head h2 { font-size: 19px; font-weight: 750; margin: 0 0 3px; }
.ab-results-head p { margin: 0; color: #95a3bc; font-size: 11px; }
.ab-results-close { flex: 0 0 32px; height: 32px; border: 0; border-radius: 9px;
  background: #252d41; color: #d4dcef; cursor: pointer; font-size: 16px; }
.ab-results-body { padding: 14px 16px 18px; max-height: calc(min(82vh, 760px) - 90px); overflow-y: auto;
  overscroll-behavior: contain; }
.ab-results-note { margin: 0 0 14px; color: #9faec7; font-size: 12px; }
.ab-results-status { margin: 8px 0; color: #bdcce7; font-size: 13px; }
.ab-results-status:empty { display: none; }
.ab-results-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ab-result { margin: 0; padding: 13px; border: 1px solid #30394e; border-radius: 13px; background: #1c2435; }
.ab-result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ab-result-title { font-size: 13px; }
.ab-result-badge { border-radius: 6px; padding: 3px 6px; font-size: 10px; white-space: nowrap;
  color: #b6c4df; background: #303a50; }
.ab-result-win { color: #7de5b8; background: #173e35; }
.ab-result-loss { color: #f4acb6; background: #452b3a; }
.ab-result-player { margin: 7px 0 0; color: #95a8c9; font-size: 11px; overflow-wrap: anywhere; }
.ab-result-player:empty { display: none; }
.ab-result-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.ab-result-value dt { font-size: 10px; color: #91a1bd; }
.ab-result-value dd { margin: 3px 0 0; font-size: 12px; font-weight: 700; color: #ecf2ff;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ab-result-value dd.ab-payout-win { color: #3ddc84; }
.ab-result-value dd.ab-payout-loss { color: #ff5667; }
.ab-result-value dd.ab-payout-neutral { color: #c7ccd6; }
.ab-result-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ab-result-time { color: #8496b6; font-size: 10px; }
.ab-result-share, .ab-results-retry { min-height: 34px; padding: 7px 11px; border: 1px solid #5361a2;
  border-radius: 8px; background: #374478; color: #f2f5ff; font: 600 11px/1.35 system-ui, sans-serif;
  cursor: pointer; }
.ab-result-share:disabled { background: #293750; border-color: #3c4f70; color: #a8bad7; cursor: default; }
.ab-result-feedback { margin: 9px 0 0; color: #a6c8db; font-size: 11px; overflow-wrap: anywhere; }
.ab-result-feedback:empty { display: none; }
.ab-results-trigger:focus-visible, .ab-results-dialog button:focus-visible { outline: 2px solid #b1c8ff; outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { .ab-results-dialog[open] { animation: ab-results-enter .13s ease-out; } }
@keyframes ab-results-enter { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
