/* Couple Rivalry Scoreboard (assets/tools/couple-scoreboard.js). Tokens only, plus one second-player tint. */
.tool { --sb-b: 226 64 127; }
.tool .sb-banner { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tool .sb-banner p { font-weight: 750; color: rgb(var(--ink)); }
.tool .sb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tool .sb-season { width: auto; min-height: 40px; padding: 6px 12px; border-radius: 20px; font-size: 14px; font-weight: 800; }

.tool .sb-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; }
.tool .sb-vs { align-self: center; font-size: 13px; font-weight: 900; color: rgb(var(--ink) / .4); text-transform: uppercase; letter-spacing: .08em; }
.tool .sb-player {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 16px; border-radius: 28px;
  background: var(--surface); box-shadow: var(--shadow); min-width: 0; transition: box-shadow .3s ease;
}
.tool .sb-player.is-lead.sb-p0 { box-shadow: var(--shadow), inset 0 0 0 2.5px rgb(var(--accent)); }
.tool .sb-player.is-lead.sb-p1 { box-shadow: var(--shadow), inset 0 0 0 2.5px rgb(var(--sb-b)); }
.tool .sb-name {
  width: 100%; min-height: 40px !important; padding: 6px 8px !important; text-align: center; font-size: 16px !important; font-weight: 900 !important;
  background: rgb(var(--ink) / .03) !important; box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / .16) !important; border-radius: 12px !important; text-overflow: ellipsis;
}
.tool .sb-name:focus-visible { box-shadow: inset 0 0 0 2px rgb(var(--accent)) !important; }
.tool .sb-num { font-size: 64px; line-height: 68px; font-weight: 950; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: rgb(var(--ink)); }
.tool .sb-p0 .sb-num { color: rgb(var(--accent)); }
.tool .sb-p1 .sb-num { color: rgb(var(--sb-b)); }
.tool .sb-num.is-new { animation: sb-bump .5s var(--ease-out); }
@keyframes sb-bump { 0% { transform: scale(1); } 30% { transform: scale(1.18); } 100% { transform: scale(1); } }
.tool .sb-sub { min-height: 20px; font-size: 13px; line-height: 20px; font-weight: 800; color: rgb(var(--ink) / .55); text-align: center; }

.tool .sb-games button { background: var(--surface); flex: none; }
/* One swipeable row of games on phones, so the win buttons stay on the first screen. */
@media (max-width: 599px) {
  .tool .sb-games { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tool .sb-games::-webkit-scrollbar { display: none; }
  .tool .sb-games button { scroll-snap-align: start; }
}
.tool .sb-add-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--link) !important; }
.tool .sb-add-btn .tool-icon { width: 18px; height: 18px; }
.tool .sb-add { display: flex; gap: 8px; }
.tool .sb-add .btn { flex: none; width: auto; height: 48px; padding: 0 20px; }

.tool .sb-log-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool .sb-win { height: 56px; padding: 0 12px; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 56px; text-align: center; }
.tool .sb-win1 { background: linear-gradient(180deg, #F27AAE 0%, #E2407F 45%, #B5235E 100%); box-shadow: 0 8px 24px rgb(181 35 94 / .3); }
.tool .sb-tie-row { display: flex; justify-content: space-between; align-items: center; margin-top: -6px; }
.tool .sb-tie, .tool .sb-undo { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 20px; font-size: 14px; font-weight: 800; color: rgb(var(--ink) / .6); }
.tool .sb-undo .tool-icon { width: 18px; height: 18px; }
.tool .sb-undo:disabled { opacity: .35; }
.tool .sb-tie:focus-visible, .tool .sb-undo:focus-visible, .tool .sb-step-btn:focus-visible, .tool .sb-match summary:focus-visible, .tool .sb-season:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
.tool .sb-empty { text-align: center; font-size: 15px; font-weight: 700; color: rgb(var(--ink) / .55); padding: 4px 8px; }

.tool .sb-stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tool .sb-stats .tool-stat b { font-size: 22px; line-height: 30px; overflow-wrap: anywhere; }
.tool .sb-pergame { display: grid; gap: 6px; }
.tool .sb-pergame li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding: 12px 16px; border-radius: 16px; background: var(--surface); }
.tool .sb-pg-name { font-weight: 850; color: rgb(var(--ink)); overflow-wrap: anywhere; }
.tool .sb-pg-score { font-weight: 900; font-variant-numeric: tabular-nums; color: rgb(var(--ink) / .8); }
.tool .sb-pg-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: rgb(var(--sb-b) / .8); overflow: hidden; }
.tool .sb-pg-bar i { display: block; height: 100%; background: rgb(var(--accent)); border-radius: 4px 0 0 4px; transition: width .4s var(--ease-out); }

.tool .sb-recent-wrap { display: flex; flex-direction: column; gap: 8px; }
.tool .sb-recent { display: grid; gap: 4px; }
.tool .sb-recent li { display: flex; gap: 10px; align-items: center; margin: 0; padding: 8px 4px; font-size: 15px; border-bottom: 1px solid rgb(var(--ink) / .06); }
.tool .sb-r-who { font-weight: 900; color: rgb(var(--ink) / .7); }
.tool .sb-r0 { color: rgb(var(--accent)); }
.tool .sb-r1 { color: rgb(var(--sb-b)); }
.tool .sb-r-game { flex: 1; min-width: 0; color: rgb(var(--ink) / .75); overflow-wrap: anywhere; }
.tool .sb-r-date { font-size: 13px; color: rgb(var(--ink) / .45); white-space: nowrap; }

.tool .sb-match { border-radius: 24px; background: var(--surface); }
.tool .sb-match summary { cursor: pointer; list-style: none; padding: 16px 18px; min-height: 56px; font-size: 16px; font-weight: 850; color: rgb(var(--ink)); border-radius: 24px; }
.tool .sb-match summary::-webkit-details-marker { display: none; }
.tool .sb-match summary::after { content: '+'; float: right; font-weight: 900; color: var(--link); transition: transform .2s var(--ease-out); }
.tool .sb-match[open] summary::after { transform: rotate(45deg); }
.tool .sb-match-inner { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 16px; }
.tool .sb-match-body { display: flex; flex-direction: column; gap: 10px; }
.tool .sb-match-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool .sb-match-name { font-weight: 850; min-width: 0; overflow-wrap: anywhere; }
.tool .sb-match-name small { font-size: 13px; font-weight: 700; color: rgb(var(--ink) / .5); }
.tool .sb-step { display: flex; align-items: center; gap: 8px; }
.tool .sb-step-btn { width: 48px; height: 48px; border-radius: 24px; font-size: 24px; font-weight: 800; background: rgb(var(--ink) / .06); color: rgb(var(--ink)); touch-action: manipulation; transition: transform .12s ease; }
.tool .sb-step-btn.is-plus { background: rgb(var(--ink)); color: var(--surface); }
.tool .sb-step-btn:active { transform: scale(.94); }
.tool .sb-step-val { min-width: 44px; text-align: center; font-size: 28px; font-weight: 950; font-variant-numeric: tabular-nums; }
.tool .sb-hole { font-weight: 900; color: var(--link); }
.tool .sb-golf-total { font-size: 14px; font-weight: 700; color: rgb(var(--ink) / .6); }
@media (min-width: 600px) { .tool .sb-share .btn { flex: 1 1 0; } }
.tool .sb-share .btn:disabled { opacity: .45; }

@media (max-width: 380px) { .tool .sb-num { font-size: 52px; line-height: 56px; } .tool .sb-win { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .tool .sb-num.is-new { animation: none; } .tool .sb-pg-bar i { transition: none; } }
/* Round 2: editable names, keyboard hints, golf grid, removable history, season champions */
.tool .sb-name { border-radius: 12px; box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / .14); background: rgb(var(--ink) / .03); }
.tool .sb-name:placeholder-shown { box-shadow: inset 0 0 0 1.5px rgb(var(--accent) / .6) !important; }
.tool .sb-kbd { display: none; margin-left: 8px; min-width: 22px; padding: 0 6px; border-radius: 6px; font: inherit; font-size: 12px; line-height: 20px; background: rgb(255 255 255 / .22); }
@media (hover: hover) and (pointer: fine) { .tool .sb-kbd { display: inline-block; } }
.tool .sb-golf-grid { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.tool .sb-gg-row { display: flex; gap: 2px; min-width: max-content; }
.tool .sb-gg-n { flex: none; width: 64px; font-size: 12px; font-weight: 850; line-height: 30px; color: rgb(var(--ink) / .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool .sb-gg-c { flex: none; width: 28px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 850; color: rgb(var(--ink)); background: rgb(var(--ink) / .04); font-variant-numeric: tabular-nums; }
.tool .sb-gg-c.is-head { color: rgb(var(--ink) / .55); background: none; }
.tool .sb-gg-c.is-on { box-shadow: inset 0 0 0 2px rgb(var(--accent)); }
.tool .sb-gg-c.is-tot { width: 36px; background: rgb(var(--accent) / .12); color: var(--link); }
.tool .sb-r-rm { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 16px; color: rgb(var(--ink) / .45); font-size: 12px; font-weight: 850; -webkit-tap-highlight-color: transparent; }
.tool .sb-r-rm[data-armed="1"] { width: auto; padding: 0 10px; color: #C2410C; background: rgb(194 65 12 / .1); }
.tool .sb-r-rm .tool-icon { width: 14px; height: 14px; }
.tool .sb-past { display: flex; flex-direction: column; }
.tool .sb-past li { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; font-weight: 750; border-bottom: 1px solid rgb(var(--ink) / .06); }
.tool .sb-past-m { flex: 1; color: rgb(var(--ink) / .6); }
.tool .sb-past-c { font-weight: 900; color: rgb(var(--ink)); }
.tool .sb-past-s { font-variant-numeric: tabular-nums; color: rgb(var(--ink) / .6); }
.tool .sb-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.tool .sb-match .u23-switch { font-size: 14px; }

/* Round 3 */
@media (max-width: 600px) { .tool .sb-player { padding: 10px 8px 10px; border-radius: 22px; } .tool .sb-num { font-size: 52px; line-height: 56px; } }
.tool .sb-head-actions { display: flex; align-items: center; gap: 8px; }
.tool .sb-link-mini { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 20px; color: var(--link); background: rgb(var(--accent) / .1); }
.tool .sb-link-mini .tool-icon { width: 18px; height: 18px; }
.tool .sb-live { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tool .sb-live-title { font-size: 16px; font-weight: 900; color: rgb(var(--ink)); }
.tool .sb-live-off .sb-match-inner > :not(.u23-seg:first-child) { display: none; }
.tool .sb-confirm { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: rgb(var(--accent) / .1); text-align: center; font-weight: 850; }
.tool .sb-golf-grid { overflow-x: visible; }
.tool .sb-gg-block { display: flex; flex-direction: column; gap: 2px; }
.tool .sb-gg-row { min-width: 0; }
.tool .sb-gg-c { width: auto; flex: 1 1 0; min-width: 22px; }
.tool .sb-gg-c.is-tot { flex: none; width: 36px; }
.tool .sb-gg-n { width: 54px; }
.tool button.sb-gg-c { cursor: pointer; }
.tool .sb-stats .tool-stat.is-text b { font-size: 16px; line-height: 22px; }
.tool .sb-win .sb-kbd { vertical-align: 2px; }
.tool .sb-kbd.is-soft { background: rgb(var(--ink) / .08); color: rgb(var(--ink) / .6); }
/* Round 5: colors follow the person, golf grid fits, chips wrap */
.tool.sb-swap .sb-p0 .sb-num, .tool.sb-swap .sb-r0 { color: rgb(var(--sb-b)); }
.tool.sb-swap .sb-p1 .sb-num, .tool.sb-swap .sb-r1 { color: rgb(var(--accent)); }
.tool.sb-swap .sb-player.is-lead.sb-p0 { box-shadow: var(--shadow), inset 0 0 0 2.5px rgb(var(--sb-b)); }
.tool.sb-swap .sb-player.is-lead.sb-p1 { box-shadow: var(--shadow), inset 0 0 0 2.5px rgb(var(--accent)); }
.tool.sb-swap .sb-win0 { background: linear-gradient(180deg, #F27AAE 0%, #E2407F 45%, #B5235E 100%); box-shadow: 0 8px 24px rgb(181 35 94 / .3); }
.tool.sb-swap .sb-win1 { background: var(--ramp); box-shadow: 0 8px 24px rgb(121 35 192 / .32); }
.tool.sb-swap .sb-pg-bar { background: rgb(var(--accent) / .8); }
.tool.sb-swap .sb-pg-bar i { background: rgb(var(--sb-b)); }
.tool .sb-golf-grid { overflow-x: auto; }
.tool .sb-gg-n { width: 44px; font-size: 11px; }
.tool .sb-gg-c { min-width: 20px; font-size: 12px; }
.tool .sb-gg-c.is-tot { width: 32px; }
.tool .sb-match-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tool .sb-target[hidden] { display: none; }
.tool .sb-target { display: flex; flex-direction: column; gap: 6px; }
.tool .sb-preview { font-size: 22px; line-height: 28px; font-weight: 950; color: rgb(var(--ink)); }
.tool .sb-sync { text-align: center; }
@media (max-width: 719px) { .tool .sb-games { flex-wrap: wrap; overflow-x: visible; margin: 0; padding: 0; -webkit-mask-image: none; mask-image: none; } }
@media (prefers-color-scheme: dark) { .tool .sb-name { box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / .3) !important; } .tool .sb-player { box-shadow: var(--shadow), inset 0 0 0 1px rgb(var(--ink) / .14); } }
.tool .sb-live .sb-match-inner { padding: 0; background: none; box-shadow: none; }
.tool .sb-match-name small { display: block; }
/* Round 7: compact head, received-board preview, live match entry, typed points, badges, 44px remove */
.tool.sb-incoming > :not(.sb-banner):not(.u23-toast) { display: none !important; }
.tool .sb-pv-board { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool .sb-pv-card { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 8px; border-radius: 20px; background: rgb(var(--ink) / .04); min-width: 0; }
.tool .sb-pv-name { max-width: 100%; font-size: 15px; font-weight: 900; color: rgb(var(--ink)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool .sb-pv-card .sb-num { font-size: 48px; line-height: 54px; }
.tool .sb-pv-a .sb-num { color: rgb(var(--accent)); }
.tool .sb-pv-b .sb-num { color: rgb(var(--sb-b)); }
.tool .sb-banner .sb-pv-games { display: grid; gap: 4px; }
.tool .sb-pv-games li { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 4px; font-size: 15px; font-weight: 750; border-bottom: 1px solid rgb(var(--ink) / .06); }
.tool .sb-pv-games b { font-variant-numeric: tabular-nums; }
.tool .sb-banner .tool-note { font-weight: 600; color: rgb(var(--ink) / .6); }

.tool .sb-head { flex-wrap: nowrap; }
.tool .sb-season-wrap { position: relative; display: inline-flex; min-width: 0; }
.tool .sb-season {
  -webkit-appearance: none; appearance: none; min-height: 44px; max-width: 100%; padding: 0 40px 0 16px !important; border: 0; border-radius: 22px;
  background: var(--surface) !important; box-shadow: 0 2px 8px rgb(var(--ink) / .08), inset 0 0 0 1.5px rgb(var(--ink) / .1) !important;
  color: rgb(var(--ink)); font: inherit; font-size: 15px; font-weight: 850; cursor: pointer; text-overflow: ellipsis;
}
.tool .sb-season-chev { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none; color: rgb(var(--ink) / .55); transform: rotate(90deg); }
.tool .sb-season-chev .tool-icon { width: 16px; height: 16px; }
.tool .sb-link-mini { position: relative; width: 44px; height: 44px; border-radius: 22px; flex: none; }
.tool .sb-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgb(var(--sb-b)); color: #fff; font-size: 11px; line-height: 20px; font-weight: 900; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.tool .sb-badge[hidden] { display: none; }

.tool .sb-live-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.tool .sb-live-close { width: 44px; height: 44px; margin: -6px -8px -6px 0; display: grid; place-items: center; border-radius: 22px; color: rgb(var(--ink) / .55); }
.tool .sb-live-close[hidden] { display: none; }
.tool .sb-live-close .tool-icon { width: 18px; height: 18px; }
.tool .sb-live-close:focus-visible, .tool .sb-live-go:focus-visible, .tool .sb-r-rm:focus-visible, .tool .sb-link-mini:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
.tool .sb-live-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool .sb-live-entry[hidden], .tool .sb-match-inner[hidden] { display: none; }
.tool .sb-live-go { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 12px 14px; border-radius: 18px; text-align: left; background: rgb(var(--accent) / .08); color: rgb(var(--ink)); transition: transform .16s var(--ease-out), background-color .2s ease; -webkit-tap-highlight-color: transparent; }
.tool .sb-live-go:active { transform: scale(.97); }
.tool .sb-live-go b { font-size: 15px; font-weight: 900; color: var(--link); }
.tool .sb-live-go span { font-size: 13px; line-height: 17px; font-weight: 700; color: rgb(var(--ink) / .55); }
@media (hover: hover) { .tool .sb-live-go:hover { background: rgb(var(--accent) / .14); } }
.tool .sb-target .u23-seg button { padding: 0 4px; min-width: 0; }
.tool .sb-target[hidden] { display: none; }
.tool .sb-toggles { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.tool .sb-step-in { flex: none; width: 76px !important; min-height: 48px !important; padding: 0 4px !important; border-radius: 14px !important; text-align: center; font-size: 26px !important; font-weight: 950 !important; background: rgb(var(--ink) / .04) !important; box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / .12) !important; color: rgb(var(--ink)); }
.tool .sb-step-btn.is-plus { font-size: 18px; }
.tool .sb-match-name.sb-r0, .tool .sb-gg-n.sb-r0 { color: rgb(var(--accent)); }
.tool .sb-match-name.sb-r1, .tool .sb-gg-n.sb-r1 { color: rgb(var(--sb-b)); }
.tool .sb-r-rm { width: 44px; height: 44px; border-radius: 22px; margin: -6px 0; }
.tool .sb-why { text-align: center; margin-top: -6px; }
.tool .sb-why[hidden] { display: none; }
.tool .sb-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (min-width: 600px) { .tool .sb-stats > :last-child:nth-child(odd) { grid-column: auto; } }
@media (max-width: 600px) { .tool .sb-player { padding: 8px 8px 6px; } .tool .sb-sub { min-height: 18px; line-height: 18px; font-size: 12px; } }
