/* Match Detail Panel */

.match-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.match-detail-panel {
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.25rem;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ── Header ── */
.md-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e5e7eb;
}

.md-header-left {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.md-label {
    font-weight: 700;
    font-size: 1.1rem;
    color: #111827;
}

.md-state-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: .25rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.md-state-pending { background: #f3f4f6; color: #6b7280; }
.md-state-ready { background: #dbeafe; color: #1e40af; }
.md-state-inprogress,
.md-state-in\ progress { background: #fef3c7; color: #92400e; }
.md-state-finished { background: #dcfce7; color: #166534; }
.md-state-bye { background: #fef3c7; color: #92400e; }

.md-bracket-badge {
    font-size: .6rem;
    font-weight: 600;
    padding: .1rem .35rem;
    border-radius: .2rem;
    background: #e5e7eb;
    color: #374151;
}

.md-close {
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
}
.md-close:hover { color: #374151; }

/* ── Review flags ── */
.md-review-flags {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: .4rem;
    padding: .5rem .75rem;
    margin-bottom: 1rem;
}
.md-review-flag {
    font-size: .8rem;
    color: #92400e;
    margin-bottom: .15rem;
}
.md-review-flag:last-child { margin-bottom: 0; }

/* ── Sections ── */
.md-section {
    margin-bottom: 1rem;
}
.md-section-title {
    font-size: .7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .4rem;
}

/* ── Score ── */
.md-score-grid {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.md-score-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    background: #f9fafb;
    border-radius: .3rem;
}
.md-slot-label {
    font-size: .65rem;
    color: #9ca3af;
    min-width: 3rem;
}
.md-player-name {
    flex: 1;
    font-weight: 500;
    font-size: .85rem;
    color: #374151;
}
.md-player-name.md-winner {
    font-weight: 700;
    color: #166534;
}
.md-score-value {
    font-weight: 700;
    font-size: .95rem;
    color: #111827;
    min-width: 2rem;
    text-align: right;
}
.md-vs {
    font-size: .6rem;
    color: #9ca3af;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
}
.md-score-summary {
    font-size: .78rem;
    color: #6b7280;
    text-align: center;
    margin-top: .25rem;
}
.md-match-length {
    font-size: .7rem;
    color: #9ca3af;
    text-align: center;
}
.md-bye-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .5rem;
}
.md-bye-label {
    font-size: .6rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ── Navigation ── */
.md-nav-grid {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.md-nav-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
}
.md-nav-label {
    font-weight: 600;
    color: #6b7280;
    min-width: 5rem;
}
.md-nav-value {
    color: #374151;
}
.md-nav-winner { color: #2563eb; }
.md-nav-loser { color: #dc2626; }

/* ── Metadata ── */
.md-meta-grid {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.md-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    padding: .15rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.md-meta-label {
    color: #9ca3af;
    font-weight: 500;
}
.md-meta-value {
    color: #374151;
}
.md-meta-id {
    font-family: monospace;
    font-size: .65rem;
    color: #9ca3af;
}

/* ── Actions ── */
.md-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.md-revert-btn {
    padding: .45rem 1rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: var(--dc-radius, .375rem);
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s;
}
.md-revert-btn:hover {
    background: #b91c1c;
}

.md-start-btn {
    padding: .45rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: var(--dc-radius, .375rem);
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s;
}
.md-start-btn:hover {
    background: #1d4ed8;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .match-detail-panel {
        max-width: 100%;
        border-radius: .5rem;
    }
}
