.round-dialog { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: clamp(14px, 3vw, 28px); }
.round-dialog h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 34px); }
.round-dialog p { margin: 8px 0; }
.round-scores { width: 100%; border-collapse: collapse; font-size: clamp(14px, 2.5vw, 20px); font-variant-numeric: tabular-nums; }
.round-scores th, .round-scores td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--pop-ink); }
.round-scores th:first-child { text-align: left; width: 34%; overflow-wrap: anywhere; }
.round-scores thead { font-size: .85em; }
.round-scores tr[data-own="true"] { background: #f4d795; }
.round-scores small { display: block; font-size: .7em; }
.round-scores [data-sign="negative"] { color: #215f50; }
.round-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.round-controls > button { min-height: 44px; }
.round-countdown { min-height: 24px; font-size: 21px; }
.round-scoreboard { min-height: 44px; padding: 0 8px; font: 14px var(--font-ui); color: var(--pop-ink); background: var(--pop-paper); border: 2px solid var(--pop-ink); border-radius: 6px; cursor: pointer; }
#result-dialog:has(.round-scores) { width: min(620px, calc(100vw - 24px)); }
#result-dialog:has(.round-scores) .result-scores h3 { font-size: 20px; margin: 8px 0; }
#result-dialog:has(.result-comparison) { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.result-comparison-scroll {
  max-width: 100%; margin: 14px 0 18px; overflow-x: auto;
  color: var(--pop-ink); background: #fffaf0; border: 2px solid var(--pop-ink); border-radius: 6px;
  box-shadow: 3px 4px 0 var(--pop-ink); scrollbar-color: var(--pop-ink) #e4d5af; scrollbar-width: thin;
}
.result-comparison {
  width: 100%; min-width: max(100%, calc(128px + var(--result-player-count) * 90px));
  border-spacing: 0; table-layout: fixed; font-size: clamp(14px, 2vw, 18px); font-variant-numeric: tabular-nums;
}
.result-comparison :is(th, td) { padding: 9px 8px; border-right: 1px solid #28282042; border-bottom: 1px solid #28282042; }
.result-comparison tr > :last-child { border-right: 0; }
.result-comparison tbody tr:last-child > * { border-bottom: 0; }
.result-comparison thead th { background: #e4d5af; line-height: 1.05; overflow-wrap: anywhere; }
.result-comparison__corner,
.result-comparison__category { width: 128px; text-align: left; }
.result-comparison__category {
  position: sticky; left: 0; z-index: 1; background: #fffaf0; box-shadow: 2px 0 0 #28282024;
}
.result-comparison__player,
.result-comparison__cell { text-align: center; }
.result-comparison__cell[data-awarded="true"] { background: #f4d35e4d; box-shadow: inset 0 -4px 0 #c9822e; }
.result-comparison__value { display: block; font-size: 1.15em; line-height: 1.1; }
.result-comparison__badge {
  display: inline-block; margin-top: 5px; padding: 2px 6px;
  color: #fffaf0; background: var(--pop-felt-edge); border: 1px solid var(--pop-ink); border-radius: 999px;
  font-size: .72em; line-height: 1.15; white-space: nowrap;
}
.result-comparison__total > * { border-top: 2px solid var(--pop-ink); background: #f0dfb6; }
.result-comparison__total .result-comparison__category { background: #f0dfb6; }
.result-comparison__total .result-comparison__value { font-size: 1em; }
.result-comparison__cell[data-winner="true"] { background: var(--pop-yellow); }
.result-comparison__badge--winner { color: var(--pop-ink); background: var(--pop-paper); }
@media (max-height: 800px) {
  #result-dialog:has(.result-comparison) { padding-block: 18px; }
  #result-dialog:has(.result-comparison) #result-copy { margin-bottom: 8px; }
  #result-dialog:has(.result-comparison) .result-comparison-scroll { margin-block: 8px 12px; }
  .result-comparison :is(th, td) { padding-block: 6px; }
  .result-comparison__badge { margin-top: 2px; }
}
@media (max-height: 480px) {
  .round-dialog { padding: 12px 20px; }
  .round-dialog h2 { font-size: 24px; }
  .round-dialog p { margin: 4px 0; }
  .round-scores th, .round-scores td { padding: 5px 8px; }
  .round-controls { margin-top: 4px; }
  #result-dialog:has(.round-scores) { padding: 12px 20px; }
  #result-dialog:has(.round-scores) .dialog-heading { float: right; margin: 0; }
  #result-dialog:has(.round-scores) h2 { font-size: 24px; margin: 0 48px 8px 0; text-align: left; }
  #result-dialog:has(.round-scores) .result-scores { margin: 4px 0 12px; }
  #result-dialog:has(.round-scores) > .wide { display: inline-block; width: auto; min-height: 44px; padding: 8px 16px; margin: 0 8px 0 0; }
  #result-dialog:has(.result-comparison) { padding: 12px 20px; }
  #result-dialog:has(.result-comparison) .dialog-heading { float: right; margin: 0; }
  #result-dialog:has(.result-comparison) h2 { font-size: 24px; margin: 0 48px 4px 0; text-align: left; }
  #result-dialog:has(.result-comparison) #result-copy { margin: 4px 0; text-align: left; }
  #result-dialog:has(.result-comparison) .result-comparison-scroll { margin: 6px 0 10px; }
  .result-comparison :is(th, td) { padding: 5px 7px; }
  .result-comparison__badge { margin-top: 2px; }
}
@media (max-width: 400px) {
  .round-scores th, .round-scores td { padding: 8px 4px; }
  .round-controls > .button { flex: 1 0 100%; }
  .result-comparison { min-width: max(100%, calc(84px + var(--result-player-count) * 56px)); font-size: 13px; }
  .result-comparison__corner,
  .result-comparison__category { width: 84px; }
  .result-comparison :is(th, td) { padding: 8px 5px; }
}
