.fixture {
  --edge: #34404f;
  --muted: #b4c4d5;
  --ice: #b9d9ff;
  --gold: #fae276;
  padding-block: 24px 56px;
}
.fixture-head h1 {font-size:clamp(26px,4vw,43px)}
.fixture-head p {color:var(--brand-muted)}
.fixture-board p,.fixture fieldset p {margin: 8px 0 0; color: var(--muted); line-height: 1.55}
.fixture-layout {display: grid; grid-template-columns: minmax(230px, 280px) minmax(0,1fr);gap: 16px; align-items: start; margin-top: 16px}
.fixture-panel {min-width: 0; padding: clamp(16px,2vw,25px);background: var(--brand-white); border: 1px solid var(--edge); border-radius: 12px}
.fixture h2 {margin: 0; font-size: 21px; line-height: 1.35}
.fixture #settings h2 {padding-bottom: 14px;border-bottom: 1px solid var(--edge)}
.fixture fieldset {min-width:0; margin: 20px 0 0; padding: 0; border: 0}
.fixture legend,.count-line label {font-weight: 700; font-size: 14px}
.fixture legend {margin-bottom: 8px}
.fixture fieldset p,.fixture .board-help {font-size: 13px}
.format-choice {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.format-choice label {position:relative;display:flex;cursor:pointer;min-width:0}
.format-choice input {position:absolute;opacity:0}
.format-choice span {
  flex:1;display:grid;place-items:center;min-height:40px;padding:5px 3px;text-align:center;
  font-size:14px;line-height:1.25;color:var(--muted);background:var(--brand-white);border:1px solid var(--brand-line);border-radius:6px;
}
.format-choice :checked + span {color:var(--brand-ink);background:var(--brand-lavender);border-color:var(--brand-line);box-shadow:inset 0 -2px var(--brand-lavender);font-weight:700}
@media (hover:hover) {
  .format-choice label:hover :not(:checked) + span {background:var(--brand-lavender);border-color:var(--brand-line)}
}
.format-choice :focus-visible + span {outline:2px solid var(--gold);outline-offset:1px}
.count-line {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
.fixture input:not([type=radio]),.fixture select {min-width:0;color:var(--brand-ink);background:var(--brand-white);border:1px solid var(--brand-line);border-radius:6px;padding:8px 10px;font:inherit}
.count-line input {width:72px}
#games-summary {display:block;margin-top:6px;color:var(--muted);font-size:13px;line-height:1.45}
.rest > span {overflow-wrap:anywhere}
.rest small {flex:none}
#team-inputs {display:grid;grid-template-columns:1fr 1fr;gap:7px;max-height:330px;overflow-y:auto;padding:3px}
.seed-field {display:flex;align-items:center;gap:6px}
.seed-field span,.fixture .seed {font:600 11px/1.2 var(--now-font);color:var(--brand-muted)}
.seed-field span {flex:none;white-space:nowrap}
.seed-field input {width:100%}
.fixture button {border:1px solid var(--brand-line);border-radius:7px;background:var(--brand-cloud);padding:8px 12px;color:var(--brand-ink);cursor:pointer;font:inherit}
.fixture button:hover:enabled {border-color:var(--brand-lavender);background:var(--brand-mist)}
.fixture button:disabled {opacity:.45;cursor:default}
.fixture .generate {margin-top:17px;width:100%;min-height:42px;background:var(--ice);color:var(--brand-ink);font-weight:800;border-color:var(--brand-lavender)}
.fixture .generate:hover:enabled {background:var(--brand-lavender)}
.fixture #board-message:empty {display:none}
.board-head {display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.fixture #metrics {color:var(--ice);font-size:14px;font-variant-numeric:tabular-nums}
.board-head button {flex:none;font-size:13px}
.fixture .board-help {margin:15px 0;border-top:1px solid var(--edge);padding-top:12px}
#round-tools {display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:14px 0}
#round-progress {margin-inline-start:4px;color:var(--muted);font-variant-numeric:tabular-nums}
#round-tools button {width:39px;font:22px/1.1 var(--now-font)}
.league-games {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,195px),1fr));gap:12px}
.game {min-width:0;border:1px solid var(--brand-line);border-radius:8px;overflow:hidden;background:var(--brand-white)}
.league-games>.game {border-top:2px solid var(--brand-line)}
.game>.match-id {display:block;padding:7px 11px 4px;font:600 10px/1 var(--now-font);letter-spacing:.08em;color:var(--brand-muted)}
.fixture .team-line {width:100%;display:flex;align-items:center;gap:9px;min-height:37px;margin:0;text-align:start;padding:7px 10px;font-size:14px;line-height:1.35;background:transparent;color:var(--brand-ink);border:0;border-radius:0}
.team-line + .team-line {border-top:1px solid var(--brand-line)}
.fixture .team-line[aria-pressed=true] {color:var(--tone-gold);background:var(--brand-lavender)}
.fixture .team-line:focus-visible {outline-offset:-3px}
.team-name {overflow-wrap:anywhere}
.win {margin-inline-start:auto;font-size:11px;font-weight:800;color:var(--gold)}
.fixture .unknown,.rest {color:var(--brand-muted);font-size:12px}
.rest {display:flex;gap:10px;grid-column:1/-1;align-items:center}
.rest small {border:1px dashed var(--brand-line);border-radius:4px;padding:3px 7px}
#standings {margin-top:18px;border-top:1px solid var(--edge);padding-top:15px}
#copy-text {width:100%;margin-top:8px;padding:8px;background:var(--brand-white);color:var(--brand-ink)}
#standings summary {cursor:pointer;font-size:14px;font-weight:700;color:var(--ice)}
#standings table {width:100%;margin-top:10px;border-collapse:collapse;font-variant-numeric:tabular-nums}
#standings :is(td,th) {text-align:right;padding:5px 8px;border-bottom:1px solid var(--brand-line)}
#standings :is(td,th):first-child {text-align:start}
.bracket-scroll {overflow:auto;overscroll-behavior-inline:contain;padding-bottom:12px;scrollbar-color:var(--brand-lavender) var(--brand-lavender)}
.tree {display:flex;gap:24px;min-width:max-content}
.tree-round {display:flex;flex-direction:column;width:clamp(150px,17vw,205px);min-width:0}
.tree-round h3 {margin:0 0 9px;color:var(--ice);font-size:14px}
.tree-round:last-child h3 {color:var(--gold)}
.tree-games {display:flex;flex:1;flex-direction:column}
.branch {position:relative;flex:1;display:flex;align-items:center;padding:6px 0}
.branch .game {width:100%}
.tree-round:not(:first-child) .branch::before,.tree-round:not(:last-child) .branch::after {content:'';position:absolute;width:12px;border-color:var(--brand-line);border-style:solid;pointer-events:none}
.tree-round:not(:first-child) .branch::before {right:100%;top:50%;border-width:1px 0 0}
.tree-round:not(:last-child) .branch::after {left:100%;height:50%;box-sizing:border-box}
.tree-round:not(:last-child) .branch:nth-child(odd)::after {top:50%;border-width:1px 1px 0 0}
.tree-round:not(:last-child) .branch:nth-child(even)::after {bottom:50%;border-width:0 1px 1px 0}
#champion {display:flex;align-items:baseline;gap:14px;margin-top:12px;padding:12px 16px;background:var(--brand-cloud);border-inline-start:3px solid var(--gold)}
#champion strong {font-size:13px;color:var(--gold)}
@media(max-width:780px) {
  .fixture-layout {grid-template-columns:1fr}
  #team-inputs {grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr));max-height:220px}
}

.fixture [hidden] { display:none }
#qualification { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:14px }
#qualification p { margin:0; font-size:14px }
#records .qualified { color:var(--gold); font-size:11px; margin-inline-start:6px }
@media(max-width:480px) {
  #standings :is(td,th) { padding:5px 3px; font-size:13px }
}

.format-explanation{display:flex;align-items:center;gap:10px}.format-explanation img{flex:none;width:clamp(35px,8vw,52px);object-fit:contain}.format-explanation p{min-width:0}

.fixture-files{display:flex;flex-wrap:wrap;gap:5px}.board-head{flex-wrap:wrap}.fixture-files button{white-space:nowrap}

.fixture.wrap {max-width:1480px;width:min(96%,1480px)}
@media(min-width:601px){.fixture .fixture-head{--scene-width:clamp(219px,28.5vw,303px)}}
.fixture-panel {background:var(--brand-white);border-color:var(--brand-line)}
.fixture-layout {grid-template-columns:minmax(230px,275px) minmax(0,1fr);gap:18px}
#settings-panel {background:var(--brand-white)}
#settings-panel>summary {font-size:19px;font-weight:700;cursor:pointer}
#settings-panel[open]>summary {padding-bottom:12px;border-bottom:1px solid var(--edge)}
.fixture #board-title {font-size:clamp(22px,2.3vw,32px);overflow-wrap:anywhere;letter-spacing:-.035em}
.poster-controls {margin:16px 0 10px;max-width:640px}
#board-progress {display:block;width:100%;height:3px;margin-top:12px;border:0;background:var(--brand-cloud);accent-color:var(--brand-focus);appearance:none}
#board-progress::-webkit-progress-bar {background:var(--brand-cloud)}
#board-progress::-webkit-progress-value {background:var(--brand-cream)}
#board-progress::-moz-progress-bar {background:var(--brand-cream)}
.poster-controls label {display:block;margin-bottom:6px;font-size:13px;font-weight:700;color:var(--brand-ink)}
.title-actions {display:flex;gap:8px}
.fixture #poster-title {width:100%;min-width:0;background:var(--brand-white)}
.fixture #download,.fixture #image-link {flex:none;background:var(--brand-cream);color:var(--brand-ink);border:1px solid var(--brand-lavender);font-weight:800;text-decoration:none;border-radius:7px;padding:9px 16px}
.fixture #download:hover:enabled,.fixture #image-link:hover {background:var(--brand-cream)}
.fixture-files {margin-top:19px;border-top:1px solid var(--edge);padding-top:14px;gap:8px}
.fixture-files button {background:var(--brand-cloud);font-size:13px}
.tree-round {width:clamp(150px,15vw,215px)}
.format-choice span {gap:3px;align-content:center;min-height:76px;padding:6px 2px}
.format-choice span::before,.tree-round h3::before,.game>.match-id::before,#champion::before {
  content:"";display:inline-block;flex:none;width:var(--stamp,19px);height:var(--stamp,19px);
  background-image:url(bracket-stickers.webp);background-repeat:no-repeat;background-size:300% 200%;
  background-position:var(--col,0%) var(--row,100%);
}
.format-choice span::before {--row:0%;--stamp:39px}
.format-choice [value=points]+span::before {--col:50%}
.format-choice [value=knockout]+span::before {--col:100%}
.tree-round h3 {display:flex;align-items:center;gap:7px;padding:2px}
.tree-round:last-child h3::before,#champion::before {--col:50%}
.game {background:linear-gradient(115deg,var(--brand-mist),var(--brand-cloud));border-color:var(--brand-line);box-shadow:0 3px 8px #4a395255}
.game>.match-id {display:flex;align-items:center;gap:5px;padding:5px 10px;background:var(--brand-white);color:var(--brand-ink);font-size:12px;letter-spacing:0}
.game>.match-id::before {--col:100%;--stamp:15px}
.fixture .seed {color:var(--brand-muted);font-variant-numeric:tabular-nums}
.fixture .team-line {min-height:38px}
.fixture .team-line[aria-pressed=true] {color:var(--tone-gold);background:var(--brand-lavender);box-shadow:inset 3px 0 var(--brand-lavender)}
.loss,.win {margin-inline-start:auto;flex:none;border-radius:4px;padding:2px 5px;font-weight:700;font-size:11px}
.loss {color:var(--brand-muted);background:var(--brand-cloud)}.win {color:var(--tone-gold);background:var(--brand-cloud)}
.tree-round:not(:last-child) .branch:has(.win)::after {border-color:var(--brand-line)}
#champion {color:var(--tone-gold);border-color:var(--brand-lavender);background:linear-gradient(90deg,var(--brand-mist),var(--brand-cloud));border-radius:4px;overflow-wrap:anywhere}
#champion::before {--stamp:26px;align-self:center}
.fixture dialog {width:min(94vw,1100px);max-height:92dvh;box-sizing:border-box;border:1px solid var(--brand-line);border-radius:12px;background:var(--brand-white);color:var(--brand-ink);padding:16px}
.fixture dialog::backdrop {background:#040911dd}
.fixture dialog header {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.fixture dialog h2 {overflow-wrap:anywhere}.fixture dialog header form {flex:none}
.poster-view {overflow:auto;max-height:65dvh;background:var(--brand-white);border:1px solid var(--brand-line)}
.poster-view img {display:block;height:auto;width:100%}
.fixture #image-link {display:inline-block;margin-top:12px}
@media(max-width:870px){.fixture-layout{grid-template-columns:1fr}}
@media(max-width:560px){
  .fixture.wrap{width:94%}.fixture-panel{padding:14px}.tree-round{width:156px}
  .fixture #download{padding-inline:12px}
}
