/* Matches - Dark Theme (single source of truth for matches page) */
.section-matches{min-height:350px;margin-bottom:15px;}
.section-matches .card{
    display:inline-block;vertical-align:middle;width:11px;height:13px;text-align:center;
    margin:0 1px 0 3px;font-family:"Tahoma",Arial;font-size:0.6rem;font-weight:normal;line-height:13px;
    border-radius:1px;
}
.section-matches .card.red{background:#e74c3c;color:#fff;}
.section-matches .card.yellow{background:#f1c40f;color:#222;}
.section-matches .card.none{display:none;}
.section-matches .sc-half{color:#9ca3af;font-size:0.75rem;font-weight:500;}
.section-matches .sc-full{color:#6b7280;font-size:0.7rem;font-weight:600;}
.section-matches .sc-live{color:#4471f0;font-size:0.75rem;font-weight:500;}
.section-matches .sc-live.sc-minute{color:#e74c3c;font-weight:600;animation:blink-live 1.5s ease-in-out infinite;}
.section-matches .sc-live.sc-ht{color:#e99105;font-weight:600;}
@keyframes blink-live{0%,100%{opacity:1;}50%{opacity:0.4;}}
.section-matches .sc-live img, .section-matches .sc-half img{
    display:inline-block;vertical-align:top;margin:4px 0 0 2px;max-height:4px;
}

/* League header */
.matches-pg{
    margin:8px 0 0 0;padding:4px 0;text-align:left;
    font-family:"Prompt",Tahoma,Arial;font-size:0.95rem;font-weight:500;color:#00a651;
}
.matches-pg .pg-img{
    display:inline-block;vertical-align:middle;overflow:hidden;width:22px;height:22px;
    text-align:center;padding:2px;margin:-5px 2px 0 0;border:1px solid #1a2a44;
    border-radius:3px;
}
.matches-pg .pg-img img{display:inline-block;width:100%;vertical-align:top;}

/* Match rows */
.matches-row{
    display:flex;font-size:0.8rem;color:#e8edf3;
    border-bottom:1px solid rgba(26,42,68,0.5);
}
.matches-row.bg-1{background:none;}
.matches-row, .matched-col, .matched-col.m-team .odds{border-color:#1a2a44 !important;}
.matches-row.header{
    font-family:"Prompt",Tahoma,Arial;font-weight:500;background:#0f2341;color:#9ca3af;
}
.matches-row.header .matched-col{padding:2px 6px;}
.matches-row.header .matched-col.m-team{padding:0 6px;}
.matches-row.header .matched-col.m-team .team{padding:2px 6px;}
.matches-row.header .matched-col.m-team .odds{padding:2px 0;}

/* Columns */
.matched-col{
    position:relative;text-align:center;padding:8px 5px;font-family:"Prompt",Tahoma,Arial;
    border:none;border-right:1px solid #1a2a44;
    box-sizing:border-box;
}
.matched-col.m-time{width:6%;color:#9ca3af;}
.matched-col.m-live{width:4%;}
.matched-col.m-team{width:46%;display:flex;padding:0 6px;align-items:stretch;}
.matched-col.m-team .team{width:44%;padding:8px 0;padding-right:8px;text-align:right;font-weight:500;color:#e8edf3;}
.matched-col.m-team .team.away{padding-right:0;padding-left:8px;text-align:left;}
.matched-col.m-team .dash{display:none;}
.matched-col.m-team .odds{width:12%;border-left:1px solid #1a2a44;border-right:1px solid #1a2a44;padding:8px 0;color:#fff;font-weight:600;}
.matched-col.m-team .t-logo{
    display:inline-block;vertical-align:middle;width:18px;height:18px;
    margin-left:3px;overflow:hidden;border-radius:3px;
}
.matched-col.m-team .t-logo img{display:inline-block;vertical-align:top;width:100%;}
.matched-col.m-team .team.away .t-logo{margin-left:0;margin-right:3px;}
.matched-col.m-half{width:8%;color:#6b7280;}
.matched-col.m-full{width:8%;position:relative;}
.matched-col.m-full .sc-note{
    position:absolute;left:45px;top:-7px;display:inline-block;white-space:nowrap;
    font-weight:400;font-size:0.55rem;color:#9ca3af;text-align:right;
}
.matched-col.m-tv{width:22%;}
.matched-col.m-tv img{display:inline-block;margin-right:3px;max-height:20px;}
.matched-col.m-tv .tip-ai{
    display:inline-block;font-size:0.72rem;font-weight:500;color:#00a651;
    text-align:left;line-height:1.3;padding:1px 3px;
}
.matched-col.m-tv .tded-result{
    display:inline-block;vertical-align:middle;margin-left:3px;
    font-size:0.6rem;font-weight:700;color:#fff;padding:1px 4px;
    border-radius:3px;line-height:1.2;
}
.matched-col.m-tv .tded-result.win{background:#00a651;}
.matched-col.m-tv .tded-result.draw{background:#1a2a44;}
.matched-col.m-tv .tded-result.lost{background:#e74c3c;}
.matched-col.m-tv .tded-result.post{background:#374151;}
.matched-col.m-icon{width:6%;border-right:none;}
.matched-col.m-icon img{max-height:16px;filter:brightness(0) invert(1);opacity:0.5;}
.matched-col.m-icon a:hover img{opacity:1;}
.matched-col .bg-score{
    position:relative;display:block;background:#00a651;margin:0 auto;
    font-size:0.75rem;font-weight:600;color:#fff;width:50px;max-width:100%;
    border-radius:12px;box-shadow:0 1px 4px rgba(0,166,81,0.3);
}
.matched-col .bg-score.none{background:none;color:#6b7280;border:none;box-shadow:none;}

.matched-col .m-vs{color:#6b7280;}
.m-team1, .m-team2{color:#e8edf3;}
.fx-team{display:inline-flex;align-items:center;gap:1px;}
.fx-tbhome, .fx-tbaway{font-size:0.7rem;color:#6b7280;}

/* ==============================================
   FAVORED TEAM COLOR - RED (PC + mobile)
   Override .m-team1/.m-team2 color inside .tx-rate
   ============================================== */
.matched-col.m-team .team.tx-rate{color:#e74c3c !important;font-weight:600;}
.matched-col.m-team .team.tx-rate .m-team1,
.matched-col.m-team .team.tx-rate .m-team2{color:#e74c3c !important;}

/* ========================================
   TABLET (590-799px)
   ======================================== */
@media screen and (min-width:590px) and (max-width:799px){
    .matched-col{font-size:0.75rem;}
    .matched-col.m-half{display:none;}
    .matched-col.m-team{width:50%;}
    .matched-col.m-tv{width:18%;font-size:0.7rem;}
}

/* ========================================
   MOBILE (max 589px)
   Row 1: match data columns
   Row 2: 4 distinct blocks
     [ทีเด็ด] [ฟันธง...] [สถิติ] [icon]
   ======================================== */
@media screen and (max-width:589px){

    /* Enable wrapping */
    .matches-row{
        flex-wrap:wrap;
        border-bottom:none;
    }

    /* ---- HEADER ROW ---- */
    .matches-row.header{
        font-weight:400;font-size:0.68rem;
        border-bottom:1px solid #1a2a44;
    }
    .matches-row.header .matched-col{padding:4px 3px;}
    .matches-row.header .matched-col.m-time{width:12%;font-size:0.65rem;}
    .matches-row.header .matched-col.m-live{width:6%;font-size:0.6rem;}
    .matches-row.header .matched-col.m-team{
        width:50%;display:flex;flex-wrap:nowrap;padding:0 3px;
    }
    .matches-row.header .matched-col.m-team .team{
        width:50%;text-align:center;padding:4px 2px;font-size:0.65rem;
    }
    .matches-row.header .matched-col.m-team .odds{display:none;}
    .matches-row.header .matched-col.m-half{width:12%;font-size:0.6rem;}
    .matches-row.header .matched-col.m-full{width:20%;font-size:0.65rem;border-right:none;}
    /* HIDE header's wrapped m-tv and m-icon on mobile */
    .matches-row.header .matched-col.m-tv{display:none;}
    .matches-row.header .matched-col.m-icon{display:none;}

    /* ---- DATA ROWS ---- */
    /* Row 1 columns */
    .matched-col.m-time{width:12%;font-size:0.68rem;padding:6px 2px;}
    .matched-col.m-live{width:6%;padding:6px 2px;}
    .matched-col.m-team{
        width:50%;font-size:0.72rem;padding:0 3px;
        display:flex;flex-wrap:wrap;position:relative;align-items:center;
    }
    .matched-col.m-half{width:12%;font-size:0.68rem;padding:6px 2px;}
    .matched-col.m-full{width:20%;font-size:0.72rem;padding:6px 2px;border-right:none;}
    /* Row 1 total: 12+6+50+12+20 = 100% */

    /* Teams stacked */
    .matched-col.m-team .team.home{
        display:flex;flex-wrap:wrap;align-items:center;
        width:100%;text-align:left;padding:3px 0;justify-content:flex-start;
    }
    .matched-col.m-team .odds{
        position:absolute;top:2px;right:2px;
        width:auto;min-width:0;font-size:0.65rem;color:#9ca3af;font-weight:500;
        border:none;background:rgba(15,35,65,0.8);border-radius:3px;padding:1px 4px;
    }
    .matched-col.m-team .team.away{
        display:flex;flex-wrap:wrap;align-items:center;
        width:100%;text-align:left;padding:1px 0;justify-content:flex-start;
    }
    .matched-col.m-team .m-vs{display:none;}
    .matched-col.m-team .t-logo{display:none;}
    .matched-col.m-team .fx-team{order:3;}
    .matched-col.m-team .fx-tbhome{order:2;margin-left:2px;font-size:0.65rem;}
    .matched-col.m-team .fx-tbaway{margin-left:2px;font-size:0.65rem;}

    /* Score display */
    .matched-col .ft-score1, .matched-col .ft-score2{display:block;line-height:16px;font-size:0.72rem;color:#fff;}
    .matched-col .ht-score1, .matched-col .ht-score2{display:block;line-height:16px;font-size:0.68rem;}
    .matched-col .sc-dash{display:none;}
    .matched-col .bg-score{margin:0 auto;font-size:0.65rem;border-radius:3px;width:38px;}
    .matched-col .bg-score.none{font-size:0.65rem;}
    .matched-col.m-full .sc-note{position:static;display:block;font-size:0.5rem;white-space:nowrap;}

    /* =====================================================
       ROW 2: 3 BLOCKS aligned with Row 1
       Row 1: เวลา12%|สด6%| ทีม 50%       |ครึ่งแรก12%|ผลบอล20%
       Row 2: ทีเด็ด18%  | ฟันธง+WDL 50%  |สถิติ12%   |icon 20%
       ===================================================== */

    /* m-tv = [ทีเด็ด label float-left][ฟันธง+WDL inline center] = 68% */
    .matches-row:not(.header) .matched-col.m-tv{
        width:68%;
        padding:5px 0;
        display:block;
        background:#0b1a30;
        border-top:1px solid #1a2a44;
        border-bottom:1px solid #1a2a44;
        border-right:1px solid #1a2a44;
        text-align:center;
        line-height:1.4;
        font-size:0.63rem;
    }
    /* Block 1: "ทีเด็ด" label — floats left */
    .matches-row:not(.header) .matched-col.m-tv::before{
        content:"ทีเด็ด";
        float:left;
        width:26.5%;
        margin-top:-5px;margin-bottom:-5px;
        padding:6px 2px;
        font-size:0.58rem;font-weight:500;color:#9ca3af;
        background:#0f2341;
        border-right:1px solid #1a2a44;
        text-align:center;
        box-sizing:border-box;
    }
    /* ฟันธง + WDL flow inline together, centered */
    .matches-row:not(.header) .matched-col.m-tv .tip-ai{
        display:inline;
        font-size:0.75rem;color:#00a651;font-weight:600;
    }
    .matches-row:not(.header) .matched-col.m-tv .tded-result{
        display:inline;
        font-size:0.5rem;padding:1px 3px;margin-left:1px;
        vertical-align:middle;border-radius:3px;
    }
    .matches-row:not(.header) .matched-col.m-tv img{display:none;}

    /* m-icon = [สถิติ 12%][icon 20%] = 32% */
    .matches-row:not(.header) .matched-col.m-icon{
        width:32%;
        padding:0;
        display:flex;align-items:stretch;flex-wrap:nowrap;
        background:#0b1a30;
        border-top:1px solid #1a2a44;
        border-bottom:1px solid #1a2a44;
        border-right:none;
    }
    /* Block 3: "สถิติ" label — 12/32 = 37.5% of m-icon */
    .matches-row:not(.header) .matched-col.m-icon::before{
        content:"สถิติ";
        display:flex;align-items:center;justify-content:center;
        width:37.5%;flex-shrink:0;
        padding:5px 2px;
        font-size:0.58rem;font-weight:500;color:#9ca3af;
        background:#0f2341;
        border-right:1px solid #1a2a44;
        white-space:nowrap;
        box-sizing:border-box;
    }
    /* Block 4: icon — 20/32 = 62.5% of m-icon */
    .matches-row:not(.header) .matched-col.m-icon a{
        display:flex;align-items:center;justify-content:center;
        flex:1;padding:5px 2px;
    }
    .matches-row:not(.header) .matched-col.m-icon img{max-height:12px;}
    /* Row 2 total: 68+32 = 100% */
}
