/* Teams: a compact catalogue, focused roster and two small editors. */
.manage-team { max-width: 1180px; width: 100%; margin: 0 auto; }
.team-catalog { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.team-catalog > h1 { margin: 0 0 20px; }
.mt-team-row { display: flex; align-items: center; gap: 18px; padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.mt-team-row:last-child { margin-bottom: 0; }
.mt-team-row.own-team { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand-ink) 30%, var(--line)); }
.mt-team-badge { display: inline-flex; flex: 0 0 66px; align-items: center; justify-content: center; width: 66px; height: 66px; overflow: hidden; border-radius: 14px; background: color-mix(in srgb, var(--recording-color, var(--brand-ink)) 18%, var(--surface)); color: var(--recording-color, var(--brand-ink)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--recording-color, var(--brand-ink)) 45%, transparent); font: 700 20px var(--font-display); }
.mt-team-badge img { width: 100%; height: 100%; object-fit: contain; }
.mt-team-copy { flex: 1; min-width: 0; }
.mt-team-copy > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-team-copy strong { font: 700 20px var(--font-display); overflow-wrap: anywhere; }
.mt-team-copy small { display: block; margin-top: 5px; color: var(--ink-muted); font: 14px var(--font-body); }
.mt-primary { padding: 3px 9px; border-radius: 30px; background: color-mix(in srgb, var(--ink) 8%, transparent); font: 600 13px var(--font-body); }
.mt-team-actions { display: flex; gap: 12px; }
.mt-team-actions .btn { padding: 8px; min-width: 36px; }
.mt-team-actions svg { width: 21px; height: 21px; }
.mt-other-heading { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 16px; gap: 10px; }
.mt-other-heading h2 { margin: 0; font: 700 18px var(--font-display); }
.team-catalog #teamSearch { width: min(100%, 385px); height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 30px; background: transparent; color: var(--ink); font: 14px var(--font-body); margin-bottom: 4px; }
.mt-back { align-self: flex-start; padding-left: 0; margin-bottom: 18px; }
.mt-roster-head { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }
.mt-roster-head .mt-team-badge { width: 110px; height: 100px; flex-basis: 110px; font-size: 32px; }
.mt-roster-head h1 { font: 700 32px var(--font-display); margin: 0 0 6px; }
.mt-roster-head p { margin: 0; color: var(--ink-muted); }
.mt-roster-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mt-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mt-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mt-card.is-starter { border-color: color-mix(in srgb, var(--brand-ink) 60%, var(--line)); }
.mt-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-card .mt-card-avatar { width: 42px; height: 42px; flex: 0 0 42px; font-size: 14px; }
.mt-card-jersey { font: 700 27px var(--font-display); }
.mt-card-name { margin: 0; font: 600 16px var(--font-display); overflow-wrap: anywhere; }
.mt-card-chips { display: flex; gap: 4px; min-height: 23px; }
.mt-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.mt-card-actions .btn { padding: 2px 4px; font-size: 12px; }
.starter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-muted); font: 12px var(--font-body); }
.starter-chip.is-starter { background: var(--brand-tint); color: var(--brand-ink); border-color: var(--brand-ink); }
.starter-chip.is-starter svg { fill: currentColor; }
.mt-editor-kicker { text-transform: uppercase; color: var(--ink-muted); font-size: 11px; margin: 0 0 4px; }
.modal-box:has(.team-editor) { width: min(640px, calc(100vw - 32px)); }
.team-editor h3 { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.mt-logo-section { padding: 6px 0; margin-bottom: 20px; }
.mt-logo-section > label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.mt-logo-controls { display: flex; gap: 12px; align-items: center; }
.mt-logo-controls > div { flex: 1; display: grid; gap: 4px; }
.mt-logo-controls .mt-team-badge { width: 76px; height: 76px; font-size: 30px; }
.mt-logo-controls .btn { width: 100%; }
.mt-edit-field { display: grid; gap: 8px; margin-bottom: 18px; color: var(--ink-muted); font: 14px var(--font-body); }
.modal-box .team-editor .mt-edit-field input, .team-editor .mt-edit-field select { border-radius: 30px; height: 42px; }
.mt-color-field { border: 0; padding: 0; margin: 0 0 20px; }
.mt-color-field legend { color: var(--ink-muted); font: 14px var(--font-body); margin-bottom: 10px; }
.mt-color-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.mt-color-swatch { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; cursor: pointer; }
.mt-color-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.mt-color-swatch span:not(.sr-only) { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); transition: transform .12s ease, box-shadow .12s ease; }
.mt-color-swatch:hover span:not(.sr-only) { transform: scale(1.1); }
.mt-color-swatch input:checked + span:not(.sr-only) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch); }
.mt-color-swatch input:focus-visible + span:not(.sr-only) { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
.team-color-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.team-color-swatch { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.team-color-swatch::before { content: ""; display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--swatch-color); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); transition: transform .12s ease, box-shadow .12s ease; }
.team-color-swatch:hover::before { transform: scale(1.1); }
.team-color-swatch[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch-color); }
.team-color-swatch:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
.mt-edit-field input, .mt-edit-field select { width: 100%; }
.team-editor .modal-actions { border-top: 1px solid var(--line); padding-top: 20px; }
.modal:has(.mt-player-editor) { justify-content: flex-end; align-items: stretch; padding: 24px; background: transparent; backdrop-filter: none; pointer-events: none; }
.modal-box:has(.mt-player-editor) { pointer-events: auto; width: 360px; max-height: calc(100dvh - 48px); display: flex; }
.mt-player-editor { width: 100%; display: flex; flex-direction: column; }
.mt-player-editor .modal-actions { margin-top: auto; padding-top: 24px; display: flex; }
.mt-player-editor .modal-actions .btn { flex: 1; }
.mt-player-summary { display: flex; gap: 20px; align-items: center; margin: 12px 0 24px; }
.mt-player-summary > div { display: grid; gap: 5px; }
.mt-player-summary strong { font: 700 28px var(--font-display); }
.mt-photo-pick { position: relative; }
.mt-photo-pick .preview { width: 64px; height: 64px; }
.mt-segment { display: flex; gap: 8px; }
.mt-segment button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); color: var(--ink); cursor: pointer; font: 14px var(--font-body); }
.mt-segment button[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand-ink); color: var(--brand-ink); }
.mt-player-remove { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 20px; }
.mt-player-remove .btn { color: var(--danger); padding-left: 0; }
.mt-player-remove p { margin: 0 0 0 26px; color: var(--ink-muted); font-size: 12px; }
body:has(.mt-player-editor) .mt-roster-view { width: calc(100% - 380px); margin-left: 0; margin-right: 0; }
@media (max-width: 1199px) { body:has(.mt-player-editor) .mt-roster-view { width: 100%; } .modal:has(.mt-player-editor) { background: color-mix(in srgb, var(--sunken) 55%, transparent); pointer-events: auto; } }
@media (max-width: 560px) { .team-catalog { padding: 14px; } .mt-team-row { padding: 12px; gap: 10px; } .mt-team-badge { width: 44px; height: 44px; flex-basis: 44px; font-size: 16px; } .mt-team-copy strong { font-size: 17px; } .mt-team-actions { gap: 2px; } .mt-team-actions .btn { min-width: 30px; padding: 5px; } .mt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mt-roster-head { gap: 12px; flex-wrap: wrap; } .mt-roster-head .mt-team-badge { width: 68px; height: 68px; flex-basis: 68px; } .mt-roster-head h1 { font-size: 26px; } .modal:has(.mt-player-editor) { padding: 12px; } .modal-box:has(.mt-player-editor) { width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); } }
/* League (Edit Team): a closed control showing the league name, opening to
   two-line options inside the dialog. Touch targets are at least 44px and
   the list stays in the dialog's scroll, so Save and Cancel stay reachable. */
.mt-league-field { position: relative; }
.mt-league-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 14px 8px 18px; border: 1px solid var(--control-border); border-radius: 30px; background: var(--sunken); color: var(--ink); font: 16px var(--font-body); text-align: left; }
.mt-league-control[aria-expanded="true"] { border-color: var(--ink-muted); }
.mt-league-control[aria-expanded="true"] svg { transform: rotate(180deg); }
.mt-league-control:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mt-league-control .is-placeholder { color: var(--ink-subtle); }
.mt-league-control:disabled { cursor: not-allowed; opacity: 0.7; }
.mt-league-control:disabled svg { visibility: hidden; }
.mt-league-confirm { color: var(--warning, var(--ink)); font-weight: 600; }
.mt-league-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--raised); overflow: auto; max-height: min(360px, 50dvh); overscroll-behavior: contain; }
.mt-league-list:focus { outline: none; }
.mt-league-list:focus-visible .mt-league-option.is-active { outline: 2px solid var(--focus); outline-offset: -2px; }
.mt-league-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 16px 10px 24px; border-top: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.mt-league-option:first-child { border-top: 0; }
.mt-league-option:hover, .mt-league-option.is-active { background: var(--hover); }
.mt-league-option[aria-selected="true"] { background: var(--brand-tint); }
.mt-league-copy { display: grid; gap: 2px; min-width: 0; }
.mt-league-copy strong { font: 600 16px/1.25 var(--font-body); }
.mt-league-copy small { color: var(--ink-muted); font: 15px/1.3 var(--font-body); }
.mt-league-check { display: inline-flex; color: var(--brand-ink); visibility: hidden; }
.mt-league-option[aria-selected="true"] .mt-league-check { visibility: visible; }
