:root {
    color-scheme: light;
    --ink: #182824;
    --accent: #204d43;
    --line: #c9d2cb;
    --paper: #f3f5ee;
    font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 clamp(.75rem, 2.4vw, 2.5rem) 2rem; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; border-bottom: 1px solid var(--line); }
nav a { display: inline-flex; align-items: center; min-height: 3rem; color: var(--accent); text-decoration: none; }
nav a[hidden] { display: none; }
nav a[aria-current] { font-weight: bold; box-shadow: inset 0 -3px var(--accent); }
.toolbar, .title, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.toolbar { align-items: end; justify-content: space-between; padding: 1.4rem 0 .8rem; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -.035em; }
.count { font-variant-numeric: tabular-nums; color: var(--accent); }
button, input { font: inherit; }
button { min-height: 2.8rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: .4rem; background: white; color: var(--ink); cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: bold; }
#import-logs { margin-inline-start: auto; }
.scroll { width: 100%; overflow-x: auto; border-top: .25rem solid var(--accent); }
table { width: 100%; border-collapse: collapse; background: white; font-size: clamp(1rem, 1.8vw, 1.35rem); }
td, th { text-align: left; padding: .75rem clamp(.55rem, 1.4vw, 1.2rem); border-bottom: 1px solid var(--line); }
thead { background: var(--accent); color: white; white-space: nowrap; }
tbody tr:nth-child(even) { background: #f8faf5; }
.standings th { padding: 0; }
.standings th button { width: 100%; text-align: inherit; padding: .75rem clamp(.5rem, 1vw, 1rem); border: 0; border-radius: 0; background: transparent; color: inherit; font-weight: inherit; }
.standings th button:focus-visible { outline: 2px solid white; outline-offset: -4px; }
.standings th button::after { content: ''; display: inline-block; width: .45em; height: .45em; margin-left: .4em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.15em) rotate(45deg); opacity: .35; }
.standings th[aria-sort] button::after { opacity: 1; }
.standings th[aria-sort="ascending"] button::after { transform: rotate(225deg); }
.standings :is(th, td):nth-child(n+4) { text-align: right; font-variant-numeric: tabular-nums; }
.standings .mark-column { width: 1%; padding: .25rem .5rem; text-align: center; }
.mark-column label { display: grid; min-width: 44px; min-height: 44px; place-items: center; cursor: pointer; }
.mark-column input { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.standings .has-conflict td { background: #fff0df; }
.standings .has-conflict td:first-child { box-shadow: inset .28rem 0 #a63c16; }
.division-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: 1.25rem 0 .5rem; }
.division-header h2 { margin: 0; }
.sort-order { font-size: .9rem; color: #485d56; margin: 0 0 .5rem; }
.standings .qualified td { background: #e5f3e9; }
.standings .qualified td:first-child { box-shadow: inset .28rem 0 var(--accent); }
.conflict, .conflict-label { font-size: .88em; color: #85300e; }
.conflict-label { display: block; margin-top: .35rem; }
.conflict summary { cursor: pointer; font-weight: bold; padding: .75rem 0; }
.conflict ul { list-style: none; margin: 0; padding: 0; }
.conflict li + li { margin-top: .4rem; }
.conflict button { max-width: 13rem; text-align: left; }
#match-review { width: min(46rem, 96vw); max-height: 90vh; max-height: 90dvh; overflow: auto; }
.review-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.review-header h2 { margin: 0; }
#review-meta, #review-help, .review-delete span { color: #485d56; overflow-wrap: anywhere; }
#review-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
#review-lanes section { border: 1px solid var(--line); border-radius: .4rem; padding: .7rem; overflow-wrap: anywhere; }
#review-lanes .selected-lane { border-color: var(--accent); background: #f0f7f2; }
#review-lanes h3 { margin: 0 0 .5rem; }
#review-lanes ul { list-style: none; padding: 0; margin: 0; }
#review-lanes li { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem; }
#review-lanes li span { white-space: nowrap; }
#review-form { margin-top: 1rem; }
#review-player { font: inherit; min-height: 2.8rem; width: 100%; }
.review-delete { border-top: 1px solid var(--line); padding-top: .75rem; }
#review-delete, #review-status { color: #85300e; }
@media (max-width: 36rem) { #review-lanes { grid-template-columns: 1fr; } }
.number, .score { font-weight: bold; font-variant-numeric: tabular-nums; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions button + button { margin-left: .4rem; }
.name { overflow-wrap: anywhere; }
.empty { padding: 3rem 1rem; text-align: center; color: #485d56; }
.status { white-space: pre-line; color: var(--accent); }
.status:empty { margin: 0; }
.scoring-warning { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #dcad76; border-inline-start: .3rem solid #975011; border-radius: .4rem; background: #fff3df; color: #663613; }
.scoring-warning h2 { margin: 0; font-size: 1.15rem; }
.scoring-warning p { margin: .4rem 0; }
#scoring-differences { list-style: none; padding: 0; margin: 0; }
.scoring-warning summary { padding: .5rem 0; cursor: pointer; font-weight: bold; overflow-wrap: anywhere; }
.scoring-warning details ul { padding-inline-start: 1.5em; overflow-wrap: anywhere; }
.maintenance { margin-top: 1.25rem; }
.maintenance summary { width: fit-content; cursor: pointer; padding: .65rem 0; }
dialog { width: min(28rem, 94vw); border: 1px solid var(--line); border-radius: .6rem; padding: 1.5rem; color: var(--ink); }
dialog::backdrop { background: #13282180; }
dialog h2 { margin-top: 0; }
dialog label { display: grid; gap: .35rem; margin-bottom: 1rem; font-weight: bold; }
dialog input { width: 100%; padding: .7rem; border: 1px solid #869e93; border-radius: .35rem; }
dialog input:read-only { background: var(--paper); }
dialog .actions { justify-content: end; }
