/* =============================================
   Tournament Manager - Public Styles
   ============================================= */

.tm-public {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
}

.tm-notice { color: #666; font-style: italic; padding: 10px 0; }
.tm-error  { color: #dc3545; }
.tm-empty  { color: #999; text-align: center; padding: 20px; }

/* ---- Badges & Labels ---- */
.tm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #1a73e8;
    letter-spacing: .5px;
}
.tm-position { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.tm-pos-gk  { background: #f39c12; color: #fff; }
.tm-pos-def { background: #27ae60; color: #fff; }
.tm-pos-mid { background: #2980b9; color: #fff; }
.tm-pos-fwd { background: #e74c3c; color: #fff; }

/* =============================================
   Teams Grid
   ============================================= */
.tm-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px 0;
}
.tm-team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 16px 12px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.tm-team-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.tm-team-logo { width: 64px; height: 64px; margin-bottom: 10px; }
.tm-team-logo img { width: 100%; height: 100%; object-fit: contain; }
.tm-team-logo-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: #fff;
}
.tm-team-info { text-align: center; }
.tm-team-info h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.tm-team-coach { font-size: 12px; color: #666; margin: 0; }

/* =============================================
   Team Detail
   ============================================= */
.tm-team-header {
    display: flex; align-items: center; gap: 20px;
    background: #f8f9fa; border-radius: 10px;
    padding: 20px; margin-bottom: 24px;
}
.tm-team-header-logo { width: 80px; height: 80px; object-fit: contain; }
.tm-team-header-logo.tm-logo-placeholder {
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 700; color: #fff;
}
.tm-team-header-info h2 { margin: 0 0 8px; font-size: 24px; }
.tm-team-header-info p  { margin: 4px 0; font-size: 14px; color: #555; }

.tm-section-title { font-size: 18px; font-weight: 700; margin: 24px 0 12px; border-bottom: 2px solid #e9ecef; padding-bottom: 8px; }
.tm-position-group { margin-bottom: 20px; }
.tm-pos-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.tm-player-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-player-card {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e9ecef;
    border-radius: 6px; padding: 6px 12px;
    font-size: 13px;
}
.tm-player-number {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}
.tm-player-name { font-weight: 600; }
.tm-player-nat  { font-size: 11px; color: #888; }

/* =============================================
   Standings – Professional Table Layout
   ============================================= */

.tm-standings-wrap { margin: 0; }

.tm-standings-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px 24px; color: #9ca3af;
    background: #fff; border-radius: 12px;
}
.tm-standings-empty svg { display: block; margin-bottom: 16px; opacity: 0.5; }

.tm-standings-container {
    display: grid; gap: 32px; margin: 0;
}

/* Section: Each group/bảng đấu */
.tm-standings-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}

/* ── Section Header ── */
.tm-standings-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e5e7eb;
}

.tm-standings-header-left { flex: 1; }
.tm-standings-title {
    font-size: 20px; font-weight: 900;
    color: #1a1a2e; margin: 0 0 4px;
}
.tm-standings-description {
    font-size: 13px; color: #6b7280; margin: 0;
}

/* ── Responsive Table Container ── */
.tm-table-responsive {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.tm-table-responsive::-webkit-scrollbar        { height: 6px; }
.tm-table-responsive::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 3px; }

/* ── Table Structure ── */
.tm-standings-table {
    width: 100%; border-collapse: collapse;
    font-size: 14px; background: #fff;
    border: none;
}

.tm-standings-table thead { background: #f9fafb; }
.tm-standings-table th {
    text-align: center;
    padding: 12px 10px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: #6b7280; border-bottom: 1px solid #e5e7eb;
    cursor: help; user-select: none;
}

.tm-standings-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.tm-standings-table tbody tr:last-child { border-bottom: none; }
.tm-standings-table tbody tr:hover { background: #f9fafb; transition: background .1s; }

/* Row states */
.tm-table-row { transition: background .12s; }

/* ── Column Styling ── */
.tm-col-rank  { text-align: center; width: 48px; padding: 12px 8px; }
.tm-col-team  { text-align: left; min-width: 180px; padding: 12px 16px; }
.tm-col-number { text-align: center; width: 48px; padding: 12px 8px; }
.tm-col-points { text-align: center; width: 54px; padding: 12px 10px; font-weight: 700; }
.tm-col-empty { text-align: center; padding: 32px 16px; color: #9ca3af; font-size: 13px; }

/* Rank Badge */
.tm-rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 12px; font-weight: 700;
    background: #e5e7eb; color: #6b7280;
}

/* ── Team Cell ── */
.tm-team-cell {
    display: flex; align-items: center; gap: 12px; min-width: 0;
}
.tm-table-logo {
    width: 44px; height: 44px;
    object-fit: contain; border-radius: 8px;
    flex-shrink: 0;
}
.tm-table-logo-placeholder {
    width: 44px; height: 44px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tm-team-info { flex: 1; min-width: 0; }
.tm-team-fullname {
    display: block; font-weight: 600; color: #1a1a2e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tm-team-shortname {
    display: none;
    font-size: 11px; color: #9ca3af; font-weight: 600;
    white-space: nowrap;
}

/* ── Stat Badges (W/D/L) ── */
.tm-stat-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; border-radius: 6px;
    font-size: 12px; font-weight: 700; color: #fff;
}
.tm-stat-win  { background: #16a34a; }
.tm-stat-draw { background: #6b7280; }
.tm-stat-loss { background: #dc2626; }

/* ── Goal Difference Badge ── */
.tm-gd-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 28px;
    border-radius: 6px; font-size: 12px; font-weight: 700;
    border: 1px solid #e5e7eb; color: #6b7280;
}
.tm-gd-positive {
    background: #ecfdf5; border-color: #16a34a; color: #16a34a;
}
.tm-gd-negative {
    background: #fef2f2; border-color: #dc2626; color: #dc2626;
}
.tm-gd-neutral {
    background: #f3f4f6; border-color: #9ca3af; color: #6b7280;
}

/* ── Points Badge (Final) ── */
.tm-points-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 32px; border-radius: 8px;
    font-size: 14px; font-weight: 900;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: #fff; box-shadow: 0 2px 6px rgba(21,101,192,.2);
    letter-spacing: -0.5px;
}

/* ── Table Row Empty ── */
.tm-table-row-empty td { padding: 40px 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .tm-standings-container { gap: 24px; }
    
    .tm-standings-section {
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }

    .tm-standings-title {
        font-size: 17px;
    }

    .tm-col-rank   { width: 40px; padding: 10px 6px; }
    .tm-col-team   { min-width: 140px; padding: 10px 12px; }
    .tm-col-number { width: 42px; padding: 10px 6px; font-size: 13px; }
    .tm-col-points { width: 48px; padding: 10px 8px; }

    .tm-standings-table th {
        padding: 10px 6px; font-size: 10px;
    }

    .tm-team-fullname { font-size: 13px; }

    .tm-table-logo { width: 36px; height: 36px; }
    .tm-table-logo-placeholder { width: 36px; height: 36px; font-size: 16px; }
}

@media (max-width: 640px) {
    .tm-standings-header-right { display: none; }
    
    .tm-standings-table th {
        padding: 8px 4px; font-size: 9px;
    }

    .tm-col-rank   { width: 34px; padding: 8px 4px; }
    .tm-col-team   { min-width: 110px; padding: 8px 10px; }
    .tm-col-number { width: 36px; padding: 8px 4px; font-size: 12px; }
    .tm-col-points { width: 42px; padding: 8px 6px; font-size: 13px; }

    .tm-rank-badge { width: 28px; height: 28px; font-size: 11px; }
    .tm-stat-badge { min-width: 24px; height: 24px; font-size: 11px; }
    .tm-points-badge { min-width: 36px; height: 28px; font-size: 13px; }

    .tm-table-logo { width: 32px; height: 32px; }
    .tm-table-logo-placeholder { width: 32px; height: 32px; font-size: 14px; }

    .tm-team-shortname { display: inline; }
    .tm-team-fullname  { display: none; }
}

/* =============================================
   Schedule - Lịch Thi Đấu
   ============================================= */
.tm-schedule-wrap { padding: 8px 0; }
.tm-date-group    { margin-bottom: 20px; }
.tm-date-header   { padding: 6px 0; margin-bottom: 8px; }
.tm-date-label    { font-size: 13px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .5px; }

/* ============================================================================
   MATCH CARD STYLING
   ============================================================================ */
.tm-match-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tm-match-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #01a7cd;
}

/* Status-based styling */
.tm-match-card.played {
    background: #fafafa;
}

/*.tm-match-card.scheduled {
    border-left: 4px solid #01a7cd;
}

.tm-match-card.cancelled {
    opacity: 0.6;
    border-left: 4px solid #dc2626;
}

.tm-match-card.postponed {
    border-left: 4px solid #f59e0b;
}

/* ============================================================================
   MATCH HEADER - Bảng Đấu, Thời Gian, Trạng Thái
   ============================================================================ */
.tm-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    border-bottom: 1px solid #e0e0e0;
    gap: 12px;
}

.tm-match-info-left,
.tm-match-info-center,
.tm-match-info-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tm-round-badge {
    display: inline-block;
    background: #01a7cd;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-match-datetime {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.tm-clock-icon {
    font-size: 16px;
}

.tm-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.tm-status-scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.tm-status-played {
    background: #dcfce7;
    color: #15803d;
}

.tm-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.tm-status-postponed {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================================================
   MATCH ROW - Đội & Tỉ Số
   ============================================================================ */
.tm-match-row {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.tm-match-team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tm-match-home {
    flex-direction: row;
    text-align: right;
}

.tm-match-away {
    flex-direction: row-reverse;
    text-align: left;
}

.tm-team-logo-sm {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.tm-match-team-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.tm-match-team-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   MATCH SCORE - Tỉ Số Trận Đấu
   ============================================================================ */
.tm-match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 80px;
    flex-shrink: 0;
}

.tm-score-played,
.tm-score-scheduled {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    letter-spacing: -1px;
}

.tm-score-scheduled {
    color: #9ca3af;
    font-weight: 600;
    font-size: 18px;
}

.tm-penalty-score {
    display: block;
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
}

/* ============================================================================
   MATCH EVENTS - Sự Kiện Bàn Thắng, Thẻ, v.v
   ============================================================================ */
.tm-match-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tm-event {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    padding: 3px 0;
}

.tm-event-icon {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.tm-event-player {
    flex: 1;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-event-minute {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
    font-weight: 600;
}

.tm-event[title] {
    cursor: help;
}

/* ============================================================================
   MATCH FOOTER - Địa Điểm Thi Đấu
   ============================================================================ */
.tm-match-footer {
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.tm-match-venue {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    font-weight: 500;
}

.tm-location-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.tm-venue-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   RESPONSIVE DESIGN - Schedule
   ============================================================================ */
@media (max-width: 1024px) {
    .tm-match-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .tm-match-info-left {
        flex: 1;
        min-width: 150px;
    }
    
    .tm-match-info-center {
        order: 3;
        flex: 1 100%;
        margin-top: 4px;
    }
    
    .tm-match-info-right {
        flex: 1;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .tm-match-card {
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    .tm-match-header {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tm-match-info-left,
    .tm-match-info-center,
    .tm-match-info-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .tm-round-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .tm-match-row {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }
    
    .tm-match-team {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .tm-match-away {
        flex-direction: row;
        text-align: left;
    }
    
    .tm-match-score {
        order: -1;
        align-self: center;
        width: auto;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
        width: 100%;
    }
    
    .tm-score-played,
    .tm-score-scheduled {
        font-size: 24px;
    }
    
    .tm-team-logo-sm {
        width: 36px;
        height: 36px;
    }
    
    .tm-match-team-name {
        font-size: 13px;
    }
    
    .tm-match-datetime {
        font-size: 12px;
    }
    
    .tm-status-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .tm-event {
        font-size: 11px;
    }
    
    .tm-event-icon {
        font-size: 13px;
    }
    
    .tm-match-venue {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .tm-match-header {
        gap: 6px;
    }
    
    .tm-round-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .tm-score-played,
    .tm-score-scheduled {
        font-size: 20px;
    }
    
    .tm-match-team-name {
        font-size: 12px;
    }
}

/* =============================================
   Top Scorers
   ============================================= */
.tm-scorers-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm-scorers-table th { background: #1a73e8; color: #fff; padding: 10px 12px; text-align: left; }
.tm-scorers-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.tm-scorers-table tr:hover td { background: #f8f9fa; }
.tm-rank-gold   td { background: #fffbea !important; }
.tm-rank-silver td { background: #f8f9fa !important; }
.tm-rank-bronze td { background: #fdf3f0 !important; }
.tm-scorer-info  { display: flex; align-items: center; gap: 8px; }
.tm-scorer-team  { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tm-player-num   { background: #e9ecef; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.tm-goals-col    { font-size: 18px; color: #e74c3c; }

/* =============================================
   Bracket — Row-based Layout (Refactored)
   Each round = full-width section, matches in grid
   ============================================= */

/* Wrapper & CSS variables */
.tm-bkt-wrap {
    --bkt-win-bg:     #f0fdf4;
    --bkt-win-border: #22c55e;
    --bkt-win-text:   #15803d;
    --bkt-radius:     12px;
    --bkt-shadow:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
}

/* ---- Round Section ---- */
.tm-bkt-round {
    margin-bottom: 36px;
}

.tm-bkt-round-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.tm-bkt-round-badge {
    width: 40px;
    height: 40px;
    background: #1565C0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.tm-bkt-round-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -.02em;
    margin: 0;
    line-height: 1.2;
}

.tm-bkt-round-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Final round — gold accent */
.tm-bkt-round.is-final .tm-bkt-round-header {
    border-bottom-color: #fbbf24;
}
.tm-bkt-round.is-final .tm-bkt-round-title {
    color: #92400e;
}

/* ---- Matches Grid ---- */
.tm-bkt-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* Final — single centered card */
.tm-bkt-round.is-final .tm-bkt-matches {
    grid-template-columns: minmax(260px, 480px);
    justify-content: center;
}

/* ---- Match Card ---- */
.tm-bkt-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--bkt-radius);
    overflow: hidden;
    box-shadow: var(--bkt-shadow);
    transition: box-shadow .2s ease, transform .15s ease;
}
.tm-bkt-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-1px);
}
.tm-bkt-card.is-played {
    border-top: 3px solid var(--bkt-accent, #1565C0);
}

/* ---- Team Row ---- */
.tm-bkt-team {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.tm-bkt-team:nth-child(2) {
    border-bottom: none;
}
.tm-bkt-team.is-winner {
    background: var(--bkt-win-bg);
    border-left: 3px solid var(--bkt-win-border);
}

.tm-bkt-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.tm-bkt-logo-ph {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 16px;
    flex-shrink: 0;
}

.tm-bkt-pen {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

/* ---- Card Meta footer ---- */
.tm-bkt-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.tm-bkt-time {
    font-weight: 600;
    color: #64748b;
}

.tm-bkt-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.tm-bkt-badge.is-played {
    background: #dcfce7;
    color: #16a34a;
}
.tm-bkt-badge.is-upcoming {
    background: #eff6ff;
    color: #2563eb;
}
.tm-bkt-badge.is-live {
    background: #fee2e2;
    color: #dc2626;
    animation: bkt-pulse-text .9s alternate infinite ease-in-out;
}
.tm-bkt-badge.is-cancelled {
    background: #f3f4f6;
    color: #6b7280;
}
.tm-bkt-badge.is-postponed {
    background: #fef9c3;
    color: #a16207;
}

@keyframes bkt-pulse-text {
    from { opacity: 1; }
    to   { opacity: .55; }
}

/* Live card pulsing outline */
.tm-bkt-card.is-live {
    border: 2px solid #ef4444;
    animation: bkt-glow 2s ease-in-out infinite;
}
@keyframes bkt-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.25); }
    50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Live bar inside card top */
.tm-bkt-live-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: #fee2e2;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.tm-bkt-live-dot {
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    animation: bkt-dot-blink 1s step-end infinite;
}
@keyframes bkt-dot-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ---- Team inner + events ---- */
.tm-bkt-team-inner {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.tm-bkt-team-info {
    flex: 1;
    min-width: 0;
}

.tm-bkt-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

/* Score column — now stacked (num + pen) */
.tm-bkt-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    flex-shrink: 0;
    gap: 1px;
}
.tm-bkt-score-num {
    font-size: 22px;
    font-weight: 800;
    color: #475569;
    line-height: 1.1;
}
.tm-bkt-team.is-winner .tm-bkt-score-num {
    color: var(--bkt-win-text);
}

/* ---- Events strip ---- */
.tm-bkt-events {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin-top: 3px;
}

.tm-bkt-ev {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.tm-bkt-ev-icon {
    font-size: 10px;
    line-height: 1;
}
.tm-bkt-ev-icon.is-goal     { color: #16a34a; }
.tm-bkt-ev-icon.is-own-goal { color: #dc2626; }
.tm-bkt-ev-icon.is-yellow   { color: #ca8a04; }
.tm-bkt-ev-icon.is-red      { color: #dc2626; }

.tm-bkt-ev-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-bkt-ev-min {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .tm-bkt-matches {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    .tm-bkt-round-title { font-size: 16px; }
    .tm-bkt-score-num   { font-size: 20px; }
}
@media (max-width: 480px) {
    .tm-bkt-matches,
    .tm-bkt-round.is-final .tm-bkt-matches {
        grid-template-columns: 1fr;
    }
    .tm-bkt-round-badge { width: 34px; height: 34px; font-size: 14px; }
}


/* ==============================================
   [tm_teams_full]  Two-Panel Teams + Players
   ============================================== */

.tm-full-wrap {
    --tm-sidebar-w: 300px;
}

/* Layout */
.tm-full-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/*  Sidebar (team list)  */
.tm-full-sidebar {
    width: var(--tm-sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    position: sticky;
    top: 155px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.tm-full-sidebar::-webkit-scrollbar        { width: 4px; }
.tm-full-sidebar::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 4px; }

.tm-full-team-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 2px solid transparent;
    border-left: 4px solid var(--tc, #1565C0);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, transform .15s, box-shadow .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.tm-full-team-btn:hover {
    background: #f0f4ff;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.tm-full-team-btn.is-active {
    background: #e8f0fe;
    border-color: var(--tc, #1565C0);
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.tm-full-team-btn:focus-visible {
    outline: 2px solid var(--tc, #1565C0);
    outline-offset: 2px;
}

.tm-full-btn-logo          { flex-shrink: 0; }
.tm-full-btn-logo img      { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; display: block; }

.tm-full-logo-placeholder {
    width: 44px; height: 44px;
    background: var(--tc, #1565C0);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; color: #fff;
    letter-spacing: -1px;
}

.tm-full-btn-info          { flex: 1; min-width: 0; }
.tm-full-btn-info strong {
    display: block;
    font-size: 14px; font-weight: 700; color: #1a1a2e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tm-full-btn-info span {
    display: block;
    font-size: 11px; color: #6b7280; margin-top: 1px;
}

.tm-full-btn-arrow {
    color: #9ca3af; font-size: 12px; flex-shrink: 0;
    transition: color .15s, transform .15s;
}
.tm-full-team-btn.is-active .tm-full-btn-arrow {
    color: var(--tc, #1565C0);
    transform: translateX(3px);
}

/*  Detail Area  */
.tm-full-detail { flex: 1; min-width: 0; }

.tm-full-panel { animation: tmfFadeIn .22s ease; }
.tm-full-panel.hidden { display: none; }

@keyframes tmfFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/*  Team Header Card  */
.tm-full-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 5px solid;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tm-full-header-logo img {
    width: 80px; height: 80px;
    object-fit: contain; border-radius: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.1));
    display: block;
}
.tm-full-logo-hero {
    width: 80px; height: 80px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 900; color: #fff;
    letter-spacing: -2px;
}
.tm-full-header-body { flex: 1; min-width: 0; }
.tm-full-name-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.tm-full-team-name { font-size: 20px; font-weight: 900; margin: 0; color: #1a1a2e; }

.tm-full-header-meta {
    display: flex; flex-wrap: wrap; gap: 14px;
}
.tm-full-header-meta span {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: #6b7280;
}
.tm-full-header-meta svg { flex-shrink: 0; fill: #9ca3af; }
.tm-full-header-meta strong { color: #374151; }

/*  Section Label  */
.tm-full-section-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .8px;
    color: #374151; margin: 0 0 12px;
}
.tm-full-section-label svg { fill: #1565C0; flex-shrink: 0; }

/*  Sponsors  */
.tm-full-sponsors {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.tm-full-sponsors-list {
    display: flex; flex-wrap: wrap; gap: 12px;
}
.tm-full-sponsor-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 100px;
    transition: box-shadow .15s;
}
.tm-full-sponsor-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tm-full-sponsor-item img {
    height: 40px; width: auto; max-width: 120px;
    object-fit: contain; display: block;
}
.tm-full-sponsor-item span {
    font-size: 12px; font-weight: 600; color: #374151; text-align: center;
}

/*  Players section  */
.tm-full-players {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
}
.tm-full-pos-group { margin-bottom: 14px; }
.tm-full-pos-group:last-child { margin-bottom: 0; }

/* Position label: thin divider style – không chiếm nhiều không gian */
.tm-full-pos-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .9px; text-transform: uppercase;
    margin-bottom: 6px;
    /* màu chữ theo vị trí, không dùng background block */
    background: none; color: inherit; padding: 0; border-radius: 0;
}
.tm-full-pos-label::before {
    content: '';
    display: inline-block;
    width: 14px; height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}
.tm-full-pos-label::after {
    content: '';
    flex: 1; height: 1px;
    background: #e5e7eb;
}

.tmf-pos-gk  { color: #b45309; }
.tmf-pos-gk::before  { background: #d97706; }
.tmf-pos-def { color: #15803d; }
.tmf-pos-def::before { background: #16a34a; }
.tmf-pos-mid { color: #1d4ed8; }
.tmf-pos-mid::before { background: #2563eb; }
.tmf-pos-fwd { color: #b91c1c; }
.tmf-pos-fwd::before { background: #dc2626; }

.tm-full-pos-count {
    background: #f3f4f6; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 0 6px; font-size: 10px;
    color: #6b7280; font-weight: 600;
}

.tm-full-player-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-full-player {
    display: flex; align-items: center; gap: 8px;
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 8px; padding: 6px 12px;
    font-size: 13px;
    transition: background .12s;
}
.tm-full-player:hover { background: #f0f4ff; }
.tm-full-pnum {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px; color: #fff; flex-shrink: 0;
}
.tm-full-pname { font-weight: 600; color: #1a1a2e; }
.tm-full-pnat  { font-size: 11px; color: #9ca3af; }

.tm-full-empty {
    text-align: center; padding: 48px 24px; color: #9ca3af;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
}
.tm-full-empty svg { display: block; margin: 0 auto 12px; opacity: .4; }
.tm-full-empty p   { font-size: 15px; margin: 0; }

/*  Responsive  */
@media (max-width: 1023px) {
    .tm-full-layout { flex-direction: column; }

    .tm-full-sidebar {
        width: 100%;
        max-height: none;
        overflow-y: visible;
        position: static;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-right: 0;
        padding-bottom: 4px;
        gap: 8px;
        scrollbar-height: thin;
    }
    .tm-full-sidebar::-webkit-scrollbar        { height: 4px; }
    .tm-full-sidebar::-webkit-scrollbar-thumb  { background: #d1d5db; }

    .tm-full-team-btn {
        min-width: 160px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-left: 2px solid var(--tc, #1565C0);
        border-top:  4px solid var(--tc, #1565C0);
        padding: 12px 10px;
    }
    .tm-full-team-btn:hover    { transform: translateY(-2px); }
    .tm-full-btn-info strong   { white-space: normal; font-size: 13px; }
    .tm-full-btn-arrow         { display: none; }
}

@media (max-width: 639px) {
    .tm-full-header              { flex-wrap: wrap; }
    .tm-full-header-logo img,
    .tm-full-logo-hero           { width: 60px; height: 60px; font-size: 22px; }
    .tm-full-header-meta         { gap: 10px; }
    .tm-full-team-name           { font-size: 17px; }
}

/* ==============================================
   [tm_team_detail]  Sponsors Section (existing view)
   ============================================== */
.tm-sponsors-section { margin: 20px 0 0; }
.tm-sponsors-list    { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.tm-sponsor-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 10px 14px; min-width: 90px;
}
.tm-sponsor-item img {
    height: 44px; width: auto; max-width: 110px;
    object-fit: contain; display: block;
}
.tm-sponsor-item span { font-size: 12px; font-weight: 600; color: #374151; text-align: center; }
