@font-face {
  font-family: Score;
  src: url('/assets/score.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #101112;
  --nav: #151617;
  --surface: #18191b;
  --control: #222428;
  --head: #1e2023;
  --hover: #24262b;
  --line: #2f3035;
  --border: #3b3d45;
  --ink: #ececf0;
  --muted: #b0b2bc;
  --soft: #9699a4;
  --accent: #9ac4ff;
  --blue: #2d5b9f;
  --blue-hover: #366cb8;
  --green: #8ad8b2;
  --red: #f2a7a8;
  --gold: #edc77e;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { display: grid; grid-template-columns: 216px minmax(0, 1fr); margin: 0; min-height: 100dvh; background: var(--page); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h2 { font: inherit; font-size: 15px; font-weight: 650; }
h3 { font: inherit; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .47; cursor: not-allowed; }
:is(button, a, input, select, summary, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
[data-icon], .icon { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon { width: 16px; height: 16px; }

.sidebar { position: sticky; top: 0; height: 100dvh; padding: 20px 13px 14px; display: flex; flex-direction: column; overflow: auto; border-right: 1px solid var(--line); background: var(--nav); }
.brand { display: inline-flex; align-items: center; gap: 9px; align-self: start; margin: 1px 7px 0; color: inherit; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; line-height: 1.3; }
.brand small { font-size: 11px; color: var(--muted); }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; color: #fff; border: 1px solid #4677b7; border-radius: 6px; background: var(--blue); }
.brand-mark .icon { width: 18px; height: 18px; }
.desk-menu { margin-top: 29px; }
.sidebar-heading { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 5px 0 8px; color: var(--soft); font-size: 11px; }
.sidebar-heading .icon-button { width: 28px; height: 28px; }
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 35px; padding: 5px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); text-align: left; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item[aria-current='page'] { background: #1c2737; border-color: #2d4261; color: var(--accent); }
.nav-title { overflow-wrap: anywhere; line-height: 1.25; }
.nav-round { margin-left: auto; flex: none; color: var(--soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-tools { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 7px; }
.sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding: 12px 7px 0; border-top: 1px solid var(--line); }
.source-status, .local-note { display: flex; gap: 8px; align-items: center; color: var(--soft); font-size: 11px; }
.source-status::before { content: ''; width: 6px; height: 6px; margin-inline: 4px; border-radius: 50%; background: var(--accent); flex: none; }
.local-note .icon { width: 14px; height: 14px; }
.mobile-desks { display: none; }

.shell { min-width: 0; width: min(1480px, 100%); margin: 0 auto; padding: 24px 24px 36px; }
.page-heading { min-height: 55px; display: flex; align-items: center; gap: 13px; }
.round-mark { display: grid; place-items: center; flex: none; min-width: 54px; height: 54px; padding-inline: 8px; border: 2px solid #538cda;
  border-radius: 28px; color: var(--ink); background: #161d28; font: 700 26px/1 Score, system-ui, sans-serif; }
.profile-copy { min-width: 0; }
.profile-copy h1 { font-size: 28px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.desk-meta { color: var(--soft); margin-top: 4px; overflow-wrap: anywhere; font-size: 12px; }
.page-actions, .section-actions, .form-actions { display: flex; align-items: center; gap: 7px; }
.page-actions { flex: none; margin-left: auto; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 4px 9px; gap: 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--control); color: var(--ink); min-height: 31px; white-space: nowrap; font-size: 12px; }
.icon-button { width: 31px; padding: 0; }
.icon-button.plain { border-color: transparent; background: transparent; color: var(--muted); min-height: 28px; }
.button .icon { width: 14px; height: 14px; }
.button:not(:disabled):hover, .icon-button:not(:disabled):hover { background: var(--hover); }
.button-primary { background: var(--blue); border-color: #3c73b6; color: #fff; }
.button-primary:not(:disabled):hover { background: var(--blue-hover); }
.page-actions :is(.button, .icon-button) { min-height: 37px; }
.page-actions .icon-button { width: 37px; }
#sync-button { min-width: 93px; }
.busy .icon { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy .icon { animation: none; } }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 7px 10px; border-left: 2px solid; color: var(--gold); background: #241f19; overflow-wrap: anywhere; }
.notice.error { color: var(--red); }
.notice.success { color: var(--green); background: #17241f; }
.notice > span { min-width: 0; }
#storage-warning { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sync-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 34px; margin-top: 9px; padding: 6px 10px; border: 1px solid #30435c; border-left: 2px solid var(--accent); color: var(--muted); background: #151e2a; font-size: 11px; }
.sync-state > span { min-width: 0; overflow-wrap: anywhere; }
.sync-state .button { margin-left: auto; flex: none; }
.sync-state.error { border-color: #5c3940; border-left-color: var(--red); color: var(--red); background: #241a1d; }
.sync-state.partial { border-color: #5f5132; border-left-color: var(--gold); color: var(--gold); background: #241f19; }

.section-heading, .section-title { display: flex; align-items: center; gap: 9px; }
.section-heading { justify-content: space-between; }
.section-title { min-width: 0; flex-wrap: wrap; }
.scoreboard {
  margin-top: 19px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background:
    linear-gradient(90deg, #161719 14%, #161719f5 35%, #161719b0 62%, #16171964 100%),
    url('/assets/taego.webp') no-repeat right 53% / min(840px, 100%) auto var(--surface);
}
.board-heading { flex-wrap: wrap; min-height: 63px; padding: 10px 16px; border-bottom: 1px solid #ffffff19; background: #12131548; }
.board-heading .section-actions { margin-left: auto; justify-content: flex-end; }
.board-heading .section-actions, .detail-foot .section-actions { flex-wrap: wrap; }
.board-title h2 { font-size: 17px; }
.board-title p { color: var(--muted); font-size: 11px; margin-top: 2px; }
.score-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.score-slot { min-width: 0; min-height: 121px; padding: 13px 16px; border-right: 1px solid #ffffff19; background: #090a0c24; }
.score-slot:last-child { border-right: 0; }
.score-name { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.score-name b { font-size: 14px; overflow-wrap: anywhere; }
.seat { min-width: 22px; flex: none; padding: 2px 3px; border: 1px solid #41464c; border-radius: 3px; background: #202226; color: #aeb7c0;
  text-align: center; font: 700 13px/15px Score, system-ui, sans-serif; }
.score-value { display: block; margin-top: 4px; font: 700 48px/1 Score, 'Arial Narrow', system-ui, sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.last-score { color: var(--muted); font-size: 11px; }
.last-score b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.vacant .score-name b, .vacant .score-value, .vacant .last-score { color: var(--soft); }
.score-foot { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 5px 12px; min-height: 40px; padding: 7px 16px;
  border-top: 1px solid #ffffff19; background: #12131573; color: var(--muted); font-size: 11px; }
.boss-status { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.boss-status .icon { width: 14px; height: 14px; color: var(--gold); }
.boss-status b { color: var(--gold); overflow-wrap: anywhere; }
.rules-summary { overflow-wrap: anywhere; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); align-items: start; gap: 16px; margin-top: 16px; }
.records, .match-detail { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.panel-heading { min-height: 47px; padding: 7px 13px; border-bottom: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; border-block: 1px solid var(--line); text-align: left; }
.data-table :is(th, td) { padding: 5px 10px; border-bottom: 1px solid var(--line); }
.data-table thead { background: var(--head); color: var(--muted); }
.data-table thead th { font-weight: 500; font-size: 12px; }
.data-table tbody th { font-weight: 550; overflow-wrap: anywhere; }
.data-table tbody .numeric { font-size: 13px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.warn, .win { color: var(--gold); }
.table-toolbar { display: flex; min-height: 36px; align-items: center; padding-inline: 13px; color: var(--soft); font-size: 11px; }
.archived-label { color: var(--muted); }
.tabs { display: flex; align-self: stretch; gap: 14px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 4px 2px; color: var(--muted); white-space: nowrap; font-size: 12px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { color: var(--soft); margin-left: 5px; font: 11px/1 ui-monospace, Consolas, monospace; }
.log-table tbody tr { cursor: pointer; }
.log-table tbody tr:hover, .log-table tbody tr:focus-within { background: var(--hover); }
.log-table tbody tr.selected { background: #1b2739; }
.log-table tr.selected td:first-child { box-shadow: inset 2px 0 #7fb4fa; }
.log-table td:nth-child(2) { font: 700 19px/1 Score, system-ui, sans-serif; }
.log-table .numeric { width: 67px; }
.log-table .match-status { width: 97px; }
.log-table :is(th, td).row-arrow { width: 26px; color: var(--soft); padding-left: 0; text-align: right; line-height: 0; }
.log-table tr.selected .row-arrow { color: var(--accent); }
.row-arrow .icon { width: 14px; height: 14px; }
.rank-total { color: var(--soft); font: 500 11px/1.2 system-ui, sans-serif; }
.state-tag { color: var(--soft); font-size: 11px; white-space: nowrap; }
.log-table .state-tag::before { content: ''; display: inline-block; width: 4px; height: 4px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 2px; }
.state-tag.warn { color: var(--gold); }
.state-tag.good { color: var(--green); }
.map-button { display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 0; border: 0; border-radius: 3px; background: none; color: inherit; text-align: left; max-width: 100%; }
.map-thumb { display: grid; place-items: center; flex: none; width: 36px; height: 36px; overflow: hidden; border: 1px solid var(--border); border-radius: 3px; color: var(--soft); background: var(--control); }
.map-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row-label { display: grid; gap: 1px; line-height: 16px; min-width: 0; }
.row-map { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { color: var(--soft); font-size: 11px; }
.list-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--soft); padding: 9px 13px; font-size: 11px; }
.empty-records { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; min-height: 102px; color: var(--soft); }
.records .empty-records { border-block: 1px solid var(--line); }
.match-detail .empty-records { min-height: 137px; }

dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; }
dialog::backdrop { background: #090a0bbb; }
.dialog-header { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line); padding: 6px 14px; }
.dialog-content { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.dialog-content p { overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: start; }
.field { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 12px; }
.field small { color: var(--soft); font-size: 11px; }
input:not([type='checkbox'], [type='radio']), select, .report-text { width: 100%; min-width: 0; max-width: 100%; min-height: 34px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--ink); background: var(--page); }
.report-text { resize: vertical; font-size: 16px; }
.report-preview { display: grid; place-items: center; aspect-ratio: 720 / 572; border: 1px solid var(--line); background: #141517; color: var(--muted); }
.report-preview img { display: block; width: 100%; height: auto; }
.report-actions .button { min-height: 36px; text-decoration: none; }
.report-status { color: var(--muted); }
.report-status:empty { display: none; }
.check-field { min-height: 29px; display: flex; align-items: center; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
input:is([type='checkbox'], [type='radio']) { flex: none; width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.rule-switch { align-self: end; }
.rules-context { color: var(--muted); }
.form-actions { justify-content: flex-end; flex-wrap: wrap; }
.secondary-action { margin-right: auto; }
.form-error { color: var(--red); font-size: 12px; }
.dialog-subtitle { cursor: pointer; }
.dialog-subtitle + :is(div, p) { margin-top: 7px; }
.dialog-subtitle + p { color: var(--muted); }
.confirm-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.confirm-roster span { padding: 5px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.manager-list { border-top: 1px solid var(--line); }
.manager-row, .history-entry { display: flex; gap: 8px; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 6px 4px; min-height: 40px; background: none; text-align: left; }
.manager-row { justify-content: space-between; }
.manager-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.manager-row small { font-size: 11px; color: var(--soft); display: block; }
.history-entry { width: 100%; }
.history-entry:hover { background: var(--hover); }
.history-entry .icon { order: 1; color: var(--soft); }
.history-entry small { color: var(--muted); margin-left: auto; overflow-wrap: anywhere; }

.match-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 101px; padding: 10px 13px;
  background: #1c252e; }
.taego-banner { background: linear-gradient(90deg, #17191dfb 6%, #17191da3 63%, #17191d30),
  url('/assets/taego.webp') no-repeat right 49% / 100% auto #17191d; }
.match-heading > div { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.match-heading b { color: var(--ink); font-size: 22px; line-height: 1.1; }
.match-heading small, .match-time { color: #c0c3c8; font-size: 11px; }
.match-time { display: inline-flex; gap: 4px; align-items: center; }
.match-time .icon { width: 12px; height: 12px; }
.match-heading > strong { padding: 4px 7px; border: 1px solid #ffffff31; border-radius: 4px; background: #151719e6; font: 700 25px/1 Score, system-ui, sans-serif; }
.detail-table :is(th, td), .form-table :is(th, td) { padding-inline: 8px; }
.detail-table tbody th { max-width: 141px; }
.detail-table tbody :is(th, td) { padding-block: 7px; }
.tail-value { color: var(--accent); font-weight: 650; }
.detail-name { display: block; }
.team-dot { display: inline-block; width: 16px; height: 17px; margin-right: 4px; border: 1px solid #46668e; color: var(--accent); border-radius: 3px; text-align: center; font: 11px/15px ui-monospace, Consolas, monospace; vertical-align: text-bottom; }
.team-dot.team-b { color: var(--gold); border-color: #715f39; }
.rescue-summary { display: flex; flex-wrap: wrap; gap: 3px 9px; color: var(--muted); font-size: 11px; padding: 5px 13px; border-bottom: 1px solid var(--line); }
.rescue-summary span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.rescue-summary .icon { width: 11px; height: 11px; }
.score-breakdown { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #151719; }
.score-breakdown summary { padding: 7px 13px; color: var(--muted); cursor: pointer; font-size: 11px; list-style-position: inside; }
.score-breakdown summary:hover { color: var(--ink); background: var(--hover); }
.score-breakdown ul { display: grid; gap: 4px; margin: 0; padding: 0 13px 9px 27px; color: var(--muted); font-size: 11px; }
.score-breakdown li { padding-left: 2px; overflow-wrap: anywhere; }
.score-breakdown li b { color: var(--ink); font-weight: 600; }
.score-breakdown li span { margin-left: 5px; }
.score-breakdown li strong { font-weight: 700; }
.late-preview { margin: -2px 0 2px; }
.late-preview :is(th, td) { padding-block: 6px; }
.detail-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted);
  min-height: 37px; padding: 8px 13px; font-size: 11px; overflow-wrap: anywhere; }
.form-table { table-layout: fixed; }
.form-table th:first-child { width: 43%; }
.form-table small { display: block; font-size: 11px; color: var(--soft); }
.revive-stack { display: grid; gap: 7px; }
.revive-stack > button { justify-self: start; }
.revive-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 51px 31px; align-items: end; gap: 6px; }
.revive-fields .icon-button { min-height: 34px; }

@media (min-width: 1080px) and (max-width: 1250px) {
  .log-table .sum-damage, .row-mode { display: none; }
}

@media (max-width: 1079px) {
  .workspace-grid { display: block; }
  .match-detail { display: none; }
}

@media (max-width: 860px) {
  body { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); padding: 9px 16px; }
  .brand { margin: 0; }
  .sidebar-foot { grid-column: 2; grid-row: 1; border: 0; margin: 0; padding: 0; gap: 2px; }
  .desk-menu { display: none; }
  .mobile-desks { display: flex; gap: 6px; min-width: 0; }
  .mobile-desks select { max-width: 245px; min-height: 32px; }
  .mobile-desks button { flex: none; }
  .sidebar-tools { display: flex; margin: 0; padding: 0; border: 0; }
  .sidebar-tools .nav-item { min-height: 32px; padding: 4px 5px; gap: 4px; white-space: nowrap; font-size: 11px; }
  .sidebar-tools .icon { width: 13px; height: 13px; }
  .shell { padding: 14px 16px 28px; }
}

@media (max-width: 640px) {
  .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-slot:nth-child(2) { border-right: 0; }
  .score-slot:nth-child(-n+2) { border-bottom: 1px solid #ffffff19; }
  .score-slot { min-height: 95px; padding: 9px 12px; }
  .score-value { font-size: 39px; }
}

@media (max-width: 500px) {
  .sidebar, .shell { padding-inline: 10px; }
  .page-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .profile-copy h1 { font-size: 23px; }
  .round-mark { min-width: 44px; height: 44px; font-size: 22px; }
  .page-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .board-heading { padding: 8px 10px; }
  .board-title h2 { font-size: 15px; }
  .score-foot { padding-inline: 10px; }
  .scoreboard { margin-top: 12px; }
  .log-table .numeric { width: 55px; }
  .log-table .match-status { width: 76px; }
  .log-table :is(th, td).row-arrow { width: 17px; padding-right: 3px; }
  .data-table :is(th, td) { padding-inline: 5px; }
  .log-table .sum-damage, .row-mode { display: none; }
  .map-button { gap: 5px; }
  .detail-table th[scope='row'] { max-width: 106px; }
  .sync-state, .notice { align-items: flex-start; }
  .sync-state .button, .notice .button { margin-left: 0; }
  .score-breakdown li span { display: block; margin: 2px 0 0; }
}

@media (max-width: 350px) {
  .sidebar-tools .nav-item { gap: 3px; padding-inline: 3px; }
  .log-table .rank-total { display: none; }
  .detail-table :is(th, td) { padding-inline: 4px; }
}
