﻿:root {
    --bg-dark: #0f1015;
    --bg-card: #181b22;
    --primary-gold: #d4af37;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

header {
    background: linear-gradient(rgba(15, 16, 21, 0.8), rgba(15, 16, 21, 0.95)), url('https://static0.polygonimages.com/wordpress/wp-content/uploads/chorus/uploads/chorus_asset/file/19428081/age1.png') no-repeat center center/cover;
    padding: 4rem 1rem;
    text-align: center;
    border-bottom: 3px solid var(--primary-gold);
    /*background: rgba(0,0,0,0.2);*/
}

.text-muted {
    --bs-text-opacity: 1;
    color: var(--text-muted)!important;
}

h1 {
    font-family: 'Cinzel', serif;
    color: var(--primary-gold);
}

.card-custom {
    background-color: var(--bg-card);
    border: 1px solid #2d3748;
    color: var(--text-main);
}

.rule-list {
    list-style: none;
    padding-left: 0;
}

    .rule-list > li {
        margin-bottom: 1.15rem;
        padding-left: 1.5rem;
        position: relative;
        color: var(--text-muted)!important;
    }

        .rule-list > li::before {
            content: "⚔️";
            position: absolute;
            left: 0;
            top: 0.15rem;
        }

        .rule-list > li > strong {
            display: block;
            color: var(--primary-gold);
            margin-bottom: 0.25rem;
        }

        .rule-list p {
            margin: 0.45rem 0 0;
        }

    .rule-sublist {
        list-style: none;
        padding-left: 0;
        margin: 0.4rem 0 0;
    }

        .rule-sublist li {
            position: relative;
            padding-left: 1rem;
            margin-bottom: 0.35rem;
            color: var(--text-muted)!important;
        }

            .rule-sublist li::before {
                content: "–";
                position: absolute;
                left: 0;
                color: var(--primary-gold);
            }

.form-control {
    background-color: #12141a;
    border: 1px solid #374151;
    color: white;
}

    .form-control:focus {
        background-color: #12141a;
        border-color: var(--primary-gold);
        color: white;
        box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
    }

.btn-gold {
    background-color: var(--primary-gold);
    color: var(--bg-dark);
    font-weight: 800;
    border: none;
}

    .btn-gold:hover {
        background-color: #f3c653;
        color: var(--bg-dark);
    }

.btn-outline-gold {
    background: transparent;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    font-weight: 600;
}

    .btn-outline-gold:hover,
    .btn-outline-gold:disabled {
        background-color: var(--primary-gold);
        color: var(--bg-dark);
    }

select.form-control {
    background-color: #12141a;
    border: 1px solid #374151;
    color: white;
}

.league-nav {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--primary-gold);
    padding: 0.85rem 0;
    margin-bottom: 1rem;
    position: relative;
    z-index: 30;
}

.league-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.league-brand {
    order: 1;
    font-family: 'Cinzel', serif;
    color: var(--primary-gold) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(62vw, 18rem);
}

.league-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.1rem;
    flex: 1;
    order: 2;
}

.league-nav-tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    order: 3;
}

.league-nav-session {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.25rem;
}

.league-nav-toggle {
    display: none;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0.45rem;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.28rem;
}

    .league-nav-toggle span {
        display: block;
        width: 1.2rem;
        height: 2px;
        background: var(--primary-gold);
        border-radius: 2px;
    }

    .league-nav a {
        color: var(--text-main);
        text-decoration: none;
        font-weight: 600;
    }

        .league-nav a:hover {
            color: var(--primary-gold);
        }

.league-user {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
}

.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.league-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
}

    .league-table th,
    .league-table td {
        padding: 0.75rem 0.6rem;
        border-bottom: 1px solid #2d3748;
        white-space: nowrap;
    }

    .league-table th {
        color: var(--primary-gold);
        font-family: 'Cinzel', serif;
    }

    .league-table a {
        color: var(--text-main);
        text-decoration: none;
    }

        .league-table a:hover {
            color: var(--primary-gold);
        }

.alert-league-ok,
.alert-league-error {
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.alert-league-ok {
    background: #16351f;
    border: 1px solid #2f6b3c;
    color: #b7f0c3;
}

.alert-league-error {
    background: #3a1616;
    border: 1px solid #7a2d2d;
    color: #f3b4b4;
}

.league-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.league-badge-ok {
    background: #16351f;
    border: 1px solid #2f6b3c;
    color: #b7f0c3;
}

.league-badge-pending {
    background: #3a2d16;
    border: 1px solid #7a5b2d;
    color: #f3d9b4;
}

.elo-sum {
    color: var(--primary-gold);
    font-weight: 700;
}

    .elo-sum.is-invalid {
        color: #f3b4b4;
    }

.match-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .match-card:hover {
        transform: scale(1.02);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }

.member-row .btn-outline-danger {
    margin-bottom: 2px;
}

.player-search {
    position: relative;
}

.player-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    background-color: #12141a;
    border: 1px solid var(--primary-gold);
    border-radius: 6px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}

.player-option {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--text-main);
    padding: 0.55rem 0.75rem;
    text-align: left;
}

    .player-option span {
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .player-option:hover,
    .player-option.is-active {
        background-color: #2d3748;
        color: var(--primary-gold);
    }

.player-empty {
    padding: 0.7rem 0.75rem;
    color: var(--text-muted);
}

.member-row.is-selected .player-query {
    border-color: var(--primary-gold);
}

.action-link {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    margin-right: 0.6rem;
}

    .action-link:hover {
        color: #f3c653;
    }

.notify-wrap {
    position: relative;
}

.notify-bell {
    background: transparent;
    border: 1px solid #374151;
    color: var(--text-main);
    border-radius: 999px;
    width: 2.2rem;
    height: 2.2rem;
    position: relative;
}

.notify-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    background: #b91c1c;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    min-width: 1.1rem;
    padding: 0.1rem 0.25rem;
    font-weight: 700;
}

.notify-menu {
    position: absolute;
    right: 0;
    top: 2.6rem;
    width: 320px;
    max-width: min(320px, calc(100vw - 1.5rem));
    background: var(--bg-card);
    border: 1px solid #2d3748;
    border-radius: 8px;
    z-index: 40;
    padding: 0.75rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.notify-menu-head,
.notify-menu-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.notify-list {
    max-height: 320px;
    overflow: auto;
    margin: 0.6rem 0;
}

.notify-item {
    display: block;
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid #2d3748;
    color: var(--text-main);
    text-decoration: none;
}

    .notify-item span {
        display: block;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .notify-item.is-unread {
        background: #1f2430;
    }

.notify-empty {
    color: var(--text-muted);
    margin: 0;
}

.notify-unread td {
    color: var(--text-main);
}

.pwa-install {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

@media (max-width: 991.98px) {
    .league-nav-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .league-brand {
        grid-column: 1;
        grid-row: 1;
        order: 0;
        max-width: min(58vw, 16rem);
    }

    .league-nav-tools {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        order: 0;
    }

    .league-nav-toggle {
        display: inline-flex;
    }

    .league-nav-links {
        display: none;
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.4rem 0 0.2rem;
        border-top: 1px solid #2d3748;
        margin-top: 0.35rem;
        order: 0;
        flex: none;
    }

        .league-nav-links.is-open {
            display: flex;
        }

        .league-nav-links > a {
            padding: 0.7rem 0.15rem;
            border-bottom: 1px solid #2d3748;
        }

    .league-nav-session {
        padding: 0.85rem 0 0.4rem;
        margin-left: 0;
    }

    .notify-menu {
        position: fixed;
        left: 50%;
        right: auto;
        top: 4.6rem;
        transform: translateX(-50%);
        width: calc(100vw - 1.5rem);
        max-width: 22rem;
    }

    .pwa-install {
        flex-wrap: wrap;
    }
}
