/* Side-table scorecard. Existing table scores remain available on narrow screens. */
#score-panel:empty { display: none; }
.score-panel {
  width: 100%;
  min-width: 0;
  margin: 0 0 20px;
  padding: 16px 17px 14px;
  border: 1px solid #697451;
  background: linear-gradient(180deg, #304631 0, #233829 100%);
  box-shadow: inset 0 1px 0 #bec98c12, 0 3px 0 #101b1d;
  color: #e7e2c3;
}
.sp-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-title { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .6px; }
.sp-target { color: #c6c79c; font-size: 14px; white-space: nowrap; }
.sp-total { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); align-items: end; gap: 7px; padding: 16px 0 14px; }
.sp-player { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 6px; }
.sp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: #b8c5a5; }
.sp-number { color: #e7e3c1; font: 600 40px/1.12 var(--mono, monospace); font-variant-numeric: tabular-nums; text-shadow: 2px 2px 0 #122f23; }
.sp-player-self .sp-number { color: #f0d296; }
.sp-separator { color: #93a27b; font: 23px/1.6 var(--mono, monospace); text-align: center; }
.sp-history { border-top: 1px solid #65794a66; padding-top: 9px; }
.sp-columns, .sp-round-button { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 7px; }
.sp-columns { padding: 0 7px 9px; font-size: 14px; color: #9db18c; }
.sp-columns > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.sp-columns > span:first-child { text-align: left; }
.sp-round-list { list-style: none; margin: 0; padding: 0 1px; max-height: 172px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #829561 #233829; overscroll-behavior: contain; }
.sp-round { margin: 0; padding: 0; }
.sp-round + .sp-round { border-top: 1px solid #6078462b; }
.sp-round-button { width: 100%; min-height: 42px; margin: 0; padding: 7px 6px; border: 1px solid transparent; border-radius: 0; background: transparent; color: #b9c9a7; text-align: left; font-size: 15px; }
.sp-round-button:hover:not(:disabled) { color: #eee3b9; border-color: #87936666; background: #66784729; }
.sp-round-button:focus-visible { outline: 2px solid #edd095; outline-offset: -2px; background: #52663b40; }
.sp-round-button:active:not(:disabled) { transform: none; background: #65784b45; }
.sp-round-label { white-space: nowrap; }
.sp-gain { text-align: center; color: #91a47e; font: 15px var(--mono, monospace); font-variant-numeric: tabular-nums; }
.sp-gain.is-positive { color: #ead399; }
.sp-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 9px 0 0; padding: 10px 7px 0; border-top: 1px dashed #6d81554d; color: #b9c6a1; font-size: 15px; }
.sp-current-state { display: inline-flex; align-items: center; gap: 7px; color: #b6c497; font-size: 14px; }
.sp-current-state::before { content: ''; display: block; width: 4px; height: 4px; background: #d9c582; box-shadow: 0 0 0 2px #d9c58212; }
.sp-current.is-scoring { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); gap: 7px; padding-right: 7px; }
.sp-current.is-scoring > span:first-child::after { content: '进行中'; display: block; margin-top: 4px; color: var(--muted, #b6c497); font-size: 14px; }
.sp-current.is-scoring .sp-gain { font-size: 15px; }
.sp-current > [hidden] { display: none; }
.sp-status { margin: 7px 0 0; padding-top: 8px; border-top: 1px solid #687c4c33; color: #9eb38c; font-size: 14px; text-align: center; }

@media (min-width: 851px) {
  body:has(#score-panel[data-score-panel-ready='true']:not([hidden])) .table-frame .score-display { display: none; }
}
@media (max-width: 850px) {
  .score-panel { grid-column: 1 / -1; margin: 0; padding: 16px 18px; }
  .sp-total { max-width: 340px; margin: 0 auto; padding: 13px 0 15px; }
  .sp-number { font-size: 35px; }
  .sp-round-list { max-height: 150px; }
  .sp-columns, .sp-round-button { grid-template-columns: minmax(80px, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .sp-current.is-scoring { grid-template-columns: minmax(80px, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .sp-round-button { min-height: 44px; }
}
