/* Modul-spezifische Styles — Root-CSS wird separat per <link> geladen */

/* Modul-spezifische Overrides für die Meisterschaft */

/* ─── MATCH GRID ──────────────────────────────── */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    align-items: start;
}
.admin-widgets-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); 
    gap: 2rem; 
    margin-bottom: 5rem;
}

.match-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-left: 7px solid var(--grey-mid);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
    gap: 0.8rem;
    height: 100%;
}

.match-card:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-md);
}

.match-card.finished {
    border-left-color: var(--primary);
}

.match-card.pending {
    border-left-color: var(--secondary);
}

.match-card.freilos {
    border-left-color: var(--accent);
    opacity: 0.85;
}

/* Dynamic Match Card Styling */
.match-card.heim-match { border-left-color: var(--primary); }
.match-card.auswaerts-match { border-left-color: var(--grey-mid); }
.match-card.win-match { border-left-color: var(--primary); }
.match-card.loss-match { border-left-color: var(--grey-dark); }

/* Match Card Inner Wrapper */
.match-card-header {
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap; /* Prevents overflow */
    gap: 0.5rem;
}

.match-card-header-result {
    align-items: flex-end;
    margin-bottom: 0.8rem;
}

.match-date-wrap {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
}

.match-badge-small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

.match-date {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 800;
}

.match-time {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.match-teams-display {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    word-break: break-word; /* Allows long team names to break cleanly */
}

.team-highlight {
    color: var(--primary);
}

.team-vs {
    color: var(--grey-mid);
    font-weight: 400;
    padding: 0 0.3rem;
}

.match-team-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.match-team-label-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.match-score {
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1;
}

.score-win { color: var(--primary); }
.score-loss { color: var(--ink); }

/* Split Layout for Availability */
.match-card-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .match-card-split {
        grid-template-columns: 1fr 200px;
        align-items: flex-start;
    }

    .match-actions {
        border-left: 1px solid var(--grey-mid);
        padding-left: 1.5rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.match-info {
    flex: 1;
}

.match-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calendar-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.calendar-label {
    font-size: 0.7rem;
    color: var(--grey-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-card a.vs-badge {
    text-decoration: none;
    color: var(--ink);
    transition: all 0.2s;
    display: inline-block;
}

.match-card a.vs-badge:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.player-name.winner {
    color: var(--primary);
}

.player-stats {
    font-size: 0.82rem;
    color: var(--grey-dark);
    font-weight: 600;
}

.stat-tag-s {
    color: #16a34a;
    font-weight: 800;
}

.stat-tag-n {
    color: #dc2626;
    font-weight: 800;
}

.score-display {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ink);
    padding: 0 1.2rem;
    min-width: 110px;
    text-align: center;
    line-height: 1.2;
}

.vs-badge {
    background: var(--grey);
    padding: 0.35rem 0.7rem;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ─── HERO BANNER ─────────────────────────────── */
.hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 3rem 1.5rem;
    margin-bottom: 2.5rem;
}

.hero-banner h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: white;
}

.hero-banner p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* ─── EMPTY STATE ─────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state p {
    margin: 0 auto;
    max-width: 460px;
    line-height: 1.6;
}

/* ─── VERFÜGBARKEIT FILTER ────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: white;
    color: var(--grey-dark);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--grey-mid);
    transition: all 0.2s;
}

.filter-badge.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.availability-summary {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.status-pill {
    background: var(--grey);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.btn-icon {
    padding: 0.4rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grey);
    color: var(--grey-dark);
    border-radius: 8px;
    border: 1px solid var(--grey-mid);
    text-decoration: none;
}

.btn-icon:hover {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

/* ─── DRAG & DROP ─────────────────────────────── */
.draggable-player {
    cursor: grab;
    padding: 0.5rem 0.8rem;
    background: var(--grey);
    border: 1px solid var(--grey-mid);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    user-select: none;
    width: 100%;
    margin-bottom: 0.4rem;
}

.draggable-player:hover {
    background: var(--grey-mid);
    border-color: var(--grey-dark);
}

.draggable-player:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.draggable-player.dragging {
    opacity: 0.5;
    background: var(--primary);
    color: white;
}

.drop-zone {
    border: 2px dashed transparent;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(17, 96, 53, 0.05);
}

/* ─── ERGEBNIS FORM ───────────────────────────── */
.ergebnis-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.ergebnis-row label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--grey-dark);
    width: 55px;
    flex-shrink: 0;
}

.score-input {
    width: 65px;
    padding: 0.6rem 0.5rem;
    border: 2px solid var(--grey-mid);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.18s;
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
}

.score-colon {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--grey-dark);
}

/* ─── RUNDEN STATUS ───────────────────────────── */
.round-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.round-status-offen {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.round-status-aktiv {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

.round-status-closed {
    background: var(--grey);
    color: var(--grey-dark);
    border: 1px solid var(--grey-mid);
}

/* ─── MATCH META / TEAMS ──────────────────────── */
.match-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--grey-dark);
    margin-bottom: 0.8rem;
}

.match-teams {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.match-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grey);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Status button group (Verfügbarkeit modal) */
.status-button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1rem;
}

.status-btn {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--grey-mid);
    background: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 0.9rem;
}

.status-btn input {
    display: none;
}

.status-btn.active-0 {
    background: #dcfce7;
    border-color: #16a34a;
}

.status-btn.active-1 {
    background: #fef9c3;
    border-color: #ca8a04;
}

.status-btn.active-2 {
    background: #ffedd5;
    border-color: #ea580c;
}

.status-btn.active-3 {
    background: #fef2f2;
    border-color: #dc2626;
}

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 650px) {
    .match-card {
        flex-direction: column;
        text-align: left; /* Center looks broken with logical grouping. */
        gap: 1rem;
    }
    
    .match-teams-display {
        font-size: 1.05rem; /* Slight resize for long names */
    }

    .score-display {
        border-top: 1px solid var(--grey-mid);
        border-bottom: 1px solid var(--grey-mid);
        padding: 0.5rem 0;
        width: 100%;
    }

    .module-head {
        padding: 1rem;
        border-radius: 10px;
    }

    .module-title {
        font-size: 1.45rem;
        margin-bottom: 0.4rem;
    }

    .module-subtitle {
        font-size: 0.83rem;
        padding: 0.25rem 0.55rem;
    }

    .module-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 0.5rem;
    }

    .module-action-btn {
        min-width: 0;
        width: 100%;
    }
}

/* ─── MODULE HEADER CARD ─────────────────────── */
.module-head-wrap {
    margin-top: 2rem;
}

.module-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2.2rem;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--grey-mid);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
}

.module-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
    letter-spacing: -0.4px;
    line-height: 1.08;
}

.module-title span {
    color: var(--primary);
}

.module-subtitle {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    color: var(--grey-dark);
    font-size: 0.9rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.module-actions {
    gap: 0.55rem;
}

.module-action-btn {
    min-width: 122px;
    justify-content: center;
}

/* --- ADMIN EXTRAS (Meisterschaft) --- */
.admin-main .admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 900px) {
    .admin-main .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1400px) {
    .admin-main .admin-grid.triple {
        grid-template-columns: repeat(3, 1fr);
    }
}

.admin-main .admin-card h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-main .admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-main .admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-main .admin-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    background: var(--grey);
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.admin-main .admin-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.admin-main .admin-table th:last-child {
    border-radius: 0 8px 8px 0;
}

.admin-main .admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--grey);
    vertical-align: middle;
}

.admin-main .admin-table tr:last-child td {
    border-bottom: none;
}

.admin-main .admin-table tr:hover td {
    background: #fafafa;
}

.admin-main .stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-main .stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.admin-main .stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.admin-main .stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
}