@charset "UTF-8";

        /* =========================================
           Badminton Match Ranking — GIAO DIỆN "SÂN NẮNG"
           Đơn giản, ấm áp, dễ nhìn — thay cho bản neumorphism cũ
           ========================================= */
        :root {
            /* ===== Sân Sáng (light mode) ===== */
            --bg-body: #F3F5FA;
            --bg-panel: #FFFFFF;
            --bg-input: #EEF1F8;
            --primary: #3651E0;
            --secondary: #FF7A45;
            --success: #1CA860;
            --danger: #E5493E;
            --info: #3651E0;
            --warning: #E08A1E;
            --text-main: #16213A;
            --text-muted: #6B7590;
            --border-color: rgba(28,42,84,0.10);
            --shadow-outer: 0 8px 20px -10px rgba(22,33,58,0.18);
            --shadow-inner: inset 0 0 0 1px rgba(22,33,58,0.08);
            --glow-active: 0 0 0 2px rgba(54,81,224,0.30);
            --gold: #C98A11; --silver: #7C8494; --bronze: #B96B2C;
        }

        .dark-mode {
            /* ===== Than Chì (dark mode) ===== */
            --bg-body: #14161C;
            --bg-panel: #1C1F28;
            --bg-input: #161820;
            --primary: #6C8CFF;
            --secondary: #FF7AA2;
            --success: #3DDC97;
            --danger: #FF6B6B;
            --info: #6C8CFF;
            --warning: #FFB84D;
            --text-main: #F1F2F6;
            --text-muted: #8B8FA3;
            --border-color: rgba(108,140,255,0.16);
            --shadow-outer: 0 8px 20px -10px rgba(0,0,0,0.55);
            --shadow-inner: inset 0 0 0 1px rgba(241,242,246,0.10);
            --glow-active: 0 0 0 2px rgba(108,140,255,0.4);
            --gold: #FFC94D; --silver: #C7CDD6; --bronze: #E0975A;
        }

        body { font-family: 'Be Vietnam Pro', -apple-system, sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 15px; transition: background-color 0.2s ease; }
        .container { max-width: 900px; margin: 0 auto; position: relative;}

        .banner-login { width: 100%; object-fit: cover; border-radius: 20px; margin-bottom: 20px; height: 140px; border: 1px solid var(--border-color); }

        .auth-screen, .header, .section, .board-half, .edit-box {
            background: var(--bg-panel);
            padding: 20px;
            border-radius: 20px;
            box-shadow: var(--shadow-outer);
            border: 1px solid var(--border-color);
            margin-bottom: 25px;
        }
        .auth-screen { max-width: 450px; margin: 50px auto; text-align: center; }
        .header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; }
        h1 { font-family: 'Nunito', sans-serif; color: var(--primary); margin: 0; font-size: 22px; font-weight: 800; display: flex; align-items: center; flex-wrap: wrap;}

        input[type="text"], input[type="password"], input[type="number"], input[type="date"] {
            width: 100%; padding: 13px 15px; margin-bottom: 12px;
            border: 1px solid var(--border-color); border-radius: 12px;
            box-sizing: border-box; font-size: 16px; font-family: 'Be Vietnam Pro', sans-serif;
            background: var(--bg-input); color: var(--text-main);
            outline: none; transition: 0.2s;
        }
        input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,158,130,0.15); }

        button {
            padding: 13px 20px; min-height: 44px; border: none; border-radius: 12px; cursor: pointer;
            font-weight: 700; font-size: 14.5px; font-family: 'Be Vietnam Pro', sans-serif;
            color: #fff; transition: transform 0.1s ease, opacity 0.15s ease;
        }
        button:active { transform: scale(0.98); opacity: 0.9; }

        .btn-primary { background: var(--primary); box-shadow: 0 6px 14px -6px rgba(31,158,130,0.5); }
        .btn-success { background: var(--success); box-shadow: 0 6px 14px -6px rgba(61,190,108,0.5); }
        .btn-danger { background: var(--danger); box-shadow: 0 6px 14px -6px rgba(240,83,63,0.5); }
        .btn-info { background: var(--info); box-shadow: 0 6px 14px -6px rgba(62,154,224,0.5); }
        .btn-warning { background: var(--warning); color: #fff; box-shadow: 0 6px 14px -6px rgba(255,138,61,0.5); }
        .btn-outline { background: var(--bg-panel); color: var(--text-main); box-shadow: none; border: 1px solid var(--border-color); }
        .btn-outline:active { background: var(--bg-input); }
        .header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
        .btn-mini { padding: 6px 11px; min-height: 32px; font-size: 12px; border-radius: 10px; white-space: nowrap; box-shadow: none; }

        .nav-tabs { display: flex; gap: 8px; margin-bottom: 20px; padding: 4px; background: var(--bg-input); border-radius: 999px; }
        .tab-btn { flex: 1; padding: 12px; background: transparent; color: var(--text-muted); border-radius: 999px; transition: 0.2s; border: none; font-weight: 700; }
        .tab-btn.active { color: #fff; font-weight: 800; background: var(--primary); }
        .tab-pane { display: none; }
        .tab-pane.active { display: block; animation: fadeIn 0.25s ease-out; }

        /* ===== BOTTOM NAV (menu tab cố định dưới đáy) ===== */
        #app_screen { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
        .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: var(--bg-panel); border-top: 1px solid var(--border-color); box-shadow: 0 -8px 22px -12px rgba(0,0,0,0.55); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
        .bottom-nav-inner { display: flex; gap: 4px; max-width: 900px; margin: 0 auto; }
        .bottom-nav .tab-btn { flex: 1 1 0; min-width: 0; margin: 0; padding: 7px 2px 6px; background: transparent; border: none; box-shadow: none; border-radius: 12px; color: var(--text-muted); font-size: 10.5px; font-weight: 700; line-height: 1.2; white-space: normal; text-align: center; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
        .bottom-nav .tab-btn .nav-ico { display: block; font-size: 20px; line-height: 1.15; margin-bottom: 2px; transition: transform 0.2s; }
        .bottom-nav .tab-btn .nav-lbl { display: block; overflow-wrap: anywhere; }
        .bottom-nav .tab-btn.active { background: transparent; box-shadow: none; color: var(--primary); font-weight: 800; }
        .bottom-nav .tab-btn.active .nav-ico { transform: translateY(-1px) scale(1.12); }
        .bottom-nav .tab-btn.active::before { content: ''; position: absolute; top: -6px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
        @media (min-width: 769px) { .bottom-nav .tab-btn { font-size: 12px; padding: 8px 6px 7px; } .bottom-nav .tab-btn .nav-ico { font-size: 22px; } }
        @media (max-width: 768px) { .bottom-nav.kb-open { display: none; } } /* ẩn menu khi đang gõ bàn phím */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

        .filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; flex-wrap: wrap; }
        .filter-bar input[type="date"] { margin-bottom: 0; }
        /* Cặp ô Từ ngày / Đến ngày luôn nằm trên 1 hàng (kể cả trên điện thoại) */
        .date-range-row { display: flex; flex-wrap: nowrap; gap: 10px; flex: 2 1 300px; min-width: 0; }
        .date-range-row input[type="date"] { flex: 1 1 0; width: auto; min-width: 0; margin-bottom: 0; }
        @media (max-width: 480px) { .date-range-row { gap: 8px; } .date-range-row input[type="date"] { padding: 13px 8px; } }

        .match-date-input-container { text-align: center; margin-bottom: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--bg-panel); border: 1px solid var(--border-color); padding: 14px; border-radius: 14px;}

        .match-form { display: grid; grid-template-columns: 1fr 100px 1fr; gap: 12px; align-items: center; margin-top: 15px; }

        .team-box { background: var(--bg-input); padding: 15px; border-radius: 16px; border: 2px solid transparent; transition: all 0.2s ease; position: relative; }
        .team-box.active { border-color: var(--success); background: rgba(61,190,108,0.08); }
        .team-box h3 { text-align: center; margin-top: 0; margin-bottom: 12px; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800;}

        .winner-selector { display: flex; justify-content: center; margin-top: 12px; }
        .winner-selector label { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg-panel); border: 1.5px dashed var(--border-color); padding: 10px; border-radius: 12px; cursor: pointer; width: 100%; transition: 0.2s; color: var(--text-muted); font-weight: 700;}
        .winner-selector input { margin: 0; cursor: pointer; width: 16px; height: 16px; display: none;}
        .winner-selector input:checked + span { color: var(--success); }
        .team-box.active .winner-selector label { background: var(--success); border-color: var(--success); border-style: solid; color: #fff; }

        .vs-badge { width: 48px; height: 48px; border-radius: 50%; background: var(--warning); display: flex; justify-content: center; align-items: center; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15px; color: #fff; border: 3px solid var(--bg-body); z-index: 10; margin: auto;}

        .form-footer { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; background: var(--bg-panel); border: 1px solid var(--border-color); padding: 16px; border-radius: 16px; gap: 15px;}

        .table-responsive { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border-color); background: var(--bg-panel); margin-top: 15px;}
        table { width: 100%; border-collapse: collapse; min-width: 550px; }
        table, th, td { border: none; }
        th { background: var(--bg-input); color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; padding: 13px; border-bottom: 1px solid var(--border-color);}
        td { padding: 13px; text-align: center; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border-color);}

        .row-top1 td { color: var(--gold) !important; background: rgba(255,201,77,0.16); }
        .row-top2 td { color: var(--text-main) !important; background: rgba(201,210,216,0.20); }
        .row-top3 td { color: var(--bronze) !important; background: rgba(227,146,87,0.16); }
        .row-bot1 td { color: var(--danger) !important; background: rgba(240,83,63,0.1); }
        .row-bot2 td, .row-bot3 td { color: var(--danger) !important; background: rgba(240,83,63,0.05); }

        /* ===== Bảng Thành Tích — ghim cột STT + Tên khi cuộn ngang ===== */
        .rank-table-wrap { max-height: 70vh; overflow: auto; }
        .rank-table { min-width: 620px; }
        .rank-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-input); }
        .rank-table th:first-child, .rank-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-panel); width: 44px; }
        .rank-table thead th:first-child { z-index: 3; background: var(--bg-input); }
        .rank-table th:nth-child(2), .rank-table td:nth-child(2) { position: sticky; left: 44px; z-index: 1; background: var(--bg-panel); text-align: left !important; }
        .rank-table thead th:nth-child(2) { z-index: 3; background: var(--bg-input); }
        .rank-table td:nth-child(2), .rank-table th:nth-child(2) { box-shadow: 2px 0 6px -2px rgba(0,0,0,0.25); }
        .rank-table tr.row-top1 td:first-child, .rank-table tr.row-top1 td:nth-child(2) { background: linear-gradient(rgba(255,201,77,0.20), rgba(255,201,77,0.20)), var(--bg-panel); }
        .rank-table tr.row-top2 td:first-child, .rank-table tr.row-top2 td:nth-child(2) { background: linear-gradient(rgba(201,210,216,0.26), rgba(201,210,216,0.26)), var(--bg-panel); }
        .rank-table tr.row-top3 td:first-child, .rank-table tr.row-top3 td:nth-child(2) { background: linear-gradient(rgba(227,146,87,0.20), rgba(227,146,87,0.20)), var(--bg-panel); }
        .rank-table tr.row-bot1 td:first-child, .rank-table tr.row-bot1 td:nth-child(2) { background: linear-gradient(rgba(240,83,63,0.14), rgba(240,83,63,0.14)), var(--bg-panel); }
        .rank-table tr.row-bot2 td:first-child, .rank-table tr.row-bot2 td:nth-child(2),
        .rank-table tr.row-bot3 td:first-child, .rank-table tr.row-bot3 td:nth-child(2) { background: linear-gradient(rgba(240,83,63,0.08), rgba(240,83,63,0.08)), var(--bg-panel); }
        .rank-table .medal-ico { font-size: 17px; }

        /* ===== Chế độ hiển thị: Thẻ trên điện thoại, Bảng ghim cột trên màn rộng ===== */
        .rank-card-list { display: flex; flex-direction: column; gap: 9px; margin-top: 15px; }
        .rank-table-wrap { display: none; }
        @media (min-width: 769px) {
            .rank-card-list { display: none; }
            .rank-table-wrap { display: block; }
        }

        .p-card {
            background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 16px;
            padding: 13px 13px 13px 11px; display: flex; align-items: flex-start; gap: 10px; box-shadow: var(--shadow-outer);
        }
        .p-card.row-top1 { border-color: rgba(255,201,77,0.55); background: linear-gradient(135deg, rgba(255,201,77,0.12), var(--bg-panel) 55%); }
        .p-card.row-top2 { border-color: rgba(201,210,216,0.5); }
        .p-card.row-top3 { border-color: rgba(227,146,87,0.5); }
        .p-card.row-bot1, .p-card.row-bot2, .p-card.row-bot3 { border-color: rgba(240,83,63,0.35); }
        .p-rank { width: 28px; flex-shrink: 0; text-align: center; padding-top: 3px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 16px; color: var(--text-muted); }
        .p-rank .medal-ico { font-size: 21px; }
        .p-avatar {
            width: 44px; height: 44px; border-radius:8px; flex-shrink: 0; overflow: hidden;
            background: var(--bg-input); border: 2px solid var(--border-color);
            display: flex; align-items: center; justify-content: center;
            font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 17px; color: var(--primary);
        }
        .p-card.row-top1 .p-avatar { border-color: var(--gold); }
        .p-card.row-top2 .p-avatar { border-color: var(--silver); }
        .p-card.row-top3 .p-avatar { border-color: var(--bronze); }
        .p-avatar img { width: 100%; height: 100%; object-fit: cover; }
        .p-main { flex: 1; min-width: 0; }
        .p-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
        .p-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 18px; color: var(--text-main); }
        .p-winrate-row { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
        .p-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-input); overflow: hidden; }
        .p-bar > i { display: block; height: 100%; border-radius: 999px; }
        .p-winrate-val { font-size: 13px; font-weight: 700; color: var(--text-muted); width: 38px; text-align: right; flex-shrink: 0; }
        .p-detail { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-color); }
        .p-detail.open { display: grid; }
        .p-detail .d-box { text-align: center; }
        .p-detail .d-val { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15.5px; }
        .p-detail .d-lbl { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
        .p-expand-btn { width: 100%; text-align: center; background: transparent; border: none; color: var(--text-muted); font-size: 12px; padding: 7px 0 0; cursor: pointer; font-family: inherit; }
        .p-score { text-align: right; flex-shrink: 0; padding-left: 8px; border-left: 1px solid var(--border-color); }
        .p-score .val { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 22px; line-height: 1; color: var(--success); }
        .p-score .val.neg { color: var(--danger); }
        .p-score .lbl { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
        .p-score .wl { font-size: 12px; color: var(--text-muted); margin-top: 5px; white-space: nowrap; }

        .history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; margin-top: 15px; }
        .match-card-v2 { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 18px; padding: 18px 15px; padding-bottom: 40px; box-shadow: var(--shadow-outer); position: relative; overflow: hidden; }
        .match-card-v2::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--primary); }

        .match-info-header { text-align: center; font-size: 11px; color: var(--text-muted); margin-bottom: 14px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 700;}
        .match-battle-area { display: flex; justify-content: space-between; align-items: center; position: relative; }
        .team-col { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;}
        .team-col.loser .avatar-split-container, .team-col.loser .team-names-v2 { filter: grayscale(60%); opacity: 0.5; }

        .avatar-split-container { position: relative; width: 74px; height: 74px; margin-bottom: 10px;}
        .ava-p1, .ava-p2 { width: 46px; height: 46px; border-radius: 8px; position: absolute; background: var(--bg-input); display: flex; justify-content: center; align-items: center; font-weight: 800; overflow: hidden; z-index: 2; font-size: 16px; border: 2px solid var(--bg-panel);}
        .ava-p1 img, .ava-p2 img { width: 100%; height: 100%; object-fit: cover; }
        .ava-p1 { top: -2px; left: -2px; }
        .ava-p2 { bottom: -2px; right: -2px; z-index: 1;}
        .avatar-split-container.single-mode .ava-p1 { width: 100%; height: 100%; top: 0; left: 0; border-radius: 12px; font-size: 26px;}

        .diagonal-line { position: absolute; top: 50%; left: 50%; width: 160%; height: 1px; background: var(--border-color); transform: translate(-50%, -50%) rotate(-45deg); z-index: 1; }
        .team-names-v2 { text-align: center; font-size: 12.5px; line-height: 1.4; font-weight: 700; color: var(--text-main); width: 100%;}

        .stamp { position: absolute; top: 35%; left: 50%; transform: translate(-50%, -50%) rotate(-10deg); font-size: 14px; font-weight: 800; padding: 4px 10px; border: 2px solid; border-radius: 10px; z-index: 10; text-transform: uppercase; background: var(--bg-panel);}
        .stamp.win { color: var(--success); border-color: var(--success); }
        .stamp.lose { color: var(--danger) !important; border-color: var(--danger) !important; }

        .vs-col { width: 66px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; z-index: 5; margin: 0 8px;}
        .vs-fire-text { font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900; color: var(--text-muted); opacity: 0.6; margin-bottom: 4px;}
        .bet-badge { background: var(--bg-input); color: var(--text-main); padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; margin-top: 5px; border: 1px solid var(--border-color); white-space: nowrap;}
        .score-badge { color: #fff; background: var(--secondary); font-size: 11px; }

        .match-card-v2 .card-actions { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 6px; }
        .match-card-v2 .card-actions button { padding: 6px 12px; font-size: 11px; min-height: 28px; }
        @media (max-width: 768px) { .match-card-v2 .card-actions { opacity: 1; } }

        .boards-container { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 15px; }
        .board-half { flex: 1; min-width: 300px; }
        .board-half h3 { text-align: center; margin-top: 0; font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800;}
        .podium-container { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin-top: 40px; min-height: 170px; }
        .podium-box { width: 30%; text-align: center; border-radius: 16px 16px 4px 4px; color: var(--text-main); padding-top: 12px; font-weight: 700; position: relative; display: flex; flex-direction: column;}

        .podium-1 { background: var(--gold); height: 160px; z-index: 3; }
        .podium-2 { background: var(--silver); height: 130px; z-index: 2; }
        .podium-3 { background: var(--bronze); height: 110px; z-index: 1; color: #fff; }
        .podium-bot-1 { background: var(--danger); height: 160px; z-index: 3; color: #fff; }
        .podium-bot-2, .podium-bot-3 { background: #E39B94; height: 120px; z-index: 2; color: #fff; }
        .podium-water-1 { background: var(--secondary); height: 160px; z-index: 3; color: #fff; }
        .podium-water-2, .podium-water-3 { background: #9FCBEE; height: 120px; z-index: 2; color: var(--text-main); }

        .podium-avatar { width: 50px; height: 50px; background: var(--bg-panel); border-radius:8px; margin: -40px auto 10px auto; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 3px solid #fff; color: var(--text-main); overflow: hidden;}
        .podium-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius:8px; }
        .podium-name { font-size: 13px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 5px; font-weight: 700; }
        .podium-score { font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900; background: rgba(0,0,0,0.12); margin: auto 8px 12px 8px; border-radius: 8px; padding: 4px 0;}

        .stats-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 20px; }
        /* Thống Kê Chi Tiết Tháng - layout Top 5 theo mẫu infographic */
        .monthly-top5-wrap { display: grid; gap: 22px; margin-top: 20px; }
        .monthly-top5-section { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 22px; padding: 14px; box-shadow: var(--shadow-outer); overflow: hidden; }
        .monthly-top5-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px 14px; }
        .monthly-top5-title { margin:0; font-size:20px; font-weight:1000; letter-spacing:.4px; color:var(--primary); text-transform:uppercase; }
        .monthly-top5-sub { font-size:11px; color:var(--text-muted); font-weight:800; text-align:right; }
        .monthly-top5-grid { display:grid; grid-template-columns:minmax(240px,.85fr) minmax(0,1.75fr); gap:12px; align-items:stretch; }
        .monthly-top5-feature { position:relative; min-height:260px; border-radius:18px; overflow:hidden; padding:20px 18px; display:flex; flex-direction:column; justify-content:flex-end; background:linear-gradient(155deg,#405e62 0%,#293d40 55%,#18282b 100%); color:#fff; }
        .monthly-top5-feature::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 75% 15%,rgba(255,255,255,.16),transparent 35%),linear-gradient(0deg,rgba(0,0,0,.58),transparent 65%); pointer-events:none; }
        .monthly-top5-feature > * { position:relative; z-index:1; }
        .monthly-top5-badge { align-self:flex-start; padding:5px 9px; border:1px solid rgba(255,255,255,.35); border-radius:999px; background:rgba(255,255,255,.09); font-size:10px; font-weight:1000; letter-spacing:1px; }
        .monthly-top5-feature-rank { font-size:62px; line-height:.85; font-weight:1000; color:#7ee0bf; text-shadow:0 3px 0 rgba(0,0,0,.18); margin-top:8px; }
        .monthly-top5-feature-avatar { width:116px; height:116px; border-radius:8px; object-fit:cover; border:3px solid rgba(255,255,255,.9); background:#111; align-self:center; margin:-6px auto 8px; box-shadow:0 8px 24px rgba(0,0,0,.28); }
        .monthly-top5-feature-name { font-size:19px; font-weight:1000; text-transform:uppercase; text-align:center; margin-bottom:10px; }
        .monthly-top5-feature-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
        .monthly-top5-mini { background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.12); border-radius:9px; padding:7px 4px; text-align:center; }
        .monthly-top5-mini b { display:block; font-size:14px; }
        .monthly-top5-mini span { display:block; font-size:8px; opacity:.78; margin-top:2px; font-weight:900; text-transform:uppercase; }
        .monthly-top5-side { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
        .monthly-top5-item { min-width:0; display:grid; grid-template-columns:42px 58px minmax(0,1fr); gap:9px; align-items:center; padding:10px; border-radius:15px; background:var(--bg-input); border:1px solid var(--border-color); }
        .monthly-top5-item-rank { font-size:34px; line-height:1; color:#49bd98; font-weight:1000; text-align:center; }
        .monthly-top5-item-avatar { width:58px; height:58px; border-radius:8px; object-fit:cover; border:2px solid var(--border-color); background:#111; }
        .monthly-top5-item-name { font-size:13px; font-weight:1000; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-transform:uppercase; }
        .monthly-top5-item-line { font-size:10px; color:var(--text-muted); margin-top:3px; line-height:1.45; }
        .monthly-top5-item-line b { color:var(--text-main); }
        .monthly-top5-empty { padding:30px; text-align:center; color:var(--text-muted); font-style:italic; }
        @media (max-width:820px) { .monthly-top5-grid { grid-template-columns:1fr; } .monthly-top5-feature { min-height:240px; } }
        @media (max-width:560px) { .monthly-top5-head { align-items:flex-start; flex-direction:column; } .monthly-top5-sub { text-align:left; } .monthly-top5-side { grid-template-columns:1fr; } .monthly-top5-item { grid-template-columns:38px 54px minmax(0,1fr); } .monthly-top5-item-avatar { width:54px; height:54px; } .monthly-top5-feature-avatar { width:104px; height:104px; } }
        .t5x-overlay { position:fixed; inset:0; z-index:99990; background:rgba(8,10,18,.72); display:flex; align-items:center; justify-content:center; padding:16px; }
        .t5x-card { width:100%; max-width:420px; background:var(--bg-panel); color:var(--text-main); border:1px solid var(--border-color); border-radius:22px; padding:22px 20px 18px; box-shadow:0 20px 60px rgba(0,0,0,.45); }
        .t5x-card h3 { margin:0 0 4px; font-size:19px; font-weight:900; color:var(--primary); }
        .t5x-sub { font-size:12px; color:var(--text-muted); font-weight:700; margin-bottom:14px; }
        .t5x-opt { display:flex; align-items:center; gap:12px; padding:14px; margin-bottom:10px; border-radius:14px; border:2px solid var(--border-color); background:var(--bg-input); cursor:pointer; font-weight:800; font-size:15px; }
        .t5x-opt:has(input:checked) { border-color:var(--primary); }
        .t5x-opt input { width:22px; height:22px; margin:0; accent-color:var(--primary); flex:0 0 auto; }
        .t5x-ico { font-size:22px; }
        .t5x-hint { font-size:11px; color:var(--text-muted); margin:2px 2px 14px; line-height:1.5; }
        .t5x-actions { display:flex; gap:10px; }
        /* ===== Thẻ Top 1 & Top 2-5: avatar chữ nhật (trên-trái), thông số bên phải ===== */
        .monthly-top5-wrap .monthly-top5-feature { justify-content:center; gap:12px; padding:16px; }
        .t5f-head { display:flex; align-items:center; gap:10px; min-width:0; }
        .monthly-top5-wrap .monthly-top5-feature-rank { font-size:44px; line-height:.9; margin:0; }
        .monthly-top5-wrap .monthly-top5-feature-name { flex:1 1 auto; min-width:0; margin:0; font-size:19px; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
        .monthly-top5-wrap .monthly-top5-badge { align-self:center; flex:0 0 auto; }
        .t5f-body, .t5i-body { display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px; align-items:stretch; }
        .monthly-top5-wrap .monthly-top5-feature-avatar { width:112px; height:auto; aspect-ratio:3/4; margin:0; border-radius:14px; object-fit:cover; align-self:start; }
        .monthly-top5-wrap .monthly-top5-feature-stats { grid-template-columns:repeat(2,1fr); grid-auto-rows:1fr; gap:8px; }
        .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini { display:flex; flex-direction:column; justify-content:center; padding:6px 2px; }
        .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini b { font-size:21px; }
        .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini span { font-size:9px; white-space:nowrap; }
        .monthly-top5-wrap .monthly-top5-item { display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:8px; padding:10px 12px; text-align:left; }
        .t5i-head { display:flex; align-items:center; gap:8px; min-width:0; }
        .monthly-top5-wrap .monthly-top5-item-rank { position:static; font-size:26px; line-height:1; }
        .monthly-top5-wrap .monthly-top5-item-name { flex:1 1 auto; min-width:0; font-size:14px; }
        .t5i-body { gap:10px; }
        .monthly-top5-wrap .monthly-top5-item-avatar { width:62px; height:auto; aspect-ratio:3/4; border-radius:10px; border:2px solid rgba(var(--glow), .7); object-fit:cover; align-self:start; flex:0 0 auto; }
        .monthly-top5-item-stats { display:grid; grid-template-columns:repeat(2,1fr); grid-auto-rows:1fr; gap:6px; }
        .monthly-top5-item-stats .monthly-top5-mini { display:flex; flex-direction:column; justify-content:center; background:rgba(var(--glow), .13); border:1px solid rgba(var(--glow), .38); color:var(--text-main); padding:4px 2px; }
        .monthly-top5-item-stats .monthly-top5-mini b { font-size:15px; }
        .monthly-top5-item-stats .monthly-top5-mini span { font-size:8px; opacity:1; color:var(--text-muted); white-space:nowrap; margin-top:1px; }
        @media (max-width:560px) { .monthly-top5-wrap .monthly-top5-feature-avatar { width:96px; } }
        .top5-water .monthly-top5-feature { padding-left:42px; padding-right:42px; }
        .top5-water .monthly-top5-feature .monthly-top5-feature-avatar { width:90px; }
        .top5-water .monthly-top5-feature-stats .monthly-top5-mini b { font-size:19px; }
        .top5-water .monthly-top5-feature-stats .monthly-top5-mini span { font-size:8px; }
        /* ===== HIỆU ỨNG TOP 1: Pháo hoa (MVP) / Nước mắt (Báo Thủ) / Chai nước bay (Thần Nước) ===== */
        .monthly-top5-feature .top5-fx { position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
        .fw { position:absolute; left:var(--x); top:var(--y); width:0; height:0; }
        .fw i { position:absolute; left:0; top:0; width:6px; height:6px; margin:-3px 0 0 -3px; border-radius:50%; background:var(--c); box-shadow:0 0 8px 2px var(--c); opacity:0; transform:rotate(var(--a)) translateX(0); animation:fwSpark 3.6s ease-out infinite; animation-delay:var(--d); }
        .fw b { position:absolute; left:-1px; top:0; width:2px; height:16px; border-radius:2px; background:#fff; opacity:0; animation:fwRocket 3.6s ease-out infinite; animation-delay:var(--d); }
        @keyframes fwSpark { 0%,22% { opacity:0; transform:rotate(var(--a)) translateX(0) scale(1.3); } 26% { opacity:1; } 68% { opacity:1; transform:rotate(var(--a)) translateX(var(--r)) scale(1); } 100% { opacity:0; transform:rotate(var(--a)) translateX(calc(var(--r) * 1.2)) scale(.3); } }
        @keyframes fwRocket { 0% { opacity:1; transform:translateY(130px); } 22% { opacity:1; transform:translateY(0); } 25%,100% { opacity:0; transform:translateY(0); } }
        .t5-tear { position:absolute; top:-14%; left:var(--x); width:var(--s); height:var(--s); opacity:0; animation:t5Fall var(--t) ease-in infinite; animation-delay:var(--d); }
        .t5-tear::after { content:''; display:block; width:100%; height:100%; border-radius:0 50% 50% 50%; transform:rotate(45deg); background:linear-gradient(135deg,#f2fbff,#7cc4f2); box-shadow:0 0 4px rgba(150,210,255,.8); }
        .t5-rain { position:absolute; top:-14%; left:var(--x); width:2px; height:16px; background:rgba(214,234,250,.6); opacity:0; animation:t5Fall var(--t) linear infinite; animation-delay:var(--d); }
        @keyframes t5Fall { 0% { opacity:0; top:-14%; } 12% { opacity:.95; } 85% { opacity:.9; } 100% { opacity:0; top:104%; } }
        .t5-cloud { position:absolute; right:10px; top:4px; font-size:26px; opacity:.9; animation:t5Bob 3s ease-in-out infinite alternate; }
        @keyframes t5Bob { from { transform:translateY(-2px); } to { transform:translateY(3px); } }
        .t5-bottle { position:absolute; top:var(--y); width:34px; height:82px; transform-origin:50% 60%; animation:t5Float 3.4s ease-in-out infinite alternate; animation-delay:var(--d); }
        .t5-bottle.l { left:4px; --r0:-16deg; --r1:-6deg; }
        .t5-bottle.r { right:4px; --r0:16deg; --r1:6deg; }
        @keyframes t5Float { from { transform:translateY(-8px) rotate(var(--r0)); } to { transform:translateY(8px) rotate(var(--r1)); } }
        .t5-bub { position:absolute; top:104%; left:var(--x); width:var(--s); height:var(--s); border-radius:50%; border:1px solid rgba(255,255,255,.9); background:rgba(255,255,255,.35); opacity:0; animation:t5Rise var(--t) ease-in infinite; animation-delay:var(--d); }
        @keyframes t5Rise { 0% { opacity:0; top:104%; } 15% { opacity:.9; } 100% { opacity:0; top:-8%; } }
        @media (prefers-reduced-motion: reduce) { .top5-fx * { animation:none !important; } .fw i { opacity:1; transform:rotate(var(--a)) translateX(var(--r)); } .fw b { display:none; } .t5-tear, .t5-rain, .t5-bub { opacity:.9; top:var(--fy); } .t5-bottle { transform:rotate(var(--r1)); } }
        .monthly-stats-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
        @media (max-width:560px) { .monthly-stats-head .ph-export-btn { width:100%; } }
        /* ===== HIỆU ỨNG NỀN TOP 5 (Vàng chảy / Xám chảy / Nước chảy) ===== */
        .top5-mvp   { --t1:#ffe58a; --t2:#ffc94d; --t3:#e0a21a; --t4:#c9870e; --txt:#3b2600; --rank:#7a4b00; --glow:255,201,77; }
        .top5-loss  { --t1:#c3cad1; --t2:#919aa4; --t3:#6b747e; --t4:#464d55; --txt:#ffffff; --rank:#ffffff; --glow:150,160,170; }
        .top5-water { --t1:#e6f8ff; --t2:#b5e5fb; --t3:#7acdf3; --t4:#4fb0e4; --txt:#08334f; --rank:#0b4f7a; --glow:90,190,240; }
        .top5-mvp, .top5-loss, .top5-water { border-color: rgba(var(--glow), .55); box-shadow: var(--shadow-outer), 0 0 22px rgba(var(--glow), .18); }
        .top5-mvp .monthly-top5-title   { color:#d99a0b; }
        .top5-loss .monthly-top5-title  { color:#7b848d; }
        .top5-water .monthly-top5-title { color:#2b9fdc; }
        .top5-mvp .monthly-top5-item, .top5-loss .monthly-top5-item, .top5-water .monthly-top5-item { border-left:4px solid var(--t3); background:linear-gradient(90deg, rgba(var(--glow), .16), var(--bg-input) 60%); }
        .top5-mvp .monthly-top5-item-rank   { color:#d99a0b; }
        .top5-loss .monthly-top5-item-rank  { color:#7b848d; }
        .top5-water .monthly-top5-item-rank { color:#2b9fdc; }
        .monthly-top5-feature.top5-theme { background:linear-gradient(160deg, var(--t1) 0%, var(--t2) 35%, var(--t3) 70%, var(--t4) 100%); color:var(--txt); }
        .monthly-top5-feature.top5-theme::before { display:none; }
        .monthly-top5-feature.top5-theme .monthly-top5-feature-rank { color:var(--rank); text-shadow:0 2px 0 rgba(255,255,255,.35); }
        .monthly-top5-feature.top5-theme .monthly-top5-badge { border-color:currentColor; background:rgba(255,255,255,.28); }
        .monthly-top5-feature.top5-theme .monthly-top5-mini { background:rgba(255,255,255,.28); border-color:rgba(0,0,0,.12); }
        .top5-loss .monthly-top5-feature.top5-theme .monthly-top5-mini { background:rgba(0,0,0,.2); border-color:rgba(255,255,255,.2); }
        .monthly-top5-feature.top5-theme .monthly-top5-feature-avatar { border-color:#fff; box-shadow:0 0 0 4px rgba(var(--glow), .45), 0 8px 24px rgba(0,0,0,.28); }
        .monthly-top5-feature.top5-theme .monthly-top5-feature-name, .monthly-top5-feature.top5-theme .monthly-top5-mini b { text-shadow:0 1px 0 rgba(255,255,255,.25); }
        .top5-loss .monthly-top5-feature.top5-theme .monthly-top5-feature-name, .top5-loss .monthly-top5-feature.top5-theme .monthly-top5-mini b { text-shadow:0 1px 3px rgba(0,0,0,.45); }
        .stat-card { display: flex; background: var(--bg-panel); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-outer); border: 1px solid var(--border-color); align-items: center; gap: 16px; }
        .stat-avatar { width: 84px; height: 108px; border-radius: 14px; background: var(--bg-input); color: var(--text-main); display: flex; justify-content: center; align-items: center; font-size: 32px; font-weight: 800; flex-shrink: 0; border: 1px solid var(--border-color); position: relative; overflow: hidden; }
        .stat-avatar img { width: 100%; height: 100%; object-fit: cover; }
        .upload-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(43,33,24,0.75); color: #fff; font-size: 11px; padding: 5px 0; text-align: center; opacity: 0; transition: opacity 0.2s ease; }
        .stat-avatar:hover .upload-overlay { opacity: 1; }
        .stat-info { flex-grow: 1; }
        .stat-name { margin: 0 0 12px 0; font-family: 'Nunito', sans-serif; font-size: 17px; color: var(--primary); font-weight: 800; border-bottom: 1px dashed var(--border-color); padding-bottom: 8px;}
        .stat-details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
        .stat-box { background: var(--bg-input); padding: 8px 4px; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid var(--border-color);}
        .stat-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 3px; text-align: center; width: 100%; }
        .stat-box .stat-val { font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; color: var(--text-main); text-align: center !important; width: 100%; }

        .badge-title { display: inline-block; font-size: 10px; padding: 3px 8px; border-radius: 999px; margin-left: 6px; font-weight: 800; vertical-align: middle; color: #fff;}
        .title-top1 { background: var(--gold); color: #6B4E00; }
        .title-top23 { background: var(--silver); color: var(--text-main); }
        .title-bot { background: var(--danger); }
        .title-water { background: var(--secondary); }

        /* =========================================
           THIẾT LẬP MOBILE
           ========================================= */
        .mobile-only { display: none !important; }

        @media (max-width: 768px) {
            .mobile-only { display: block !important; }
            .desktop-only { display: none !important; }

            .nav-tabs {
                display: grid !important;
                grid-template-columns: 1fr 1fr;
                gap: 8px;
                margin-top: 15px !important;
                background: transparent;
                padding: 0;
            }
            .tab-btn {
                padding: 11px 5px;
                font-size: 12.5px;
                white-space: nowrap;
                background: var(--bg-panel);
                box-shadow: var(--shadow-outer);
                border: 1px solid var(--border-color);
            }
            .tab-btn.active { box-shadow: none; border-color: var(--primary); }

            .header { flex-direction: column; gap: 10px; }

            .match-form {
                display: flex !important;
                flex-direction: row !important;
                align-items: stretch !important;
                gap: 5px !important;
                background: transparent !important;
                box-shadow: none !important;
                border: none !important;
                padding: 0 !important;
            }
            .team-box {
                flex: 1;
                padding: 12px 8px !important;
                display: flex;
                flex-direction: column;
                width: 45%;
            }

            .center-col {
                width: 30px !important;
                flex-shrink: 0;
                display: flex !important;
                flex-direction: column;
                align-items: center !important;
                justify-content: center !important;
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
                padding: 0 !important;
                margin: 0 !important;
                grid-column: auto !important;
            }
            .desktop-score-box, .center-col .desktop-only { display: none !important; }
            .center-col .vs-badge {
                display: flex !important;
                color: var(--danger) !important;
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
                font-size: 22px !important;
                font-weight: 900 !important;
                width: auto !important;
                height: auto !important;
            }

            .form-footer { padding: 14px; }
            .form-footer > div:first-child { flex-direction: row; flex-wrap: wrap; gap: 10px; }
            .form-footer > div:first-child > div { flex: 1; min-width: 45%; padding: 12px; }
            .form-footer > div:last-child { width: 100%; flex-direction: column; }
            .form-footer > div:last-child button { width: 100%; }

            .history-grid { grid-template-columns: 1fr; }

            .boards-container { gap: 15px; flex-direction: column; }
            .board-half { width: 100%; min-width: 0; padding: 15px; }
            .podium-container { min-height: 110px; margin-top: 32px; gap: 5px; }
            .podium-box { width: 32%; }
            .podium-1, .podium-bot-1, .podium-water-1 { height: 110px; }
            .podium-2, .podium-bot-2, .podium-3, .podium-bot-3, .podium-water-2, .podium-water-3 { height: 84px; }
            .podium-avatar { width: 38px; height: 38px; margin: -28px auto 5px auto; font-size: 15px; border-width: 2px; }
            .podium-score { font-size: 15px; margin: auto 5px 10px 5px; padding: 2px 0; }
            .podium-name { font-size: 11px; }

            .stat-card { flex-direction: column; text-align: center; }
            .stat-avatar { width: 110px; height: 110px; border-radius:8px; }
            .stat-details-grid { grid-template-columns: repeat(2, 1fr); width: 100%;}

            table { min-width: 100%; }
            th { padding: 8px 2px; font-size: 9.5px; letter-spacing: 0; }
            td { padding: 8px 2px; font-size: 12px; }
            .row-top1 td, .row-top2 td, .row-top3 td, .row-bot1 td, .row-bot2 td, .row-bot3 td { padding: 8px 2px; }
            .badge-title { display: inline-block; margin-top: 4px; font-size: 9px; padding: 2px 6px; }
            .streak-badge { font-size: 9px; padding: 2px 5px; }
            #dashboard_body td:nth-child(10), #monthly_dashboard_body td:nth-child(9) { font-size: 13px !important; }
        }

        #loading { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(43,33,24,0.6); backdrop-filter: blur(4px); z-index: 9999; justify-content: center; align-items: center; font-size: 18px; font-weight: 700; color: #fff; flex-direction: column; gap: 12px;}
        .dashboard-date { font-size: 13px; font-weight: 400; color: var(--text-muted); font-style: normal; display: block; margin-top: 6px;}

        .stats-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(43,33,24,0.6); backdrop-filter: blur(4px); justify-content: center; align-items: center; }
        .modal-content-wrapper { position: relative; background: var(--bg-panel); padding: 26px; border-radius: 24px; max-width: 90%; width: 420px; text-align: center; box-shadow: var(--shadow-outer); border: 1px solid var(--border-color); }
        .modal-content-wrapper .stat-card { flex-direction: column; width: 100%; box-shadow: none; border: none; padding: 0; background: transparent;}
        .modal-content-wrapper .stat-avatar { width: 170px; height: 220px; margin-bottom: 18px; font-size: 60px; border-radius: 18px;}
        .modal-content-wrapper .stat-name { font-size: 24px; margin-bottom: 20px; }
        .close-modal { position: absolute; top: -45px; right: 0; color: var(--text-main); background: var(--bg-panel); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; box-shadow: var(--shadow-outer); }
        .stat-avatar-hq { display: none; }
        * { box-sizing: border-box; }
        body { font-family: 'Be Vietnam Pro', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 15px; overflow-x: hidden; }

        .container { max-width: 900px; margin: 0 auto; position: relative; width: 100%; }
        #app_screen, #login_screen, #superadmin_screen { display: none; }

        .custom-autocomplete-container { position: relative; width: 100%; }
        .custom-autocomplete-container input.has-clear-btn { padding-right: 34px; box-sizing: border-box; }
        .clear-name-btn { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 900; font-size: 14px; cursor: pointer; z-index: 10; user-select: none; }
        .clear-name-btn.show { display: block; }
        .custom-autocomplete-box { position: absolute; top: 100%; left: 0; width: 100%; max-height: 180px; overflow-y: auto; background: var(--bg-panel); border: 1px solid var(--primary); box-shadow: var(--shadow-outer); border-radius: 12px; z-index: 9999; margin-top: -10px; display: none; }
        .custom-suggestion-item { padding: 12px 15px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-main); border-bottom: 1px solid var(--border-color); transition: 0.15s; }
        .custom-suggestion-item:last-child { border-bottom: none; }
        .custom-suggestion-item:active, .custom-suggestion-item:hover { background: var(--bg-input); color: var(--primary); }

        .row-top1 td { border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
        .row-top2 td { border-top: 1px solid var(--silver); border-bottom: 1px solid var(--silver); }
        .row-top3 td { border-top: 1px solid var(--bronze); border-bottom: 1px solid var(--bronze); }
        .row-bot1 td { border-top: 1px solid var(--danger); border-bottom: 1px solid var(--danger); }
        .row-bot2 td { border-top: 1px solid rgba(240,83,63,0.5); border-bottom: 1px solid rgba(240,83,63,0.5); }
        .row-bot3 td { border-top: 1px solid rgba(240,83,63,0.25); border-bottom: 1px solid rgba(240,83,63,0.25); }

        .streak-badge { font-size: 10.5px; padding: 3px 7px; border-radius: 999px; margin-left: 5px; font-weight: 800; }
        .streak-win { background: rgba(255,138,61,0.15); color: var(--warning); border: 1px solid var(--warning); }
        .streak-lose { background: rgba(62,154,224,0.15); color: var(--secondary); border: 1px solid var(--secondary); }

        #h2h_result { font-size: 12px; font-weight: 700; text-align: center; margin-top: 10px; color: var(--primary); background: var(--bg-input); padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--primary); display: none; }

        .card-container { display: flex; justify-content: center; margin-bottom: 10px;}
        .fut-card { width: 280px; height: 440px; border-radius: 22px; position: relative; overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--shadow-outer); }
        .card-rating { position: absolute; top: 18px; left: 16px; text-align: center; z-index: 2; }
        .card-rating .label { font-size: 9px; font-weight: 800; color: rgba(255,255,255,0.85); text-transform: uppercase; margin-bottom: -2px; display: block; letter-spacing: 0.5px; }
        .card-rating .pos { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; color: #fff; border-bottom: 2px solid rgba(255,255,255,0.6); padding-bottom: 3px; margin-bottom: 5px;}
        .card-avatar-fut { width: 100%; height: 185px; display: flex; justify-content: center; align-items: flex-end; }
        .card-avatar-fut img { height: 165px; object-fit: cover; border-radius: 12px;}
        .card-name-fut { text-align: center; font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 800; text-transform: uppercase; margin: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 6px; width: 82%; margin-left: auto; margin-right: auto; color: #fff; }
        .card-radar { width: 100%; height: 130px; position: relative; z-index: 2; display: flex; justify-content: center;}
        .card-stats-fut { display: flex; justify-content: space-between; padding: 10px 22px; font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,0.85); }
        .stat-col { display: flex; flex-direction: column; gap: 5px; }
        .stat-item { display: flex; gap: 5px; align-items: center;}
        .stat-val { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; color: #fff; min-width: 42px; text-align: left; }

        .card-red { background: #C0463A; border-color: #F0533F;}
        .card-gold { background: #C99A2E; border-color: var(--gold);}
        .card-silver { background: #6E7A74; border-color: var(--silver);}
        .card-bronze { background: #A15E33; border-color: var(--bronze);}
        .fut-card { --fut-ac: #fff; transform-style: flat; }
        .card-bronze { --fut-ac: #f0c9a6; } .card-silver { --fut-ac: #eef2f5; } .card-gold { --fut-ac: #ffe58a; } .card-red { --fut-ac: #ffc2c8; }
        .card-vip { background: #0b1b33; border-color: #00f2fe; border-width: 2px; --fut-ac: #00f2fe; }
        .card-container { touch-action: pan-y; }
        .card-rating .ovr { font-family: 'Nunito', sans-serif; font-size: 42px; font-weight: 900; line-height: 1; color: #fff; margin: 2px 0 6px; }
        /* Thẻ FUT tĩnh, không ánh sáng quét hoặc lấp lánh. */
        .fut-card { isolation: isolate; transform: none; will-change: auto; }
        /* ===== Modal thẻ FUT: cuộn được, nút đóng luôn nằm trong màn hình (điện thoại / tablet) ===== */
        #stats_modal { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; align-items: flex-start; box-sizing: border-box; padding: max(60px, calc(env(safe-area-inset-top, 0px) + 54px)) 12px max(18px, env(safe-area-inset-bottom, 0px)); }
        #stats_modal .modal-content-wrapper { margin: auto; padding: 18px; }
        #stats_modal .close-modal { position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); width: 42px; height: 42px; font-size: 28px; z-index: 10003; }
        .fut-custom-labels { max-height: 50px; overflow: hidden; }
        /* Lật thẻ FUT 720° khi mở */
        #capture_card_area { perspective: 1400px; }
        .card-container.fut-flip { animation: futFlip 1.35s cubic-bezier(.2,.75,.25,1) both; transform-origin: 50% 50%; }
        .card-container.fut-flip .fut-card { box-shadow: 0 0 0 rgba(255,255,255,0); animation: futGlow 1.35s ease-out both; }
        @keyframes futFlip {
            0%   { transform: rotateY(0deg) scale(.45); opacity: 0; filter: brightness(1.6); }
            12%  { opacity: 1; }
            70%  { transform: rotateY(660deg) scale(1.08); filter: brightness(1.25); }
            86%  { transform: rotateY(726deg) scale(1.02); }
            100% { transform: rotateY(720deg) scale(1); opacity: 1; filter: none; }
        }
        @keyframes futGlow {
            0%, 70% { box-shadow: 0 0 0 rgba(255,255,255,0); }
            82%     { box-shadow: 0 0 46px 10px var(--fut-ac, #fff); }
            100%    { box-shadow: var(--shadow-outer); }
        }
        @media (prefers-reduced-motion: reduce) { .card-container.fut-flip, .card-container.fut-flip .fut-card { animation: none; } }
        .fut-card:has(.fut-custom-labels:not(:empty)) .card-avatar-fut { padding-top: 74px; }
        .fut-card:has(.fut-custom-labels:not(:empty)) .card-avatar-fut img { height: 124px; }
        @media (max-height: 740px) {
            #stats_modal { padding-top: max(56px, calc(env(safe-area-inset-top, 0px) + 50px)); }
            #stats_modal .modal-content-wrapper { padding: 12px; }
            #stats_modal .fut-card { height: 450px; }
            #stats_modal .card-avatar-fut { height: 176px; padding-top: 40px; }
            #stats_modal .card-avatar-fut img { height: 132px; }
            #stats_modal .fut-card:has(.fut-custom-labels:not(:empty)) .card-avatar-fut { padding-top: 70px; }
            #stats_modal .fut-card:has(.fut-custom-labels:not(:empty)) .card-avatar-fut img { height: 106px; }
        }
        .fut-rarity { position: absolute; top: 20px; right: 16px; z-index: 3; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--fut-ac); border: 1px solid var(--fut-ac); padding: 2px 8px; border-radius: 99px; }
        .fut-card { height: 480px; }
        .fut-titles { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 3; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
        .fut-titles .pos { font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800; color: #fff; letter-spacing: 0.5px; border: 1px solid rgba(255,255,255,0.55); background: rgba(0,0,0,0.18); padding: 3px 10px; border-radius: 99px; margin: 0; }
        .fut-titles .fut-rarity { position: static; padding: 3px 10px; }
        .fut-custom-labels { width:100%; display:flex; justify-content:center; align-items:center; gap:6px; flex-wrap:wrap; margin-top:2px; }
        .fut-custom-label { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:999px; color:#fff; font-size:10px; font-weight:900; letter-spacing:.4px; border:1px solid rgba(255,255,255,.35); box-shadow:0 3px 10px rgba(0,0,0,.18); backdrop-filter:blur(4px); }
        .card-avatar-fut { height: 196px; padding-top: 44px; box-sizing: border-box; }
        .card-avatar-fut img { height: 150px; }
        .fut-card .card-rating { position: absolute; top: auto; left: 0; right: 0; bottom: 0; height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid rgba(255,255,255,0.22); background: rgba(0,0,0,0.18); z-index: 2; }
        .fut-card .card-rating .label { font-size: 12px; letter-spacing: 2px; margin: 0; }
        .fut-card .card-rating .ovr { font-size: 38px; margin: 0; }
        .fut-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; padding: 6px 22px 2px; position: relative; z-index: 2; }
        .fut-bar-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.9); }
        .fut-bar-trk { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); margin-top: 3px; overflow: hidden; }
        .fut-bar-fill { height: 100%; border-radius: 3px; background: var(--fut-ac); width: 0; }
        .fx-rel { background: var(--bg-input); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: var(--text-main); line-height: 1.8; }
        .streak-lose { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid #3498db; }
        #fx_toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); width: min(92vw, 420px); display: flex; flex-direction: column; gap: 8px; z-index: 100001; pointer-events: none; }
        .fx-toast { background: #14181f; color: #fff; border: 1px solid rgba(255,255,255,0.14); border-left: 4px solid #2ecc71; border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 700; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,0.35); animation: fxIn .3s ease; }
        .fx-toast span { font-weight: 500; opacity: .85; font-size: 13px; }
        .fx-toast.fire { border-left-color: #ff8a3d; } .fx-toast.sad { border-left-color: #5b8def; }
        .fx-toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
        @keyframes fxIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
        .fx-pair { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 18px; padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow-outer); }
        .fx-pair-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
        .fx-pair-head h3 { margin: 0; color: var(--primary); font-weight: 900; font-size: 17px; }
        .fx-seg { display: flex; gap: 6px; }
        .fx-seg button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-main); font-size: 12px; font-weight: 700; cursor: pointer; }
        .fx-seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
        .fx-pair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
        @media (max-width: 768px) { .fx-pair-cols { grid-template-columns: 1fr; } }
        .fx-sub { font-size: 13px; font-weight: 800; color: var(--text-muted); margin-bottom: 8px; }
        .fx-row { padding: 8px 10px; border-radius: 12px; background: var(--bg-input); margin-bottom: 6px; }
        .fx-row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-main); }
        .fx-row-top em { font-style: normal; color: var(--text-muted); font-weight: 800; white-space: nowrap; }
        .fx-row-bar { height: 4px; border-radius: 3px; background: var(--border-color); margin-top: 6px; overflow: hidden; }
        .fx-row-bar i { display: block; height: 100%; background: var(--primary); }
        .fx-empty { font-size: 13px; color: var(--text-muted); padding: 6px 2px; }
        .btn-wrapped { width: 100%; margin-top: 10px; padding: 13px; border-radius: 12px; border: 0; font-weight: 800; font-size: 15px; color: #fff; background: #5b3fd1; cursor: pointer; }
        #wr_modal { position: fixed; inset: 0; z-index: 10050; background: rgba(6,8,14,0.94); display: flex; align-items: center; justify-content: center; padding: 10px; }
        .wr-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
        .wr-top { width: 100%; display: flex; align-items: center; gap: 8px; }
        .wr-chips { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
        .wr-chips::-webkit-scrollbar { display: none; }
        .wr-chip { flex: none; border: 1px solid rgba(255,255,255,0.25); background: transparent; color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
        .wr-chip.on { background: #fff; color: #111; }
        .wr-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: #fff; font-size: 16px; cursor: pointer; }
        .mobile-tools{display:none}.mobile-tool-btn{border:1px solid var(--border-color);background:var(--bg-input);color:var(--text-main);border-radius:10px;padding:7px 10px;font-weight:800;font-size:12px;cursor:pointer;white-space:nowrap}
        #mobile_fullscreen_hint{display:none;position:fixed;inset:0;z-index:10070;background:rgba(5,7,12,.88);backdrop-filter:blur(8px);align-items:center;justify-content:center;padding:22px}
        .mobile-hint-card{width:min(420px,92vw);background:var(--bg-panel);color:var(--text-main);border:1px solid var(--border-color);border-radius:22px;padding:24px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.4)}
        .mobile-hint-card p{color:var(--text-muted);line-height:1.55;font-size:13px}.mobile-hint-actions{display:flex;gap:8px;margin-top:16px}
        .wr-player-picker{flex:1;display:flex;align-items:center;gap:6px;min-width:0}.wr-player-search{flex:1;min-width:0;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;border-radius:12px;padding:9px 11px;font-size:13px;font-weight:700;outline:none}.wr-player-search::placeholder{color:rgba(255,255,255,.58)}
        .wr-nav-btn{flex:none;width:34px;height:34px;padding:0;border-radius:10px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.10);color:#fff;font-size:18px;font-weight:900;cursor:pointer}.wr-player-name{flex:0 1 auto;max-width:42%;color:#fff;font-size:12px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
        @media(max-width:1024px){.mobile-tools{display:flex;align-items:center;gap:6px}}@media(min-width:1025px){#mobile_fullscreen_btn,#mobile_fullscreen_hint{display:none!important}}@media(max-width:600px){.header{padding:11px 12px;gap:8px}.header-actions{gap:4px}.header-actions .mobile-tool-btn{padding:6px 7px;font-size:11px}.header-actions #fx_sound_btn{display:none!important}.wr-player-name{max-width:34%}}

        .wr-frame { position: relative; width: min(92vw, 380px); height: min(74vh, 600px); border-radius: 18px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; transition: background .35s; }
        .wr-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 5; }
        .wr-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); overflow: hidden; }
        .wr-bar i { display: block; height: 100%; width: 0; background: #fff; }
        .wr-slide { position: absolute; inset: 0; padding: 58px 24px 24px; display: flex; flex-direction: column; justify-content: center; color: #fff; box-sizing: border-box; }
        .wr-slide { padding-top: 92px; }
        .wr-who { position: absolute; top: 24px; left: 12px; right: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; }
        .wr-who .wr-player-name { flex: 1 1 auto; max-width: none; font-size: 18px; font-weight: 900; text-align: center; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .wr-who .wr-nav-btn { width: 36px; height: 36px; background: rgba(255,255,255,0.16); }
        .wr-a { opacity: 0; animation: wrUp .5s ease forwards; }
        @keyframes wrUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
        .wr-static .wr-a { animation: none; opacity: 1; }
        .wr-hd { font-size: 14px; opacity: .85; font-weight: 700; }
        .wr-big { font-size: 76px; font-weight: 900; line-height: 1.1; margin: 10px 0 6px; }
        .wr-name { font-size: 38px; font-weight: 800; line-height: 1.2; margin: 14px 0 8px; word-break: break-word; }
        .wr-ds { font-size: 16px; line-height: 1.6; opacity: .92; }
        .wr-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; padding: 7px 0; border-bottom: 0.5px solid rgba(255,255,255,0.18); }
        .wr-row span:first-child { opacity: .8; } .wr-row span:last-child { font-weight: 800; text-align: right; }
        .wr-share { margin-top: 14px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 12px; padding: 11px; font-weight: 800; font-size: 14px; cursor: pointer; }
        .wr-hint { font-size: 12px; color: rgba(255,255,255,0.55); }
        @media (prefers-reduced-motion: reduce) { .wr-a { animation: none; opacity: 1; } }

        .quick-chips-container {
            display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
            padding: 12px; background: var(--bg-input);
            border-radius: 14px;
            max-height: 120px; overflow-y: auto;
        }
        .player-chip {
            padding: 8px 12px; background: var(--bg-panel); border: 1px solid var(--border-color);
            border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-main);
            cursor: pointer; user-select: none; transition: 0.15s;
            display: inline-block;
        }
        .player-chip:active { transform: scale(0.97); }
        .chip-vl { border-color: var(--danger); color: var(--danger); }
        .player-chip.ticked { background: var(--primary); color: #fff; border-color: var(--primary); }

        .score-input { font-weight: 800 !important; border-width: 1px !important;}
        .score-t1 { color: var(--primary) !important; border-color: rgba(31,158,130,0.35) !important; }
        .score-t2 { color: var(--danger) !important; border-color: rgba(240,83,63,0.35) !important; }

        .modal-overlay {
            display: none; position: fixed; z-index: 10005; left: 0; top: 0; width: 100%; height: 100%;
            background-color: rgba(43,33,24,0.6); backdrop-filter: blur(6px);
            justify-content: center; align-items: center;
        }
        .modal-content {
            background: var(--bg-panel); padding: 25px 20px; border-radius: 22px;
            width: 90%; max-width: 400px; box-shadow: var(--shadow-outer); border: 1px solid var(--border-color);
            text-align: center;
        }


/* Ẩn mũi tên lên xuống mặc định của ô nhập số */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        input[type=number] { -moz-appearance: textfield; }
    
        /* ===== PHONG THẦN V2 — Dashboard / Podium / Detail Drawer ===== */
        .ph-v2{display:flex;flex-direction:column;gap:18px}
        .ph-hero-actions{display:flex;align-items:flex-start;justify-content:flex-end;gap:10px;min-width:260px}
        .ph-export-btn{border:1px solid rgba(255,201,77,.55);background:linear-gradient(135deg,#3651E0,#2337A8);color:#fff;border-radius:12px;padding:11px 16px;font-family:inherit;font-weight:900;font-size:13px;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.18);white-space:nowrap;transition:.18s ease}
        .ph-export-btn:hover{transform:translateY(-1px);filter:brightness(1.08)}
        .ph-export-btn:disabled{opacity:.65;cursor:wait;transform:none}
        @media(max-width:900px){.ph-hero-top{flex-direction:column}.ph-hero-actions{width:100%;justify-content:space-between;min-width:0}.ph-summary{flex:1}}
        @media(max-width:560px){.ph-hero-actions{flex-direction:column;align-items:stretch}.ph-export-btn{width:100%}}

        .ph-hero{position:relative;overflow:hidden;border:1px solid var(--border-color);border-radius:22px;padding:22px;background:radial-gradient(circle at 80% 10%,rgba(54,81,224,.18),transparent 35%),linear-gradient(135deg,var(--bg-panel),var(--bg-input));box-shadow:var(--shadow-outer)}
        .ph-hero:after{content:"";position:absolute;inset:auto -80px -110px auto;width:260px;height:260px;border-radius:50%;background:rgba(54,81,224,.08);filter:blur(8px)}
        .ph-hero-top{position:relative;z-index:1;display:flex;justify-content:space-between;align-items:flex-start;gap:18px}
        .ph-kicker{font-size:11px;font-weight:900;letter-spacing:1.6px;color:var(--text-muted);text-transform:uppercase}
        .ph-title{margin:3px 0 5px;font-size:30px;line-height:1.05;font-weight:1000;color:var(--text-main)}
        .ph-subtitle{font-size:13px;color:var(--text-muted);font-weight:700}
        .ph-summary{display:grid;grid-template-columns:repeat(3,minmax(90px,1fr));gap:8px;min-width:330px}
        .ph-summary-box{background:rgba(255,255,255,.035);border:1px solid var(--border-color);border-radius:14px;padding:10px 12px;text-align:center}
        .ph-summary-box b{display:block;font-size:20px;color:var(--text-main);line-height:1.1}.ph-summary-box span{font-size:10px;color:var(--text-muted);font-weight:800;text-transform:uppercase}
        .ph-podium{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:12px;align-items:end;margin-top:18px;position:relative;z-index:1}
        .ph-pod-card{position:relative;min-height:168px;border:1px solid var(--border-color);border-radius:20px;padding:17px;text-align:center;background:var(--bg-panel);box-shadow:var(--shadow-outer);cursor:pointer;transition:.18s transform,.18s box-shadow}
        .ph-pod-card:hover{transform:translateY(-3px)}.ph-pod-card.ph-1{min-height:205px;border-color:rgba(255,201,77,.65);background:linear-gradient(145deg,rgba(255,201,77,.13),var(--bg-panel) 65%)}
        .ph-pod-card.ph-2{border-color:rgba(199,205,214,.5)}.ph-pod-card.ph-3{border-color:rgba(185,107,44,.55)}
        .ph-pod-rank{font-size:27px;font-weight:1000}.ph-pod-avatar{width:62px;height:62px;margin:4px auto 8px;border-radius:8px;overflow:hidden;background:var(--bg-input);border:3px solid var(--border-color);display:flex;align-items:center;justify-content:center;font-weight:1000;font-size:24px}.ph-1 .ph-pod-avatar{width:76px;height:76px;border-color:var(--gold)}.ph-2 .ph-pod-avatar{border-color:var(--silver)}.ph-3 .ph-pod-avatar{border-color:var(--bronze)}
        .ph-pod-avatar img{width:100%;height:100%;object-fit:cover}.ph-pod-name{font-weight:1000;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ph-pod-title{margin:6px auto}.ph-pod-points{font-size:24px;font-weight:1000;color:var(--gold)}.ph-pod-meta{display:flex;justify-content:center;gap:12px;margin-top:8px;font-size:11px;color:var(--text-muted);font-weight:800}.ph-pod-bar{height:5px;border-radius:99px;background:var(--bg-input);overflow:hidden;margin-top:10px}.ph-pod-bar i{display:block;height:100%;border-radius:99px;background:var(--success)}
        .ph-toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}.ph-tabs{display:flex;gap:7px;flex-wrap:wrap}.ph-filter{border:1px solid var(--border-color);background:var(--bg-input);color:var(--text-main);padding:9px 13px;border-radius:12px;font-weight:900;font-size:12px;cursor:pointer}.ph-filter.active{background:var(--primary);border-color:var(--primary);color:#fff}.ph-search{min-width:220px;max-width:300px;margin:0!important;padding:10px 13px!important;border-radius:12px!important}
        .ph-table-wrap{overflow:auto;border:1px solid var(--border-color);border-radius:18px;background:var(--bg-panel);box-shadow:var(--shadow-outer)}.ph-table{width:100%;min-width:950px;border-collapse:collapse}.ph-table th{position:sticky;top:0;background:var(--bg-input);color:var(--text-muted);font-size:11px;text-transform:uppercase;letter-spacing:.4px;padding:13px 9px;text-align:center;z-index:2}.ph-table td{padding:12px 9px;border-top:1px solid var(--border-color);text-align:center;font-size:22px;font-weight:800;color:var(--text-main)}.ph-table td:nth-child(2){text-align:left}.ph-table th:nth-child(2),.ph-table td:nth-child(2){width:210px;max-width:210px}.ph-table th:nth-child(3),.ph-table td:nth-child(3){text-align:left;padding-left:14px}.ph-player-cell{min-width:0}.ph-player-cell{display:flex;align-items:center;gap:9px;min-width:190px}.ph-mini-avatar{width:36px;height:36px;flex:0 0 36px;border-radius:8px;overflow:hidden;background:var(--bg-input);border:1px solid var(--border-color);display:flex;align-items:center;justify-content:center;font-weight:900;color:var(--primary)}.ph-mini-avatar img{width:100%;height:100%;object-fit:cover}.ph-player-name{font-weight:1000;font-size:22px}.ph-player-sub{display:flex;gap:5px;align-items:center;margin-top:3px}.ph-rate{min-width:95px}.ph-rate-top{display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:4px}.ph-rate-bar{height:6px;border-radius:99px;background:var(--bg-input);overflow:hidden}.ph-rate-bar i{display:block;height:100%;border-radius:99px;background:var(--success)}.ph-action{padding:7px 10px;border:1px solid var(--border-color);background:var(--bg-input);color:var(--text-main);border-radius:9px;cursor:pointer;font-weight:900}
        .ph-extra-grid{display:grid;grid-template-columns:1.35fr .65fr;gap:14px}.ph-panel{border:1px solid var(--border-color);border-radius:18px;background:var(--bg-panel);padding:16px;box-shadow:var(--shadow-outer)}.ph-panel h3{margin:0 0 12px;font-size:15px}.ph-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.ph-stat-box{background:var(--bg-input);border:1px solid var(--border-color);border-radius:12px;padding:10px;text-align:center}.ph-stat-box b{display:block;font-size:18px}.ph-stat-box span{font-size:10px;color:var(--text-muted);font-weight:800}.ph-honor-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.ph-honor{padding:11px;border-radius:13px;border:1px solid var(--border-color);background:var(--bg-input);text-align:center}.ph-honor .ico{font-size:25px}.ph-honor b{display:block;font-size:11px;margin-top:4px}.ph-honor small{color:var(--text-muted);font-size:9px}.ph-empty{padding:28px;text-align:center;color:var(--text-muted);font-style:italic}
        .ph-drawer{position:fixed;inset:0;z-index:10050;display:none;background:rgba(0,0,0,.58);backdrop-filter:blur(4px);justify-content:flex-end}.ph-drawer.open{display:flex}.ph-drawer-card{width:min(520px,100%);height:100%;overflow:auto;background:var(--bg-panel);border-left:1px solid var(--border-color);box-shadow:-15px 0 45px rgba(0,0,0,.25);padding:20px}.ph-drawer-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.ph-detail-hero{display:flex;gap:13px;align-items:center;margin:15px 0}.ph-detail-avatar{width:72px;height:72px;border-radius:8px;overflow:hidden;background:var(--bg-input);border:3px solid var(--gold);display:flex;align-items:center;justify-content:center;font-size:26px;font-weight:1000}.ph-detail-avatar img{width:100%;height:100%;object-fit:cover}.ph-detail-name{font-size:21px;font-weight:1000}.ph-detail-points{margin-left:auto;text-align:right}.ph-detail-points b{display:block;font-size:28px;color:var(--gold)}.ph-detail-points span{font-size:10px;color:var(--text-muted);font-weight:900}.ph-detail-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-bottom:15px}.ph-detail-stat{background:var(--bg-input);border:1px solid var(--border-color);border-radius:12px;padding:10px 5px;text-align:center}.ph-detail-stat b{display:block;font-size:17px}.ph-detail-stat span{font-size:9px;color:var(--text-muted);font-weight:900}.ph-recent{display:flex;flex-direction:column;gap:7px}.ph-match-row{display:grid;grid-template-columns:65px 1fr 60px;gap:8px;align-items:center;background:var(--bg-input);border:1px solid var(--border-color);border-radius:11px;padding:9px;font-size:11px}.ph-match-result{font-weight:1000}.ph-win{color:var(--success)}.ph-loss{color:var(--danger)}.ph-match-score{text-align:right;font-weight:1000}.ph-close{border:1px solid var(--border-color);background:var(--bg-input);color:var(--text-main);width:36px;height:36px;border-radius:50%;font-size:20px;cursor:pointer}
        .ph-zoom-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0 0 10px}.ph-zoom-tools span{min-width:48px;text-align:center;font-size:12px;font-weight:800;color:var(--text-muted)}.ph-zoom-tools button{min-height:34px;padding:6px 10px}
        .ph-table-wrap,.rank-card-list{transform-origin:top center}.ph-title-inline{display:none}
        @media(max-width:768px){.ph-zoom-tools{justify-content:center}.ph-table-wrap{overflow-x:auto}.rank-card-list{gap:12px}.p-card{padding:17px 15px}.p-name{font-size:20px}.p-score .val{font-size:26px}.p-score .lbl{font-size:11.5px}.p-score .wl{font-size:13px}.p-winrate-val{font-size:14px}.p-detail .d-val{font-size:18px}.p-detail .d-lbl{font-size:12px}.p-avatar{width:52px;height:52px;font-size:19px}.p-rank{font-size:17px}.p-rank .medal-ico{font-size:23px} }
        @media(max-width:768px){.ph-hero{padding:16px}.ph-hero-top{flex-direction:column}.ph-title{font-size:25px}.ph-summary{width:100%;min-width:0}.ph-podium{grid-template-columns:1fr;align-items:stretch}.ph-pod-card,.ph-pod-card.ph-1{min-height:0}.ph-pod-card.ph-1{order:-1}.ph-toolbar{align-items:stretch}.ph-tabs{width:100%}.ph-filter{flex:1}.ph-search{min-width:100%;max-width:none}.rank-card-list{display:none}.ph-table-wrap{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:14px}.ph-table{min-width:0;width:100%}.ph-table th{padding:8px 3px;font-size:9px;line-height:1.2;letter-spacing:0;white-space:normal}.ph-table td{padding:8px 3px;font-size:12.5px}.ph-table .ph-col-title,.ph-table .ph-col-action,.ph-table .ph-rate-bar{display:none}.ph-table .ph-rate{min-width:0}.ph-table .ph-rate-top{justify-content:center;margin:0;font-size:12px}.ph-player-cell{min-width:0;gap:5px}.ph-mini-avatar{width:26px;height:26px;flex:0 0 26px}.ph-player-name{font-size:12.5px}.ph-title-inline{display:block;margin-top:3px}.ph-title-inline .badge-title{font-size:9.5px;padding:2px 6px;white-space:nowrap}.ph-title-inline span[style]{font-size:9.5px!important}.ph-table tbody tr{cursor:pointer}.ph-extra-grid{grid-template-columns:1fr}.ph-stat-grid{grid-template-columns:repeat(2,1fr)}.ph-detail-stats{grid-template-columns:repeat(2,1fr)}.ph-drawer-card{width:100%;border-left:0}.ph-match-row{grid-template-columns:58px 1fr 55px}}
        /* ===== SPACE THEME - Bang Phong Than (tat: bo class "ph-space" trong HTML, hoac xoa khoi nay) ===== */
        .ph-space{--bg-panel:rgba(14,16,38,.92);--bg-input:#12142e;--primary:#8c7bff;--text-main:#eef1ff;--text-muted:#9aa3cf;--border-color:rgba(150,165,255,.24);--shadow-outer:0 0 0 1px rgba(140,160,255,.06),0 10px 30px -14px rgba(120,100,255,.4);color:var(--text-main)}
        .ph-v2.ph-space{padding:14px;border-radius:24px;background:radial-gradient(ellipse 60% 40% at 15% 0%,rgba(120,60,220,.22),transparent 60%),radial-gradient(ellipse 50% 35% at 95% 15%,rgba(30,140,220,.18),transparent 60%),radial-gradient(ellipse 45% 40% at 60% 100%,rgba(220,60,160,.12),transparent 60%),#05061a}
        .ph-space .ph-hero{position:relative;overflow:visible!important;border:1px solid rgba(150,165,255,.3);border-radius:20px;background:linear-gradient(160deg,rgba(40,30,90,.55),rgba(6,8,24,.9))!important;box-shadow:0 0 36px rgba(100,80,220,.22),inset 0 0 60px rgba(60,40,140,.12)}
        .ph-space .ph-hero:before{display:none!important;}
        .ph-space .ph-shuttle-icon{display:grid;place-items:center;width:84px;height:72px;flex:0 0 84px;pointer-events:none;}
        .ph-space .ph-shuttle-icon svg{display:block;width:64px;height:64px;filter:drop-shadow(0 3px 6px rgba(140,123,255,.18));}
        .ph-space .ph-mascot-brand{display:flex;align-items:center;justify-content:space-between;gap:12px;}
        .ph-space .ph-hero-top>div:first-child{flex:1;min-width:0;}
        .ph-space .ph-mascot-brand .ph-kicker{line-height:1.5;}
        .ph-space .ph-hero:after{display:none!important;}
        .ph-space .ph-hero>*{position:relative;z-index:1}
        .ph-space .ph-kicker{color:#a6b8ff;letter-spacing:3px;font-family:'Orbitron','Be Vietnam Pro',sans-serif}
        .ph-space .ph-title{font-family:'Orbitron','Be Vietnam Pro',sans-serif;font-weight:700;color:#f2f5ff;text-shadow:0 0 16px rgba(140,120,255,.6),0 0 36px rgba(90,60,220,.4)}
        .ph-space .ph-subtitle{color:#aab3d6}
        .ph-space .ph-summary-box,.ph-space .ph-stat-box,.ph-space .ph-detail-stat{background:linear-gradient(160deg,rgba(140,120,255,.09),rgba(10,12,32,.9));border:1px solid rgba(140,160,255,.24)}
        .ph-space .ph-pod-card{background:linear-gradient(160deg,rgba(140,120,255,.08),rgba(8,10,26,.94));border-color:rgba(140,160,255,.3);box-shadow:0 0 24px -8px rgba(120,100,255,.4)}
        .ph-space .ph-pod-card.ph-1{border-color:#ffd98a;background:linear-gradient(160deg,rgba(255,210,140,.16),rgba(8,10,26,.96) 65%)!important;box-shadow:0 0 30px rgba(255,200,120,.35)}
        .ph-space .ph-pod-card.ph-2{border-color:#b9c6ff}
        .ph-space .ph-pod-card.ph-3{border-color:#ff9a6a}
        .ph-space .ph-pod-points{font-family:'Orbitron',sans-serif;color:#cddcff;text-shadow:0 0 10px rgba(140,160,255,.55)}
        .ph-space .ph-pod-bar{background:rgba(140,160,255,.15)}
        .ph-space .ph-pod-bar i,.ph-space .ph-rate-bar i{background:linear-gradient(90deg,#7a5cff,#43c6ff);box-shadow:0 0 8px rgba(120,150,255,.6)}
        .ph-space .ph-rate-bar{background:rgba(140,160,255,.15)}
        .ph-space .ph-filter{background:rgba(140,160,255,.07);border:1px solid rgba(140,160,255,.3);color:#c6cdf2;font-family:'Orbitron','Be Vietnam Pro',sans-serif;text-transform:uppercase}
        .ph-space .ph-filter.active{background:linear-gradient(90deg,#7a5cff,#43c6ff);color:#0a0c1f;border-color:transparent;box-shadow:0 0 16px rgba(120,150,255,.55)}
        .ph-space .ph-search{background:#10122a;color:#eef1ff;border-color:rgba(140,160,255,.3)}
        .ph-space .ph-search input{background:transparent;color:#eef1ff}
        .ph-space .ph-zoom-tools button{background:rgba(140,160,255,.07);border:1px solid rgba(140,160,255,.3);color:#c6cdf2}
        .ph-space .ph-export-btn{background:linear-gradient(90deg,#ff7ad1,#7a5cff)!important;border-color:transparent!important;box-shadow:0 0 18px rgba(255,120,210,.4)}
        .ph-session-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 12px;padding:10px 14px;border-radius:14px;border:1px solid rgba(140,160,255,.3);background:rgba(140,160,255,.07);color:#c6cdf2;font-weight:800;font-size:13px}
        .ph-session-bar .ph-session-msg.done{color:#7cffb2}
        .ph-session-btn{border:0;border-radius:12px;padding:10px 16px;font-family:inherit;font-weight:900;font-size:13px;cursor:pointer;color:#fff;background:linear-gradient(90deg,#ff7ad1,#7a5cff);box-shadow:0 0 14px rgba(255,120,210,.35)}
        .ph-session-btn.reopen{background:rgba(140,160,255,.15);border:1px solid rgba(140,160,255,.4);box-shadow:none;color:#c6cdf2}
        @media(max-width:560px){.ph-session-btn{width:100%}}
        .ph-space .ph-table-wrap{border:1px solid rgba(140,160,255,.28);background:rgba(6,8,22,.85);box-shadow:0 0 30px -10px rgba(120,100,255,.4)}
        .ph-space .ph-table th{background:linear-gradient(180deg,#181b3e,#0c0e26);color:#a9b6ff;text-transform:uppercase;font-family:'Orbitron','Be Vietnam Pro',sans-serif}
        .ph-space .ph-table td{border-top:1px solid rgba(140,160,255,.1);color:var(--text-main)}
        .ph-space .ph-table tbody tr:nth-child(even) td{background:rgba(140,160,255,.03)}
        .ph-space .ph-table tbody tr:hover td{background:rgba(140,160,255,.1)}
        .ph-space .ph-table tbody tr:nth-child(1) td:first-child{box-shadow:inset 3px 0 0 #ffd98a}
        .ph-space .ph-table tbody tr:nth-child(2) td:first-child{box-shadow:inset 3px 0 0 #b9c6ff}
        .ph-space .ph-table tbody tr:nth-child(3) td:first-child{box-shadow:inset 3px 0 0 #ff9a6a}
        .ph-space .ph-win{color:#7affc4;text-shadow:0 0 8px rgba(122,255,196,.45)}
        .ph-space .ph-loss{color:#ff6a8a;text-shadow:0 0 8px rgba(255,106,138,.4)}
        .ph-space .ph-drawer-card{background:linear-gradient(170deg,#10122a,#05061a)!important;border-left:1px solid rgba(140,160,255,.4)!important;box-shadow:-10px 0 40px rgba(120,100,255,.22)!important}
        @media(max-width:768px){.ph-space .ph-shuttle-icon{width:60px;height:52px;flex-basis:60px}.ph-space .ph-shuttle-icon svg{width:48px;height:48px}.ph-space .ph-mascot-brand{gap:8px}.ph-space .ph-hero-top>div:first-child{width:100%;box-sizing:border-box}.ph-space .ph-mascot-brand .ph-kicker{font-size:10px;letter-spacing:1.5px}}

        /* Tạm ẩn toàn bộ danh hiệu/nhãn FUT. */
        #player_fut_card .fut-titles { display: none !important; }
        .player-top { display: inline-block; font-size: .7em; font-weight: 900; margin-left: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(128,128,128,.16); color: inherit; vertical-align: middle; white-space: nowrap; }
        .card-name-fut { overflow-wrap: anywhere; }
        @media (max-width: 1024px), (pointer: coarse) {
            #fx_sound_btn { display: none !important; }
        }
        html.mobile-device #fx_sound_btn { display: none !important; }
        .monthly-metric-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:10px; }
        .monthly-metric-options label { display:flex;align-items:center;gap:8px;cursor:pointer; }
        .monthly-metric-options input { width:18px;height:18px;margin:0; }
        #pair_player_results .fx-rel { margin-bottom:12px; }
        #monthly_ph_cards .custom-monthly-metrics { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:8px; }
        /* Controls follow the system palette in both light and dark modes. */
        .dashboard-control-panel { background:var(--bg-panel);border:1px solid var(--border-color);border-radius:18px;padding:16px;box-shadow:var(--shadow-outer);margin:12px 0 18px; }
        .dashboard-control-panel[hidden] { display:none; }
        .dashboard-control-title { display:block;font-size:15px;font-weight:900;color:var(--primary);margin:0; }
        .dashboard-control-hint { font-size:12px;line-height:1.6;color:var(--text-muted);margin:7px 0 12px; }
        .dashboard-control-header { display:flex;align-items:center;justify-content:space-between;gap:10px; }
        .dashboard-control-tag { background:var(--bg-input);color:var(--text-muted);padding:4px 9px;border-radius:8px;font-size:11px;font-weight:800;border:1px solid var(--border-color); }
        .dashboard-search.ph-search { width:100%;max-width:none;min-width:0;box-sizing:border-box;background:var(--bg-input);color:var(--text-main);border:1px solid var(--border-color);box-shadow:var(--shadow-inner); }
        .dashboard-search:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
        .dashboard-adjust-btn { display:inline-flex;align-items:center;gap:8px;border-radius:12px;padding:10px 14px;font-size:13px; }
        .dashboard-adjust-btn[aria-expanded="true"] { background:var(--primary);border-color:var(--primary);color:#fff; }
        .monthly-metric-options label { background:var(--bg-input);border:1px solid var(--border-color);border-radius:12px;padding:11px 10px;color:var(--text-main);font-size:12px;font-weight:800;transition:border-color .2s,background .2s; }
        .monthly-metric-options label:has(input:checked) { border-color:var(--primary);background:color-mix(in srgb,var(--primary) 13%,var(--bg-panel));color:var(--primary); }
        .monthly-metric-options input { accent-color:var(--primary);flex-shrink:0;box-shadow:none; }
        .dashboard-reset-btn { margin:14px 0 0; }
        #pair_player_results .pair-player-result { border:1px solid var(--border-color);border-radius:18px;padding:14px 16px;box-shadow:var(--shadow-outer); }
        .pair-result-name { color:var(--primary);font-size:15px;font-weight:900;margin-bottom:7px; }
        /* Rank highlights apply only to athlete cards in the Statistics tab. */
        #stats_container .stats-medal { border-color:var(--medal-color);animation:statsMedalGlow 3.2s ease-in-out infinite; }
        #stats_container .stats-medal-1 { --medal-color:var(--gold);--medal-rgb:255,185,40; }
        #stats_container .stats-medal-2 { --medal-color:var(--silver);--medal-rgb:176,192,216;animation-delay:-1s; }
        #stats_container .stats-medal-3 { --medal-color:var(--bronze);--medal-rgb:205,126,65;animation-delay:-2s; }
        #stats_container .stats-medal .player-top { color:var(--medal-color);background:rgba(var(--medal-rgb),.13);border:1px solid rgba(var(--medal-rgb),.35); }
        @keyframes statsMedalGlow {
            0%,100% { box-shadow:var(--shadow-outer),0 0 8px rgba(var(--medal-rgb),.20),0 0 18px rgba(var(--medal-rgb),.09); }
            50% { box-shadow:var(--shadow-outer),0 0 14px rgba(var(--medal-rgb),.43),0 0 28px rgba(var(--medal-rgb),.19); }
        }
        @media(prefers-reduced-motion:reduce) { #stats_container .stats-medal { animation:none;box-shadow:var(--shadow-outer),0 0 12px rgba(var(--medal-rgb),.25); } }
        @media(max-width:480px) { .dashboard-control-panel{padding:13px}.monthly-metric-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.monthly-metric-options label{padding:10px 8px;font-size:11px} }
        /* Thống kê tháng: không cắt thông số dài trên màn hình nhỏ. */
        .monthly-top5-wrap .monthly-top5-feature { min-width:0;height:auto;box-sizing:border-box; }
        .monthly-top5-wrap .t5f-body, .monthly-top5-wrap .t5i-body { min-width:0; }
        .monthly-top5-wrap .monthly-top5-feature-stats,
        .monthly-top5-wrap .monthly-top5-item-stats { min-width:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:auto; }
        .monthly-top5-wrap .monthly-top5-mini { min-width:0;box-sizing:border-box; }
        .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini span,
        .monthly-top5-wrap .monthly-top5-item-stats .monthly-top5-mini span { white-space:normal;overflow-wrap:anywhere;line-height:1.35; }
        .monthly-top5-wrap .monthly-top5-mini b { overflow-wrap:anywhere;line-height:1.25; }
        @media(max-width:560px) {
            .monthly-top5-wrap .monthly-top5-feature { padding:14px;justify-content:flex-start;min-height:0; }
            .monthly-top5-wrap .top5-water .monthly-top5-feature { padding:14px; }
            .monthly-top5-wrap .t5f-body { grid-template-columns:84px minmax(0,1fr);gap:10px;align-items:start; }
            .monthly-top5-wrap .monthly-top5-feature-avatar,
            .monthly-top5-wrap .top5-water .monthly-top5-feature-avatar { width:80px;box-sizing:border-box; }
            .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini { padding:8px 4px;min-height:52px; }
            .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini b { font-size:18px; }
            .monthly-top5-wrap .monthly-top5-feature-stats .monthly-top5-mini span { font-size:10px; }
            .monthly-top5-wrap .t5f-head { align-items:flex-start;gap:8px; }
            .monthly-top5-wrap .monthly-top5-feature-name { white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.35;font-size:17px; }
            .monthly-top5-wrap.monthly-metrics-expanded .t5f-body { grid-template-columns:minmax(0,1fr); }
            .monthly-top5-wrap.monthly-metrics-expanded .monthly-top5-feature-avatar { width:88px;justify-self:start; }
            .monthly-top5-wrap.monthly-metrics-expanded .monthly-top5-feature-stats { width:100%; }
            .monthly-top5-wrap.monthly-metrics-expanded .monthly-top5-item-stats { gap:5px; }
        }
        /* Bảng tháng giữ đầy đủ cột trên cả PC và điện thoại. */
        #capture_monthly_area .ph-table-wrap { overflow-x:auto;-webkit-overflow-scrolling:touch; }
        @media(max-width:768px) {
            #capture_monthly_area .ph-table { min-width:950px;width:100%; }
            #capture_monthly_area .ph-table th { padding:13px 9px;font-size:11px;line-height:1.4;white-space:nowrap;letter-spacing:.4px; }
            #capture_monthly_area .ph-table td { padding:12px 9px;font-size:22px; }
            #capture_monthly_area .ph-table .ph-col-title,
            #capture_monthly_area .ph-table .ph-col-action { display:table-cell; }
            #capture_monthly_area .ph-table .ph-rate-bar { display:block; }
            #capture_monthly_area .ph-table .ph-rate { min-width:95px; }
            #capture_monthly_area .ph-table .ph-rate-top { justify-content:space-between;margin-bottom:4px;font-size:12.5px; }
            #capture_monthly_area .ph-table .ph-player-cell { min-width:190px;gap:9px; }
            #capture_monthly_area .ph-table .ph-mini-avatar { width:36px;height:36px;flex:0 0 36px; }
            #capture_monthly_area .ph-table .ph-player-name { font-size:22px; }
            #capture_monthly_area .ph-table .ph-title-inline { display:none; }
        }
        /* Wrapped: minh họa phía sau, nội dung phía trước. */
        .wr-badminton-art { position:absolute;inset:0;z-index:0;pointer-events:none; }
        .wr-badminton-art img { width:100%;height:100%;object-fit:cover;display:block; }
        .wr-slide::before { content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,rgba(5,10,24,.16),rgba(5,10,24,.78) 35%,rgba(5,10,24,.73) 70%,rgba(5,10,24,.12)); }
        .wr-content { position:relative;z-index:2;width:100%;display:flex;flex-direction:column;min-height:0;text-shadow:0 2px 12px rgba(0,0,0,.5); }

        /* Square player avatars in Match Dashboard: table, cards and podium. */
        #capture_area .ph-mini-avatar,
        #capture_monthly_area .ph-mini-avatar,
        #capture_area .p-avatar,
        #capture_monthly_area .p-avatar,
        #capture_area .ph-pod-avatar,
        #capture_monthly_area .ph-pod-avatar { border-radius: 7px; }
        #capture_area .ph-mini-avatar img,
        #capture_monthly_area .ph-mini-avatar img,
        #capture_area .p-avatar img,
        #capture_monthly_area .p-avatar img,
        #capture_area .ph-pod-avatar img,
        #capture_monthly_area .ph-pod-avatar img { border-radius: 0; width: 100%; height: 100%; object-fit: cover; }

        /* Relationship rankings: scoped to the global statistics panel. */
        #pair_stats_box .fx-pair { padding:20px;border-radius:22px;background:linear-gradient(135deg,rgba(103,131,255,.07),transparent 50%),var(--bg-panel); }
        #pair_stats_box .fx-pair-head { gap:16px;margin-bottom:20px; }
        #pair_stats_box .fx-pair-head h3 { font-size:19px;line-height:1.4;color:var(--text-main); }
        #pair_stats_box .fx-pair-eyebrow { display:block;font-size:10px;letter-spacing:1.4px;color:var(--primary);font-weight:900;margin-bottom:5px; }
        #pair_stats_box .fx-pair-caption { font-size:12px;color:var(--text-muted);margin:5px 0 0; }
        #pair_stats_box .fx-seg { padding:4px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-input); }
        #pair_stats_box .fx-seg button { border:0;border-radius:10px;padding:9px 14px;transition:background .2s,box-shadow .2s; }
        #pair_stats_box .fx-seg button.on { box-shadow:0 3px 12px rgba(103,131,255,.22); }
        #pair_stats_box .fx-pair-cols { gap:16px;align-items:start; }
        #pair_stats_box .fx-pair-panel { --pair-accent:#29c5a2;--pair-tint:rgba(41,197,162,.1);padding:14px;border:1px solid var(--border-color);border-radius:18px;background:linear-gradient(160deg,var(--pair-tint),transparent 45%),var(--bg-input);min-width:0; }
        #pair_stats_box .fx-pair-panel.rival { --pair-accent:#f27991;--pair-tint:rgba(242,121,145,.1); }
        #pair_stats_box .fx-panel-head { display:flex;align-items:center;gap:10px;margin-bottom:14px; }
        #pair_stats_box .fx-panel-icon { width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:12px;background:var(--pair-tint);font-size:20px; }
        #pair_stats_box .fx-panel-title { margin:0;font-size:14px;font-weight:900;color:var(--text-main); }
        #pair_stats_box .fx-panel-note { margin:3px 0 0;font-size:10px;line-height:1.5;color:var(--text-muted); }
        #pair_stats_box .fx-row { --rank-color:var(--border-color);position:relative;padding:12px;margin:0 0 9px;background:var(--bg-panel);border:1px solid var(--border-color);border-left:3px solid var(--rank-color);border-radius:13px;animation:pairRowIn .45s ease both;animation-delay:var(--row-delay,0ms);transition:transform .2s,box-shadow .2s; }
        #pair_stats_box .fx-row:last-child { margin-bottom:0; }
        #pair_stats_box .fx-row:hover { transform:translateY(-2px);box-shadow:0 6px 18px var(--pair-tint); }
        #pair_stats_box .fx-row.rank-1 { --rank-color:#e9bb58;background:linear-gradient(100deg,rgba(233,187,88,.09),transparent 65%),var(--bg-panel); }
        #pair_stats_box .fx-row.rank-2 { --rank-color:#b9c9dc; }
        #pair_stats_box .fx-row.rank-3 { --rank-color:#cc936f; }
        #pair_stats_box .fx-row-top { align-items:center;gap:9px;font-size:13px; }
        #pair_stats_box .fx-rank { display:grid;place-items:center;flex:0 0 24px;width:24px;height:28px;font-size:12px;font-weight:900;color:var(--text-muted); }
        #pair_stats_box .rank-1 .fx-rank,#pair_stats_box .rank-2 .fx-rank,#pair_stats_box .rank-3 .fx-rank { font-size:20px;filter:drop-shadow(0 0 5px var(--rank-color)); }
        #pair_stats_box .fx-duo-avatars { display:flex;flex:0 0 72px;width:72px;gap:8px;align-items:center; }
        #pair_stats_box .fx-duo-avatar { display:grid;place-items:center;flex:0 0 32px;width:32px;height:42px;box-sizing:border-box;border-radius:8px;background:var(--pair-tint);border:2px solid var(--bg-panel);color:var(--pair-accent);font-size:13px;font-weight:900;overflow:hidden; }
        #pair_stats_box .fx-duo-avatar+ .fx-duo-avatar { margin-left:0; }
        #pair_stats_box .fx-duo-avatar img { width:100%;height:100%;object-fit:cover; }
        #pair_stats_box .fx-row-names { flex:1;min-width:0;overflow-wrap:break-word;word-break:normal;line-height:1.5; }
        #pair_stats_box .fx-vs { display:block;color:var(--text-muted);font-size:10px;font-weight:700; }
        #pair_stats_box .fx-row-top em { text-align:right;color:var(--pair-accent);font-size:15px;line-height:1.4;flex:0 0 auto; }
        #pair_stats_box .fx-row-top em small { display:block;font-size:10px;font-weight:700;color:var(--text-muted); }
        #pair_stats_box .fx-row-bar { height:5px;margin-top:10px;border-radius:6px; }
        #pair_stats_box .fx-row-bar i { border-radius:6px;background:linear-gradient(90deg,var(--pair-accent),var(--primary));transform-origin:left;animation:pairBarIn .75s ease both;animation-delay:var(--row-delay,0ms); }

        #pair_stats_box .fx-pair-pager { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:12px;border-top:1px solid var(--border-color); }
        #pair_stats_box .fx-pair-pager button { display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-panel);color:var(--pair-accent);font-size:28px;line-height:1;cursor:pointer;box-shadow:none; }
        #pair_stats_box .fx-pair-pager button:hover:not(:disabled) { background:var(--pair-tint);border-color:var(--pair-accent); }
        #pair_stats_box .fx-pair-pager button:disabled { opacity:.35;cursor:default; }
        #pair_stats_box .fx-pair-pager span { text-align:center;color:var(--text-main);font-size:12px;font-weight:800; }
        #pair_stats_box .fx-pair-pager small { display:block;margin-top:3px;color:var(--text-muted);font-size:10px;font-weight:600; }
        #pair_stats_box .fx-empty { padding:20px 10px;border:1px dashed var(--border-color);border-radius:12px;text-align:center;line-height:1.7; }
        #pair_stats_box button:focus-visible { outline:2px solid var(--primary);outline-offset:3px; }
        @keyframes pairRowIn { from { opacity:0;transform:translateY(8px); } to { opacity:1;transform:translateY(0); } }
        @keyframes pairBarIn { from { transform:scaleX(0); } to { transform:scaleX(1); } }
        @media(max-width:768px) {
            #pair_stats_box .fx-pair { padding:14px; }
            #pair_stats_box .fx-pair-head h3 { font-size:17px; }
            #pair_stats_box .fx-pair-panel { padding:12px; }
            #pair_stats_box .fx-row-top { display:grid;grid-template-columns:24px minmax(72px,1fr) auto;column-gap:9px;row-gap:8px; }
            #pair_stats_box .fx-row-top .fx-rank { grid-column:1;grid-row:1; }
            #pair_stats_box .fx-row-top .fx-duo-avatars { grid-column:2;grid-row:1; }
            #pair_stats_box .fx-row-top em { grid-column:3;grid-row:1; }
            #pair_stats_box .fx-row-top .fx-row-names { grid-column:1 / -1;grid-row:2;font-size:14px;line-height:1.55;white-space:normal;overflow-wrap:break-word;word-break:normal; }
        }
        #pair_stats_box .fx-rival-top { display:grid;grid-template-columns:24px minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px; }
        #pair_stats_box .fx-rival-player { display:flex;align-items:center;gap:7px;min-width:0; }
        #pair_stats_box .fx-rival-player.right { justify-content:flex-end;text-align:right; }
        #pair_stats_box .fx-rival-name { min-width:0;overflow-wrap:anywhere;color:var(--text-main);font-size:12px;font-weight:800;line-height:1.4; }
        #pair_stats_box .fx-rival-score { display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:60px;color:var(--pair-accent);font-size:17px;white-space:nowrap;font-weight:900;line-height:1.4; }
        #pair_stats_box .fx-rival-score small { font-size:9px;color:var(--text-muted);font-weight:700; }
        @media(max-width:380px) { #pair_stats_box .fx-row { padding:10px 8px; } #pair_stats_box .fx-rival-top { grid-template-columns:20px minmax(0,1fr) auto minmax(0,1fr);gap:5px; } #pair_stats_box .fx-rival-player { gap:4px; } #pair_stats_box .fx-rival-score { min-width:48px;font-size:15px; } #pair_stats_box .fx-rival-name { font-size:11px; } #pair_stats_box .fx-rival-player .fx-duo-avatar { width:26px;height:36px;flex-basis:26px; } }
        @media(prefers-reduced-motion:reduce) { #pair_stats_box .fx-row,#pair_stats_box .fx-row-bar i { animation:none;transition:none; } #pair_stats_box .fx-row:hover { transform:none; } }

        /* Hồ sơ VĐV: chiều cao tự nhiên, cuộn một vùng và không cắt thông số. */
        #stats_modal .modal-content-wrapper { width:860px;max-width:100%;box-sizing:border-box;padding:0;min-width:0;text-align:left; }
        #stats_modal .card-container { margin:0; }
        #stats_modal #player_fut_card { width:100%;height:auto;min-height:0;box-sizing:border-box;padding:24px;overflow:visible;background:var(--bg-panel);border:1px solid var(--border-color);color:var(--text-main); }
        #stats_modal .profile-header { display:grid;grid-template-columns:100px minmax(0,1fr) auto;align-items:center;gap:20px;padding-bottom:20px;border-bottom:1px solid var(--border-color); }
        #stats_modal #fut_avatar { width:100px;height:134px;padding:0;align-items:center;border-radius:14px;background:var(--bg-input);overflow:hidden; }
        #stats_modal #fut_avatar img { width:100%;height:100%;object-fit:cover; }
        #stats_modal .profile-initial { font-size:44px;font-weight:900;color:var(--primary); }
        #stats_modal .profile-eyebrow { font-size:10px;font-weight:900;letter-spacing:1px;color:var(--primary); }
        #stats_modal #fut_name { width:auto;text-align:left;margin:7px 0;padding:0;border:0;color:var(--text-main);font-size:28px;line-height:1.25;overflow-wrap:anywhere; }
        #stats_modal .profile-scope { color:var(--text-muted);font-size:12px;line-height:1.5;margin:0; }
        #stats_modal #player_fut_card .card-rating { position:static;display:flex;flex-direction:column;gap:5px;width:auto;height:auto;padding:14px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-input); }
        #stats_modal .card-rating .label { color:var(--text-muted);font-size:10px;letter-spacing:1px; }
        #stats_modal .card-rating .ovr { color:var(--primary);font-size:36px; }
        #stats_modal .card-rating small { color:var(--text-muted);font-size:9px; }
        #stats_modal .profile-section-title { font-size:14px;font-weight:900;color:var(--text-main);margin:20px 0 12px; }
        #stats_modal .profile-section-title small { display:block;margin-top:4px;color:var(--text-muted);font-size:10px;font-weight:600; }
        #stats_modal .card-stats-fut,#stats_modal .profile-extra-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:0; }
        #stats_modal .profile-extra-grid { margin-top:10px; }
        #stats_modal .profile-metric { display:flex;flex-direction:column;gap:7px;padding:12px;min-width:0;background:var(--bg-input);border:1px solid var(--border-color);border-radius:12px; }
        #stats_modal .profile-metric>span { color:var(--text-muted);font-size:11px;font-weight:700;line-height:1.5; }
        #stats_modal .profile-metric strong { color:var(--metric);font-size:20px;line-height:1.3;font-weight:900;overflow-wrap:anywhere; }
        #stats_modal .fut-bars { padding:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
        #stats_modal .fut-bar-top { color:var(--text-main);gap:8px;font-size:11px; }
        #stats_modal .fut-bar-trk { background:var(--bg-input);height:6px; }
        #stats_modal .fut-bar-fill { background:var(--primary); }
        #stats_modal .profile-download { width:100%;padding:14px;margin:14px 0;font-size:14px;font-weight:900;border-radius:12px; }
        #stats_modal .profile-insights { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px; }
        #stats_modal .profile-insight { padding:16px;border-radius:14px;border:1px solid var(--border-color);background:var(--bg-panel);min-width:0; }
        #stats_modal .profile-insight h4 { margin:0 0 8px;font-size:13px;color:var(--primary); }
        #stats_modal .profile-insight strong { display:block;overflow-wrap:anywhere;color:var(--text-main);font-size:16px; }
        #stats_modal .profile-insight p { margin:6px 0 0;color:var(--text-muted);font-size:12px;line-height:1.6; }
        #stats_modal .profile-form { grid-column:1/-1; }
        #stats_modal .profile-form-chips { display:flex;gap:7px;flex-wrap:wrap;margin-top:10px; }
        #stats_modal .profile-form-chips span { padding:6px 9px;border-radius:7px;background:var(--bg-input);font-size:11px;font-weight:900; }
        #stats_modal #player_history_list { max-height:none;overflow:visible;padding:18px;background:var(--bg-panel);border:1px solid var(--border-color);border-radius:18px; }
        #stats_modal .profile-history-heading { display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px; }
        #stats_modal .profile-history-heading h4 { margin:0;color:var(--text-main);font-size:15px; }
        #stats_modal .profile-history-heading select { width:auto;max-width:100%;padding:9px;border-radius:10px;font-size:12px; }
        #stats_modal .profile-match { padding:13px;margin-bottom:10px;border:1px solid var(--border-color);border-left:3px solid var(--result);border-radius:12px;background:var(--bg-input);font-size:12px; }
        #stats_modal .profile-match-meta { display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:center;color:var(--text-muted);margin-bottom:9px; }
        #stats_modal .profile-match-meta strong { color:var(--result); }
        #stats_modal .profile-match-teams { display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center;line-height:1.6;color:var(--text-main); }
        #stats_modal .profile-match-teams>div { min-width:0;overflow-wrap:anywhere; }
        #stats_modal .profile-match-teams>div:last-child { text-align:right; }
        #stats_modal .profile-match-teams small { display:block;font-size:10px;color:var(--text-muted); }
        #stats_modal .profile-match-footer { display:flex;gap:12px;flex-wrap:wrap;color:var(--text-muted);font-size:11px;margin-top:10px;padding-top:9px;border-top:1px solid var(--border-color); }
        #stats_modal .profile-history-pages { display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:14px;color:var(--text-muted);font-size:12px; }
        #stats_modal .profile-history-pages button { min-width:44px;min-height:44px;border-radius:10px; }
        @media(max-width:600px) {
            #stats_modal #player_fut_card { padding:16px; }
            #stats_modal .profile-header { grid-template-columns:76px minmax(0,1fr);gap:14px; }
            #stats_modal #fut_avatar { width:76px;height:104px; }
            #stats_modal #fut_name { font-size:22px; }
            #stats_modal #player_fut_card .card-rating { grid-column:1/-1;flex-direction:row;justify-content:space-between;gap:8px;padding:10px 12px; }
            #stats_modal .card-rating .ovr { font-size:28px; }
            #stats_modal .card-stats-fut,#stats_modal .profile-extra-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
            #stats_modal .profile-metric { padding:11px; }
            #stats_modal .fut-bars { grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }
            #stats_modal .profile-insights { grid-template-columns:minmax(0,1fr); }
            #stats_modal #player_history_list { padding:12px; }
            #stats_modal .profile-match { padding:11px; }
        }

        #avatar_crop_modal { z-index: 10020; padding: 16px; box-sizing: border-box; }
        #avatar_crop_modal .modal-content { max-width: 420px; max-height: 100%; overflow-y: auto; box-sizing: border-box; color: var(--text-main); }
        #avatar_crop_canvas { display: block; width: auto; height: min(40vh, 360px); max-width: 100%; margin: 14px auto; border-radius: 12px; border: 2px solid var(--primary); background: #12141c; cursor: grab; touch-action: none; }
        #avatar_crop_canvas:active { cursor: grabbing; }
        .avatar-crop-controls { display: grid; gap: 12px; text-align: left; margin-bottom: 16px; }
        .avatar-crop-controls label { display: flex; align-items: center; gap: 12px; font-size: 14px; }
        .avatar-crop-controls input, .avatar-crop-controls select { flex: 1; min-width: 0; }
        .avatar-crop-controls select { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; }
        .avatar-crop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
        .avatar-crop-actions button { flex: 1; min-width: 80px; }


/* Lịch sử trận đấu: readable result cards and an independent action rail. */
#history_grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#history_grid .history-match{padding:0;min-width:0;box-shadow:0 6px 22px rgba(15,23,42,.07);border-radius:20px;background:var(--bg-panel);border:1px solid var(--border-color)}
#history_grid .history-match::before{height:3px;background:linear-gradient(90deg,var(--primary),var(--secondary))}
.history-match-trigger{padding:17px 18px 14px;cursor:pointer;outline:none}
.history-match-trigger:focus-visible{box-shadow:inset 0 0 0 2px var(--primary);border-radius:18px}
.history-match-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--text-muted);font-size:11px;font-weight:700;margin-bottom:18px}
.history-match-number{color:var(--primary);background:var(--bg-input);padding:5px 8px;border-radius:7px;font-size:12px}
.history-match-mode{margin-left:auto;border:1px solid var(--border-color);padding:4px 8px;border-radius:20px;font-size:10px}
.history-court{display:grid;grid-template-columns:minmax(0,1fr) 78px minmax(0,1fr);gap:10px;align-items:center}
.history-team{display:flex;flex-direction:column;gap:12px;min-width:0;align-items:center;align-self:start;text-align:center}
.history-team.right{text-align:center}
.history-team-players{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%;align-items:start}
.history-team-players.duo{grid-template-columns:repeat(2,minmax(0,1fr))}
.history-player{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;text-align:center}
.history-team.right .history-player{flex-direction:column}
.history-avatar{display:flex;width:38px;height:46px;flex:0 0 auto;align-items:center;justify-content:center;border:1px solid var(--border-color);border-radius:9px;overflow:hidden;background:var(--bg-input);font-size:16px;font-weight:900;color:var(--text-main)}
.history-avatar img{width:100%;height:100%;object-fit:cover}
.history-player-name{font-size:13px;font-weight:800;line-height:1.4;color:var(--text-main);min-width:0;overflow-wrap:anywhere}
.history-status{display:inline-flex;align-self:center;font-size:10px;line-height:1.5;font-weight:900;padding:3px 8px;border-radius:6px;letter-spacing:.4px}
.history-team.right .history-status{align-self:center}
.history-status.won{color:var(--success);background:var(--bg-input);border:1px solid var(--success)}
.history-status.lost{color:var(--danger);background:var(--bg-input);border:1px solid var(--danger)}
.history-score{text-align:center;min-width:0;color:var(--text-main)}
.history-vs{display:inline-flex;align-items:center;justify-content:center;font-size:19px;font-weight:900;font-style:italic;letter-spacing:1px;color:var(--primary);margin:0 0 10px;text-shadow:0 2px 10px rgba(99,102,241,.25)}
.history-team.is-winner .history-avatar{border-color:var(--success);box-shadow:0 0 0 2px rgba(46,204,113,.12)}
.history-team.is-loser .history-avatar{border-color:var(--danger)}
@keyframes historyWinGlow{0%,100%{box-shadow:0 0 0 0 rgba(46,204,113,0)}50%{box-shadow:0 0 0 5px rgba(46,204,113,.14)}}
@keyframes historyLoseGlow{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0)}50%{box-shadow:0 0 0 4px rgba(239,68,68,.10)}}
@keyframes historyVsGlow{0%,100%{opacity:.75}50%{opacity:1;text-shadow:0 0 12px rgba(99,102,241,.45)}}
@media(prefers-reduced-motion:no-preference){.history-team.is-winner .history-status{animation:historyWinGlow 2.6s ease-in-out infinite}.history-team.is-loser .history-status{animation:historyLoseGlow 3s ease-in-out infinite}.history-vs{animation:historyVsGlow 3s ease-in-out infinite}}

.history-score strong{display:block;font-size:22px;font-weight:900;line-height:1.2;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.history-score small{display:block;font-size:9px;font-weight:800;letter-spacing:1.2px;color:var(--text-muted);margin-top:5px}
.history-match-meta{display:flex;justify-content:center;flex-wrap:wrap;gap:7px;margin-top:16px}
.history-match-meta span{padding:5px 9px;border-radius:8px;background:var(--bg-input);font-size:11px;color:var(--text-muted)}
.history-match-meta b{color:var(--text-main)}
.history-action-rail{display:grid;align-items:center;min-height:58px;padding:7px 12px;border-top:1px solid var(--border-color);background:var(--bg-input)}
.history-action-hint{grid-area:1/1;text-align:center;font-size:10px;color:var(--text-muted);pointer-events:none}
.history-action-hint .touch-hint{display:none}
#history_grid .history-match .card-actions{grid-area:1/1;position:static;display:flex;gap:7px;justify-content:flex-end;flex-wrap:nowrap;min-width:0}
#history_grid .card-actions[hidden],.history-match.actions-visible .history-action-hint{display:none!important}
#history_grid .history-match .card-actions button{flex:1;min-width:0;min-height:42px;font-size:11px!important;line-height:1.2;padding:8px 6px!important;border-radius:10px;box-shadow:none;white-space:normal;justify-content:center}
#history_grid .card-actions .bk-icon{width:20px;height:20px;flex-basis:20px;margin-right:3px}
#history_pagination{gap:10px!important;box-shadow:none!important;padding:10px!important}
#history_pagination button{min-height:42px;padding:9px 12px;font-size:12px}
#current_history_date_label{font-size:12px!important;white-space:nowrap}
#capture_history_area .dashboard-header-flex{gap:12px;flex-wrap:wrap}
@media(hover:none),(pointer:coarse){.history-action-hint .touch-hint{display:inline}.history-action-hint .mouse-hint{display:none}}
@media(max-width:680px){#history_grid{grid-template-columns:minmax(0,1fr);gap:13px}.history-match-trigger{padding:15px}.history-court{grid-template-columns:minmax(0,1fr) 68px minmax(0,1fr);gap:8px}.history-score strong{font-size:20px}#capture_history_area .dashboard-header-flex h2{font-size:20px}#capture_history_area .dashboard-header-flex>button{padding:10px 12px;font-size:12px}}
@media(max-width:360px){.history-avatar{width:30px;height:38px;flex-basis:auto}.history-player{gap:5px}.history-player-name{font-size:12px}.history-court{grid-template-columns:minmax(0,1fr) 52px minmax(0,1fr);gap:5px}.history-score strong{font-size:17px}.history-match-trigger{padding:13px 10px}#history_pagination{gap:5px!important}#history_pagination button{padding:8px;font-size:11px}}
@media(prefers-reduced-motion:no-preference){.history-match{transition:border-color .15s ease,box-shadow .15s ease}.history-match.actions-visible{border-color:var(--primary)}}
    

/* 16 genuine raster 3D icons in one cached transparent sprite. */
.bk-control{border-radius:10px;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 2px 0 rgba(25,45,82,.18);transition:transform .15s}
.bk-control:active{transform:translateY(2px)}
.bk-control:disabled{opacity:.45;transform:none}
.bk-icon{display:inline-block;width:34px;height:34px;flex:0 0 34px;vertical-align:middle;background-image:url('../../assets/ui-3d-sprite.png');background-size:400% 400%;background-repeat:no-repeat;pointer-events:none;filter:drop-shadow(0 2px 2px rgba(27,40,82,.15))}
button.bk-button{border-radius:14px!important;border:1px solid rgba(255,255,255,.42)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 4px 0 var(--bk-edge,#ccd6e6),0 7px 13px rgba(25,45,82,.14)!important;background:var(--bk-fill)!important;color:var(--bk-text,#fff)!important;transition:transform .15s,box-shadow .15s,filter .15s;line-height:1.3;isolation:isolate}
button.bk-button>.bk-icon{margin-right:7px}
button.bk-button[data-bk-tone="blue"]{--bk-fill:linear-gradient(160deg,#459eff,#125af0);--bk-edge:#0a48c9}
button.bk-button[data-bk-tone="green"]{--bk-fill:linear-gradient(160deg,#35df85,#069c52);--bk-edge:#078241}
button.bk-button[data-bk-tone="violet"]{--bk-fill:linear-gradient(160deg,#ad62fa,#6825dc);--bk-edge:#5720b1}
button.bk-button[data-bk-tone="red"]{--bk-fill:linear-gradient(160deg,#ff6975,#db2135);--bk-edge:#b6192a}
button.bk-button[data-bk-tone="soft-blue"]{--bk-fill:linear-gradient(160deg,#f6faff,#d7e7ff);--bk-text:#244775;--bk-edge:#b7cdec}
button.bk-button[data-bk-tone="amber"]{--bk-fill:linear-gradient(160deg,#fff9eb,#ffe5b2);--bk-text:#634317;--bk-edge:#e9ca8d}
button.bk-button[data-bk-tone="soft-red"]{--bk-fill:linear-gradient(160deg,#fff6f7,#ffd7dc);--bk-text:#a5182a;--bk-edge:#eab1ba}
button.bk-button[data-bk-tone="soft"]{--bk-fill:linear-gradient(160deg,#f9fbff,#dde5f1);--bk-text:#354563;--bk-edge:#bbc8dc}
.dark-mode button.bk-button[data-bk-tone^="soft"]{--bk-fill:linear-gradient(160deg,#34435f,#222e44);--bk-text:#e7f0ff;--bk-edge:#152036;border-color:#51617b!important}
.dark-mode button.bk-button[data-bk-tone="soft-red"]{--bk-fill:linear-gradient(160deg,#603642,#43232e);--bk-text:#ffced6;--bk-edge:#301720}
.dark-mode button.bk-button[data-bk-tone="amber"]{--bk-fill:linear-gradient(160deg,#5b492f,#3c3022);--bk-text:#ffe7b6;--bk-edge:#2d2318}
button.bk-button:active{transform:translateY(3px);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 var(--bk-edge),0 2px 5px rgba(25,45,82,.12)!important}
button.bk-button:disabled{opacity:.5;filter:grayscale(.6);transform:none}
button.bk-button:focus-visible{outline:3px solid #679cff;outline-offset:5px}
button.btn-mini.bk-button .bk-icon,.card-actions .bk-icon,.ph-action .bk-icon{width:25px;height:25px;flex-basis:25px;margin-right:3px}
.bottom-nav{padding-top:9px!important;box-shadow:0 -5px 22px rgba(32,56,105,.10)!important}
.bottom-nav .nav-ico{height:43px;display:flex!important;align-items:center;justify-content:center;margin-bottom:4px!important}
.bottom-nav .nav-ico .bk-icon{width:45px;height:45px;flex-basis:45px;transition:transform .18s}
.bottom-nav .tab-btn.active{background:rgba(65,133,255,.12)!important;border-radius:14px!important}
.bottom-nav .tab-btn.active::before{display:none!important}
.bottom-nav .tab-btn.active::after{content:'';display:block;background:var(--primary,#2563eb);border-radius:8px;width:22px;height:4px;margin:5px auto 0}
.bottom-nav .tab-btn.active .nav-ico{transform:translateY(-2px)!important}
body{padding-bottom:125px!important}
.bk-date{position:relative;display:block;width:100%;min-width:0;flex:1 1 0}
.bk-date>input{width:100%!important;margin:0!important;padding-right:47px!important;box-sizing:border-box;min-width:0}
.bk-date>.bk-icon{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:31px;height:31px}
.bk-date>input::-webkit-calendar-picker-indicator{opacity:0;width:31px;position:absolute;right:8px;cursor:pointer}
label>.bk-icon,h2>.bk-icon{width:29px;height:29px;flex-basis:29px;margin-right:5px}
.match-info-header>.bk-icon,.profile-match-meta>span>.bk-icon{width:22px;height:22px;flex-basis:22px;margin-right:3px}
@media(max-width:480px){.bottom-nav .nav-ico .bk-icon{width:35px;height:35px;flex-basis:35px}.bottom-nav .nav-ico{height:35px}.bottom-nav .nav-lbl{font-size:10px;line-height:1.3}.bk-icon{width:29px;height:29px;flex-basis:29px}button.bk-button{padding-left:10px;padding-right:10px}.card-actions{flex-wrap:wrap}.header-actions{flex-wrap:wrap;gap:9px}button.bk-button>.bk-icon{margin-right:4px}}
@media(prefers-reduced-motion:reduce){button.bk-button,.bottom-nav .nav-ico .bk-icon{transition:none}}

/* Recessed fields and raised captions, using CSS only. */
:root{--bk-field-top:#e6ecf6;--bk-field-bottom:#fff;--bk-field-border:#bdcbe1;--bk-label-top:#fff;--bk-label-bottom:#e5ecf7;--bk-well-shadow:rgba(40,65,106,.20);--bk-field-text:#24344f;--bk-placeholder:#64748b}
.dark-mode{--bk-field-top:#10141e;--bk-field-bottom:#1c2435;--bk-field-border:#3d4d6b;--bk-label-top:#2a344a;--bk-label-bottom:#181e2c;--bk-well-shadow:rgba(0,0,0,.6);--bk-field-text:#eff4ff;--bk-placeholder:#a3b1c9}
input:not([type]),input[type="text"],input[type="password"],input[type="email"],input[type="search"],input[type="tel"],input[type="number"],input[type="date"],input[type="month"],select,textarea{background:linear-gradient(160deg,var(--bk-field-top),var(--bk-field-bottom))!important;border:1px solid var(--bk-field-border)!important;border-radius:12px!important;box-shadow:inset 2px 3px 6px var(--bk-well-shadow),inset 0 -1px 1px rgba(130,160,210,.3),0 1px 0 rgba(130,160,210,.18)!important;color:var(--bk-field-text);transition:box-shadow .15s,border-color .15s}
/* Native dropdown menus need solid foreground/background colors. */
select{color-scheme:light}
.dark-mode select{color-scheme:dark}
select option,select optgroup{background-color:#f8fafc!important;color:#24344f!important}
.dark-mode select option,.dark-mode select optgroup{background-color:#1e293b!important;color:#eff4ff!important}
select option:checked,.dark-mode select option:checked{background-color:#2563eb!important;color:#fff!important}
input::placeholder,textarea::placeholder{color:var(--bk-placeholder);opacity:1}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #689cff;outline-offset:2px;border-color:#689cff!important}
#bet_amount,#water_amount{background:transparent!important;box-shadow:none!important;border:0!important;border-radius:0!important}
.bk-field-label{display:inline-block;padding:7px 12px;border-radius:10px;background:linear-gradient(155deg,var(--bk-label-top),var(--bk-label-bottom));border:1px solid var(--bk-field-border);box-shadow:inset 0 1px 0 rgba(150,177,220,.25),0 3px 0 var(--bk-field-top),0 5px 9px var(--bk-well-shadow);text-shadow:0 1px 1px var(--bk-well-shadow);max-width:100%;box-sizing:border-box;align-self:center}
.team-box{background:linear-gradient(150deg,var(--bk-label-top),var(--bk-label-bottom))!important;border:1px solid var(--bk-field-border)!important;box-shadow:inset 0 1px 0 rgba(150,177,220,.22),0 4px 10px var(--bk-well-shadow)!important}
.team-box .bk-field-label{margin:0 auto 16px}
.bk-no-minus{display:flex;align-items:center;gap:10px;padding:11px 14px;margin:0;width:100%;box-sizing:border-box;border-radius:12px;background:linear-gradient(155deg,var(--bk-label-top),var(--bk-label-bottom));border:1px solid var(--bk-field-border);box-shadow:inset 0 1px 0 rgba(150,177,220,.22),0 2px 5px var(--bk-well-shadow);color:var(--bk-field-text);font-size:13px;font-weight:700;line-height:1.4;cursor:pointer;min-height:44px}
.bk-no-minus input{width:20px!important;height:20px!important;margin:0!important;flex:0 0 20px;accent-color:var(--primary,#2563eb);cursor:pointer}
.bk-no-minus:has(input:checked){border-color:var(--primary,#2563eb);box-shadow:inset 0 1px 0 rgba(150,177,220,.22),0 0 0 1px var(--primary,#2563eb)}
@media(max-width:480px){.bk-field-label{padding:6px 9px}.bk-no-minus{font-size:13px}}

