﻿:root {
            --bg-color: #0f172a; 
            --card-bg: rgba(30, 41, 59, 0.45); 
            --accent-blue: #3b82f6;
            --accent-green: #10b981;
            --text-white: #ffffff;
            --text-gray: #94a3b8;
            --border: rgba(255, 255, 255, 0.1);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { background-color: var(--site-bg); color: var(--text-white); min-height: 100vh; }
        .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

        main { padding: 60px 0; }
        h1 { font-size: 42px; font-weight: 800; margin-bottom: 40px; }

        .tournaments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
        .tournament-card { background: var(--card-bg); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 24px; padding: 30px; cursor: pointer; transition: 0.4s; }
        .tournament-card:hover { transform: translateY(-10px); border-color: var(--accent-blue); background: rgba(30, 41, 59, 0.7); }
        .tournament-card__link { margin-top: 20px; font-size: 12px; color: var(--accent-blue); font-weight: 700; }
        .status-badge { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 15px; display: inline-block; }

        .details-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.98); z-index: 2000; overflow: auto; padding: 40px 0; }
        .details-content { background: var(--card-bg); border-radius: 32px; padding: 40px; border: 1px solid var(--border); max-width: 1300px; margin: 0 auto; }
        .close-btn { float: right; cursor: pointer; font-size: 32px; color: var(--text-gray); }
        .modal-title { font-size: 32px; }
        .modal-desc { color: var(--text-gray); margin-bottom: 30px; }

        .modal-info { font-size: 14px; color: var(--text-gray); }

        .modal-event-info { font-size: 14px; color: var(--text-gray); margin-top: 12px; }
        .modal-event-info__label { font-weight: 700; margin-bottom: 8px; color: var(--text-white); }
        .modal-event-info__row { margin-top: 6px; }

        .bracket-container { display: flex; gap: 30px; margin-top: 40px; padding-bottom: 20px; overflow-x: auto; align-items: stretch; }
        .round { display: flex; flex-direction: column; justify-content: space-around; min-width: 240px; }
        .round-header { text-align: center; color: var(--text-gray); font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 20px; }
        .match-box { background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; padding: 10px; position: relative; }
        .team-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.05); }
        .team-line:last-child { border-bottom: none; }
        .team-line.winner { color: var(--accent-blue); font-weight: 700; }
        .m-score { background: rgba(255,255,255,0.05); padding: 0 6px; border-radius: 4px; font-family: monospace; min-width: 25px; text-align: center; }

        .chess-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; background: rgba(15, 23, 42, 0.4); border-radius: 12px; overflow: hidden; }
        .chess-table th, .chess-table td { padding: 12px; border: 1px solid var(--border); text-align: center; }
        .chess-table th { background: rgba(59, 130, 246, 0.1); color: var(--text-gray); font-weight: 600; }
        .chess-table .player-name { text-align: left; font-weight: 600; min-width: 200px; }
        .chess-table .points { font-weight: 800; color: var(--accent-blue); }
        .chess-table .cell-res { font-size: 12px; color: var(--text-gray); }

        .podium-box { margin-top: 40px; background: rgba(255, 255, 255, 0.03); border-radius: 20px; padding: 25px; border: 1px solid var(--border); }
        .podium-title { margin-bottom: 20px; }
        .podium-row { display: flex; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--border); }
        .podium-row:last-child { border-bottom: none; }
        .rank-num { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
        .gold { background: #ffd700; color: #000; }
        .silver { background: #c0c0c0; color: #000; }
        .bronze { background: #cd7f32; color: #000; }

        .download-btn {
            display: block;
            width: fit-content;
            margin: 30px auto 0;
            background: var(--accent-green);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: 0.3s;
            font-size: 14px;
        }
        .download-btn:hover {
            filter: brightness(1.2);
            transform: scale(1.05);
        }
.pdf-printing {
    background-color: #0f172a !important;
    color: #ffffff !important;
    padding: 20px !important;
}

.pdf-printing * {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.pdf-printing .match-box, 
.pdf-printing .chess-table,
.pdf-printing .podium-box {
    background-color: #1e293b !important;
}

.pdf-printing .winner {
    color: #3b82f6 !important;
}

.pdf-printing .m-score {
    background-color: #334155 !important;
    color: #ffffff !important;
}

.pdf-printing .rank-num {
    color: #000000 !important;
}

@media (max-width: 640px) {
    .details-content { padding: 18px; max-width: calc(100% - 32px); margin: 12px; border-radius: 16px; }
    .bracket-container { flex-direction: column; gap: 14px; }
    .podium-box { padding: 18px; }
    .modal-title { font-size: 20px; }
    .modal-desc { margin-bottom: 16px; }
    .modal-event-info__label { font-size: 14px; }
    .modal-event-info__row { font-size: 13px; }
}
