/* ==========================================================================
   dfb_compete – Match-Day Mini-Page (mobil-first, Terminal-Style)
   ========================================================================== */
.md-incident-launch { display:flex; margin:20px 0 16px; }
.md-incident-launch .md-btn { width:100%; justify-content:center; text-align:center; color:#efb5a9; border-color:#69443f; }
.md-forfeit-consent { padding:14px; margin:16px 0; border:1px solid #946935; border-radius:10px; background:#30251b; color:#f6c779; }
.md-forfeit-consent label { display:flex; align-items:flex-start; gap:10px; }
.md-forfeit-consent input { margin-top:5px; }
.md-forfeit-consent[hidden] { display:none; }
.md-incident-paused { border-color:#b0803b; background:linear-gradient(135deg,#30251b,#17191d); }
.md-incident-paused h2 { margin:12px 0; font-size:1.5rem; }
.md-incident-tag { color:#f6c779; text-transform:uppercase; font-size:.75rem; font-weight:800; letter-spacing:.1em; }
.md-incident-score { font-size:1.2rem; font-weight:700; }
.md-incident-verdict { color:#f6c779; }
.md-incident-item { padding:18px 0; border-top:1px solid #393b41; }
.md-incident-item:first-of-type { margin-top:16px; }
.md-incident-item-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.md-incident-item-head > span { color:#e6bc78; font-size:.75rem; }
.md-incident-message { white-space:pre-wrap; overflow-wrap:anywhere; border-left:2px solid #6b7684; padding-left:12px; }
.md-incident-message small { display:block; color:#a3a8b1; margin-bottom:6px; }
.md-incident-list summary { cursor:pointer; }
#md-incident-modal .md-field select, #md-incident-modal .md-field textarea { width:100%; border:1px solid #50535a; border-radius:8px; padding:12px; background:#111318; color:#f4f3ef; font:inherit; }
#md-incident-modal .md-field textarea { resize:vertical; min-height:110px; }
#md-incident-modal .md-modal-body { overflow-y:auto; }
#md-incident-modal .md-modal { max-height:calc(100dvh - 32px); overflow-y:auto; }
.matchday {
    margin: 0;
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #0c0d0f;
    color: #f4f3ef;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

.matchday * {
    box-sizing: border-box;
}

.matchday :focus-visible {
    outline: 3px solid #e8a33d;
    outline-offset: 2px;
    border-radius: 4px;
}

.md-shell {
    max-width: 34rem;
    margin-inline: auto;
    padding: 1rem 1rem 3rem;
}

.md-btn[hidden], .md-venue-panel[hidden] { display: none; }
.md-meta-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.md-problems .md-card-title, .md-problems-offline .md-card-title { font-size: .95rem; }
.md-problems .md-btn, .md-problems-offline .md-btn { white-space: normal; overflow-wrap: anywhere; text-align: center; }

.md-card {
    background: #17181c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.1rem;
    margin-top: 0.9rem;
}

.md-card-title {
    margin: 0 0 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #e8a33d;
}

.md-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244, 243, 239, 0.55);
}

.md-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.md-sub {
    margin: 0.35rem 0 0;
    color: rgba(244, 243, 239, 0.68);
    font-size: 0.95rem;
}

.md-duel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.9rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.md-duel .md-vs {
    color: #e8a33d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.md-meta {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
    font-size: 0.95rem;
}

.md-meta strong {
    font-weight: 700;
}

.md-meta-row {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.md-label {
    color: rgba(244, 243, 239, 0.55);
    min-width: 5.5rem;
    font-size: 0.82rem;
}

/* Buttons */
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.95rem 1.1rem;
    margin-top: 0.9rem;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.md-btn:active {
    transform: scale(0.985);
}

.md-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.md-btn--primary {
    background: #e8a33d;
    color: #171208;
}

.md-btn--ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f4f3ef;
}

.md-btn--teal {
    background: #14b8a6;
    color: #062a26;
}

.md-btn--danger {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fca5a5;
}

.md-btn--small {
    width: auto;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    margin-top: 0;
}

/* Formulare */
.md-field {
    margin-top: 0.85rem;
}

.md-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(244, 243, 239, 0.72);
    margin-bottom: 0.3rem;
}

.md-field input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: #0c0d0f;
    color: #f4f3ef;
    font: inherit;
    font-size: 1rem;
}

.md-field input:focus {
    outline: 2px solid #e8a33d;
    outline-offset: 1px;
}

.md-field input::placeholder {
    color: rgba(244, 243, 239, 0.35);
}

.md-field-hint {
    font-size: 0.75rem;
    color: rgba(244, 243, 239, 0.45);
    margin-top: 0.25rem;
}

.md-athlete-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.md-athlete-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: rgba(232, 163, 61, 0.16);
    color: #e8a33d;
    font-weight: 700;
    font-size: 0.85rem;
}

.md-athlete-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.md-badge-reserve {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(244, 243, 239, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
}

.md-status {
    margin: 0.9rem 0 0;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.md-status--ok {
    background: rgba(20, 184, 166, 0.12);
    color: #7ce3d8;
}

.md-status--error {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

/* Waiting */
.md-waiting {
    text-align: center;
    padding: 2.2rem 1rem;
}

.md-waiting-ring {
    width: 3.4rem;
    height: 3.4rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 3px solid rgba(232, 163, 61, 0.25);
    border-top-color: #e8a33d;
    animation: md-spin 1s linear infinite;
}

@keyframes md-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .md-waiting-ring {
        animation: none;
    }
}

/* Tableau */
.md-tableau {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.md-col-num {
    width: 4%;
}

.md-col-name {
    width: 27%;
}

.md-col-hits {
    width: 7%;
}

.md-col-cum {
    width: 9%;
}

.md-col-ziel {
    width: 10%;
}

.md-tableau th {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(244, 243, 239, 0.45);
    padding: 0.25rem 0.1rem;
    text-align: center;
    overflow: hidden;
}

.md-tableau td {
    padding: 0.45rem 0.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    overflow: hidden;
}

.md-tableau .md-bout-name {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.md-tableau .md-cum {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.md-tableau .md-bout-row--current {
    background: rgba(232, 163, 61, 0.12);
}

.md-tableau .md-bout-row--current .md-hits-cell {
    color: #e8a33d;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.md-tableau .md-bout-row--current td {
    border-top-color: rgba(232, 163, 61, 0.5);
}

.md-tableau .md-bout-row--future td {
    color: rgba(244, 243, 239, 0.4);
}

.md-bout-number {
    color: rgba(244, 243, 239, 0.5);
    font-variant-numeric: tabular-nums;
}

/* Aktive Zeile als Live-Panel (offen, ohne innere Rahmen) */
.md-tableau .md-bout-row--active td {
    padding: 0.9rem 0.2rem 1rem;
    border-top: 1px solid rgba(232, 163, 61, 0.45);
    border-bottom: 1px solid rgba(232, 163, 61, 0.45);
}

.md-live {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: start;
}

.md-live-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.md-live-team--one .md-fencer {
    color: #93c5fd;
}

.md-live-team--two .md-fencer {
    color: #2dd4bf;
}

.md-live-team .md-fencer {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.2;
    overflow-wrap: anywhere;
    min-height: 2.5em;
}

.md-live-team .md-fencer-pos {
    font-size: 0.68rem;
    color: rgba(244, 243, 239, 0.5);
}

.md-live-score {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Kleine graue Durchgangs-Treffer neben dem großen Gesamtstand */
.md-live-score-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}
.md-live-score-bout {
    font-size: 1.05rem;
    font-weight: 600;
    color: #64748b;
}

.md-live-team--one .md-live-score {
    color: #93c5fd;
}

.md-live-team--two .md-live-score {
    color: #2dd4bf;
}

.md-live-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
}
.md-live-controls .md-hit {
    min-width: 0;
    min-height: 44px;
}
.md-live-card-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: .25rem;
}
.md-live-card-actions .md-cards-button {
    width: 100%;
    max-width: 11rem;
    height: auto;
    min-height: 44px;
    padding: .45rem .25rem;
    font: inherit;
    font-size: .7rem;
    flex-wrap: wrap;
}
.md-live-card-actions .md-cards-button span:last-child {
    white-space: nowrap;
}

.md-hit {
    padding: 0.7rem 0.3rem;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease;
}

.md-hit:active {
    transform: scale(0.96);
}

.md-hit--plus {
    background: rgba(96, 165, 250, 0.9);
    color: #0b1c33;
}

.md-hit--two.md-hit--plus {
    background: rgba(20, 184, 166, 0.9);
    color: #06251f;
}

.md-hit--minus {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(244, 243, 239, 0.75);
}

.md-live-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding-top: 1.5rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(244, 243, 239, 0.55);
}

.md-live-vs strong {
    font-size: 1.3rem;
    color: #e8a33d;
    font-variant-numeric: tabular-nums;
}

.md-undo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.65rem 0.8rem;
    border: 1px dashed rgba(244, 243, 239, 0.3);
    border-radius: 10px;
    background: transparent;
    color: rgba(244, 243, 239, 0.7);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.md-undo:hover {
    border-color: rgba(244, 243, 239, 0.5);
    color: #f4f3ef;
}

/* Sudden Death */
.md-sudden {
    margin-top: 1rem;
    border: 1px solid rgba(248, 113, 113, 0.5);
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.07);
    padding: 1rem 1rem 0.8rem;
    text-align: center;
}

.md-prio-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: rgba(232, 163, 61, 0.2);
    border: 1px solid rgba(232, 163, 61, 0.55);
    color: #e8a33d;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    vertical-align: 1px;
}

.md-sudden-title {
    margin: 0 0 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fca5a5;
}

.md-sudden-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.md-priority-btn {
    margin-top: 0;
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
}

.md-priority-btn--lot {
    border: 1px dashed rgba(244, 243, 239, 0.35);
    background: transparent;
    color: rgba(244, 243, 239, 0.7);
}

.md-live .md-live-score--vd-a,
.md-live-score--vd-b {
    font-size: 2.4rem;
}

.md-winner {
    margin: 0.9rem 0 0;
    font-size: 1.05rem;
    color: rgba(244, 243, 239, 0.85);
}

.md-winner strong {
    color: #e8a33d;
}

/* Endergebnis: Teamattribution + Bestätigungsblock */
.md-end-duel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-top: 1.1rem;
}

.md-end-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.md-end-team-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(244, 243, 239, 0.45);
}

.md-end-team {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.md-end-score {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.md-end-score--one {
    color: #93c5fd;
}

.md-end-score--two {
    color: #2dd4bf;
}

.md-end-vs {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgba(244, 243, 239, 0.4);
}

.md-confirm-block {
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(20, 184, 166, 0.4);
    border-radius: 12px;
    background: rgba(20, 184, 166, 0.06);
    text-align: center;
}

.md-confirm-block p {
    margin: 0.25rem 0;
    font-size: 0.92rem;
    color: rgba(244, 243, 239, 0.85);
}

.md-confirm-block strong {
    color: #7ce3d8;
}

.md-confirm-block--done {
    border-color: rgba(20, 184, 166, 0.6);
    background: rgba(20, 184, 166, 0.12);
}

.md-confirm-wait {
    font-size: 0.8rem !important;
    color: rgba(244, 243, 239, 0.55) !important;
}

.md-winner strong {
    color: #e8a33d;
}

.md-target {
    font-size: 0.72rem;
    color: rgba(244, 243, 239, 0.5);
    text-align: center;
    margin-top: 0.5rem;
}

/* Paarungsablauf + Hinweise */
.md-plan {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.md-plan-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    padding: 0.45rem 0.6rem;
    background: #0c0d0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.md-plan-bout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(244, 243, 239, 0.65);
    font-weight: 700;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    flex: none;
}

.md-plan-duel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.md-plan-vs {
    color: rgba(244, 243, 239, 0.45);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.md-plan-side {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}

.md-plan-side--left {
    justify-content: flex-end;
}

.md-plan-side--right {
    justify-content: flex-start;
}

.md-plan-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-plan-name--empty {
    color: rgba(244, 243, 239, 0.35);
    font-weight: 500;
    font-style: italic;
}

.md-plan-target {
    color: rgba(244, 243, 239, 0.5);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 2.8rem;
    text-align: right;
    flex: none;
}

.md-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
}

.md-bubble--one {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.55);
}

.md-bubble--two {
    background: rgba(20, 184, 166, 0.16);
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.5);
}

.md-plan-legend {
    margin: 0.6rem 0 0;
    font-size: 0.75rem;
    color: rgba(244, 243, 239, 0.5);
}

.md-legend-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    margin: 0 0.25rem 0 0.6rem;
    vertical-align: -1px;
}

.md-legend-dot--one {
    background: rgba(96, 165, 250, 0.7);
}

.md-legend-dot--two {
    background: rgba(20, 184, 166, 0.7);
}

.md-step-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.md-step-actions .md-btn {
    width: 100%;
    margin-top: 0;
    padding-inline: 0.4rem;
    font-size: 0.92rem;
}

.md-card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.md-card-head-row .md-card-title {
    margin: 0;
}

.md-plan-toggle {
    margin-top: 0;
}

/* Schritt-Aufbau */
.md-step {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: #0c0d0f;
}

.md-step > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.9rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    user-select: none;
}

.md-step > summary::-webkit-details-marker {
    display: none;
}

.md-step > summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.2rem;
    color: rgba(244, 243, 239, 0.55);
}

.md-step[open] > summary::after {
    content: '−';
}

.md-step[open] {
    border-color: rgba(232, 163, 61, 0.45);
}

.md-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #e8a33d;
    color: #171208;
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
}

.md-step-title {
    letter-spacing: -0.01em;
}

.md-step-body {
    padding: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.md-step-status {
    margin-left: auto;
}

.md-step-status--ready {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.5);
    color: #7ce3d8;
}

/* Roster-Speichern: Spinner, Feedback, Tönungen */
.md-athlete {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    margin-top: 0.6rem;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.md-athlete:first-of-type {
    margin-top: 0.4rem;
}

.md-athlete.md-dirty {
    background: rgba(250, 204, 21, 0.07);
    border-color: rgba(250, 204, 21, 0.4);
}

.md-athlete.md-saved {
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.45);
}

.md-gear {
    animation: md-spin 1s linear infinite;
    vertical-align: -2px;
}

.md-roster-feedback {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7ce3d8;
}

.md-roster-feedback svg {
    flex: none;
}

.md-info {
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 10px;
}

.md-info-line {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: rgba(244, 243, 239, 0.78);
}

.md-info-line:first-child {
    margin-top: 0;
}

.md-info-line:last-child {
    margin-bottom: 0;
}

.md-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(244, 243, 239, 0.6);
}

.md-count--ready {
    color: #7ce3d8;
}

.md-end {
    text-align: center;
    padding: 1.4rem 1rem;
}

.md-end-score {
    font-size: 2.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e8a33d;
    margin-top: 0.4rem;
}

/* Aufstellungen */
.md-lineups {
    display: grid;
    gap: 0.8rem;
}

.md-lineup {
    background: #0c0d0f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}

.md-lineup-team {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.md-lineup ol {
    margin: 0;
    padding-left: 1.4rem;
    font-size: 0.9rem;
    display: grid;
    gap: 0.15rem;
}

.md-lineup .md-person {
    color: rgba(244, 243, 239, 0.75);
}

.md-lineup .md-person small {
    color: rgba(244, 243, 239, 0.4);
}

.md-lineup .md-person--reserve {
    list-style: none;
    margin-left: -1.4rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.md-person--reserve small,
.md-reserve-tag {
    color: #e8a33d;
    font-weight: 600;
}

.md-swap-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(232, 163, 61, 0.16);
    border: 1px solid rgba(232, 163, 61, 0.5);
    color: #e8a33d;
    flex: none;
    vertical-align: -2px;
}

.md-substitute {
    margin-left: auto;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(232, 163, 61, 0.55);
    border-radius: 9px;
    background: rgba(232, 163, 61, 0.14);
    color: #e8a33d;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease;
}

.md-substitute:active {
    transform: scale(0.97);
}

/* Wechsel-Modal */
.md-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(6, 7, 8, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.md-modal {
    width: 100%;
    max-width: 30rem;
    max-height: 86vh;
    overflow-y: auto;
    background: #17181c;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 1rem 1rem 1.2rem;
}

.md-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.md-modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.md-modal-close {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #f4f3ef;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.md-modal-hint {
    margin: 0 0 0.9rem;
    font-size: 0.82rem;
    color: rgba(244, 243, 239, 0.55);
}

.md-modal-body p {
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

.md-modal-subst {
    padding: 0.6rem 0.8rem;
    background: rgba(232, 163, 61, 0.08);
    border: 1px solid rgba(232, 163, 61, 0.35);
    border-radius: 10px;
    margin: 0.6rem 0 0 !important;
    color: #f4f3ef;
}

.md-modal-foot {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.md-priority-options {
    display: grid;
    gap: 0.65rem;
    margin: 1rem 0;
}

.md-modal--action .md-modal-foot {
    flex-wrap: wrap;
    gap: 0.65rem;
}

.md-modal--action .md-modal-foot .md-btn {
    margin: 0;
}

.md-priority-options[hidden] {
    display: none;
}

.md-priority-options .md-btn {
    margin: 0;
    width: 100%;
}

.md-hit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.md-sub-list {
    display: grid;
    gap: 0.4rem;
}

.md-sub-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0c0d0f;
}

.md-sub-row--current {
    border-color: rgba(232, 163, 61, 0.5);
    background: rgba(232, 163, 61, 0.08);
}

.md-sub-row--past {
    opacity: 0.45;
}

.md-sub-row--locked {
    opacity: 0.55;
}

.md-sub-bout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: rgba(232, 163, 61, 0.16);
    color: #e8a33d;
    font-weight: 700;
    font-size: 0.8rem;
    flex: none;
}

.md-sub-names {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
}

.md-sub-names small {
    color: rgba(244, 243, 239, 0.5);
    font-size: 0.75rem;
}

.md-sub-actions {
    display: grid;
    gap: 0.3rem;
    flex: none;
}

.md-sub-lock-hint {
    font-size: 0.68rem;
    color: rgba(244, 243, 239, 0.45);
    text-align: right;
}

.md-modal-swapback {
    margin: 0 0 0.9rem;
    padding: 0.65rem 0.85rem;
    background: rgba(232, 163, 61, 0.08);
    border: 1px solid rgba(232, 163, 61, 0.35);
    border-radius: 10px;
    font-size: 0.85rem;
    color: rgba(244, 243, 239, 0.85);
}

.md-modal-swapback strong {
    color: #e8a33d;
}

.md-sub-btn {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(244, 243, 239, 0.8);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.md-sub-btn--primary {
    border-color: rgba(20, 184, 166, 0.55);
    background: rgba(20, 184, 166, 0.16);
    color: #7ce3d8;
}

.md-sub-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.md-order-note {
    font-size: 0.8rem;
    color: rgba(244, 243, 239, 0.55);
    margin: 0.7rem 0 0;
}

.md-place-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.7rem;
    color: #e8a33d;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.md-flash {
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.md-flash--error {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.md-flash--status {
    background: rgba(20, 184, 166, 0.12);
    color: #7ce3d8;
}

/* ---------- Karten & Strafen (FIE t.170 / t.124) ---------- */
.md-cards-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
    cursor: pointer;
    color: inherit;
}
.md-cards-button:hover {
    background: rgba(148, 163, 184, 0.18);
}

.md-card-ico {
    display: inline-block;
    width: 12px;
    height: 16px;
    border-radius: 3px;
    flex: none;
}
.md-card-ico--yellow { background: #facc15; }
.md-card-ico--red { background: #ef4444; }
.md-card-ico--black { background: #111827; border: 1px solid rgba(148, 163, 184, 0.5); }
.md-card-ico--p_red { background: url('/svg/card-p-red.svg') center / contain no-repeat; }
.md-card-ico--p_black { background: url('/svg/card-p-black.svg') center / contain no-repeat; }

.md-roster-summary {
    margin: 12px 0 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.06);
}
.md-roster-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #e2e8f0;
}
.md-roster-summary-list small { color: #94a3b8; font-size: 11px; margin-left: 5px; }
.md-roster-summary-empty { margin: 0; color: #94a3b8; font-size: 13px; }
.md-roster-summary-support { margin: 8px 0 0; color: #94a3b8; font-size: 12px; }
.md-roster-summary .md-bubble { width: 22px; height: 22px; font-size: 11px; line-height: 22px; text-align: center; border-radius: 50%; display: inline-block; margin-right: 7px; }
.md-roster-summary .md-bubble--reserve { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.md-rules-button {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}
.md-rules-button:hover { color: #e2e8f0; }
.md-live-footnote { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px; text-align:center; grid-column:1 / -1; }
.md-double-hit { margin:12px 0 0; max-width:100%; min-height:44px; padding:8px 16px; border:1px solid #5e9ea2; border-radius:10px; background:linear-gradient(105deg,#233f5c,#174d47); color:#e0f8f4; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.md-double-hit:hover:not(:disabled) { border-color:#7ae6d2; box-shadow:0 0 14px #21c5af25; }
.md-double-hit:disabled { opacity:.45; cursor:not-allowed; }
.md-double-hit:focus-visible { outline:2px solid #f8bf57; outline-offset:3px; }

.md-cards-step { margin: 14px 0; }
.md-cards-step-title {
    margin: 0 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7dd3fc;
}
.md-cards-teams,
.md-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}
.md-cards-team,
.md-card-choice {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.06);
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
}
.md-cards-team strong,
.md-card-choice strong { display: block; font-size: 14px; }
.md-cards-team small,
.md-card-choice small { color: #94a3b8; font-size: 11px; }
.md-cards-team--active { border-color: #38bdf8; background: rgba(56, 189, 248, 0.14); }
.md-card-choice--yellow:hover { border-color: #facc15; }
.md-card-choice--red:hover, .md-card-choice--p_red:hover { border-color: #ef4444; }
.md-card-choice--black:hover, .md-card-choice--p_black:hover { border-color: #e2e8f0; }

.md-violations-list {
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.md-violation-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 8px 10px 10px;
    border-radius: 10px;
    border-left: 3px solid #94a3b8;
    background: rgba(148, 163, 184, 0.05);
}
.md-cards-body { margin: 0; }
.md-violation-group--1 { border-left-color: #facc15; }
.md-violation-group--2 { border-left-color: #ef4444; }
.md-violation-group--3 { border-left-color: #fb923c; }
.md-violation-group--4 { border-left-color: #e2e8f0; }
.md-violation-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7dd3fc;
}
.md-violation {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}
.md-violation small { display: block; color: #7dd3fc; font-size: 11px; margin-bottom: 2px; }
.md-violation span { display: block; }
.md-violation em { display: block; color: #94a3b8; font-size: 11px; font-style: italic; margin-top: 2px; }
.md-violation:hover { border-color: #7dd3fc; background: rgba(125, 211, 252, 0.1); }
.md-violation.md-cards-team--active { border-color: #38bdf8; background: rgba(56, 189, 248, 0.16); }

.md-card-choice--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.6);
}
.md-card-choice--emphasized.md-card-choice--red {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45), 0 0 18px rgba(239, 68, 68, 0.25);
}
.md-card-choice--emphasized.md-card-choice--yellow { border-color: #facc15; box-shadow: 0 0 18px rgba(250, 204, 21, 0.25); }
.md-card-choice--emphasized.md-card-choice--black { border-color: #e2e8f0; box-shadow: 0 0 18px rgba(226, 232, 240, 0.25); }
.md-cards-footer--back {
    display: inline-block;
    margin-top: 12px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    background: transparent;
    border: 0;
    padding: .65rem 0;
}
.md-cards-footer--back[hidden] { display: none; }
.md-reference .md-rules-button { margin: 0; min-height: 44px; }
.md-cards-footer--back:hover { color: #e2e8f0; }

.md-cards-confirm { margin-top: 14px; }
.md-overlay[data-step="confirmation"] .md-modal-hint { display: none; }
.md-cards-confirm .md-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-cards-confirm .md-card-choice { min-width: 0; padding: 10px 8px; }
.md-cards-confirm small { color: #94a3b8; font-size: 11px; }
.md-cards-confirm-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.md-card-choice--passivity:hover,
.md-card-choice--penalty:hover { border-color: #38bdf8; }

.md-rules-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7dd3fc;
}
.md-rules-group-cards {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.md-rules-group-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
    font-size: 11px;
    letter-spacing: normal;
    text-transform: none;
}
.md-rules-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}
.md-rules-content ul { margin: 0 0 10px; padding-left: 18px; }
.md-rules-content li {
    margin-bottom: 6px;
    font-size: 13px;
    color: #e2e8f0;
}
.md-rules-content li strong { font-size: 13px; }
.md-rules-content li small { display: block; color: #94a3b8; font-size: 11px; }

.md-winner--black { color: #fecaca; }
.md-black-mark { color: #ef4444; margin-right: 4px; }

.md-fencer-cards {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    vertical-align: middle;
}
.md-fencer-card { display: inline-flex; }
.md-fencer-card .md-card-ico { width: 9px; height: 12px; }

.md-cards-overview {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.06);
}
.md-cards-overview-title {
    margin: 0 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7dd3fc;
}
.md-cards-overview ul { margin: 0; padding: 0; list-style: none; }
.md-cards-overview li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #e2e8f0;
}
.md-cards-overview li em { color: #94a3b8; font-style: normal; font-size: 12px; margin-left: auto; text-align: right; }
.md-cards-overview .md-card-violation { color: #cbd5e1; }
.md-cards-overview .md-card-violation::first-letter { color: #7dd3fc; }

/* Spaltenköpfe mit Vereinsnamen */
.md-th-team { text-align: center; }
.md-th-bubble {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.md-th-bubble.md-bubble--one { background: rgba(147, 197, 253, 0.16); color: #93c5fd; }
.md-th-bubble.md-bubble--two { background: rgba(45, 212, 191, 0.14); color: #2dd4bf; }
.md-th-name {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #e2e8f0;
    overflow-wrap: anywhere;
}


/* ==== Karten & Strafen — ENDFASSUNG ==== */
/* Zeilen = eigenständige Kartenblöcke: oben Kopf-Zeile mit Durchgangs-Badge,
   Karten-Icon, Name/Verein + rechts der Uhrzeit; darunter der Verstoß. */
.md-cards-overview ul {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.md-cards-overview-cols {
    margin-top: 3px;
    font-size: 0;
}
.md-cards-overview .md-cards-row,
.md-cards-overview li.md-cards-row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 3px;
    margin-bottom: 4px;
    padding: 7px 10px 8px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.06);
    font-size: 13px;
}
.md-cards-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.md-cards-bout {
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.md-cards-bout--one { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
.md-cards-bout--two { background: rgba(33, 128, 141, 0.3); color: #2dd4bf; }
.md-cards-head .md-card-ico { flex: none; width: 11px; height: 15px; }
.md-cards-person {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    margin-left: 2px;
}
.md-cards-person strong {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.md-cards-person small { font-size: 11px; color: rgba(148, 163, 184, 0.75); overflow-wrap: anywhere; }
.md-cards-time {
    flex: none;
    font-size: 11px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.85);
    font-variant-numeric: tabular-nums;
    text-align: left;
}
.md-cards-violation {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
