.league-team {
  --league-rule: #dbdcd2;
  --league-ink: #23251e;
  --league-muted: #636558;
  container: league / inline-size;
  min-width: 0;
  margin-top: clamp(15px, 2vh, 23px);
  padding: 15px 16px 13px;
  border: 1px solid var(--league-rule);
  border-radius: 13px;
  background: #fff;
  color: var(--league-ink);
}

.league-team[hidden], .league-team [hidden] { display: none !important; }
.league-head, .league-modes, .league-foot, .league-controls, .league-confirm {
  display: flex;
  align-items: center;
}
.league-head { gap: 10px; flex-wrap: wrap; }
.league-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  color: #ffd05a;
  background: #25271f;
}
.league-mark svg { width: 25px; height: 25px; }
.league-title { flex: 1 1 auto; min-width: 0; }
.league-title span {
  display: block;
  margin-bottom: 2px;
  color: var(--league-muted);
  font-size: 9.5px;
  font-weight: 740;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.league-title h2 {
  margin: 0;
  font-size: clamp(21px, 1.9vw, 28px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.league-modes {
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid #dedfd5;
  border-radius: 9px;
  background: #f3f3ed;
}
.league-modes label { position: relative; display: block; cursor: pointer; }
.league-modes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.league-modes span {
  display: grid;
  min-width: 53px;
  min-height: 30px;
  padding: 4px 11px;
  place-items: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 680;
  color: #606254;
}
.league-modes input:checked + span { color: #fff; background: var(--league-ink); }
.league-modes input:disabled { cursor: default; }
.league-team button:focus-visible, .league-modes input:focus-visible + span {
  outline: 3px solid #a87407;
  outline-offset: 2px;
}

.league-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 14px 0 10px;
  padding: 0;
  list-style: none;
}
.league-roster li { min-width: 0; }
.league-seat {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 25px auto auto;
  align-content: start;
  align-items: center;
  gap: 3px 5px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 89px;
  padding: 8px 10px;
  border: 1px dashed #c4c6b8;
  border-radius: 9px;
  background: #f8f9f4;
  color: #24271e;
  text-align: left;
}
.league-seat.is-occupied { border: 1px solid var(--league-rule); background: #fff; }
.league-seat.is-mine { border-color: #c59737; }
.league-seat.is-ready { background: #fff8e4; border-color: #dbbd71; }
.league-role-mark {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e8eadf;
  color: #595f4d;
}
.league-role-mark svg { width: 17px; height: 17px; }
.is-ready .league-role-mark { background: #f6cc65; color: #3e321b; }
.league-role { grid-area: 2 / 1 / 3 / -1; font-size: 15px; font-weight: 740; letter-spacing: -.022em; }
.league-player {
  grid-area: 3 / 1 / 4 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--league-muted);
  font-size: 12px;
  font-weight: 510;
  line-height: 1.3;
}
.league-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-occupied .league-player { color: #30342a; font-weight: 640; }
.league-avatar { width: 20px; height: 20px; object-fit: cover; flex: none; border-radius: 50%; }
.league-readiness {
  grid-area: 4 / 1 / 5 / -1;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--league-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}
.league-readiness::before { content: ""; width: 6px; height: 6px; flex: none; border: 1px solid #868971; border-radius: 50%; }
.is-ready .league-readiness { color: #76530d; }
.is-ready .league-readiness::before { background: #d8a632; border-color: #ac801e; }
.league-add { grid-area: 1 / 2; display: grid; place-items: center; color: #696d5f; }
.league-add svg { width: 15px; height: 15px; }

.league-seat-pick {
  grid-area: 3 / 1 / 4 / -1;
  color: #76530d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.has-champion .league-player { grid-row: 4; }
.has-champion .league-readiness { grid-row: 5; }
.draft-portrait {
  --portrait-size: 32px;
  position: relative;
  display: inline-block;
  flex: none;
  overflow: hidden;
  width: var(--portrait-size);
  height: var(--portrait-size);
  border-radius: 6px;
  background: var(--league-ink);
}
.draft-portrait > span {
  position: absolute;
  inset: 0 auto auto 0;
  width: 48px;
  height: 48px;
  background-repeat: no-repeat;
  transform: scale(.666667);
  transform-origin: top left;
}
.league-role-mark .draft-portrait { --portrait-size: 24px; }
.league-role-mark .draft-portrait > span { transform: scale(.5); }
.league-draft {
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid #dcc999;
  border-radius: 10px;
}
.draft-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  color: #fff;
  background: var(--league-ink);
}
.draft-current { display: flex; }
.draft-heading { flex: 1; min-width: 0; }
.draft-role { color: #ffd366; font-size: 11px; font-weight: 670; }
.draft-heading h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.18; }
.draft-head .league-controls button { border-color: #726b52; color: #fff; background: transparent; }
.draft-head .league-controls button:is(:hover,:focus-visible) { border-color: #ffd366; background: #333429; }
.draft-options { display: grid; gap: 13px; padding: 12px; }
.draft-options > section { min-width: 0; }
.draft-options h4 { margin: 0 0 7px; font-size: 13px; line-height: 1.25; }
.draft-options input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 11px;
  border: 1px solid var(--league-rule);
  border-radius: 7px;
  background: #fafaf7;
  color: var(--league-ink);
  font: inherit;
  font-size: 13px;
}
.draft-options input:focus-visible { outline: 2px solid #a87407; outline-offset: 1px; }
.draft-advice, .draft-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 6px;
}
.draft-results {
  grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
  max-height: 196px;
  overflow-y: auto;
  padding: 3px;
  margin: -3px;
}
.draft-choice {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid var(--league-rule);
  border-radius: 7px;
  background: #fff;
  color: var(--league-ink);
  text-align: left;
}
.draft-with-reason { align-items: flex-start; }
[data-draft-recommended] .draft-choice { border-color: #e3cd99; background: #fff9e8; }
.draft-choice:not(:disabled):is(:hover,:focus-visible) { border-color: #a87919; background: #fff0c5; }
.draft-copy { display: grid; min-width: 0; gap: 3px; line-height: 1.3; overflow-wrap: anywhere; }
.draft-copy strong { font-size: 13px; }
.draft-copy span, .draft-note, .draft-results > p { color: var(--league-muted); font-size: 12px; }
.draft-copy span { font-weight: 450; }
.draft-copy .draft-evidence {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid #dfceaa;
  font-variant-numeric: tabular-nums;
}
.draft-evidence span { color: #564322; font-weight: 620; }
.draft-patch-evidence { row-gap: 5px; }
.draft-patch-evidence b { display: block; color: var(--league-ink); font-size: 12px; }
.draft-source {
  margin: -2px 0 8px;
  color: var(--league-muted);
  font-size: 12px;
  line-height: 1.4;
}
.draft-choice:disabled { background: #f1f2eb; color: #505446; cursor: default; }
.draft-choice.is-chosen { border-color: #cfb46d; }
.draft-note, .draft-results > p { margin: 0; }
.draft-clear {
  justify-self: start;
  min-height: 32px;
  padding: 4px 2px;
  border: 0;
  color: var(--league-muted);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.league-foot, .league-confirm { flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; }
.league-count, .league-question, .league-message { margin: 0; font-size: 12px; line-height: 1.4; }
.league-count { color: var(--league-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.league-controls { flex-wrap: wrap; gap: 6px; }
.league-controls button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--league-rule);
  border-radius: 7px;
  background: #fff;
  color: #41443b;
  font-size: 12px;
  font-weight: 660;
}
.league-controls .league-gold { border-color: #d7a52f; background: #f7c548; color: #312819; }
.league-controls .league-gold[aria-pressed="true"] { border-color: #dad9c9; background: #f4f4ed; color: #514e42; }
.league-confirm { margin-top: 10px; padding: 8px 10px; border: 1px solid #e9d39d; border-radius: 8px; background: #fff8e7; }
.league-message:not(:empty) { margin-top: 7px; color: #79551c; }
.league-team[aria-busy="true"] { cursor: progress; }

@media (hover: hover) {
  button.league-seat:hover { border-color: #aa842e; background: #fff9e8; }
  .league-controls button:hover { background: #f2f3eb; }
  .league-controls .league-gold:hover { background: #ffcf5e; }
}
@container league (max-width: 595px) {
  .league-roster { grid-template-columns: 1fr; gap: 5px; margin-top: 10px; }
  .league-seat {
    grid-template-columns: 27px minmax(61px, .75fr) minmax(50px, 1fr) auto;
    grid-template-rows: auto;
    align-content: center;
    column-gap: 7px;
    min-height: 43px;
    padding: 5px 9px;
  }
  .league-role { grid-area: 1 / 2; font-size: 14px; }
  .league-player { grid-area: 1 / 3; }
  .league-add, .league-readiness { grid-area: 1 / 4; }
  .league-readiness { font-size: 10px; }
  .league-seat.has-champion { row-gap: 2px; }
  .has-champion .league-role-mark { grid-row: 1 / 3; }
  .has-champion .league-player { grid-area: 1 / 3; }
  .has-champion .league-readiness { grid-area: 1 / 4 / 3 / 5; }
  .league-seat-pick { grid-area: 2 / 2 / 3 / 4; }
}
@container league (max-width: 365px) {
  .league-modes { width: 100%; margin-left: 0; }
  .league-modes label { flex: 1; }
  .league-seat { column-gap: 5px; }
  .league-avatar { display: none; }
}
@container league (max-width: 280px) {
  .league-seat { grid-template-columns: 23px minmax(58px, .55fr) minmax(40px, 1fr) auto; }
  .league-readiness::before { display: none; }
  .league-readiness { max-width: 54px; }
}
@media (pointer: coarse) {
  .league-modes span, .league-controls button, .league-seat { min-height: 44px; }
  .draft-options input { min-height: 44px; font-size: 16px; }
  .draft-clear { min-height: 44px; }
}
