/* Feedback and final states. Existing game state, scoring and timings are unchanged. */
.skip-link { min-height: 44px; box-sizing: border-box; }
.panel.bestwert-wait .react-bar { display: grid; grid-template-columns: repeat(auto-fit,minmax(44px,1fr)); gap: 4px; }
.panel.bestwert-wait .react-btn { width: 44px; min-width: 44px; flex: 0 0 44px; justify-self: center; }
.panel.bestwert-play .bw-answer.is-locked,
.panel.bestwert-play .bw-answer.is-locked :is(input,button) {
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor;
}
.panel.bestwert-play .bw-answer.is-locked { pointer-events: auto; }
.panel.bestwert-play .bw-answer.is-locked button { cursor: default; }
.panel.bestwert-play :is(.bw-h2h-choice,.bw-hl-choice,.bw-choice).is-on {
  border-color: var(--kk-accent) !important;
  box-shadow: inset 0 0 0 2px var(--kk-accent);
}
.panel.bestwert-play :is(.bw-submit-status:empty) { display: none; }
.panel.bestwert-play .bw-submit-status:not(:empty) {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; margin: 8px 16px 0; padding: 10px 12px;
  border: 1px solid var(--kk-line); border-radius: 12px;
  background: var(--kk-surface); color: var(--kk-ink);
  font: 700 14px/1.4 var(--kk-body); text-align: left;
}
.bw-status-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px;
  width: 28px; height: 28px; border-radius: 50%; font-size: 22px; line-height: 1;
}
.panel.bestwert-play[data-submit-state="success"] .bw-status-icon { background: var(--kk-accent); color: var(--kk-accent-text); }
.panel.bestwert-play[data-submit-state="success"] .bw-submit-status { border-color: var(--kk-accent); }
.panel.bestwert-play[data-submit-state="error"] .bw-submit-status,
.panel.bestwert-play .bw-field-hint.is-error {
  color: var(--kk-ink); border: 1px solid var(--kk-miss); background: var(--kk-surface);
}
.panel.bestwert-play .bw-field-hint.is-error { padding: 10px; border-radius: 8px; }
.panel.bestwert-play[data-submit-state="error"] .bw-status-icon { background: var(--kk-miss); color: var(--kk-bg); }
.panel.bestwert-play :is(input[aria-invalid="true"]) { border-color: var(--kk-miss); }
.panel.bestwert-play[data-submit-state="sending"] #bw-submit,
.panel.bestwert-play[data-submit-state="success"] #bw-submit {
  opacity: 1 !important; background: var(--kk-surface) !important;
  color: var(--kk-ink) !important; border: 1px solid var(--kk-line) !important;
}
body.in-match #game-stage .panel.bestwert-play[data-submit-state="sending"] #bw-submit,
body.in-match #game-stage .panel.bestwert-play[data-submit-state="success"] #bw-submit {
  opacity: 1 !important; background: var(--kk-surface) !important; color: var(--kk-ink) !important;
}
.panel.bestwert-play[data-submit-state="success"] :is(.bw-explainer,.bw-pick-hint,.bw-pair-status,.bw-field-hint:not(.is-error)) { display: none; }

/* Names get their own space below the score, irrespective of score length. */
.panel.result.res .res-score {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px;
}
.panel.result.res .res-score-num {
  grid-column: 1 / -1; grid-row: 1; justify-self: center;
  font-size: clamp(48px,20vw,88px); letter-spacing: 0; white-space: nowrap;
}
.panel.result.res .res-score--long .res-score-num { font-size: clamp(28px,12vw,64px); }
.panel.result.res .res-score-side {
  grid-row: 2; min-width: 0; font: 700 15px/1.4 var(--kk-body);
  overflow-wrap: break-word; word-break: normal; hyphens: none; color: var(--kk-ink);
}
.panel.result.res .res-score-side:first-child { text-align: left; }
.panel.result.res .res-score-side:last-child { text-align: right; }
.panel.result.res .res-score--single { display: flex; }
.panel.result.res .res-score--single .res-score-side { text-align: center; }
.panel.result.res .res-sub { color: var(--kk-muted); }
.panel.result.res .res-row { grid-template-columns: 24px 36px minmax(0,1fr); gap: 4px 10px; padding: 12px; }
.panel.result.res .res-row-rank { grid-column: 1; grid-row: 1 / 3; }
.panel.result.res .res-row-avatar { grid-column: 2; grid-row: 1 / 3; width: 36px; height: 36px; }
.panel.result.res .res-row-name { grid-column: 3; grid-row: 1; }
.panel.result.res .res-row-name b { line-height: 1.4; hyphens: none; overflow-wrap: break-word; word-break: normal; }
.panel.result.res .res-row-name small { color: var(--kk-muted); }
.panel.result.res .res-row-pts { grid-column: 3; grid-row: 2; font-size: 26px; }
.panel.result.res .res-row-pts small { color: var(--kk-muted); }

/* A quiet score remains beside the vote, including after state re-renders. */
.panel.result.res .res-rematch-score { width: 100%; padding: 12px; background: var(--kk-surface); color: var(--kk-ink); border-radius: 12px; }
.res-rematch-score p { margin: 0 0 8px; color: var(--kk-muted); font: 700 14px/1.4 var(--kk-body); }
.res-rematch-score > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: baseline; margin-top: 6px; font: 600 14px/1.4 var(--kk-body); }
.res-rematch-score span { overflow-wrap: break-word; min-width: 0; }
.res-rematch-score b { white-space: nowrap; }
.panel.result.res #btn-rematch:disabled { opacity: 1; background: var(--kk-surface) !important; color: var(--kk-ink) !important; border: 1px solid var(--kk-accent) !important; }
.panel.result.res .res-rematch-status { margin: 0; color: var(--kk-ink); font: 600 14px/1.5 var(--kk-body); overflow-wrap: break-word; }
.panel.result.res .vote-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; width: 100%; }
.panel.result.res .vote-chip { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 8px; padding: 10px; border-radius: 12px; background: var(--kk-surface); font-size: 14px; }
.panel.result.res .vote-chip > span { grid-column: 1; width: 24px; height: 24px; }
.panel.result.res .vote-chip b { min-width: 0; font-weight: 600; line-height: 1.4; overflow-wrap: break-word; }
.panel.result.res .vote-chip small { font-size: 12px; white-space: nowrap; color: var(--kk-muted); }
.panel.result.res .vote-chip.is-voted small { color: var(--kk-accent); }
.panel.result.res .sticky-cta .btn-secondary { border-color: var(--kk-line) !important; }
.panel.result.res .sticky-cta .btn-link { color: var(--kk-muted) !important; min-width: 44px; min-height: 44px; }
.panel.result.res .react-bar { flex-wrap: wrap; }
.panel.result.res .jgr-tip { grid-template-columns: 24px minmax(0,1fr) auto; border-radius: 12px; }
.panel.result.res .jgr-who { grid-column: 2; white-space: normal; overflow: visible; overflow-wrap: break-word; }
.panel.result.res .jgr-guess { grid-column: 2; overflow-wrap: break-word; }
.panel.result.res .jgr-pts { grid-column: 3; grid-row: 1 / 3; }
.panel.result.res :is(.jgr-item,.series li) { background: var(--kk-surface); color: var(--kk-ink); }
.panel.result.res :is(.jgr-q,.jgr-who) { color: var(--kk-ink); }
.panel.result.res .series li { align-items: baseline; }
.panel.result.res .series li span { min-width: 0; overflow-wrap: break-word; }
.panel.result.res .series li b { white-space: nowrap; }
.panel.result.res .bw-item-solution { color: var(--kk-result); }

@media (max-width: 260px) {
  .panel.lobby .code-actions { grid-template-columns: minmax(0,1fr); }
  .panel.lobby .code-actions .code-btn { min-width: 44px; min-height: 44px; }
  .panel.result.res { padding-inline: 12px !important; }
  .panel.result.res .match-top { margin-inline: -12px !important; flex-wrap: wrap; }
  .panel.result.res .match-top .round-tag { flex: 1 0 100%; }
  .panel.result.res .res-score { grid-template-columns: minmax(0,1fr); }
  .panel.result.res .res-score-side { grid-row: auto; text-align: center !important; }
  .panel.result.res .res-score-num { font-size: 23vw; }
  .panel.result.res .res-score--long .res-score-num { font-size: 12vw; }
  .panel.result.res .res-row { grid-template-columns: minmax(0,1fr); gap: 6px; padding: 8px; }
  .panel.result.res .res-row-avatar { display: none; }
  .panel.result.res .res-row-rank { grid-column: 1; grid-row: 1; }
  .panel.result.res .res-row-name { grid-column: 1; grid-row: 2; }
  .panel.result.res .res-row-pts { grid-column: 1; grid-row: 3; }
  .panel.result.res .vote-chip { grid-template-columns: minmax(0,1fr); }
  .panel.result.res .vote-chip > span { display: none; }
  .panel.result.res .vote-chip small { grid-column: 1; }
  .res-rematch-score > div { grid-template-columns: minmax(0,1fr); gap: 0; }
  .panel.result.res .jgr-tip { grid-template-columns: minmax(0,1fr); }
  .panel.result.res .jgr-tip .jg-av { display: none; }
  .panel.result.res :is(.jgr-who,.jgr-guess) { grid-column: 1; }
  .panel.result.res .jgr-pts { grid-column: 1; grid-row: auto; }
  .panel.result.res .series li { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel.result.res, .panel.result.res *, .panel.bestwert-wait, .panel.bestwert-wait * {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
