@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600;700;800&display=swap');

/* ============================================
   JsFootball Professional Theme
   ============================================ */

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

:root {

    --bg: #0f172a;
    --bg-soft: #1e293b;

    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;

    --border: #e2e8f0;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-on-dark: #f1f5f9;

    --primary: #1e40af;
    --primary-hover: #1d4ed8;

    --live: #ef4444;
    --live-bg: #fef2f2;

    --finished: #64748b;
    --finished-bg: #f1f5f9;

    --scheduled: #1e40af;
    --scheduled-bg: #eff6ff;

    --shadow:
            0 1px 3px rgba(15,23,42,0.08);

    --shadow-lg:
            0 6px 16px rgba(15,23,42,0.08);
}

html {
    font-size: 15px;
}

body {

    font-family:
            "Kanit",
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;

    background: #f1f5f9;

    color: var(--text);

    line-height: 1.5;

    min-height: 100vh;
}

/* ============================================
   CONTAINER
============================================ */

.container {

    max-width: 1440px;

    margin: 0 auto;

    padding: 0 16px;
}

/* ============================================
   HEADER
============================================ */

.site-header {

    background: var(--bg);

    color: var(--text-on-dark);

    border-bottom: 3px solid var(--primary);

    box-shadow: var(--shadow);
}

.header-inner {

    display: flex;

    align-items: center;

    justify-content: space-between;

    /*padding: 14px 0;*/
}

.logo {

    display: flex;

    align-items: center;

    gap: 10px;

    color: white;

    text-decoration: none;

    font-size: 1.3rem;

    font-weight: 700;
}

.logo-mark {
    font-size: 1.5rem;
}

.logo-img {
    width: 180px;
    height: 120px;
    object-fit: contain;
}

.logo-text {
    font-size: 36px;
}

.header-actions {

    display: flex;

    align-items: center;

    gap: 12px;
}

.link-admin {

    color: #cbd5e1;

    text-decoration: none;

    font-size: 0.88rem;

    border: 1px solid #475569;

    padding: 7px 12px;

    border-radius: 6px;

    transition: 0.15s;
}

.link-admin:hover {

    color: white;

    border-color: #cbd5e1;

    background: rgba(255,255,255,0.04);
}

/* ============================================
   DATE BAR
============================================ */

.date-bar {

    margin: 18px 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    background: white;

    border-radius: 10px;

    padding: 14px 18px;

    box-shadow: var(--shadow);
}

.date-nav {

    color: var(--primary);

    text-decoration: none;

    font-size: 0.9rem;

    font-weight: 600;

    padding: 6px 12px;

    border-radius: 6px;

    transition: 0.15s;
}

.date-nav:hover {
    background: #eff6ff;
}

.date-current {

    text-align: center;

    flex: 1;
}

.date-label {

    font-size: 1.05rem;

    font-weight: 700;
}

.date-sub {

    margin-top: 2px;

    font-size: 0.82rem;

    color: var(--text-muted);
}

.hidden-info {

    margin-left: 5px;

    opacity: 0.8;
}

/* ============================================
   EMPTY
============================================ */

.empty {

    background: white;

    border-radius: 12px;

    padding: 60px 24px;

    text-align: center;

    box-shadow: var(--shadow);
}

.empty-icon {

    font-size: 3rem;

    margin-bottom: 12px;
}

.empty-sub {

    margin-top: 10px;

    color: var(--text-muted);
}

/* ============================================
   LEAGUE
============================================ */

.league-block {

    background: white;

    border-radius: 10px;

    overflow: hidden;

    margin-bottom: 16px;

    box-shadow: var(--shadow);
}

.league-header {

    background:
            linear-gradient(
                    90deg,
                    var(--bg-soft),
                    #334155
            );

    color: white;

    padding: 10px 18px;

    display: flex;

    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}

.league-header-logo {

    width: 32px;

    height: 32px;

    object-fit: contain;

    flex-shrink: 0;

    background: #ffffff;

    border-radius: 5px;

    padding: 2px;
}

.league-country {

    background: rgba(255,255,255,0.12);

    padding: 3px 8px;

    border-radius: 5px;

    font-size: 0.72rem;

    font-weight: 700;

    text-transform: uppercase;
}

.league-name {

    font-size: 0.92rem;

    font-weight: 700;
}

.league-season {

    opacity: 0.75;

    font-size: 0.8rem;
}

/* ============================================
   MATCH TABLE
============================================ */

/* เวลา | สด | เจ้าบ้าน | ราคาบอล | ทีมเยือน | ผลบอล | ฟันธง */

/* รีเซ็ต default styling ของ <ul> — ไม่งั้น browser จะใส่ bullets + padding */
.match-list {

    list-style: none;

    margin: 0;

    padding: 0;
}

.match-head,
.match-row {

    display: grid;

    grid-template-columns:
            58px
            68px
            minmax(120px, 1fr)
            82px
            minmax(120px, 1fr)
            76px
            minmax(90px, 1.2fr)
            48px;

    align-items: center;

    gap: 8px;

    padding: 12px 16px;
}

/* ============================================
   TABLE HEADER
============================================ */

.match-head {

    background: var(--bg-card-alt);

    border-bottom: 1px solid var(--border);

    padding-top: 9px;
    padding-bottom: 9px;

    font-size: 0.72rem;

    font-weight: 700;

    color: var(--text-muted);

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.match-head .cell {
    justify-content: center;
}

.match-head .cell-home {
    justify-content: flex-end;
}

.match-head .cell-away {
    justify-content: flex-start;
}

/* ============================================
   MATCH ROW
============================================ */

.match-row {

    border-bottom: 1px solid var(--border);

    transition:
            background 0.15s ease,
            transform 0.15s ease;
}

.match-row:last-child {
    border-bottom: none;
}

.match-row:hover {
    background: var(--bg-card-alt);
}

.match-row.is-live {

    background:
            linear-gradient(
                    90deg,
                    rgba(239,68,68,0.08),
                    transparent 42%
            );
}

.match-row.is-live:hover {

    background:
            linear-gradient(
                    90deg,
                    rgba(239,68,68,0.12),
                    transparent 45%
            );
}

.match-row.is-finished {
    opacity: 0.92;
}

/* ============================================
   CELL BASE
============================================ */

.cell {

    display: flex;

    align-items: center;

    min-width: 0;
}

/* ============================================
   TIME
============================================ */

.cell-time {
    justify-content: center;
}

.time-text {

    font-size: 0.98rem;

    font-weight: 700;

    font-variant-numeric: tabular-nums;
}

.is-live .time-text,
.is-finished .time-text {

    color: var(--text-muted);

    font-weight: 600;
}

/* ============================================
   STATUS
============================================ */

.cell-status {

    justify-content: center;

    flex-direction: column;

    gap: 4px;
}

.badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 52px;

    padding: 4px 10px;

    border-radius: 999px;

    font-size: 0.68rem;

    font-weight: 800;

    letter-spacing: 0.5px;

    text-transform: uppercase;

    white-space: nowrap;
}

.badge-live {

    background: var(--live);

    color: white;

    animation: pulse-live 1.8s ease infinite;
}

.badge-finished {

    background: var(--finished-bg);

    color: var(--finished);

    border: 1px solid var(--border);
}

.badge-scheduled {

    background: var(--scheduled-bg);

    color: var(--scheduled);

    border: 1px solid #bfdbfe;
}

.badge-postponed {

    background: #fef3c7;

    color: #92400e;

    border: 1px solid #fcd34d;
}

.badge-cancelled {

    background: #fee2e2;

    color: #991b1b;

    border: 1px solid #fca5a5;

    text-decoration: line-through;
}

/* แถวที่ยกเลิก/เลื่อน — ทำให้จางลงเหมือนจบแล้ว */
.match-row:has(.badge-cancelled),
.match-row:has(.badge-postponed) {

    opacity: 0.7;

    background: rgba(254, 226, 226, 0.25);
}

.elapsed {

    font-size: 0.72rem;

    font-weight: 700;

    color: var(--live);
}

@keyframes pulse-live {

    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.03);
    }
}

/* ============================================
   TEAM
============================================ */

.cell-home,
.cell-away {

    gap: 10px;

    min-width: 0;
}

.cell-home {

    justify-content: flex-end;

    text-align: right;
}

.cell-away {

    justify-content: flex-start;

    text-align: left;
}

.team-logo {

    width: 34px;

    height: 34px;

    flex-shrink: 0;

    object-fit: contain;

    background: white;

    border-radius: 50%;

    padding: 2px;

    border: 1px solid rgba(0,0,0,0.05);
}

.team-name {

    font-size: 0.92rem;

    font-weight: 600;

    line-height: 1.3;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

/* ทีมต่อ */

.team-favorite .team-name {

    color: var(--live);

    font-weight: 700;
}

/* ============================================
   HANDICAP
============================================ */

.cell-handicap {
    justify-content: center;
}

.hc-display {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 72px;

    background: #fef2f2;

    border: 1px solid #fecaca;

    border-radius: 999px;

    padding: 5px 10px;

    color: var(--live);

    font-size: 0.95rem;

    font-weight: 800;

    line-height: 1;
}

.hc-to-home::before {

    content: "◀";

    margin-right: 5px;

    font-size: 0.68rem;
}

.hc-to-away::after {

    content: "▶";

    margin-left: 5px;

    font-size: 0.68rem;
}

/* ============================================
   SCORE
============================================ */

.cell-score {

    justify-content: center;

    gap: 5px;

    background: var(--bg-card-alt);

    border-radius: 8px;

    padding: 5px 8px;

    min-width: 76px;
}

.match-head .cell-score {

    background: transparent;

    padding: 0;

    min-width: 0;
}

.score {

    min-width: 16px;

    text-align: center;

    font-size: 1.05rem;

    font-weight: 800;

    font-variant-numeric: tabular-nums;
}

.is-live .score {
    color: var(--live);
}

.score-sep {
    color: var(--text-muted);
}

.vs {

    font-size: 0.78rem;

    font-weight: 700;

    color: var(--text-muted);

    letter-spacing: 1px;
}

/* ============================================
   TIP
============================================ */

.cell-tip {

    /* ★ center ทั้งแนวตั้งและแนวนอน */
    justify-content: center;

    text-align: center;

    min-width: 0;

    /* เว้นช่องว่างจาก "ผลบอล" ทางซ้าย ไม่ให้ชิดกันเกินไป */
    padding-left: 16px;

    border-left: 1px dashed var(--border);

    margin-left: 6px;
}

/* header ไม่ต้องมีเส้นประ */
.match-head .cell-tip {

    border-left: none;

    margin-left: 0;

    padding-left: 0;
}

.tip-text {

    font-size: 0.82rem;

    line-height: 1.45;

    color: var(--text);

    text-align: center;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.no-data {

    color: var(--text-muted);

    opacity: 0.45;
}

/* ============================================
   FOOTER
============================================ */

.site-footer {

    margin-top: 34px;

    padding: 24px 0;

    text-align: center;

    color: var(--text-muted);

    font-size: 0.82rem;
}

.footer-sep {

    margin: 0 6px;

    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 1180px) {

    .match-head,
    .match-row {

        grid-template-columns:
                56px
                64px
                minmax(110px,1fr)
                78px
                minmax(110px,1fr)
                70px
                44px;
    }

    .cell-tip {
        display: none;
    }
}

@media (max-width: 920px) {

    .match-head,
    .match-row {

        grid-template-columns:
                56px
                66px
                minmax(120px,1fr)
                minmax(120px,1fr)
                74px
                46px;
    }

    .cell-handicap {
        display: none;
    }

    .team-logo {

        width: 30px;
        height: 30px;
    }

    .team-name {
        font-size: 0.86rem;
    }
}

@media (max-width: 680px) {

    html {
        font-size: 14px;
    }

    /* mobile: เวลา | เจ้าบ้าน | ราคาบอล | ทีมเยือน | ฟันธง | วิเคราะห์ */
    .match-head,
    .match-row {

        grid-template-columns:
                44px
                minmax(0, 1fr)
                62px
                minmax(0, 1fr)
                minmax(68px, 0.75fr)
                36px;

        gap: 5px;

        padding: 10px;
    }

    /* ซ่อนสถานะ + ผลบอล */
    .cell-status { display: none; }
    .cell-score  { display: none; }

    /* คืน handicap + tip + h2h ที่ถูกซ่อนใน breakpoint กว้างกว่า */
    .cell-handicap { display: flex; }

    .cell-tip {
        display: flex;
        border-left: none;
        margin-left: 0;
        padding-left: 6px;
    }

    .cell-h2h { display: flex; }

    .team-logo {
        width: 26px;
        height: 26px;
    }

    .team-name {
        font-size: 0.78rem;
    }

    .league-header {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {

    .match-head {
        display: none;
    }

    /* 2-row layout: row1 = เวลา|เจ้าบ้าน|ราคาบอล|ทีมเยือน|วิเคราะห์, row2 = ฟันธง */
    .match-row {

        display: grid;

        grid-template-columns:
                40px
                minmax(0, 1fr)
                56px
                minmax(0, 1fr)
                34px;

        grid-template-rows: auto auto;

        grid-template-areas:
                "time home hc away btn"
                "tip  tip  tip tip  tip";

        gap: 4px 5px;

        padding: 10px;

        align-items: center;
    }

    .cell-time     { grid-area: time; }
    .cell-status   { display: none; }
    .cell-home     { grid-area: home; }
    .cell-handicap { grid-area: hc; display: flex; }
    .cell-away     { grid-area: away; }
    .cell-score    { display: none; }
    .cell-h2h      { grid-area: btn; display: flex; }

    .cell-tip {
        grid-area: tip;
        display: flex;
        border-left: none;
        border-top: 1px dashed var(--border);
        margin-left: 0;
        padding-left: 0;
        padding-top: 4px;
        justify-content: center;
    }

    /* ซ่อนแถวฟันธงถ้าไม่มีข้อมูล */
    .cell-tip:has(.no-data) {
        display: none;
    }

    .cell-home,
    .cell-away {
        gap: 6px;
    }

    .team-logo {
        width: 22px;
        height: 22px;
    }

    .team-name {
        font-size: 0.72rem;
        -webkit-line-clamp: 2;
    }

    .tip-text {
        font-size: 0.76rem;
        text-align: center;
    }

    .date-bar {
        padding: 12px 10px;
    }

    .date-nav {
        font-size: 0.78rem;
        padding: 5px 8px;
    }

    .date-label {
        font-size: 0.95rem;
    }
}

/* ============================================
   H2H BUTTON (คอลัมน์ขวาสุดหน้า index)
============================================ */

.cell-h2h {
    justify-content: center;
}

.btn-h2h {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 5px 9px;

    border-radius: 6px;

    font-size: 0.68rem;

    font-weight: 700;

    letter-spacing: 0.5px;

    text-decoration: none;

    background: #eff6ff;

    color: var(--primary);

    border: 1px solid #bfdbfe;

    transition: 0.15s;

    white-space: nowrap;
}

.btn-h2h:hover {

    background: var(--primary);

    color: white;

    border-color: var(--primary);
}

/* ============================================
   MATCH CENTER (h2h page top section)
============================================ */

.mc-wrapper {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

/* League bar */
.mc-league-bar {
    background: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mc-league-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #fff;
    border-radius: 5px;
    padding: 2px;
    flex-shrink: 0;
}

.mc-league-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
}

.mc-site-tag {
    margin-left: auto;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Matchup area */
.mc-matchup {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 50%, #0f172a 100%);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 36px 28px 28px;
}

.mc-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.mc-team-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55));
}

.mc-team-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    text-align: center;
    line-height: 1.4;
    max-width: 160px;
}

/* Center block */
.mc-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 130px;
}

.mc-time {
    font-size: 2.6rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 22px;
    white-space: nowrap;
}

.mc-time-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.mc-wdl {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.mc-wdl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mc-wdl-num {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.mc-wdl-lbl {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-wdl-sep {
    color: rgba(255,255,255,0.15);
    font-size: 1rem;
    align-self: center;
}

.mc-wdl-home .mc-wdl-num  { color: #f97316; }
.mc-wdl-home .mc-wdl-lbl  { color: #f97316; opacity: 0.75; }
.mc-wdl-draw .mc-wdl-num  { color: #94a3b8; }
.mc-wdl-draw .mc-wdl-lbl  { color: #94a3b8; opacity: 0.75; }
.mc-wdl-away .mc-wdl-num  { color: #3b82f6; }
.mc-wdl-away .mc-wdl-lbl  { color: #3b82f6; opacity: 0.75; }

/* Live score display */
.mc-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 2.6rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: 4px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 22px;
    white-space: nowrap;
}

.mc-score-live {
    border-color: rgba(239,68,68,0.45);
    background: rgba(239,68,68,0.08);
    color: #fca5a5;
}

.mc-score-sep {
    color: rgba(255,255,255,0.25);
    font-weight: 400;
    font-size: 2rem;
}

.mc-score-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* LIVE badge */
.mc-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    color: #fca5a5;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 20px;
}

.mc-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    animation: pulse-live 1.5s ease infinite;
}

/* Info bar (วันที่ + handicap) */
.mc-info-bar {
    background: rgba(8, 14, 30, 0.75);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.mc-info-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.mc-info-icon {
    color: #475569;
    flex-shrink: 0;
}

/* Prediction card */
.mc-prediction {
    background: #111827;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-left: 4px solid #10b981;
    padding: 22px 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Confidence circle */
.mc-pred-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mc-circle-wrap {
    position: relative;
    width: 104px;
    height: 104px;
}

.mc-circle-svg {
    width: 104px;
    height: 104px;
    transform: rotate(-90deg);
}

.mc-circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 7;
}

.mc-circle-prog {
    fill: none;
    stroke: #10b981;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
}

.mc-circle-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.mc-circle-pct {
    font-size: 1.2rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1;
}

.mc-circle-lbl {
    font-size: 0.5rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-confident-badge {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.35);
    color: #10b981;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Stats side */
.mc-pred-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mc-pred-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mc-pred-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
}

.mc-stars {
    display: flex;
    gap: 3px;
}

.mc-star {
    font-size: 1.05rem;
}

.mc-star-on  { color: #f59e0b; }
.mc-star-off { color: rgba(255,255,255,0.15); }

.mc-stats-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mc-stat-card {
    flex: 1;
    min-width: 76px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mc-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.mc-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: #f1f5f9;
}

.mc-val-over  { color: #f97316; }
.mc-val-under { color: #60a5fa; }

.mc-tip-bar {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.22);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: #fca5a5;
    line-height: 1.55;
}

/* Responsive match center */
@media (max-width: 680px) {
    .mc-matchup {
        padding: 24px 14px 20px;
        gap: 10px;
    }
    .mc-team-logo  { width: 68px; height: 68px; }
    .mc-team-name  { font-size: 0.82rem; max-width: 110px; }
    .mc-time       { font-size: 1.9rem; padding: 8px 16px; letter-spacing: 2px; }
    .mc-score      { font-size: 1.9rem; padding: 8px 16px; letter-spacing: 2px; }
    .mc-score-sep  { font-size: 1.5rem; }
    .mc-center     { min-width: 100px; }
    .mc-wdl-num    { font-size: 1.05rem; }
    .mc-info-bar   { gap: 16px; padding: 10px 14px; }
    .mc-info-item  { font-size: 0.76rem; }
}

@media (max-width: 520px) {
    .mc-prediction {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    .mc-pred-left {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        width: 100%;
    }
    .mc-circle-wrap { width: 88px; height: 88px; }
    .mc-circle-svg  { width: 88px; height: 88px; }
    .mc-stats-row   { gap: 8px; }
    .mc-stat-card   { padding: 8px 10px; min-width: 64px; }
    .mc-stat-value  { font-size: 0.9rem; }
    .mc-matchup     { padding: 20px 12px 16px; }
    .mc-team-logo   { width: 52px; height: 52px; }
    .mc-team-name   { font-size: 0.75rem; max-width: 90px; }
    .mc-time        { font-size: 1.5rem; padding: 7px 12px; }
    .mc-wdl         { gap: 6px; }
}

/* ============================================
   TEAM FORM SECTION
============================================ */

.form-wrap {
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Header */
.form-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
    gap: 10px;
}

.form-hdr-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #94a3b8;
    font-weight: 500;
}

.form-hdr-left strong {
    color: #e2e8f0;
    font-weight: 700;
}

.form-streak {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-streak-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
}

.form-badge-w { background: #f97316; color: white; }
.form-badge-d { background: #475569; color: #e2e8f0; }
.form-badge-l { background: rgba(37,99,235,0.2); color: #93c5fd; border: 1px solid rgba(37,99,235,0.35); }

/* Match cards */
.form-card {
    margin: 8px 10px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1a2035;
    border: 1px solid rgba(255,255,255,0.05);
    border-left: 3px solid transparent;
}

.form-card:last-of-type { margin-bottom: 0; }

.form-card-win  { border-left-color: #f97316; background: rgba(249,115,22,0.04); }
.form-card-draw { border-left-color: #475569; }

.form-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 13px 14px 6px;
}

.form-side {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.form-side-l { justify-content: flex-end; }
.form-side-r { justify-content: flex-start; }

.form-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-side-l .form-name { text-align: right; }

.form-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 2px;
    flex-shrink: 0;
}

.form-score {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.form-score-win {
    border-color: rgba(249,115,22,0.45);
    color: #fb923c;
}

.form-score-sep {
    color: rgba(255,255,255,0.2);
    font-weight: 400;
    font-size: 0.8rem;
}

.form-result {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.form-result-w { background: #f97316; color: white; }
.form-result-d { background: #475569; color: #e2e8f0; }
.form-result-l { background: rgba(37,99,235,0.18); color: #93c5fd; border: 1px solid rgba(37,99,235,0.35); }

/* Match meta (league + date) */
.form-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px 10px;
    font-size: 0.7rem;
    color: #475569;
}

.form-meta svg { flex-shrink: 0; }

.form-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
}

/* Footer summary */
.form-footer {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 10px 0 0;
}

.form-footer-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11px 8px;
    gap: 3px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.form-footer-item:last-child { border-right: none; }

.form-footer-num {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    color: #94a3b8;
}

.form-num-win   { color: #f97316; }
.form-num-draw  { color: #94a3b8; }
.form-num-loss  { color: #60a5fa; }
.form-num-goals { color: #f97316; }

.form-footer-lbl {
    font-size: 0.6rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 520px) {
    .form-name  { font-size: 0.75rem; }
    .form-logo  { width: 22px; height: 22px; }
    .form-score { font-size: 0.84rem; padding: 6px 10px; }
    .form-row   { gap: 6px; padding: 10px 10px 5px; }
}

/* ============================================
   LIGHT / DARK MODE — Match Center & Team Form
   Default = light mode; dark overrides below
============================================ */

/* ---- Match Center — light mode defaults ---- */
.mc-matchup {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #1e3a8a 100%);
}
.mc-time,
.mc-score {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.32);
}
/* text ใน mc-matchup ต้องสว่างพอบน blue gradient */
.mc-score-live       { background: rgba(239,68,68,0.20); border-color: rgba(239,68,68,0.55); color: #fef2f2; }
.mc-live-badge       { background: rgba(239,68,68,0.20); border-color: rgba(239,68,68,0.55); color: #fef2f2; }
.mc-score-sep        { color: rgba(255,255,255,0.55); }
.mc-score-label,
.mc-time-label       { color: rgba(255,255,255,0.8); }
.mc-wdl-sep          { color: rgba(255,255,255,0.4); }
.mc-wdl-home .mc-wdl-num { color: #fdba74; }
.mc-wdl-home .mc-wdl-lbl { color: #fdba74; }
.mc-wdl-draw .mc-wdl-num { color: #cbd5e1; }
.mc-wdl-draw .mc-wdl-lbl { color: #cbd5e1; }
.mc-wdl-away .mc-wdl-num { color: #bfdbfe; }
.mc-wdl-away .mc-wdl-lbl { color: #bfdbfe; }
.mc-circle-bg        { stroke: rgba(0,0,0,0.1); }
.mc-prediction       { background: var(--bg-card); border-top-color: var(--border); }
.mc-pred-title       { color: var(--text); }
.mc-star-off         { color: var(--border); }
.mc-stat-card        { background: var(--bg-card-alt); border-color: var(--border); }
.mc-stat-label       { color: var(--text-muted); }
.mc-stat-value       { color: var(--text); }
.mc-circle-lbl       { color: var(--text-muted); }
.mc-tip-bar          { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ---- Match Center — dark mode ---- */
[data-theme="dark"] .mc-matchup {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 50%, #0f172a 100%);
}
[data-theme="dark"] .mc-time,
[data-theme="dark"] .mc-score      { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .mc-score-live { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.45); color: #fca5a5; }
[data-theme="dark"] .mc-live-badge { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); color: #fca5a5; }
[data-theme="dark"] .mc-score-sep  { color: rgba(255,255,255,0.25); }
[data-theme="dark"] .mc-score-label,
[data-theme="dark"] .mc-time-label { color: #64748b; }
[data-theme="dark"] .mc-wdl-sep    { color: rgba(255,255,255,0.15); }
[data-theme="dark"] .mc-wdl-home .mc-wdl-num { color: #f97316; }
[data-theme="dark"] .mc-wdl-home .mc-wdl-lbl { color: #f97316; }
[data-theme="dark"] .mc-wdl-draw .mc-wdl-num { color: #94a3b8; }
[data-theme="dark"] .mc-wdl-draw .mc-wdl-lbl { color: #94a3b8; }
[data-theme="dark"] .mc-wdl-away .mc-wdl-num { color: #3b82f6; }
[data-theme="dark"] .mc-wdl-away .mc-wdl-lbl { color: #3b82f6; }
[data-theme="dark"] .mc-circle-bg  { stroke: rgba(255,255,255,0.08); }
[data-theme="dark"] .mc-prediction { background: #111827; border-top-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .mc-pred-title { color: #f1f5f9; }
[data-theme="dark"] .mc-star-off   { color: rgba(255,255,255,0.15); }
[data-theme="dark"] .mc-stat-card  { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .mc-stat-label { color: #64748b; }
[data-theme="dark"] .mc-stat-value { color: #f1f5f9; }
[data-theme="dark"] .mc-circle-lbl { color: #64748b; }
[data-theme="dark"] .mc-tip-bar    { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.22); color: #fca5a5; }

/* ---- Team Form — light mode defaults ---- */
.form-wrap           { background: var(--bg-card); box-shadow: var(--shadow-lg); }
.form-hdr            { border-bottom-color: var(--border); }
.form-hdr-left       { color: var(--text-muted); }
.form-hdr-left strong{ color: var(--text); }
.form-streak-lbl     { color: var(--text-muted); }
.form-card           { background: var(--bg-card-alt); border-color: var(--border); }
.form-name           { color: var(--text); }
.form-score          { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.form-score-sep      { color: var(--text-muted); }
.form-meta           { color: var(--text-muted); }
.form-meta-dot       { background: var(--border); }
.form-footer         { border-top-color: var(--border); }
.form-footer-item    { border-right-color: var(--border); }
.form-footer-lbl     { color: var(--text-muted); }

/* ---- Team Form — dark mode ---- */
[data-theme="dark"] .form-wrap        { background: #111827; box-shadow: 0 4px 16px rgba(0,0,0,0.45); }
[data-theme="dark"] .form-hdr         { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .form-hdr-left    { color: #94a3b8; }
[data-theme="dark"] .form-hdr-left strong { color: #e2e8f0; }
[data-theme="dark"] .form-streak-lbl  { color: #475569; }
[data-theme="dark"] .form-card        { background: #1a2035; border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .form-name        { color: #e2e8f0; }
[data-theme="dark"] .form-score       { background: #0f172a; border-color: rgba(255,255,255,0.1); color: #f1f5f9; }
[data-theme="dark"] .form-score-sep   { color: rgba(255,255,255,0.2); }
[data-theme="dark"] .form-meta        { color: #475569; }
[data-theme="dark"] .form-meta-dot    { background: #334155; }
[data-theme="dark"] .form-footer      { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .form-footer-item { border-right-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .form-footer-lbl  { color: #475569; }

/* ============================================
   H2H PAGE
============================================ */

.h2h-back {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    color: var(--primary);

    text-decoration: none;

    font-size: 0.88rem;

    font-weight: 600;

    padding: 8px 14px;

    border-radius: 6px;

    border: 1px solid #bfdbfe;

    background: #eff6ff;

    margin: 18px 0 14px;

    transition: 0.15s;
}

.h2h-back:hover {

    background: var(--primary);

    color: white;

    border-color: var(--primary);
}

.h2h-matchup {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 24px;

    background: white;

    border-radius: 12px;

    padding: 28px 24px;

    margin-bottom: 16px;

    box-shadow: var(--shadow);

    flex-wrap: wrap;
}

.h2h-team {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 10px;

    flex: 1;

    min-width: 120px;
}

.h2h-team-logo {

    width: 64px;

    height: 64px;

    object-fit: contain;

    background: white;

    border-radius: 50%;

    padding: 4px;

    border: 2px solid var(--border);
}

.h2h-team-name {

    font-size: 1rem;

    font-weight: 700;

    text-align: center;

    line-height: 1.3;
}

.h2h-vs {

    font-size: 1.4rem;

    font-weight: 800;

    color: var(--text-muted);

    flex-shrink: 0;
}

.h2h-title {

    font-size: 0.78rem;

    font-weight: 700;

    color: var(--text-muted);

    text-transform: uppercase;

    letter-spacing: 1px;

    text-align: center;

    margin-bottom: 10px;
}

.h2h-block {

    background: white;

    border-radius: 10px;

    overflow: hidden;

    box-shadow: var(--shadow);

    margin-bottom: 24px;
}

.h2h-head,
.h2h-row {

    display: grid;

    grid-template-columns:
            100px
            minmax(100px, 1fr)
            90px
            minmax(100px, 1fr)
            80px;

    align-items: center;

    gap: 8px;

    padding: 10px 16px;
}

.h2h-head {

    background: var(--bg-card-alt);

    border-bottom: 1px solid var(--border);

    font-size: 0.7rem;

    font-weight: 700;

    color: var(--text-muted);

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.h2h-row {

    border-bottom: 1px solid var(--border);

    transition: background 0.15s;
}

.h2h-row:last-child {
    border-bottom: none;
}

.h2h-row:hover {
    background: var(--bg-card-alt);
}

.h2h-cell-date {

    font-size: 0.82rem;

    color: var(--text-muted);

    font-variant-numeric: tabular-nums;
}

.h2h-cell-home {

    text-align: right;

    font-size: 0.88rem;

    font-weight: 600;

    padding-right: 6px;
}

.h2h-cell-away {

    text-align: left;

    font-size: 0.88rem;

    font-weight: 600;

    padding-left: 6px;
}

.h2h-cell-score {

    text-align: center;

    font-size: 1rem;

    font-weight: 800;

    font-variant-numeric: tabular-nums;

    background: var(--bg-card-alt);

    border-radius: 6px;

    padding: 4px 6px;
}

.h2h-cell-league {

    font-size: 0.75rem;

    color: var(--text-muted);

    text-align: right;

    overflow: hidden;

    display: -webkit-box;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;
}

.h2h-empty {

    text-align: center;

    padding: 48px 24px;

    color: var(--text-muted);

    font-size: 0.92rem;
}

/* ============================================
   H2H v2 — New Design
============================================ */

.h2h-main {
    max-width: 1440px;
    padding-top: 20px;
    padding-bottom: 40px;
}

.h2h-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 28%, 380px);
    gap: 1.25rem;
    align-items: start;
}

.h2h-left {
    min-width: 0;
}

.h2h-sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,0.3) transparent;
}

.h2h-sidebar::-webkit-scrollbar { width: 4px; }
.h2h-sidebar::-webkit-scrollbar-track { background: transparent; }
.h2h-sidebar::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 4px; }

.h2h-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border-left: 3px solid #f97316;
}

.h2h-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--bg-card-alt);
    border-bottom: 1px solid var(--border);
}

.h2h-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.h2h-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: 20px;
}

.h2h-stats-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    gap: 12px;
}

.h2h-stat-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.h2h-stat-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--bg-card-alt);
    padding: 4px;
}

.h2h-stat-name {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.h2h-stat-circles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.h2h-stat-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    gap: 1px;
}

.h2h-circle-home { background: #f97316; color: #fff; }
.h2h-circle-draw { background: #475569; color: #e2e8f0; }
.h2h-circle-away { background: #3b82f6; color: #fff; }

.h2h-stat-number {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.h2h-stat-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1;
}

.h2h-match-row {
    display: grid;
    grid-template-columns: 58px 1fr 78px 1fr 130px;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border);
}

.h2h-match-row:last-child { border-bottom: none; }

.h2h-match-row:hover { background: var(--bg-card-alt); }

.h2h-match-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.h2h-match-daymonth {
    font-size: 0.88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.h2h-match-year {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.h2h-match-team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.h2h-match-home-side { justify-content: flex-end; }
.h2h-match-away-side { justify-content: flex-start; }

.h2h-match-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.h2h-match-name {
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h2h-match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 6px;
    padding: 5px 8px;
}

.h2h-score-sep {
    color: #64748b;
    font-weight: 400;
    font-size: 0.8rem;
}

.h2h-match-league {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================
   DARK MODE
   เปิดผ่าน <html data-theme="dark">
============================================ */

:root {
    color-scheme: light;
}

[data-theme="dark"] {

    color-scheme: dark;

    --bg: #020617;
    --bg-soft: #0f172a;

    --bg-card: #1e293b;
    --bg-card-alt: #0f172a;

    --border: #334155;

    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-on-dark: #f1f5f9;

    --primary: #3b82f6;
    --primary-hover: #2563eb;

    --live: #f87171;
    --live-bg: rgba(239, 68, 68, 0.15);

    --finished: #94a3b8;
    --finished-bg: #334155;

    --scheduled: #60a5fa;
    --scheduled-bg: rgba(59, 130, 246, 0.15);

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* body background ของหน้าหลัก (hardcoded อยู่ — ต้อง override) */
[data-theme="dark"] body {
    background: #0a0f1c;
}

/* การ์ดต่างๆ ที่ hardcoded background: white — ต้อง override ในโหมดมืด */
[data-theme="dark"] .date-bar,
[data-theme="dark"] .empty,
[data-theme="dark"] .league-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* match-head ของตารางคู่บอล bg เป็นสีเทาอ่อน */
[data-theme="dark"] .match-head {
    background: var(--bg-card-alt);
    border-bottom-color: var(--border);
}

/* match-row บอร์เดอร์ระหว่างแถว */
[data-theme="dark"] .match-row {
    border-bottom-color: var(--border);
}

/* card hover */
[data-theme="dark"] .match-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* score pill bg แทนสีเทาอ่อนเดิม */
[data-theme="dark"] .cell-score {
    background: var(--bg-card-alt);
}

/* hc-display เดิม bg แดงอ่อน — ดาร์กให้แดงเข้มกว่า */
[data-theme="dark"] .hc-display {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .hc-display.hc-to-home::before,
[data-theme="dark"] .hc-display.hc-to-away::after {
    color: #fca5a5;
}

/* badge-finished bg เดิมเป็นสีเทาอ่อน */
[data-theme="dark"] .badge-finished {
    background: var(--bg-card-alt);
    color: var(--text-muted);
    border-color: var(--border);
}

[data-theme="dark"] .badge-scheduled {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .badge-postponed {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .badge-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .match-row:has(.badge-cancelled),
[data-theme="dark"] .match-row:has(.badge-postponed) {
    background: rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .team-logo {
    background: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
}

/* date-nav hover */
[data-theme="dark"] .date-nav:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* hidden-info, empty-sub muted */
[data-theme="dark"] .no-data {
    color: #475569;
}

/* ============================================
   THEME TOGGLE button
============================================ */

.theme-toggle {

    background: transparent;

    border: 1px solid #475569;

    color: #cbd5e1;

    width: 36px;

    height: 36px;

    border-radius: 50%;

    font-size: 1rem;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition: all 0.15s ease;

    padding: 0;
}

.theme-toggle:hover {
    color: #fff;
    border-color: #cbd5e1;
    transform: rotate(20deg);
}

/* แสดง icon ตาม theme — JS จะตั้ง content แต่ fallback ก็มี */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* H2H dark mode */
[data-theme="dark"] .btn-h2h {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .btn-h2h:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .h2h-back {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .h2h-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .h2h-matchup,
[data-theme="dark"] .h2h-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="dark"] .h2h-head {
    background: var(--bg-card-alt);
    border-bottom-color: var(--border);
}

[data-theme="dark"] .h2h-row {
    border-bottom-color: var(--border);
}

[data-theme="dark"] .h2h-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .h2h-cell-score {
    background: var(--bg-card-alt);
}

[data-theme="dark"] .h2h-team-logo {
    background: #f1f5f9;
    border-color: var(--border);
}

[data-theme="dark"] .h2h-match-score {
    background: #0f172a;
}

/* ============================================
   MAIN NAV (tabs: หน้าหลัก | ข่าว)
============================================ */

.main-nav {
    background: var(--bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.main-nav .container {
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.main-nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 14px 26px;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    display: inline-block;
}

.main-nav-link:hover {
    color: #e2e8f0;
}

.main-nav-link.active {
    color: #fff;
    border-bottom-color: var(--primary);
}

/* ============================================
   INDEX — TWO-COLUMN LAYOUT
============================================ */

.index-layout {
    display: grid;
    grid-template-columns: 180px 1fr 300px;
    grid-template-areas: "league fixtures news";
    gap: 20px;
    align-items: start;
    padding-top: 16px;
}

.league-nav {
    grid-area: league;
    position: sticky;
    top: 16px;
}

.fixtures-col {
    grid-area: fixtures;
    min-width: 0;
}

.fixtures-date-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.fixtures-date-text {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

/* ============================================
   LEAGUE NAV SIDEBAR (ซ้ายมือหน้า index)
============================================ */

.league-nav-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 0 4px;
    margin-bottom: 8px;
}

.league-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.league-nav-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.league-nav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.league-nav-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.league-nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 6px;
    padding: 3px;
}

.league-nav-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.league-nav-name {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
}

.league-nav-country {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.75;
}

.league-nav-link.active .league-nav-country {
    opacity: 0.85;
}

/* ============================================
   NEWS SIDEBAR (หน้า index)
============================================ */

.news-sidebar {
    grid-area: news;
    position: sticky;
    top: 16px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px;
}

.sidebar-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sidebar-all-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.sidebar-all-link:hover {
    text-decoration: underline;
}

.sidebar-empty {
    background: white;
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    box-shadow: var(--shadow);
}

.sidebar-news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-news-item {
    display: block;
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}

.sidebar-news-item:hover {
    border-color: var(--primary);
    transform: translateX(2px);
}

.sidebar-news-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.sidebar-news-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-news-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ============================================
   NEWS TAGS (ลีก / สโมสร)
============================================ */

.news-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.news-tag-league {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.news-tag-team {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.news-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ============================================
   NEWS PAGE — LIST
============================================ */

.news-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 20px 0 16px;
}

.news-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
}

.news-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    max-width: 420px;
}

.news-search-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--text);
}

.news-search-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}

.btn-news-search {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-news-search:hover {
    background: var(--primary-hover);
}

.btn-news-clear {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    white-space: nowrap;
    transition: 0.15s;
}

.btn-news-clear:hover {
    background: var(--bg-card-alt);
    color: var(--text);
}

.news-filter-info {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding-bottom: 32px;
}

.news-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    overflow: hidden;
}

.news-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.news-card-link {
    display: block;
    padding: 0;
    text-decoration: none;
    color: var(--text);
}

.news-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.news-read-more {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    display: block;
    margin-top: 4px;
}

/* ============================================
   ARTICLE PAGE
============================================ */

.article-body {
    background: white;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: var(--shadow);
    margin: 16px 0 32px;
    max-width: 820px;
}

.article-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.article-title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
}

.article-summary {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-style: italic;
}

.article-content {
    font-size: 0.97rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================
   RESPONSIVE — NEWS + INDEX LAYOUT
============================================ */

@media (max-width: 1080px) {
    .index-layout {
        grid-template-columns: 160px 1fr 260px;
    }
}

@media (max-width: 860px) {
    .index-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "league"
            "fixtures"
            "news";
    }

    .league-nav {
        position: static;
    }

    .league-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .league-nav-link {
        padding: 7px 10px;
        gap: 7px;
    }

    .league-nav-logo {
        width: 32px;
        height: 32px;
    }

    .league-nav-country {
        display: none;
    }

    .news-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
    }

    .sidebar-news-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .news-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-search-form {
        width: 100%;
        max-width: 100%;
    }

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

    .article-body {
        padding: 18px 16px;
    }

    .article-title {
        font-size: 1.35rem;
    }
}

/* ============================================
   DARK MODE — NEWS + SIDEBAR + MAIN-NAV
============================================ */

[data-theme="dark"] .league-nav-link {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .league-nav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .league-nav-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .league-nav-logo {
    background: #ffffff;
}

[data-theme="dark"] .sidebar-empty,
[data-theme="dark"] .sidebar-news-item,
[data-theme="dark"] .news-card,
[data-theme="dark"] .article-body {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .sidebar-news-item:hover,
[data-theme="dark"] .news-card:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .news-search-input,
[data-theme="dark"] .btn-news-clear {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .btn-news-clear:hover {
    background: var(--bg-card-alt);
}

[data-theme="dark"] .news-tag-league {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .news-tag-team {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .article-summary {
    border-bottom-color: var(--border);
}

/* ============================================
   NEWS CARD — with image
============================================ */

.news-card-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: var(--bg-card-alt);
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-img {
    transform: scale(1.03);
}

.news-card-body {
    padding: 16px 20px 18px;
}

/* ============================================
   ARTICLE HERO IMAGE
============================================ */

.article-hero-img-wrap {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 22px;
    background: var(--bg-card-alt);
}

.article-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   DARK MODE — image wrappers
============================================ */

[data-theme="dark"] .news-card-img-wrap,
[data-theme="dark"] .article-hero-img-wrap {
    background: var(--bg-card-alt);
}

/* ============================================
   RESPONSIVE — HEADER (ทุกขนาดจอ)
============================================ */

/* Tablet landscape → logo text เล็กลง */
@media (max-width: 1024px) {
    .logo-text { font-size: 1.6rem; }
    .logo-img  { width: 150px; height: 100px; }
}

/* Tablet portrait / large phone */
@media (max-width: 768px) {
    .logo-text { font-size: 1.3rem; }
    .logo-img  { width: 120px; height: 80px; }
    .link-admin { padding: 6px 10px; font-size: 0.82rem; }
    .header-actions { gap: 9px; }
    .main-nav-link { padding: 12px 18px; font-size: 0.95rem; }
}

/* Large phone */
@media (max-width: 600px) {
    .logo-text { font-size: 1.1rem; }
    .logo-img  { width: 100px; height: 66px; }
    .link-admin { padding: 6px 9px; font-size: 0.78rem; }
    .header-actions { gap: 7px; }
    .main-nav-link { padding: 12px 16px; font-size: 0.9rem; }
}

/* Small phone — ซ่อนข้อความโลโก้ ใช้แค่รูป */
@media (max-width: 480px) {
    .logo-text { display: none; }
    .logo-img  { width: 84px; height: 56px; }
    .link-admin { padding: 5px 8px; font-size: 0.72rem; }
    .header-actions { gap: 6px; }
    .main-nav-link { padding: 10px 14px; font-size: 0.85rem; }
    .container { padding: 0 12px; }
    .site-footer { font-size: 0.75rem; padding: 18px 0; }
}

/* ============================================
   RESPONSIVE — H2H PAGE
============================================ */

/* Tablet: ซ่อนคอลัมน์ลีก (80px) */
@media (max-width: 720px) {
    .h2h-head,
    .h2h-row {
        grid-template-columns: 90px minmax(80px, 1fr) 80px minmax(80px, 1fr);
    }
    .h2h-cell-league { display: none; }
}

/* Large phone: ลดขนาดคอลัมน์ */
@media (max-width: 540px) {
    .h2h-head,
    .h2h-row {
        grid-template-columns: 72px minmax(70px, 1fr) 68px minmax(70px, 1fr);
        padding: 9px 12px;
        gap: 6px;
    }
    .h2h-cell-date  { font-size: 0.76rem; }
    .h2h-cell-home,
    .h2h-cell-away  { font-size: 0.82rem; padding-left: 3px; padding-right: 3px; }
    .h2h-cell-score { font-size: 0.88rem; padding: 3px 5px; }
    .h2h-matchup    { gap: 16px; padding: 20px 14px; }
    .h2h-team-logo  { width: 52px; height: 52px; }
    .h2h-team-name  { font-size: 0.9rem; }
}

/* Small phone */
@media (max-width: 480px) {
    .h2h-head,
    .h2h-row {
        grid-template-columns: 58px minmax(60px, 1fr) 58px minmax(60px, 1fr);
        padding: 8px 10px;
        gap: 4px;
    }
    .h2h-cell-date  { font-size: 0.68rem; }
    .h2h-cell-home,
    .h2h-cell-away  { font-size: 0.76rem; }
    .h2h-matchup    { gap: 10px; padding: 14px 10px; flex-wrap: wrap; }
    .h2h-team       { min-width: 90px; }
    .h2h-team-logo  { width: 42px; height: 42px; }
    .h2h-team-name  { font-size: 0.8rem; }
    .h2h-vs         { font-size: 1rem; }
    .h2h-back       { margin: 12px 0 10px; padding: 7px 11px; font-size: 0.8rem; }
}

/* H2H v2 responsive */
@media (max-width: 640px) {
    .h2h-match-row { grid-template-columns: 48px 1fr 68px 1fr; }
    .h2h-match-league { display: none; }
    .h2h-stat-logo { width: 48px; height: 48px; }
    .h2h-stat-circle { width: 44px; height: 44px; }
    .h2h-stat-circles { gap: 7px; }
    .h2h-stat-number { font-size: 1rem; }
}

@media (max-width: 420px) {
    .h2h-match-row { grid-template-columns: 40px 1fr 60px 1fr; gap: 5px; padding: 8px 10px; }
    .h2h-match-name { font-size: 0.78rem; }
    .h2h-match-logo { width: 20px; height: 20px; }
    .h2h-stats-body { padding: 16px 10px; gap: 8px; }
    .h2h-stat-logo { width: 42px; height: 42px; }
    .h2h-stat-name { font-size: 0.8rem; }
    .h2h-stat-circle { width: 40px; height: 40px; }
}

/* ============================================
   RESPONSIVE — NEWS SIDEBAR (index)
============================================ */

/* เมื่อ sidebar stack ด้านล่าง → แสดงเป็น horizontal scroll */
@media (max-width: 860px) {
    .sidebar-news-list {
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .sidebar-news-item {
        min-width: 210px;
        max-width: 240px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .sidebar-news-item:hover {
        transform: none;
    }
}

/* ============================================
   RESPONSIVE — ARTICLE & NEWS (extra mobile)
============================================ */

@media (max-width: 480px) {
    .article-body      { padding: 15px 14px; border-radius: 8px; }
    .article-title     { font-size: 1.15rem; }
    .article-summary   { font-size: 0.9rem; margin-bottom: 14px; padding-bottom: 14px; }
    .article-content   { font-size: 0.9rem; line-height: 1.75; }
    .article-hero-img-wrap { border-radius: 8px; max-height: 230px; }

    .news-page-title   { font-size: 1.1rem; }
    .news-card-title   { font-size: 0.95rem; }
    .news-card-body    { padding: 12px 14px 14px; }
    .news-grid         { gap: 12px; }
}

/* ============================================
   DARK MODE — extra (logo area in dark header)
============================================ */

/* logo text สีขาวอยู่แล้ว ไม่ต้อง override */

/* ============================================
   CONTACT PAGE
============================================ */

.contact-page {
    max-width: 560px;
    margin: 48px auto 64px;
    padding: 0 16px;
}

.contact-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.contact-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 28px;
    line-height: 1.6;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 28px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-light, rgba(37,99,235,.1));
    color: var(--accent);
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.contact-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.contact-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.contact-value:hover {
    text-decoration: underline;
}

/* ============================================
   STANDINGS TABLE  (h2h.html)
   ============================================ */

.standings-card {
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.standings-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
    gap: 0.6rem;
}

.standings-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.st-league-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.standings-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standings-season {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.standings-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 220px;
}

.standings-table thead tr {
    background: var(--bg-card-alt);
}

.standings-table th {
    padding: 0.5rem 0.6rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.standings-table td {
    padding: 0.45rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table tbody tr:hover {
    background: var(--bg-card-alt);
}

/* highlighted rows */
.st-row-home {
    background: rgba(249, 115, 22, 0.06) !important;
    border-left: 3px solid #f97316;
}

.st-row-away {
    background: rgba(59, 130, 246, 0.06) !important;
    border-left: 3px solid #3b82f6;
}

.st-col-rank {
    width: 30px;
    font-weight: 600;
    color: var(--text-muted);
}

.st-col-team {
    text-align: left !important;
    width: 100%;
}

.st-team-inner {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.st-team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.st-team-name {
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.st-col-num {
    width: 36px;
    color: var(--text-muted);
}

.st-won  { color: #16a34a !important; font-weight: 600; }
.st-drawn { color: var(--text-muted) !important; }
.st-lost { color: #ef4444 !important; font-weight: 600; }
.st-pos  { color: #16a34a !important; font-weight: 600; }
.st-neg  { color: #ef4444 !important; font-weight: 600; }

.st-col-pts {
    width: 44px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary);
}

.st-col-form { width: 80px; }

.st-form-wrap {
    display: flex;
    gap: 3px;
    justify-content: center;
    align-items: center;
}

.st-form-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.st-dot-w { background: #16a34a; }
.st-dot-d { background: #94a3b8; }
.st-dot-l { background: #ef4444; }

/* legend */
.standings-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.st-legend-home,
.st-legend-away {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.st-legend-home { background: #f97316; }
.st-legend-away { background: #3b82f6; }

/* dark mode */
[data-theme="dark"] .standings-card  { background: #111827; box-shadow: 0 4px 16px rgba(0,0,0,0.45); }
[data-theme="dark"] .standings-header { border-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .standings-table thead tr { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .standings-table th { border-color: rgba(255,255,255,0.07); color: #94a3b8; }
[data-theme="dark"] .standings-table td { border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .standings-table tbody tr:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .st-row-home { background: rgba(249,115,22,0.1) !important; }
[data-theme="dark"] .st-row-away { background: rgba(59,130,246,0.1) !important; }
[data-theme="dark"] .st-team-name { color: #f1f5f9; }
[data-theme="dark"] .standings-legend { border-color: rgba(255,255,255,0.07); }

/* h2h responsive */
@media (max-width: 1100px) {
    .h2h-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 860px) {
    .h2h-layout {
        grid-template-columns: 1fr;
    }
    .h2h-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .standings-card {
        border-radius: 10px;
    }
    .st-team-name {
        max-width: 45vw;
    }
}

@media (max-width: 480px) {
    .st-col-num {
        width: 28px;
        font-size: 0.75rem;
        padding: 0.4rem 0.3rem;
    }
    .st-col-pts {
        width: 36px;
        font-size: 0.82rem;
    }
    .st-col-rank {
        width: 22px;
    }
    .standings-table {
        font-size: 0.78rem;
    }
}

