/* v4: live UI on imagegen scenery; only content scrolls, actions never do. */
#result {padding:16px;background:rgba(23,51,41,.48)}
#result[hidden] {display:none}
#resCard {width:760px;max-width:100%;max-height:100%;display:flex;flex-direction:column;overflow:hidden;background:#e0ebb4;border:2px solid #fff6d8;border-radius:28px;color:#294b35;text-align:center}
#resCard .sr-only {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.res-header {display:flex;align-items:center;padding:12px 24px 4px;background:#fff5d9;flex-shrink:0;gap:14px}
.res-header img {width:132px;height:44px;object-fit:contain}
#resRound {margin-left:auto;font-size:13px;font-weight:800;white-space:nowrap}
#resCard .ui-close,.support-board .ui-close {width:40px;height:40px;min-height:40px;flex:0 0 40px;border:0;border-radius:50%;padding:0;background:#42633e;color:#fff5dc;font-size:29px;line-height:1}
#resScroll {min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#7c9a54 #e0ebb4;-webkit-overflow-scrolling:touch}
#resScroll::-webkit-scrollbar,.board-scroll::-webkit-scrollbar {width:6px}
#resScroll::-webkit-scrollbar-thumb,.board-scroll::-webkit-scrollbar-thumb {background:#7c9a54;border-radius:5px}
#result .res-scene {padding:8px 32px 12px;background:#d4e6b2 url('assets/result-v4/garden.png') center bottom/cover no-repeat;border-radius:0}
#result .cut-title {margin:0 0 27px;font-size:36px;line-height:1.2;letter-spacing:1px;animation:none;transform:none;color:#305539}
.cut-title span {display:inline-block;transform:rotate(-3deg);color:#c45136}
.cut-title span+span {transform:rotate(3deg);color:#526b3c}
#result .podium {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;gap:16px;margin:0 auto;min-height:0;max-width:580px}
#result .step {width:100%;min-width:0;margin:0}
#result .who {position:relative;width:100%;height:96px;padding:0;aspect-ratio:auto}
#result .who>img,#result .who>.portrait {position:relative;top:auto;left:auto;width:92px;height:92px;max-width:100%;aspect-ratio:1;animation:none;filter:none}
#result .p1 .who>img,#result .p1 .who>.portrait {width:108px;height:108px}
#result .p1 .who {height:110px}
#result .step .crown {width:28px;margin-left:-14px;top:-23px}
#result .mound {width:100%;max-width:none;height:47px;border-radius:55% 48% 13px 12px;background:#83b4a4;color:#244e40;font-size:28px;line-height:1;font-weight:900}
#result .p1 .mound {height:65px;background:#f3c64d;color:#624917}
#result .p3 .mound {height:34px;background:#dfa078;color:#5a402e}
#result .place-number {bottom:8px;font-size:inherit}
#result .podium-label {margin:0;padding:7px 2px 0;min-height:45px;background:none;border-radius:0}
#result .nm {font-size:14px;line-height:1.3;color:#294b35;font-weight:800;overflow-wrap:anywhere}
#result .tm {margin-top:3px;font-size:13px;font-weight:700;color:#42604a;font-variant-numeric:tabular-nums}
#result .res-others {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;gap:9px;margin:0;padding:13px 30px 14px;list-style:none;background:#cbdc98;border-bottom:1px solid #b9cf83}
#result .res-others li {min-width:0;margin:0;text-align:center}
#result .other-portrait {display:flex;justify-content:center}
#result .other-portrait>img,#result .other-portrait>.portrait {width:62px;height:62px;max-width:100%;object-fit:contain}
#result .res-others .nm {font-size:11px;margin-top:4px;white-space:nowrap;letter-spacing:-.4px}
#result .res-others .tm {font-size:12px}
#result .res-body {padding:14px 26px 20px;text-align:left}
#result #supportReceipt {margin:0 0 16px;padding:16px 20px;background:#fff6dc;border:0;border-radius:24px 18px 26px 16px;color:#264d37;text-align:center}
#result .receipt-thanks {margin:0 0 4px;font-size:13px;font-weight:700}
#result #supportReceipt h3 {margin:0;font-size:23px;line-height:1.4;overflow-wrap:anywhere}
#result #supportReceipt h3 strong {display:inline-block;font-size:30px;white-space:nowrap}
#result i,.support-board i {font-style:normal;color:#ed675b}
#result .receipt-stats {display:grid;grid-template-columns:1fr 1fr;gap:12px;border-top:1px solid #dcd7ae;margin-top:10px;padding-top:9px;font-size:13px}
#result .receipt-stats span {min-width:0;overflow-wrap:anywhere}
#result .receipt-stats b {font-size:17px}
#result .support-breakdown h3 {font-size:17px;margin:0 0 4px}
#result .support-breakdown ul {list-style:none;margin:0;padding:0}
#result .support-breakdown li {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 4px;border-bottom:1px solid #bdcd99;font-size:14px}
#result .receipt-partner {display:flex;flex-direction:column;gap:4px;min-width:0}
#result .receipt-partner small {font-size:12px;font-weight:400}
#result .support-breakdown li>strong {text-align:right;overflow-wrap:anywhere;max-width:60%}
#result .support-note {font-size:12px;line-height:1.7;margin:10px 0;color:#52674d}
#result .res-award {margin:16px 0 12px;background:#edf0ce;padding:14px 16px}
#result .res-record {font-size:11px;text-align:center;overflow-wrap:anywhere}
#result .res-footer {flex-shrink:0;position:relative;padding:0 24px 16px;background:#42633e;color:#fff7dc}
.scroll-cue {padding:7px 4px;font-size:11px;line-height:1.3;text-align:center;color:#e1e8bd;min-height:28px}
.scroll-cue.has-more {color:#fff4c9}
#result .res-actions {display:grid;grid-template-columns:1fr 1.65fr;gap:14px}
#result .res-actions button,.support-board .board-actions button {min-height:48px;padding:10px 15px;border:1px solid #a7ba86;border-radius:16px;background:transparent;color:#fff8dd;font-size:16px;font-weight:800;line-height:1.3;white-space:normal}
#result .res-actions .paper-primary,.support-board .board-actions .paper-primary {border:0;background:#f5cc51;color:#4b3919;border-radius:12px 24px 24px 12px}
#result button:focus-visible,.support-board button:focus-visible,#resScroll:focus-visible {outline:3px solid #e48142;outline-offset:-4px}
#resPick {display:block;margin:12px auto 0}
#resPick[hidden] {display:none}
@media(max-width:600px) {
 #result {padding:9px}
 #resCard {border-radius:23px}
 .res-header {padding:8px 14px 2px;gap:10px}
 .res-header img {width:103px;height:35px}
 #resRound {font-size:11px}
 #resCard .ui-close {width:34px;height:34px;min-height:34px;flex-basis:34px;font-size:25px}
 #result .res-scene {padding:8px 16px 10px}
 #result .cut-title {font-size:29px;margin-bottom:24px}
 #result .podium {gap:11px}
 #result .who {height:69px}
 #result .who>img,#result .who>.portrait {width:68px;height:68px}
 #result .p1 .who {height:83px}
 #result .p1 .who>img,#result .p1 .who>.portrait {width:80px;height:80px}
 #result .mound {height:36px;font-size:23px}
 #result .p1 .mound {height:48px}
 #result .p3 .mound {height:28px}
 #result .nm {font-size:12px}
 #result .tm {font-size:11px}
 #result .podium-label {min-height:39px;padding-top:6px}
 #result .res-others {padding:10px 10px 12px;gap:5px}
 #result .other-portrait>img,#result .other-portrait>.portrait {width:48px;height:48px}
 #result .res-others .nm {font-size:9px;letter-spacing:-.7px}
 #result .res-others .tm {font-size:10px}
 #result .res-body {padding:12px 14px 16px}
 #result #supportReceipt {padding:12px 12px;margin-bottom:16px}
 #result #supportReceipt h3 {font-size:18px}
 #result #supportReceipt h3 strong {font-size:25px}
 #result .receipt-stats {font-size:11px;gap:8px;margin-top:7px;padding-top:7px}
 #result .receipt-stats b {font-size:15px}
 #result .res-footer {padding:0 14px 12px}
 #result .res-actions {gap:10px}
 #result .res-actions button {font-size:14px;padding:9px 8px;min-height:44px}
}
@media(max-height:700px) {
 #result .cut-title {font-size:26px;margin-bottom:22px}
 #result .res-scene {padding-top:4px}
 #result .who {height:56px}
 #result .who>img,#result .who>.portrait {width:55px;height:55px}
 #result .p1 .who {height:65px}
 #result .p1 .who>img,#result .p1 .who>.portrait {width:63px;height:63px}
 #result .p1 .mound {height:37px}
 #result .mound {height:29px}
 #result .p3 .mound {height:24px}
 #result .other-portrait>img,#result .other-portrait>.portrait {width:38px;height:38px}
 #result .res-others {padding-top:8px;padding-bottom:8px}
 #result #supportReceipt {padding:10px}
 #result .res-header {padding-top:6px}
}
/* Bilibili-only leaderboard: separate header, scrollable list, persistent own score. */
.support-board {padding:16px;background:rgba(23,51,41,.55)}
.support-board .support-board-card {display:flex;flex-direction:column;width:620px;max-width:100%;max-height:100%;overflow:hidden;padding:0;border:2px solid #fff5d9;border-radius:28px;background:#eaf0d4;color:#254832;box-shadow:0 20px 65px #15342255}
.board-header {position:relative;flex-shrink:0;padding:20px 26px 16px;background:#f7f3df;border-bottom:1px solid #ccd5ad}
.board-topline {display:flex;align-items:center;justify-content:space-between;gap:20px}
.board-logo {width:126px;height:42px;object-fit:contain}
.support-board h2 {margin:12px 0 8px;font-size:32px;line-height:1.3;letter-spacing:0;font-weight:900;color:#254832}
.support-board .cut-title span {transform:none;color:inherit}
.board-header p {margin:0;font-size:14px;line-height:1.6;color:#3e5744}
.board-scroll {overflow:auto;min-height:100px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#7c9a54 #e0ebb4;padding:12px 22px;-webkit-overflow-scrolling:touch}
#heartBoardStatus {font-size:13px;line-height:1.6;margin:0;overflow-wrap:anywhere}
#heartBoardStatus:not(:empty) {padding:18px 4px}
.support-board table {table-layout:fixed;width:100%;border-collapse:separate;border-spacing:0 7px;margin:0}
.support-board th {border:0;font-size:13px;font-weight:600;color:#435a42;padding:0 10px 5px}
.support-board th:first-child {width:58px}
.support-board th:last-child {width:150px;text-align:right}
.support-board td {height:60px;padding:8px 10px;border:0;border-bottom:1px solid #c6d1ad;font-size:16px}
.support-board td:first-child {text-align:center;font-size:20px;font-weight:900;border-radius:16px 0 0 16px}
.support-board td:last-child {text-align:right;border-radius:0 16px 16px 0;font-size:20px;font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.support-board tr.board-top td {background:#fff4cf;border-bottom:0}
.support-board tr.board-first td {background:#f7d66b}
.support-board tr.board-mine td {box-shadow:inset 0 -2px #729354}
.board-player {display:flex;align-items:center;gap:10px;min-width:0}
.board-avatar {width:34px;height:34px;border-radius:50%;flex:0 0 34px;overflow:hidden;background:#c7d899;position:relative;display:flex;align-items:center;justify-content:center;color:#42633e;font-size:18px}
.board-avatar img {position:absolute;width:100%;height:100%;object-fit:cover;top:0;left:0;background:#c7d899}
.board-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-weight:700}
.board-medal {display:none}
.board-footer {flex-shrink:0;background:#42633e;padding:14px 24px 18px;color:#fff5d9}
#heartBoardMine {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;font-size:14px;overflow-wrap:anywhere}
#heartBoardMine strong {font-size:24px;white-space:nowrap}
#heartLocalBest {margin:6px 0 12px;font-size:13px;line-height:1.6;color:#e0e6c6;overflow-wrap:anywhere}
.board-actions {display:grid;grid-template-columns:1fr 1.6fr;gap:12px}
.support-board button:disabled {opacity:.55;cursor:not-allowed}
@media(max-width:600px) {
 .support-board {padding:10px}
 .support-board .support-board-card {border-radius:23px}
 .board-header {padding:12px 16px}
 .board-logo {width:108px;height:36px}
 .support-board h2 {font-size:27px;margin:7px 0}
 .board-header p {font-size:13px}
 .board-scroll {padding:8px 10px}
 .support-board th:first-child {width:44px;white-space:nowrap}
 .support-board th:last-child {width:112px}
 .support-board th,.support-board td {padding-left:7px;padding-right:7px}
 .support-board td {height:58px;font-size:14px}
 .support-board td:last-child {font-size:18px}
 .support-board .board-wide-scores td:last-child {font-size:14px}
 .board-avatar {width:27px;height:27px;flex-basis:27px;font-size:14px}
 .board-player {gap:6px}
 .board-footer {padding:10px 14px 13px}
 .support-board .board-actions button {font-size:14px;min-height:44px;padding:9px 6px}
 #heartBoardMine strong {font-size:20px}
}
@media(max-height:500px) {
 .board-header {padding:8px 16px}
 .board-topline {float:right;margin-left:10px}
 .board-logo {display:none}
 .support-board h2 {font-size:24px;margin:0 0 4px}
 .board-footer {padding:7px 14px 10px}
 #heartLocalBest {margin:3px 0 6px}
}
/* Keep icon controls legible while hovered/focused (override generic button hover). */
#resCard .ui-close:hover,#resCard .ui-close:focus,.support-board .ui-close:hover,.support-board .ui-close:focus {background:#345331;color:#fff5dc}
/* A pistachio wash keeps pale sheep/bird silhouettes separate from the scenery. */
#result .res-scene {background-image:linear-gradient(rgba(169,204,131,.52),rgba(169,204,131,.12)),url('assets/result-v4/garden.png')}

/* Scores stay exact at the SDK maximum; name truncation never squeezes the score. */
.support-board .board-name {line-height:1.5}
.support-board .board-footer {background:#385a3c}
.support-board .board-actions button:disabled {opacity:1;background:#d7dfc5;color:#506047;border-color:#d7dfc5}
.support-board .board-scroll:focus-visible {outline:2px solid #456b41;outline-offset:-2px}
/* Endless support: the leaderboard occupies the former round-counter position. */
#result .res-header img {margin-right:auto;flex-shrink:0}
#result #resPick {display:block;margin:0;padding:8px 10px;min-height:40px;border:0;border-radius:10px;background:transparent;color:#294b35;font-size:14px;font-weight:800;white-space:nowrap}
#result #resPick[hidden] {display:none}
#result #resPick:hover {background:#e2e9c8}
#result #supportReceipt.large-value h3 strong {font-size:20px}
#result #supportReceipt.large-value .receipt-stats {grid-template-columns:1fr}
#picker #supportBoardOpen {border-left:0}
@media(max-width:600px) {
 #result #resPick {font-size:12px;padding:6px;min-height:36px}
 #result .res-header {gap:8px}
 #result #supportReceipt.large-value h3 strong {font-size:17px}
}
