/* Tournament Manager Styles - Refined Gothic Minimalist */

:root {
    --bg-primary: #080808;
    --bg-secondary: #0f0f0f;
    --bg-card: #151515;
    --bg-hover: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent: #c0c0c0;
    --accent-hover: #a8a8a8;
    --border: #252525;
    --border-light: #353535;
    --success: #5a5a5a;
    --error: #6b0000;
    --gold: #b8860b;
    --gold-bg: rgba(184, 134, 11, 0.08);
    --silver: #a8a8a8;
    --silver-bg: rgba(168, 168, 168, 0.05);
    --bronze: #8b6914;
    --bronze-bg: rgba(139, 105, 20, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 0%, rgba(192, 192, 192, 0.04) 0%, transparent 55%), radial-gradient(circle at 0% 100%, rgba(184, 134, 11, 0.03) 0%, transparent 40%), linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

    .header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, transparent 0%, rgba(192, 192, 192, 0.02) 50%, transparent 100%);
        pointer-events: none;
    }

    .header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 5%;
        right: 5%;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--accent), transparent);
    }

.title {
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 1.9em;
    font-weight: 400;
    text-align: center;
    margin-bottom: 18px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 0 0 30px rgba(192, 192, 192, 0.12), 2px 2px 6px rgba(0, 0, 0, 0.7);
    position: relative;
    padding-bottom: 14px;
}

    /* Ornamental line under title */
    .title::after {
        content: '⸻ ✦ ⸻';
        display: block;
        font-size: 0.4em;
        letter-spacing: 6px;
        color: var(--text-muted);
        margin-top: 6px;
        opacity: 0.7;
    }

.nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 7px 20px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Cinzel', serif;
    font-size: 0.78em;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

    /* Shimmer sweep */
    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.14), transparent);
        pointer-events: none;
        opacity: 0;
    }

    /* Top-left corner ornament */
    .nav-link::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 5px;
        height: 5px;
        border-top: 1px solid var(--accent);
        border-left: 1px solid var(--accent);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .nav-link:hover {
        color: var(--accent);
        border-color: var(--accent);
        background: rgba(192, 192, 192, 0.03);
    }

        .nav-link:hover::before {
            animation: btn-shimmer 0.65s ease forwards;
        }

        .nav-link:hover::after {
            opacity: 0.65;
        }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
}

    .card > p.text-muted {
        font-size: 1.05em;
        color: #999;
        margin: 4px 0;
    }

    /* Decorative corner ornaments */
    .card::before {
        content: '';
        position: absolute;
        top: -1px;
        left: -1px;
        width: 10px;
        height: 10px;
        border-top: 2px solid var(--accent);
        border-left: 2px solid var(--accent);
        opacity: 0.4;
        pointer-events: none;
    }

    .card::after {
        content: '';
        position: absolute;
        bottom: -1px;
        right: -1px;
        width: 10px;
        height: 10px;
        border-bottom: 2px solid var(--accent);
        border-right: 2px solid var(--accent);
        opacity: 0.4;
        pointer-events: none;
    }

    .card h2 {
        font-family: 'Cinzel', 'Georgia', serif;
        font-weight: 400;
        color: var(--accent);
        margin-bottom: 20px;
        padding-bottom: 12px;
        padding-left: 14px;
        border-bottom: 1px solid var(--border);
        border-left: 2px solid var(--accent);
        text-transform: uppercase;
        letter-spacing: 4px;
        font-size: 1.2em;
        position: relative;
    }

        .card h2::before {
            content: '';
            position: absolute;
            left: -1px;
            top: 0;
            width: 2px;
            height: 40%;
            background: var(--gold);
            opacity: 0.5;
        }

    .card h3 {
        color: var(--text-primary);
        margin: 18px 0 10px;
        font-family: 'Cinzel', 'Georgia', serif;
        font-weight: 300;
        letter-spacing: 3px;
        font-size: 1em;
        text-transform: uppercase;
    }

/* Text styles */
.text-muted {
    color: #999;
    font-size: 1em;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    line-height: 1.6;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: -10px;
    font-weight: 300;
    letter-spacing: 1px;
}

.input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 300;
}

    .input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 10px rgba(192, 192, 192, 0.05);
    }

textarea.input {
    resize: vertical;
    min-height: 100px;
}

select.input {
    cursor: pointer;
}

@keyframes btn-shimmer {
    0% {
        left: -100%;
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.button {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 36px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85em;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

    /* Shimmer sweep */
    .button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 60%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.18), transparent);
        pointer-events: none;
        opacity: 0;
        transition: none;
    }

    /* Top-left corner ornament — hidden by default */
    .button::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 7px;
        height: 7px;
        border-top: 1px solid var(--accent);
        border-left: 1px solid var(--accent);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .button:hover {
        background: linear-gradient(135deg, #222 0%, #2c2c2c 100%);
        box-shadow: 0 0 24px rgba(192, 192, 192, 0.08);
        letter-spacing: 4px;
    }

        .button:hover::before {
            animation: btn-shimmer 0.7s ease forwards;
        }

        .button:hover::after {
            opacity: 0.7;
        }

    /* Bottom-right corner ornament using box-shadow inset trick */
    .button:hover {
        box-shadow: 0 0 24px rgba(192, 192, 192, 0.08), inset -1px -1px 0 0 rgba(192, 192, 192, 0);
    }

    .button.small {
        padding: 7px 22px;
        font-size: 0.78em;
        letter-spacing: 2px;
    }

/* Admin actions */
.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

    .table th {
        background: var(--bg-secondary);
        color: var(--text-muted);
        padding: 12px;
        text-align: left;
        font-family: 'Cinzel', 'Georgia', serif;
        font-weight: 300;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-size: 0.78em;
        border-bottom: 2px solid var(--border-light);
    }

    .table td {
        padding: 12px;
        border-bottom: 1px solid var(--border);
        color: #c0c0c0;
        font-family: 'Cormorant Garamond', Georgia, serif;
        font-size: 1em;
        font-variant-numeric: tabular-nums; /* фиксирует высоту цифр */
    }


    .table tbody tr {
        transition: background 0.3s ease;
    }

        .table tbody tr:hover {
            background: rgba(192, 192, 192, 0.03);
        }

/* Place highlights */
.row-gold {
    background: var(--gold-bg);
}

.row-silver {
    background: var(--silver-bg);
}

.row-bronze {
    background: var(--bronze-bg);
}

    .row-gold td:first-child,
    .row-silver td:first-child,
    .row-bronze td:first-child {
        font-weight: bold;
    }

.row-gold td:first-child {
    color: var(--gold);
}

.row-silver td:first-child {
    color: var(--silver);
}

.row-bronze td:first-child {
    color: var(--bronze);
}

/* Cards */
.season-card,
.tournament-card,
.final-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin: 12px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .season-card::after,
    .tournament-card::after,
    .final-card::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(192, 192, 192, 0.02) 0%, transparent 70%);
        pointer-events: none;
    }

    .season-card:hover,
    .tournament-card:hover,
    .final-card:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

.tournament-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.tournament-info {
    flex: 1;
}

.manage-btn {
    flex-shrink: 0;
    align-self: center;
}

.season-link,
.player-link {
    color: var(--accent);
    text-decoration: none;
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    overflow: hidden;
    transition: color 0.3s ease;
}

    /* Metal sheen sweep on text links */
    .season-link::before,
    .player-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
        opacity: 0;
        pointer-events: none;
    }

    .season-link:hover,
    .player-link:hover {
        color: var(--text-primary);
        text-shadow: 0 0 12px rgba(192, 192, 192, 0.25);
    }

        .season-link:hover::before,
        .player-link:hover::before {
            animation: btn-shimmer 0.55s ease forwards;
        }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(192, 192, 192, 0.05);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 8px;
}

    .badge.success {
        background: rgba(90, 90, 90, 0.1);
        border-color: var(--success);
        color: var(--text-secondary);
    }

/* Pairs */
.pair-card,
.match-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vs {
    color: var(--text-muted);
    font-family: 'Cinzel', 'Georgia', serif;
    font-weight: 300;
    font-size: 0.85em;
    letter-spacing: 3px;
    opacity: 0.7;
}

.match-result {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: #aaa;
    font-weight: 400;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    flex-wrap: nowrap;
}

/* Final specific */
.round-section {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.player {
    padding: 10px;
    margin: 5px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 300;
}

    .player.winner {
        border-color: var(--accent);
        background: rgba(192, 192, 192, 0.05);
        font-weight: bold;
    }

.vs-text {
    text-align: center;
    color: var(--accent);
    font-family: 'Georgia', serif;
    font-weight: 300;
    margin: 10px 0;
}

.winner-label {
    font-size: 0.85em;
    line-height: 1.4;
    text-align: center;
    color: var(--accent);
    margin-top: 10px;
    font-weight: 300;
    letter-spacing: 2px;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .winner-label a {
        font-family: inherit;
        font-size: inherit;
        letter-spacing: inherit;
        color: inherit;
    }

        .winner-label a.muted-link {
            font-family: 'Cinzel', serif;
            font-size: 1em;
        }

    .winner-label::before {
        content: '✦';
        opacity: 0.5;
        font-size: 0.75em;
        line-height: 1;
        flex-shrink: 0;
    }

    .winner-label::after {
        content: '✦';
        opacity: 0.5;
        font-size: 0.75em;
        line-height: 1;
        flex-shrink: 0;
    }

.final-standings {
    margin-top: 20px;
}

.place {
    padding: 15px;
    margin: 10px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 300;
}

.place-gold {
    border-color: var(--gold);
    background: var(--gold-bg);
}

.place-silver {
    border-color: var(--silver);
    background: var(--silver-bg);
}

.place-bronze {
    border-color: var(--bronze);
    background: var(--bronze-bg);
}

.place-number {
    color: var(--text-muted);
    font-weight: 300;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.place-player {
    font-weight: 400;
    letter-spacing: 2px;
    font-family: 'Cinzel', serif;
}

/* Error */
.error {
    background: rgba(107, 0, 0, 0.15);
    border: 1px solid var(--error);
    color: #ff6b6b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 300;
}

/* Suggestions */
.suggestions {
    padding: 10px;
    background: rgba(192, 192, 192, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Stat item */
.stat-item {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 5px 0;
    font-weight: 300;
}

    .stat-item .text-muted {
        font-size: 1em;
        color: #999;
    }

    .stat-item strong {
        color: var(--text-primary);
        font-weight: 400;
    }

/* Player input with autocomplete */
.player-input-row {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

    .player-input-row .player-input,
    .player-input-row .final-player-input {
        flex: 1;
    }

    .player-input-row .remove-btn {
        flex-shrink: 0;
    }

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 300;
}

    .suggestion-item:last-child {
        border-bottom: none;
    }

    .suggestion-item:hover {
        background: rgba(192, 192, 192, 0.05);
        color: var(--text-primary);
    }

.hint {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: -10px;
    font-weight: 300;
}

/* Stage sections */
.stage-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

    .stage-section.current-stage {
        border-color: var(--accent);
        box-shadow: 0 0 15px rgba(192, 192, 192, 0.05);
    }

    .stage-section.past-stage {
        opacity: 0.8;
    }

    .stage-section.future-stage {
        opacity: 0.5;
    }

.stage-complete,
.stage-pending {
    padding: 5px 0;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 300;
}

.match-label {
    color: var(--accent);
    font-weight: 300;
    margin-bottom: 10px;
    font-family: 'Cinzel', 'Georgia', serif;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.82em;
    opacity: 0.85;
}

.match-players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.player-name {
    flex: 1;
    text-align: center;
    padding: 5px;
    font-weight: 300;
}

    .player-name.winner {
        color: var(--accent);
        font-weight: 400;
        position: relative;
    }

        .player-name.winner::after {
            content: '';
            margin-left: 5px;
        }

.match-pending {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 4px;
    margin: 5px 0;
    font-weight: 300;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }

    .title {
        font-size: 1.4em;
    }

    .header {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    .nav {
        gap: 10px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .table {
        font-size: 0.85em;
    }

        .table th,
        .table td {
            font-variant-numeric: tabular-nums;
            padding: 8px;
        }

    .button {
        padding: 10px 20px;
        font-size: 0.85em;
    }

    .tournament-card {
        flex-direction: column;
        align-items: stretch;
    }

    .manage-btn {
        width: 100%;
        text-align: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent);
    }


/* Добавьте после существующих стилей */

.result-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.result-btn {
    flex: 1;
    position: relative;
    cursor: pointer;
}

    .result-btn input[type="radio"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .result-btn span {
        display: block;
        padding: 12px 8px;
        text-align: center;
        font-size: 0.8em;
        font-family: 'Cinzel', serif;
        font-weight: 300;
        letter-spacing: 1.5px;
        border: 1px solid var(--border);
        border-radius: 2px;
        transition: all 0.3s ease;
        background: var(--bg-secondary);
        color: var(--text-muted);
        text-transform: uppercase;
    }

.win1-btn span {
    border-color: #4a6741;
}

.draw-btn span {
    border-color: var(--border-light);
}

.win2-btn span {
    border-color: #4a6741;
}

.result-btn input[type="radio"]:checked + span {
    background: rgba(192, 192, 192, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.win1-btn input[type="radio"]:checked + span {
    background: rgba(74, 103, 65, 0.1);
    border-color: #4a6741;
    color: #7cb342;
}

.draw-btn input[type="radio"]:checked + span {
    background: rgba(192, 192, 192, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.win2-btn input[type="radio"]:checked + span {
    background: rgba(74, 103, 65, 0.1);
    border-color: #4a6741;
    color: #7cb342;
}

.result-btn:hover span {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pair-names {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.player-name-display {
    font-weight: 300;
    flex: 1;
    text-align: center;
    font-size: 1em;
}

.vs-small {
    color: var(--accent);
    font-family: 'Georgia', serif;
    margin: 0 10px;
    font-size: 0.9em;
}


/* Добавьте после существующих стилей */

.delete-btn {
    background: linear-gradient(135deg, #1a1010 0%, #200808 100%);
    border: 1px solid #6b2020;
    color: #a06060;
}

    /* Shimmer red-tinted for delete */
    .delete-btn::before {
        background: linear-gradient(90deg, transparent, rgba(180, 60, 60, 0.2), transparent);
    }

    /* Top-left corner ornament red */
    .delete-btn::after {
        border-color: #8b0000;
    }

    .delete-btn:hover {
        background: linear-gradient(135deg, #2a1a1a 0%, #3a1a1a 100%);
        border-color: #8b0000;
        color: #c06060;
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.2);
    }

.season-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.season-info {
    flex: 1;
}

.tournament-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.tournament-info {
    flex: 1;
}

.tournament-actions,
.final-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

    /* Delete sits bottom-right, pushed further from edge */
    .tournament-actions .delete-btn,
    .final-actions .delete-btn {
        align-self: stretch;
        margin-right: 0;
        margin-top: 2px;
    }

.final-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.final-info {
    flex: 1;
}
/* ── Additional Ornamental Enhancements ── */

/* Decorative header top border glow */
.header {
    border-radius: 4px;
    border-top: 2px solid rgba(192, 192, 192, 0.15);
}

/* Subtle animated shimmer on header */
@keyframes shimmer {
    0% {
        opacity: 0.3;
        transform: translateX(-100%);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Label styling upgrade */
.label {
    color: var(--text-muted);
    font-size: 0.8em;
    margin-bottom: -10px;
    font-family: 'Cinzel', serif;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Input upgrade */
.input {
    border-radius: 2px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1em;
    letter-spacing: 0.5px;
}

    .input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 1px rgba(192,192,192,0.06), 0 2px 12px rgba(0,0,0,0.4);
    }

/* Season/tournament/final cards — match card border-radius */
.season-card,
.tournament-card,
.final-card {
    border-radius: 2px;
}

/* Stage section upgrade */
.stage-section {
    border-radius: 2px;
}

/* Place section upgrade */
.place {
    border-radius: 2px;
}

/* Match card upgrade */
.pair-card,
.match-card {
    border-radius: 2px;
}

.match-players {
    border-radius: 2px;
}

/* Place gold: subtle left accent bar */
.place-gold {
    border-left: 3px solid var(--gold);
}

.place-silver {
    border-left: 3px solid var(--silver);
}

.place-bronze {
    border-left: 3px solid var(--bronze);
}

/* player-name winner glow */
.player-name.winner {
    color: var(--accent);
    font-weight: 400;
    text-shadow: 0 0 12px rgba(192, 192, 192, 0.25);
}

/* Scrollbar upgrade */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-light), var(--accent));
    border-radius: 3px;
    opacity: 0.7;
}

/* vs-small Cinzel */
.vs-small {
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    margin: 0 10px;
    font-size: 0.8em;
    letter-spacing: 3px;
    opacity: 0.7;
}

/* Badge upgrade */
.badge {
    font-family: 'Cinzel', serif;
    letter-spacing: 1.5px;
    border-radius: 2px;
    font-size: 0.78em;
}

/* Stage-section h3 override */
.stage-section h3 {
    font-family: 'Cinzel', serif;
    letter-spacing: 3px;
    font-size: 0.9em;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ── New feature styles ── */

/* Muted player/season links — look like text, glow on hover */
.muted-link {
    color: inherit;
    text-decoration: none;
    font-family: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    font-size: inherit;
    transition: color 0.25s ease, text-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

    .muted-link:hover {
        color: var(--accent);
        text-shadow: 0 0 10px rgba(192, 192, 192, 0.2);
    }

/* Table scroll wrapper for mobile */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}

    .table-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .table-scroll::-webkit-scrollbar-thumb {
        background: var(--border-light);
        border-radius: 2px;
    }

/* Season matches list under each season in player profile */
.season-matches {
    margin: 6px 0 14px 0;
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.match-result-row {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(37, 37, 37, 0.6);
    font-size: 0.95em;
    flex-wrap: nowrap; /* было wrap */
    min-height: 32px;
}

    .match-result-row .text-muted {
        color: #888;
        font-size: 0.9em;
    }

.match-vs-name {
    flex: 1;
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: #bbb;
    letter-spacing: 0.5px;
    line-height: 1;
}

.match-outcome {
    font-family: 'Cinzel', serif;
    font-size: 0.85em;
    color: #999;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 300;
    min-width: 90px;
    text-align: right;
    line-height: 1;
}

.match-win {
    border-left: 2px solid rgba(124, 179, 66, 0.4);
    padding-left: 8px;
    margin-left: -10px;
}

.match-loss {
    border-left: 2px solid rgba(160, 96, 96, 0.35);
    padding-left: 8px;
    margin-left: -10px;
}

.match-draw {
    border-left: 2px solid rgba(112, 112, 112, 0.3);
    padding-left: 8px;
    margin-left: -10px;
}

/* stat-item spacing */
.stat-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

    .stat-item:last-of-type {
        border-bottom: none;
    }

/* Table min-width so it doesn't squeeze on mobile */
.table {
    min-width: 400px;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.82em;
    }

        .table th,
        .table td {
            padding: 8px 6px;
        }
}

.tournament-actions .button,
.final-actions .button {
    width: 160px;
    text-align: center;
    box-sizing: border-box;
    letter-spacing: 1.5px;
    padding: 10px 12px;
}

.stat-item-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

    .stat-item-header .season-link {
        font-family: 'Cinzel', serif;
        font-size: 1em;
        white-space: nowrap;
    }

    .stat-item-header .text-muted {
        font-family: 'Lora', serif;
        font-size: 0.9em;
        line-height: 1.4;
    }

.active-pairs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.active-pair {
    font-size: 0.88em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 3px 10px;
    font-family: 'Lora', serif;
}

.pin-btn {
    font-size: 1.3em;
    color: var(--border-light);
    text-decoration: none;
    margin-right: 3px;
    transition: color 0.2s ease;
    text-transform: none;
    vertical-align: super;
    line-height: 0;
}

    .pin-btn:hover {
        color: var(--accent);
    }

    .pin-btn.pinned {
        color: var(--gold);
    }

.deck-link {
    font-size: 0.78em;
    font-family: 'Lora', serif;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

    .deck-link:hover {
        color: var(--accent);
    }

.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
    align-items: start;
}

.bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.bg-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border: 2px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.2s ease;
}

.bg-none-btn {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.78em;
    letter-spacing: 1px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.bg-thumb-full {
    width: 100%;
    max-width: 200px;
    height: 120px;
    object-fit: cover;
    border: 2px solid var(--border);
    border-radius: 2px;
}

.bg-option-sync {
    width: 200px;
    flex-shrink: 0;
}

.bg-option.active .bg-thumb,
.bg-option.active .bg-none-btn {
    border-color: var(--accent);
}

.bg-none-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Таблица — цифры крупнее */
.table td:not(:nth-child(2)) {
    font-size: 1.05em;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    margin: 20px 0;
}

    .auth-divider::before,
    .auth-divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--border);
    }

    .auth-divider span {
        padding: 0 12px;
        font-size: 0.9em;
    }

.telegram-login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Карточки полупрозрачные */
.card {
    background: rgba(18, 18, 18, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.season-card,
.tournament-card,
.final-card {
    background: rgba(22, 22, 22, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Кнопки */
.button {
    background: linear-gradient(135deg, rgba(26,26,26,0.85) 0%, rgba(34,34,34,0.85) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

    .button:hover {
        background: linear-gradient(135deg, rgba(34,34,34,0.9) 0%, rgba(44,44,44,0.9) 100%);
    }

/* Хедер */
.header {
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Таблица */
.table {
    background: transparent;
}

    .table tr {
        background: rgba(0, 0, 0, 0.3);
    }

    .table th {
        background: rgba(10, 10, 10, 0.6);
    }

    .table tr:hover {
        background: rgba(255, 255, 255, 0.04);
    }

a:visited {
    color: inherit;
}

.player-link:visited,
.muted-link:visited,
.season-link:visited,
.deck-link:visited {
    color: inherit;
}

.match-pair {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.match-player {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 80px;
}

.match-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.match-result-outcome {
    color: var(--text-muted);
    font-size: 0.9em;
    white-space: nowrap;
    align-self: center;
}

.vs-small {
    align-self: center;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.8em;
    letter-spacing: 3px;
    opacity: 0.7;
}

/* Плавная прокрутка для всей страницы */
html {
    scroll-behavior: smooth;
}

/* Дополнительная плавность для карточек при появлении */
.card, .season-card, .tournament-card, .match-card, .pair-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

    /* Задержки для последовательного появления */
    .season-card:nth-child(1) {
        animation-delay: 0.05s;
    }

    .season-card:nth-child(2) {
        animation-delay: 0.10s;
    }

    .season-card:nth-child(3) {
        animation-delay: 0.15s;
    }

    .season-card:nth-child(4) {
        animation-delay: 0.20s;
    }

    .season-card:nth-child(5) {
        animation-delay: 0.25s;
    }

    .season-card:nth-child(6) {
        animation-delay: 0.30s;
    }

    .season-card:nth-child(7) {
        animation-delay: 0.35s;
    }

    .season-card:nth-child(8) {
        animation-delay: 0.40s;
    }

    .season-card:nth-child(9) {
        animation-delay: 0.45s;
    }

    .season-card:nth-child(10) {
        animation-delay: 0.50s;
    }

    .tournament-card:nth-child(1) {
        animation-delay: 0.05s;
    }

    .tournament-card:nth-child(2) {
        animation-delay: 0.10s;
    }

    .tournament-card:nth-child(3) {
        animation-delay: 0.15s;
    }

    .tournament-card:nth-child(4) {
        animation-delay: 0.20s;
    }

    .tournament-card:nth-child(5) {
        animation-delay: 0.25s;
    }

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Плавный ховер для ссылок и кнопок */
.nav-link, .button, .season-link, .player-link, .muted-link {
    transition: all 0.25s ease;
}

.button {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

    .button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

/* Плавное появление таблиц */
.table tbody tr {
    transition: background-color 0.2s ease;
}

    .table tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

/* Плавный скролл для контейнеров с overflow */
.table-scroll {
    scroll-behavior: smooth;
}

/* Плавное изменение фона карточек при наведении */
.card, .season-card, .tournament-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

    .season-card:hover, .tournament-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    }

/* Плавное появление элементов в паре */
.match-pair {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

    .match-pair:nth-child(1) {
        animation-delay: 0.05s;
    }

    .match-pair:nth-child(2) {
        animation-delay: 0.10s;
    }

    .match-pair:nth-child(3) {
        animation-delay: 0.15s;
    }

    .match-pair:nth-child(4) {
        animation-delay: 0.20s;
    }

    .match-pair:nth-child(5) {
        animation-delay: 0.25s;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Плавная смена фона при переключении тем */
#site-bg {
    transition: background-image 0.5s ease, background-color 0.5s ease;
}

/* Плавный скролл для мобильных устройств */
@media (max-width: 768px) {
    .table-scroll {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}
/* ── Background settings panel ── */
.bg-settings {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bg-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .bg-settings-row .text-muted {
        min-width: 200px;
        font-size: 0.9em;
    }

.bg-mode-toggle {
    display: flex;
    gap: 6px;
}

.bg-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bg-slider {
    flex: 1;
    min-width: 120px;
    max-width: 220px;
    accent-color: var(--accent);
    cursor: pointer;
}

.active-btn {
    border-color: var(--accent) !important;
    color: var(--text-primary) !important;
    background: rgba(192,192,192,0.1) !important;
}

/* Убрать серые уголки у кнопок */
.button {
    isolation: isolate;
}

/* Убрать подчёркивание и синий цвет у всех muted-link */
.muted-link,
.muted-link:visited,
.muted-link:hover {
    text-decoration: none;
    color: inherit;
}

a:visited {
    color: inherit;
}

.player-link:visited,
.season-link:visited,
.deck-link:visited,
.muted-link:visited {
    color: inherit;
    text-decoration: none;
}

/* Крестик удаления фона — серый без подчёркивания */
.bg-delete-btn {
    font-size: 0.75em;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease, color 0.2s ease;
    line-height: 1;
}

    .bg-delete-btn:hover {
        opacity: 1;
        color: var(--accent);
        text-decoration: none;
    }

    .bg-delete-btn:visited {
        color: var(--text-muted);
    }

@media (max-width: 600px) {
    .bg-settings-row {
        flex-direction: column;
        align-items: flex-start;
    }

        .bg-settings-row .text-muted {
            min-width: unset;
        }
}

.match-result-outcome a.muted-link {
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    vertical-align: baseline;
    line-height: inherit;
}

.match-result-outcome .player-link {
    display: inline;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    vertical-align: baseline;
    overflow: visible; /* убрать clip */
}

    .match-result-outcome .player-link::before {
        display: none; /* отключить shimmer в этом контексте */
    }