#main {
    padding-left: 0 !important;
}

#main .mlx-app {
    --mlx-bg-a: #f7fbff;
    --mlx-bg-b: #eef5ff;
    --mlx-card-bg: rgba(255, 255, 255, 0.96);
    --mlx-border: #d4dfeb;
    --mlx-text: #14283a;
    --mlx-content-width: min(100%, 480px);
    --mlx-primary: #115cb8;
    --mlx-primary-dark: #0f4e9d;
    --mlx-shadow: 0 10px 24px rgba(10, 30, 48, 0.08);
    --mlx-pitch-slot-w: clamp(82px, 24vw, 105px);
    --mlx-pitch-slot-h: clamp(52px, 12vw, 62px);
    --mlx-pitch-full-card-w: 105px;
    --mlx-pitch-full-card-h: 70px;
    --mlx-pitch-mid-card-w: 133px;
    --mlx-pitch-mid-card-h: 70px;
    --mlx-bench-bottom-card-w: 133px;
    --mlx-bench-bottom-card-h: 70px;
    font-family: "Trebuchet MS", "Verdana", sans-serif;
    color: var(--mlx-text);
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: 8px 8px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, var(--mlx-bg-a) 0%, var(--mlx-bg-b) 100%);
    border-radius: 0;
    box-sizing: border-box;
}

#main .mlx-app * {
    box-sizing: border-box;
}

#main .mlx-app h1,
#main .mlx-app h2,
#main .mlx-app p {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
}

.mlx-header {
    background: linear-gradient(140deg, #08284b 0%, #0e3f73 58%, #165193 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 10px 20px rgba(10, 35, 62, 0.25);
}

.mlx-kicker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mlx-kicker {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.mlx-desktop-link {
    color: #ffffff;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 3px 10px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.mlx-header h1 {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.05;
    color: #ffffff;
}

.mlx-subline {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.93);
    font-size: 13px;
}

.mlx-message {
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid #cedaea;
    background: #f5f9fe;
    color: #27435e;
    padding: 8px 10px;
    font-size: 12px;
}

.mlx-message.success {
    background: #ecffef;
    border-color: #93d89d;
    color: #1f7233;
}

.mlx-message.error {
    background: #fff0f0;
    border-color: #e2aaaa;
    color: #8a3131;
}

.mlx-message.warn {
    background: #fff8e8;
    border-color: #e8c987;
    color: #78541b;
}

.mlx-toolbar {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

#main .mlx-app.mlx-mobile .mlx-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "clear auto"
        "save save";
}

#main .mlx-app.mlx-mobile .mlx-toolbar #mlx-clear-btn {
    grid-area: clear;
}

#main .mlx-app.mlx-mobile .mlx-toolbar a.mlx-btn {
    grid-area: auto;
}

#main .mlx-app.mlx-mobile .mlx-toolbar #mlx-save-btn {
    grid-area: save;
}

.mlx-btn {
    border: 1px solid #b8c9da;
    border-radius: 10px;
    background: #ffffff;
    color: #20384e;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    padding: 9px 6px;
    text-align: center;
    cursor: pointer;
    line-height: 1.1;
}

.mlx-btn:hover,
.mlx-btn:focus,
.mlx-btn:active {
    text-decoration: none !important;
    color: #20384e;
}

a.mlx-btn:link,
a.mlx-btn:visited,
a.mlx-btn:hover,
a.mlx-btn:focus,
a.mlx-btn:active {
    text-decoration: none !important;
}

.mlx-btn-primary {
    background: linear-gradient(135deg, var(--mlx-primary) 0%, #2f79d2 100%);
    border-color: var(--mlx-primary-dark);
    color: #ffffff;
}

.mlx-btn-primary:hover,
.mlx-btn-primary:focus,
.mlx-btn-primary:active,
a.mlx-btn-primary:visited {
    color: #ffffff;
}

.mlx-btn-disabled {
    background: linear-gradient(180deg, #e6ebf1 0%, #d7dee7 100%);
    border-color: #bcc8d5;
    color: #5e7185;
    cursor: not-allowed;
}

.mlx-btn-disabled:hover,
.mlx-btn-disabled:focus,
.mlx-btn-disabled:active {
    color: #5e7185;
}

.mlx-btn-auto-highlight {
    background: linear-gradient(135deg, #ffb347 0%, #f57c00 100%);
    border-color: #d66a00;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.22);
}

.mlx-toolbar-note {
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid #cfdceb;
    background: #f6fbff;
    color: #2a4761;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: bold;
}

.mlx-toolbar-note.warn {
    background: #fff7e6;
    border-color: #e8c67f;
    color: #7a5419;
}

.mlx-card {
    margin-top: 8px;
    border: 1px solid var(--mlx-border);
    border-radius: 12px;
    background: var(--mlx-card-bg);
    box-shadow: var(--mlx-shadow);
    padding: 8px;
}

.mlx-setup-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    min-width: 0;
}

.mlx-setup-row label {
    font-size: 12px;
    color: #364d63;
    font-weight: bold;
}

#mlx-formation {
    border: 1px solid #9fb5cb;
    border-radius: 8px;
    padding: 0 8px;
    min-width: 92px;
    height: 30px;
    box-sizing: border-box;
    background: #fff;
    font-size: 14px;
    font-weight: bold;
    color: #0f2740;
    line-height: 28px;
}

.mlx-taktik {
    border: 1px solid #d8e4ef;
    border-radius: 8px;
    background: #f8fbff;
    padding: 0 7px;
    min-width: 0;
    height: 30px;
    box-sizing: border-box;
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlx-taktik span {
    display: inline;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5e7690;
    flex-shrink: 0;
}

.mlx-taktik strong {
    display: inline;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    color: #0f243a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mlx-stats {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
}

.mlx-stat {
    min-width: 64px;
    height: 30px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #d6e3ee;
    background: #fcfeff;
    padding: 0 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.mlx-stat span {
    color: #5e7690;
    font-size: 10px;
}

.mlx-stat strong {
    color: #0f243a;
    font-size: 13px;
    font-weight: bold;
}

.mlx-save-status {
    margin-top: 8px;
    min-height: 0;
    font-size: 12px;
    font-weight: bold;
    color: #51687e;
}

.mlx-save-status.success {
    color: #1f6f35;
}

.mlx-save-status.error {
    color: #8b2d2d;
}

.mlx-stage-head {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.mlx-segment {
    border: 1px solid #b9c9da;
    border-radius: 10px;
    background: #f7fbff;
    color: #24445f;
    font-size: 13px;
    font-weight: bold;
    padding: 8px 8px;
    cursor: pointer;
    text-align: center;
}

.mlx-segment.active {
    background: #0f3158;
    color: #ffffff;
    border-color: #0d2a49;
}

.mlx-view {
    display: none;
}

.mlx-view.is-active {
    display: block;
}

.mlx-pitch-wrap {
    border: 2px solid #d0deea;
    border-radius: 14px;
    overflow: hidden;
}

.mlx-pitch {
    position: relative;
    width: 100%;
    min-width: 0;
    height: clamp(410px, 60vh, 500px);
    /* Rasen: Streifen entlang der Spielfeldlaenge (links nach rechts) */
    background:
        linear-gradient(to bottom, transparent 0, transparent 14.85%, rgba(255, 255, 255, 0.6) 15%, rgba(255, 255, 255, 0.6) calc(15% + 2px), transparent calc(15% + 2px)),
        linear-gradient(to bottom, transparent calc(85% - 2px), rgba(255, 255, 255, 0.6) calc(85% - 2px), rgba(255, 255, 255, 0.6) 85%, transparent 85.15%),
        linear-gradient(90deg, #3aab45 0%, #3aab45 25%, #4db857 25%, #4db857 50%, #3aab45 50%, #3aab45 75%, #4db857 75%, #4db857 100%);
    border-top: 3px solid rgba(255, 255, 255, 0.85);
    border-bottom: 3px solid rgba(255, 255, 255, 0.85);
    box-sizing: border-box;
}

/* Mittellinie (von links nach rechts) */
.mlx-pitch::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

/* Ankreis Mitte */
.mlx-pitch::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(18vw, 80px);
    height: min(18vw, 80px);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    pointer-events: none;
}

/* Bank-View: seitliches Padding der Karte ausgleichen, damit Bank so breit wie Kader wirkt */
#mlx-view-bench {
    margin-left: -8px;
    margin-right: -8px;
    width: calc(100% + 16px);
}

.mlx-bench {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
    justify-items: center;
    gap: 8px;
    padding: 7px 8px 8px;
    max-width: var(--mlx-content-width, 100%);
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
}

.mlx-bench-item {
    position: relative;
    overflow: visible;
}

.mlx-bench-item.mlx-roster-full {
    width: var(--mlx-pitch-mid-card-w);
    min-width: var(--mlx-pitch-mid-card-w);
    max-width: var(--mlx-pitch-mid-card-w);
    height: var(--mlx-pitch-mid-card-h);
    min-height: var(--mlx-pitch-mid-card-h);
}

.mlx-bench-item.mlx-roster-full .mlx-slot-meta {
    flex-direction: column;
    gap: 4px;
}

.mlx-bench-item.mlx-roster-full .mlx-row-1 {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.mlx-bench-item.mlx-roster-full .mlx-row-1 .mlx-chip-note {
    position: static;
}

.mlx-bench-item.mlx-roster-full .mlx-slot-name {
    margin-bottom: 6px;
    max-width: 100%;
}

.mlx-bench-slot-num {
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 10px;
    font-weight: bold;
    color: #44607a;
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 0 12px 0 8px;
    padding: 2px 6px 3px 8px;
    line-height: 1.2;
}

.mlx-bench-item.is-empty {
    width: var(--mlx-pitch-mid-card-w);
    min-width: var(--mlx-pitch-mid-card-w);
    max-width: var(--mlx-pitch-mid-card-w);
    height: var(--mlx-pitch-mid-card-h);
    min-height: var(--mlx-pitch-mid-card-h);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mlx-bench-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    min-width: 0;
}

.mlx-bench-empty-inner .mlx-slot-name {
    margin-bottom: 0;
    font-size: 10px;
    max-width: 100%;
    white-space: nowrap;
}

.mlx-bench-empty-inner .mlx-chip {
    font-size: 9px;
    padding: 1px 5px;
    white-space: nowrap;
}

.mlx-slot {
    border: 1px solid #9fb3c8;
    border-left: 5px solid #9fb3c8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 18px rgba(24, 44, 67, 0.13);
    padding: 6px 7px;
    cursor: pointer;
    touch-action: manipulation;
}

.mlx-slot.is-empty {
    border-style: dashed;
    background: rgba(245, 251, 255, 0.94);
}

.mlx-slot.is-selected {
    box-shadow: 0 0 0 2px rgba(255, 164, 74, 0.45), 0 10px 20px rgba(20, 43, 67, 0.18);
}

.mlx-slot-offpos {
    border-color: #f0a64b;
    box-shadow: 0 0 0 2px rgba(240, 166, 75, 0.3), 0 10px 20px rgba(20, 43, 67, 0.14);
}

.mlx-slot-num {
    position: absolute;
    top: 5px;
    right: 6px;
    font-size: 10px;
    color: #44607a;
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 7px;
    padding: 1px 6px;
}

.mlx-slot-name {
    display: block;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.18;
    color: #102842;
    margin-bottom: 4px;
    max-width: calc(100% - 28px);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.mlx-slot-meta {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.mlx-chip {
    display: inline-block;
    width: fit-content;
    border: 1px solid #d4e2ef;
    border-radius: 6px;
    background: #edf6ff;
    color: #1c3854;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px;
}

.mlx-chip-note {
    position: absolute;
    right: 7px;
    bottom: 6px;
}

.mlx-slot-es {
    display: block;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.1;
    color: #24425f;
    margin-bottom: 2px;
}

.mlx-offpos-flag {
    position: absolute;
    right: 30px;
    top: 5px;
    font-size: 8px;
    font-weight: bold;
    color: #8b4c0d;
    background: #ffe5c4;
    border: 1px solid #efbf86;
    border-radius: 6px;
    padding: 0 4px;
    line-height: 1.2;
}

.mlx-pitch .mlx-slot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: var(--mlx-pitch-slot-w);
    min-width: var(--mlx-pitch-slot-w);
    min-height: var(--mlx-pitch-slot-h);
    padding: 5px 6px;
    z-index: 2;
}

/* Große Spielfeld-Karten: kompaktes Desktop-Format */
.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full,
.mlx-roster .mlx-slot.mlx-roster-full,
.mlx-bench .mlx-slot.mlx-roster-full {
    padding: 6px 4px 4px;
    box-sizing: border-box;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full {
    width: var(--mlx-pitch-full-card-w);
    min-width: var(--mlx-pitch-full-card-w);
    max-width: var(--mlx-pitch-full-card-w);
    height: var(--mlx-pitch-full-card-h);
    min-height: var(--mlx-pitch-full-card-h);
}

.mlx-roster .mlx-slot.mlx-roster-full,
.mlx-bench .mlx-slot.mlx-roster-full {
    width: var(--mlx-pitch-mid-card-w);
    min-width: var(--mlx-pitch-mid-card-w);
    max-width: var(--mlx-pitch-mid-card-w);
    height: var(--mlx-pitch-mid-card-h);
    min-height: var(--mlx-pitch-mid-card-h);
}

.mlx-roster .mlx-slot.mlx-roster-full {
    height: auto;
    min-height: var(--mlx-pitch-mid-card-h);
    margin-left: auto;
    margin-right: auto;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-slot-name,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-slot-name,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-slot-name {
    font-size: 10px;
    margin-bottom: 0;
    line-height: 1.02;
    flex-shrink: 0;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-roster-full-fields,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-roster-full-fields,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-roster-full-fields {
    margin-top: 0;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto;
    row-gap: 1px;
    align-content: center;
    padding-top: 1px;
    padding-bottom: 0;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-row-1,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-row-1,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-row-1 {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    align-items: center;
    margin-bottom: 0;
    flex-shrink: 0;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-chip,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-chip,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-chip {
    display: inline-flex;
    align-items: center;
    height: 13px;
    line-height: 1;
    font-size: 8px;
    padding: 0 4px;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-progress-row,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-progress-row,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-progress-row {
    flex-shrink: 0;
    margin-top: 0;
    gap: 1px;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-progress-label,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-progress-label,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-progress-label {
    flex: 0 0 31px;
}

.mlx-roster .mlx-slot.mlx-roster-full .mlx-progress-row.mlx-progress-wide .mlx-progress-label {
    flex-basis: 48px;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-row-1 .mlx-chip-note,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-row-1 .mlx-chip-note,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-row-1 .mlx-chip-note {
    position: static;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.mlx-pitch-card-full .mlx-progress-bar,
.mlx-roster .mlx-slot.mlx-roster-full .mlx-progress-bar,
.mlx-bench .mlx-slot.mlx-roster-full .mlx-progress-bar {
    height: 4px;
}

.mlx-pitch-debug {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(159, 179, 200, 0.95);
    background: rgba(255, 255, 255, 0.86);
    color: #21405f;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    pointer-events: none;
}

/* Leere Pitch-Slots bei Vollkarten-Optik: gleiche Maße wie die großen Bank-Karten */
.mlx-pitch.mlx-pitch-full-cards .mlx-slot.is-empty {
    width: var(--mlx-pitch-full-card-w);
    min-width: var(--mlx-pitch-full-card-w);
    max-width: var(--mlx-pitch-full-card-w);
    height: var(--mlx-pitch-full-card-h);
    min-height: var(--mlx-pitch-full-card-h);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.is-empty .mlx-pitch-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    min-width: 0;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.is-empty .mlx-pitch-empty-inner .mlx-slot-name {
    margin-bottom: 0;
    font-size: 10px;
    max-width: 100%;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-full-cards .mlx-slot.is-empty .mlx-pitch-empty-inner .mlx-chip {
    font-size: 7px;
    line-height: 1.05;
    padding: 0 3px;
    max-width: calc(100% - 4px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mittlere Spielfeld-Karten: zwischen Bank-Größe und Mobile-Miniatur */
.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid {
    width: var(--mlx-pitch-mid-card-w);
    min-width: var(--mlx-pitch-mid-card-w);
    max-width: var(--mlx-pitch-mid-card-w);
    height: var(--mlx-pitch-mid-card-h);
    min-height: var(--mlx-pitch-mid-card-h);
    padding: 5px 6px;
    box-sizing: border-box;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-slot-name {
    font-size: 12px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-roster-full-fields {
    margin-top: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-row-1 {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 1px;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-chip {
    font-size: 10px;
    padding: 1px 6px;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-progress-row {
    margin-top: 2px;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.mlx-pitch-card-mid .mlx-progress-label {
    flex: 0 0 44px;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.is-empty {
    width: var(--mlx-pitch-mid-card-w);
    min-width: var(--mlx-pitch-mid-card-w);
    max-width: var(--mlx-pitch-mid-card-w);
    height: var(--mlx-pitch-mid-card-h);
    min-height: var(--mlx-pitch-mid-card-h);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.is-empty .mlx-pitch-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    min-width: 0;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.is-empty .mlx-pitch-empty-inner .mlx-slot-name {
    margin-bottom: 0;
    max-width: 100%;
    white-space: nowrap;
}

.mlx-pitch.mlx-pitch-mid-cards .mlx-slot.is-empty .mlx-pitch-empty-inner .mlx-chip {
    white-space: nowrap;
}

.mlx-pitch-slot-num {
    position: absolute;
    top: -6px;
    right: -7px;
    font-size: 10px;
    font-weight: bold;
    color: #44607a;
    background: #ffffff;
    border: 1px solid #d7e3ef;
    border-radius: 0 12px 0 8px;
    padding: 2px 6px 3px 8px;
    line-height: 1.2;
}

.mlx-pitch .mlx-slot:hover {
    transform: translate(-50%, -50%);
}

.mlx-pitch .mlx-slot-name {
    font-size: 11px;
    margin-bottom: 1px;
    max-width: 100%;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mlx-pitch .mlx-slot-es {
    display: block;
    font-size: 10px;
    margin-bottom: 2px;
    color: #1e3d5c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mlx-pitch .mlx-pitch-note-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.mlx-pitch .mlx-pitch-note-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mlx-pitch .mlx-pitch-note-row .mlx-offpos-flag {
    position: static;
    flex-shrink: 0;
}

.mlx-pitch .mlx-pitch-note-row .mlx-slot-num {
    position: static;
    flex-shrink: 0;
}

.mlx-pitch .mlx-slot-num {
    top: auto;
    right: 6px;
    bottom: 5px;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
}

.mlx-pitch .mlx-chip {
    font-size: 9px;
    padding: 0 4px;
}

.mlx-pitch .mlx-chip-note {
    position: static;
}

.mlx-pitch .mlx-slot-meta {
    position: absolute;
    left: 6px;
    bottom: 5px;
    flex-direction: row;
    gap: 3px;
}

.mlx-pitch .mlx-offpos-flag {
    right: 24px;
    top: 4px;
    font-size: 7px;
    padding: 0 3px;
}

.mlx-chip-off {
    background: #fff0de !important;
    border-color: #efbf86 !important;
    color: #8b4c0d !important;
}

.mlx-slot.is-inline {
    position: relative;
    transform: none;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 80px;
}

.mlx-pos-t {
    border-left-color: #000000 !important;
}

.mlx-pos-a {
    border-left-color: #ce2f2f !important;
}

.mlx-pos-m {
    border-left-color: #d3a113 !important;
}

.mlx-pos-s {
    border-left-color: #278e35 !important;
}

.mlx-fit-top,
.mlx-note-top {
    background: #e8f9e9 !important;
    border-color: #97d7a0 !important;
    color: #1f6c30 !important;
}

.mlx-fit-good,
.mlx-note-good {
    background: #eef9e5 !important;
    border-color: #b7dd9f !important;
    color: #346d23 !important;
}

.mlx-fit-mid,
.mlx-note-mid {
    background: #fff6e8 !important;
    border-color: #e7c48f !important;
    color: #8a5c1f !important;
}

.mlx-fit-low,
.mlx-note-low {
    background: #ffebea !important;
    border-color: #e2a29f !important;
    color: #8e2b28 !important;
}

.mlx-note-unknown {
    background: #f0f5f9 !important;
    border-color: #cedbe6 !important;
    color: #5c758c !important;
}

.mlx-roster-sheet {
    margin-top: 10px;
    border: 1px solid #c9d7e5;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--mlx-shadow);
    overflow: hidden;
    max-width: var(--mlx-content-width, 100%);
    margin-left: auto;
    margin-right: auto;
}

#main .mlx-app.mlx-mobile .mlx-roster-sheet {
    width: calc(100% - 18px);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.mlx-roster-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    border-bottom: 1px solid #dce6ef;
    background: #f4f9ff;
}

.mlx-roster-head h2 {
    font-size: 14px;
    font-weight: bold;
    color: #173450;
}

.mlx-link-btn {
    border: 1px solid #b5c6d8;
    border-radius: 999px;
    background: #f8fbff;
    color: #264664;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    cursor: pointer;
}

.mlx-link-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mlx-filters {
    padding: 6px 8px 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}

.mlx-filter {
    border: 1px solid #c8d7e6;
    border-radius: 8px;
    background: #f7fbff;
    color: #2a4a67;
    font-size: 11px;
    font-weight: bold;
    padding: 6px 0;
    cursor: pointer;
}

.mlx-filter.active {
    background: #0f355b;
    border-color: #0d2f51;
    color: #ffffff;
}

.mlx-desktop .mlx-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.mlx-desktop .mlx-filter {
    min-width: 0;
    padding: 6px 0;
    line-height: 1;
}

.mlx-desktop .mlx-filter[data-filter="all"] {
    min-width: 0;
}

.mlx-search-wrap {
    padding: 6px 8px 0;
}

#mlx-search {
    width: 100%;
    border: 1px solid #bfd0e1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
}

.mlx-roster {
    padding: 7px 8px 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.mlx-roster-item {
    user-select: none;
}

#main .mlx-app.mlx-mobile .mlx-roster {
    grid-template-columns: repeat(auto-fit, minmax(var(--mlx-pitch-mid-card-w), var(--mlx-pitch-mid-card-w)));
    justify-content: start;
    justify-items: start;
    align-content: start;
}

#main .mlx-app.mlx-mobile .mlx-roster .mlx-slot.mlx-roster-full {
    margin-left: 0;
    margin-right: 0;
}

.mlx-roster-empty {
    border: 1px dashed #c5d3e0;
    border-radius: 12px;
    background: #fbfdff;
    color: #5f758c;
    font-size: 12px;
    padding: 10px;
    text-align: center;
}

/* Kader: Fortschrittsbalken (Fitness, Frische) */
.mlx-progress-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
    color: #364d63;
}

.mlx-progress-row .mlx-progress-label {
    flex: 0 0 52px;
    font-weight: bold;
}

.mlx-progress-row.mlx-progress-wide .mlx-progress-label {
    flex-basis: 72px;
}

.mlx-progress-bar {
    flex: 1;
    min-width: 0;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.mlx-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s ease;
}

.mlx-progress-fill.mlx-fit-top {
    background: #22c55e;
}

.mlx-progress-fill.mlx-fit-good {
    background: #84cc16;
}

.mlx-progress-fill.mlx-fit-mid {
    background: #eab308;
}

.mlx-progress-fill.mlx-fit-low {
    background: #ef4444;
}

.mlx-progress-pct {
    flex: 0 0 28px;
    text-align: right;
    font-weight: bold;
}

.mlx-progress-row.mlx-progress-health-alert {
    color: #a3272f;
}

.mlx-progress-row.mlx-progress-health-alert .mlx-progress-label,
.mlx-progress-row.mlx-progress-health-alert .mlx-progress-pct {
    color: #a3272f;
}

.mlx-progress-fill.mlx-progress-health-fill {
    background: #d9363e !important;
}

.mlx-roster-full .mlx-slot-meta {
    flex-direction: column;
    gap: 4px;
}

.mlx-roster-full {
    min-height: var(--mlx-pitch-full-card-h);
}

.mlx-chip-age {
    color: #5e7690;
}

.mlx-health-warn {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #b45309;
    background: #fff0de;
    border: 1px solid #efbf86;
    border-radius: 6px;
    padding: 1px 6px;
}

.mlx-health-injured {
    color: #8b2d2d;
    background: #ffebea;
    border-color: #e2a29f;
}

/* Hover-Popover fuer Spielfeld/Bank */
.mlx-player-popover {
    position: fixed;
    z-index: 9999;
    max-width: 280px;
    border: 1px solid #9fb3c8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(24, 44, 67, 0.22);
    padding: 8px 10px;
    pointer-events: none;
}

.mlx-player-popover .mlx-slot-name {
    margin-bottom: 6px;
}

.mlx-player-popover .mlx-progress-row {
    margin-top: 4px;
}

.mlx-popover-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mlx-popover-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mlx-popover-bars {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mlx-popover-bars .mlx-progress-row {
    margin-top: 4px;
    min-width: 0;
}

.mlx-popover-bars .mlx-progress-row:first-child {
    margin-top: 0;
}

/* Auswahlliste beim Klick auf freien Slot */
.mlx-slot-picker {
    position: fixed;
    z-index: 10000;
    max-width: 300px;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #9fb3c8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(24, 44, 67, 0.22);
    padding: 0;
    pointer-events: auto;
}

.mlx-slot-picker-inner {
    padding: 10px 12px;
}

.mlx-slot-picker-title {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6f8598;
}

.mlx-slot-picker-empty {
    margin: 0;
    font-size: 13px;
    color: #6f8598;
}

.mlx-slot-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mlx-slot-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    margin: 0 -4px 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mlx-slot-picker-item:hover {
    background: #e8eef4;
}

.mlx-slot-picker-item.mlx-slot-picker-match {
    background: #e8f4ea;
}

.mlx-slot-picker-item.mlx-slot-picker-match:hover {
    background: #d4ead6;
}

.mlx-slot-picker-name {
    font-weight: 500;
    color: #0f2740;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mlx-slot-picker-es {
    font-size: 12px;
    color: #6f8598;
    flex-shrink: 0;
}

.mlx-selection-bar {
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid #c9d6e4;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--mlx-shadow);
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
}

.mlx-selected-copy span {
    display: block;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6f8598;
}

.mlx-selected-copy strong {
    display: block;
    font-size: 14px;
    color: #0f2740;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px;
}

.mlx-selection-actions {
    display: inline-flex;
    gap: 6px;
}

.mlx-selection-actions .mlx-link-btn {
    padding: 5px 9px;
}

.mlx-roster-sheet:not(.is-open) .mlx-filters,
.mlx-roster-sheet:not(.is-open) .mlx-search-wrap,
.mlx-roster-sheet:not(.is-open) .mlx-roster {
    display: none;
}

#main .mlx-app.mlx-desktop {
    max-width: none;
    width: 100%;
    --mlx-pitch-slot-w: clamp(82px, 24vw, 116px);
    --mlx-pitch-slot-h: clamp(52px, 12vw, 58px);
    padding: 10px 10px 12px;
}

.mlx-desktop .mlx-desktop-main {
    margin-top: 8px;
    display: grid;
    grid-template-columns: minmax(146px, 156px) minmax(0, 1fr) minmax(146px, 156px);
    gap: 10px;
    align-items: start;
}

.mlx-desktop .mlx-stage,
.mlx-desktop .mlx-bench-side {
    margin-top: 0;
}

.mlx-desktop .mlx-stage-head {
    display: none;
}

.mlx-panel-head {
    margin: 0 0 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0f3158;
    border-radius: 8px;
    padding: 7px 9px;
    min-height: 36px;
}

/* Startelf und Bank: Ueberschrift ganzflaechig dunkelblau wie Kader (bis zum Kartenrand) */
.mlx-card > .mlx-panel-head:first-child {
    margin: -8px -8px 8px -8px;
    padding: 7px 17px;
    border-radius: 12px 12px 0 0;
}

.mlx-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff !important;
    background: none !important;
    text-align: center;
}

.mlx-desktop .mlx-stage-desktop .mlx-pitch-wrap {
    overflow: hidden;
}

.mlx-desktop .mlx-stage-desktop .mlx-pitch {
    height: 640px;
    min-height: 640px;
    max-height: 640px;
}

.mlx-desktop .mlx-roster-sheet-desktop {
    margin-top: 0;
    border: 1px solid var(--mlx-border);
    border-radius: 12px;
    background: var(--mlx-card-bg);
    box-shadow: var(--mlx-shadow);
}

.mlx-desktop .mlx-roster-sheet-desktop .mlx-roster-head.mlx-panel-head {
    border-bottom: none;
}

.mlx-roster-head.mlx-panel-head {
    justify-content: center;
    align-items: center;
    background: #0f3158;
    border-bottom: none;
    border-radius: 8px;
    padding: 7px 9px;
    min-height: 36px;
}

.mlx-roster-head.mlx-panel-head h2.mlx-panel-title {
    color: #ffffff !important;
    text-align: center;
}

.mlx-desktop .mlx-roster-sheet-desktop .mlx-roster {
    max-height: 640px;
    overflow-y: auto;
}

.mlx-desktop .mlx-bench {
    grid-template-columns: 1fr;
    gap: 8px;
}

.mlx-desktop .mlx-slot.is-inline {
    min-height: 70px;
}

.mlx-desktop .mlx-selection-bar {
    position: static;
    margin-top: 10px;
    padding-bottom: 7px;
}

@media (max-width: 1360px) {
    .mlx-desktop .mlx-desktop-main {
        grid-template-columns: minmax(144px, 152px) minmax(0, 1fr) minmax(144px, 152px);
    }
}

@media (max-width: 1180px) {
    .mlx-desktop .mlx-desktop-main {
        grid-template-columns: minmax(136px, 152px) minmax(0, 1fr);
        grid-template-areas:
            "kader start"
            "bank bank";
    }

    .mlx-desktop .mlx-roster-sheet-desktop {
        grid-area: kader;
    }

    .mlx-desktop .mlx-stage-desktop {
        grid-area: start;
    }

    .mlx-desktop .mlx-bench-side {
        grid-area: bank;
    }

    .mlx-desktop .mlx-bench {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        grid-template-columns: repeat(auto-fit, minmax(var(--mlx-bench-bottom-card-w), var(--mlx-bench-bottom-card-w)));
        justify-content: start;
        justify-items: start;
        align-content: start;
        column-gap: 8px;
        row-gap: 8px;
    }

    .mlx-desktop .mlx-bench .mlx-bench-item.mlx-roster-full,
    .mlx-desktop .mlx-bench .mlx-bench-item.is-empty,
    .mlx-desktop .mlx-bench .mlx-slot.mlx-roster-full,
    .mlx-desktop .mlx-bench .mlx-slot.is-empty {
        width: var(--mlx-bench-bottom-card-w);
        min-width: var(--mlx-bench-bottom-card-w);
        max-width: var(--mlx-bench-bottom-card-w);
        height: var(--mlx-bench-bottom-card-h);
        min-height: var(--mlx-bench-bottom-card-h);
    }

    .mlx-desktop .mlx-bench.mlx-bench-bottom-compact .mlx-bench-empty-inner .mlx-slot-name {
        font-size: 9px;
    }

    .mlx-desktop .mlx-bench.mlx-bench-bottom-compact .mlx-bench-empty-inner .mlx-chip {
        font-size: 8px;
        padding: 0 4px;
    }
}

@media (max-width: 430px) {
    #main .mlx-app {
        max-width: 100%;
    }

    .mlx-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mlx-setup-row {
        gap: 6px;
    }

    .mlx-taktik {
        max-width: 120px;
    }

    .mlx-stat {
        min-width: 56px;
    }

    .mlx-stat strong {
        font-size: 12px;
    }

    .mlx-bench {
        grid-template-columns: 1fr;
    }
}
