@font-face{font-family:Court;src:url('ui/nunito.ttf') format('truetype');font-display:swap}
#leaderboard{position:fixed;inset:auto;margin:0;left:var(--wall-left,10vw);top:var(--wall-top,10vh);width:var(--wall-width,80vw);height:var(--wall-height,80vh);max-width:none;max-height:none;color:#eaf5f3;background:transparent;border:0;border-radius:0;padding:20px;box-shadow:none;font:16px Court,Arial,sans-serif;letter-spacing:0;overflow:hidden;opacity:0;visibility:hidden;transition:opacity .16s ease}
#leaderboard[open]{display:flex;flex-direction:column}#leaderboard.is-arrived{opacity:1;visibility:visible}
#leaderboard::backdrop{background:transparent}
#leaderboard header{display:grid;grid-template-columns:40px 1fr 40px;gap:10px;align-items:center;flex-shrink:0;margin-bottom:8px}
#leaderboard h2{font-size:26px;line-height:1.1;margin:0;font-weight:900}
#leaderboard button{font:800 14px Court,Arial,sans-serif;cursor:pointer;color:#eaf5f3;background:#285764;border:1px solid #70a7b8;border-radius:6px;padding:8px 12px;min-height:38px;letter-spacing:0}
#leaderboard button:disabled{opacity:.55;cursor:default}
#leaderboard button:focus-visible,#leaderboard input:focus-visible,#leaderboard select:focus-visible,.board-table:focus-visible{outline:3px solid #f1ca83;outline-offset:2px}
#leaderboard .board-back,#leaderboard .board-refresh{width:40px;height:40px;padding:3px;background:none;border:0}
#leaderboard .board-refresh{font-size:30px;line-height:1}
#leaderboard .board-back img{width:100%;height:100%;object-fit:contain}
#score-form{border-bottom:1px solid #57797b;padding-bottom:10px;margin-bottom:0;flex-shrink:0}
#score-form[hidden]{display:none}
#leaderboard h3{font-size:17px;margin:0;font-weight:800}
.submit-heading{display:flex;gap:20px;align-items:baseline;justify-content:space-between;margin-bottom:6px}
#submit-points{font-size:26px;line-height:1;color:#f1ca83;font-variant-numeric:tabular-nums}
.submit-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}
.submit-fields button{grid-column:1/-1}
#score-form label{display:block;font-size:13px;color:#b5d2d6;min-width:0}
#score-form .optional{font-size:11px}
#score-name,#score-flag,#flag-category{width:100%;min-width:0;color:#16383c;background:#f0f8f7;border:1px solid #90b3b6;border-radius:4px;padding:7px 9px;font:15px Court,Arial,sans-serif;min-height:37px}
.flag-picker{min-width:0}.flag-field{display:flex;align-items:center;gap:7px;margin-top:6px}.flag-field[hidden]{display:none}
.submit-fields{align-items:start}
#selected-flag,.player-flag{width:26px;height:20px;object-fit:contain;flex-shrink:0}
#selected-flag.is-logo,.player-flag.is-logo{background:#fff;border-radius:3px;padding:2px;box-sizing:content-box}
#selected-flag[hidden]{display:none}
#leaderboard .board-privacy{font-size:12px;color:#afc9cc;margin:5px 0 0}
#board-notice{min-height:0;line-height:1.3;margin:4px 0;color:#b8e6d9;font-size:13px;flex-shrink:0}
#board-notice:empty{margin:0}#board-notice.board-error{color:#ffc6af}
.board-tabs{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px;flex-shrink:0;margin:10px 0 8px;border-bottom:1px solid #57797b;padding-bottom:8px}
#leaderboard .board-tabs button{padding:8px 4px;font-size:14px;background:transparent;border-color:transparent}
#leaderboard .board-tabs button[aria-selected="true"]{color:#142e32;background:#d4b780;border-color:#f1ca83}
.leaderboard-panels{display:flex;flex:1;min-height:0}
.leaderboard-panels section{display:flex;flex-direction:column;min-height:0;min-width:0;flex:1}
.leaderboard-panels section[hidden]{display:none}
.board-period{font-size:12px;color:#a8c2c2;margin:2px 0 7px;line-height:1.2;min-height:15px}
.board-mine{color:#f1ca83;font-size:12px;margin:0 0 6px;min-height:17px}
.board-mine[hidden]{display:block;visibility:hidden}
.board-table{width:100%;overflow:auto;min-height:0;flex:1;scrollbar-color:#779d9f #142e32;scrollbar-width:thin}
#leaderboard table{border-collapse:collapse;width:100%;table-layout:fixed;font-variant-numeric:tabular-nums}
#leaderboard th{text-align:left;color:#9cbdc3;font-size:12px;font-weight:700;border-bottom:1px solid #567679;padding:7px 6px;position:sticky;top:0;background:#142e32;z-index:1}
#leaderboard td{padding:8px 6px;border-bottom:1px solid #416066;overflow-wrap:anywhere;font-size:14px}
#leaderboard th:first-child{width:42px}#leaderboard th:last-child{width:64px}
#leaderboard td:last-child,#leaderboard th:last-child{text-align:right}
#leaderboard td:last-child{font-weight:900;color:#d9f2ff}
.player-name{display:flex;align-items:center;gap:7px}.player-name span{min-width:0;overflow-wrap:anywhere}
#leaderboard .is-you{background:#245058}
#leaderboard td.board-empty{text-align:center;color:#aac8ca;padding:30px 8px;font-weight:400}
@media(max-width:700px),(max-height:600px){#leaderboard{left:14px;top:14px;width:min(440px,calc(100vw - 28px));height:calc(100dvh - 28px);transform:translateX(-50%);margin-left:calc(50vw - 14px);padding:14px;background:#142e32;border:3px solid #839792;border-radius:5px;box-shadow:0 0 0 4px #3f5357,5px 8px 18px #06131270}#leaderboard h2{font-size:23px}.submit-fields button{min-height:34px}}
@media(max-height:600px){#leaderboard{overflow:auto}.leaderboard-panels{flex:none;min-height:160px}.board-table{max-height:220px}}
@media(prefers-reduced-motion:reduce){#leaderboard{transition:none}}
.ghost-reduced-motion #leaderboard{transition:none}
.ghost-large-text #leaderboard{overflow:auto}
.ghost-large-text #leaderboard button,.ghost-large-text #leaderboard .board-tabs button,.ghost-large-text #leaderboard td{font-size:17px}
.ghost-large-text #leaderboard h3{font-size:20px}
.ghost-large-text #score-form label,.ghost-large-text #board-notice{font-size:16px}
.ghost-large-text #score-form .optional,.ghost-large-text #leaderboard .board-privacy,.ghost-large-text .board-period,.ghost-large-text .board-mine,.ghost-large-text #leaderboard th{font-size:15px}
.ghost-large-text #score-name,.ghost-large-text #score-flag,.ghost-large-text #flag-category{font-size:18px}
.ghost-large-text .leaderboard-panels{flex:1 0 190px}
.court-filter{display:flex;align-items:center;gap:12px;font-size:13px;margin-top:6px;flex-shrink:0;color:#afc9cc}
#board-court{flex:1;min-width:0;min-height:38px;background:#203f44;color:#eaf5f3;border:1px solid #57797b;border-radius:4px;padding:6px 8px;font:15px Court,Arial,sans-serif}
.ghost-large-text #board-court{font-size:18px}
