﻿/* ============================================================
   FIFA2026 redesign additions — loaded AFTER style.min.css.
   Pure additions: nothing here edits or removes existing rules,
   so style.min.css can stay exactly as it is.
   ============================================================ */

/* Safety net: if any element on the page (now or in some future
   change) ends up wider than the viewport, this stops it from
   dragging the whole page into horizontal scroll — the oversized
   element clips instead of shifting everything sideways. */
html,
body {
    overflow-x: hidden;
}

/* ── Standardized Section Titles ──
   Unifies 4 previously-inconsistent title styles (red gradient,
   grey gradient, plain dark, navy) into one shared look, and gives
   every title an icon badge — including the 3 that had no icon
   before. Icons/badges live on <i>, which keeps its own explicit
   color/background, so it renders solid even though the parent
   heading uses a transparent gradient-clipped text color. */
.section-title h2,
.quota-title,
.prize-tiers-header h2,
.rule-card h3 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #1f2937, #dc2626);
    -webkit-background-clip: text;
    background-clip: text;
    color: rgba(0, 0, 0, 0);
}

    .section-title h2 i,
    .quota-title i,
    .prize-tiers-header h2 i,
    .rule-card h3 i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #fee2e2, #fecaca);
        color: var(--primary-red);
        font-size: 1.05rem;
        margin-right: 6px;
        vertical-align: middle;
        box-shadow: 0 3px 8px rgba(220, 38, 38, 0.18);
    }

.prize-tier-arrow i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

/* ── Elevation & Breathing Room ──
   Original cards used a barely-visible shadow (0 1px 2px @ 5%
   opacity) and a 6px gap between sections. Raising both gives the
   page real depth/hierarchy instead of everything sitting flush
   against the page background. */
.section-card,
.deposit-tiers-col,
.quota-card,
#matchesWrap {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    margin-bottom: 20px;
}

.rule-card {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

/* Desktop logo: was 179px, trimmed a bit smaller. */
.logo-image {
    max-width: 145px;
}

/* <header> itself had zero vertical padding — content sat flush
   against the very top edge of the page on every viewport size. */
header {
    padding: 16px 0;
}

/* ── Header Right Cluster (user badge / T&C / language) ──
   Previously mismatched: user-badge and tnc-btn were bordered
   pills with a shadow, but lang-switch was a bare 28px image with
   no background/border/height of its own. Giving all three the
   same 40px chip treatment makes them read as one balanced row. */
.user-badge,
.tnc-btn,
.lang-switch {
    height: 40px;
    box-sizing: border-box;
}

.tnc-btn {
    box-shadow: var(--shadow-sm);
}

.lang-switch {
    width: 40px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

    .lang-switch img {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        object-fit: cover;
    }

/* Logo shrinks on mobile — was allowed up to 179px wide (same cap
   as desktop) even on a ~375px viewport, forcing the J888/T&C/
   language chips to squeeze into whatever was left. */
@media (max-width: 768px) {
    header {
        padding: 12px 0;
    }

    .header-inner {
        flex-wrap: wrap;
        row-gap: 10px;
        justify-content: space-between;
        text-align: left;
    }

    .logo-area {
        justify-content: flex-start;
        width: auto;
    }

    .logo-image {
        max-width: 100px;
    }

    .user-badge,
    .tnc-btn,
    .lang-switch {
        height: 34px;
    }

    .user-badge {
        padding: 6px 12px;
        gap: 6px;
    }

    .tnc-btn {
        padding: 6px 10px;
    }

    .lang-switch {
        width: 34px;
    }

        .lang-switch img {
            width: 18px;
            height: 18px;
        }
}

/* ── Match Section Title / Countdown ── */
.match-section-title {
    align-items: flex-start;
    gap: 10px;
}

.match-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-week-range {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.match-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-red-dark);
    white-space: nowrap;
}

    .match-countdown strong {
        font-size: 0.95rem;
        letter-spacing: 0.5px;
    }

@media (max-width: 768px) {
    .match-section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .match-countdown {
        justify-content: center;
    }
}

/* Header title wraps ("This Week's Matches" / "(1)" on two lines)
   on narrow phones at the standardized 1.75rem size — step it down
   just for this heading below 480px. */
@media (max-width: 480px) {
    .match-title-block h2 {
        font-size: 1.35rem;
    }
}

/* ── Prize Tiers Section (奖金设置) ── */
.prize-tiers-section {
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    margin-bottom: 20px;
}

.prize-tiers-header {
    text-align: left;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

    .prize-tiers-header h2 {
        margin: 0;
    }

        /* The title span inherits the h2's size and gradient,
           same as "This Week's Matches" */
        .prize-tiers-header h2 span {
            font-size: inherit;
            color: inherit;
        }

    /* Subtitle only (direct child), styled like .match-week-range */
    .prize-tiers-header > span {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
    }

@media (max-width: 480px) {
    .prize-tiers-header h2 {
        font-size: 1.35rem;
    }
}

    /* Subtitle only (direct child), styled like .match-week-range */
    .prize-tiers-header > span {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
    }

.prize-tiers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.prize-tier-box {
    position: relative;
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-top: 3px solid var(--primary-red);
    border-radius: 16px;
    padding: 24px 12px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .prize-tier-box:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 20px rgba(15, 23, 42, 0.1);
    }

.prize-tier-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.prize-tier-arrow {
    margin: 12px 0;
    color: var(--text-muted);
}

.prize-tier-amount {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-red);
    font-variant-numeric: tabular-nums;
}

.prize-tier-box.prize-tier-top {
    background: var(--gradient-red);
    border-top-color: #ffd257;
    border-color: var(--primary-red);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.35);
    padding-top: 18px;
    transform: scale(1.04);
}

    .prize-tier-box.prize-tier-top:hover {
        transform: scale(1.04) translateY(-6px);
        box-shadow: 0 16px 32px rgba(220, 38, 38, 0.4);
    }

    .prize-tier-box.prize-tier-top .prize-tier-label,
    .prize-tier-box.prize-tier-top .prize-tier-amount {
        color: #fff;
    }

    .prize-tier-box.prize-tier-top .prize-tier-amount {
        font-size: 1.75rem;
    }

@media (max-width: 900px) {
    .prize-tier-box.prize-tier-top {
        transform: none;
    }

        .prize-tier-box.prize-tier-top:hover {
            transform: translateY(-6px);
        }
}

.prize-tier-crown {
    font-size: 1.4rem;
    color: #ffd257;
    margin-bottom: 6px;
}

.prize-tiers-footnote {
    margin-top: 18px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .prize-tiers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 550px) {
    .prize-tiers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Match Table (boxed table: header stays put, body scrolls) ── */
.match-table-outer {
    overflow-x: auto;
}

.match-table-header,
.match-table {
    min-width: 820px;
    table-layout: fixed;
}

.match-table-header {
    margin-bottom: 0;
}

    .match-table-header th,
    .match-table td {
        padding: 11px 10px;
    }

.match-list-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.match-table tbody tr.match-item {
    display: table-row;
    background: transparent;
    border: none;
    width: auto;
    margin: 0;
}

    .match-table tbody tr.match-item:hover {
        background: #fafafa;
    }

.table-team-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.table-vs-cell {
    text-align: center;
}

.table-vs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-red-light);
    color: var(--primary-red);
    font-size: 11px;
    font-weight: 800;
}

.table-dash {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.table-predicted-tick {
    color: #15803d;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

    .table-predicted-tick i {
        margin-right: 4px;
    }

.match-table .btn-predict {
    padding: 6px 16px;
    font-size: 0.78rem;
}

.no-match-msg {
    color: var(--text-muted);
    padding: 24px 0 !important;
    text-align: center !important;
}

/* Mobile match cards: plain <div>s (#matchCardsContainer in the
   HTML), rendered by the same loadCurrentWeekMatches() call as the
   desktop table, just into a different container. Hidden on desktop;
   the table is hidden on mobile. No table element is being coerced
   into flex here, so there's no table-layout/colgroup fight. */
.match-cards-mobile {
    display: none;
}

.match-cards-hint {
    display: none;
}

@media (max-width: 768px) {
    .match-table-outer {
        display: none;
    }

    .match-cards-mobile {
        display: block;
    }

        /* Every mobile card renders with class="match-item match-card"
       (script_b.js). style.min.css defines .match-item as a flex
       row (display:flex; justify-content:space-between;
       align-items:center;) meant for the old single-row layout —
       without this override it hijacks the whole card, squeezing
       the header/teams/prediction/action blocks into one horizontal
       row instead of stacking them. This descendant selector beats
       the bare .match-item on specificity, so it wins regardless of
       stylesheet load order. */
        .match-cards-mobile .match-item {
            display: block;
            width: 100%;
            margin-left: 0;
            padding: 16px;
        }

    .match-card {
        max-width: 100%;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--border-subtle);
        border-radius: 18px;
        padding: 16px;
        margin-bottom: 14px;
        box-sizing: border-box;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    }

    /* Row 1: time + status together, matching status-badge colors
       already used elsewhere (fff7e6/b45309 for "pending" etc.) */
    .match-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 16px;
    }

    .match-card-time {
        white-space: nowrap;
        font-weight: 700;
        font-size: 0.85rem;
        color: var(--text-primary);
    }

        .match-card-time i {
            color: var(--primary-red);
            margin-right: 4px;
        }

    /* Row 2: both teams + VS. Grid with minmax(0, 1fr) columns
       forces each team column to actually shrink to fit rather than
       overflow — a plain flex/table-cell split can end up computed
       against zero width if any ancestor's shrink-to-fit context
       interferes, which is what caused the per-letter wrap and the
       sideways-overflow-and-clip failures seen earlier. min-width:0
       on every column removes the implicit "don't shrink below
       content size" floor that was the real root cause both times. */
    .match-card-teams {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: start;
        column-gap: 6px;
        width: 100%;
        margin-bottom: 16px;
    }

    .match-card-team {
        min-width: 0;
        text-align: center;
    }

    .match-card-team-logo {
        width: clamp(38px, 14vw, 52px);
        height: clamp(38px, 14vw, 52px);
        margin: 0 auto 8px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f4f4f4;
        box-shadow: none;
    }

        .match-card-team-logo img {
            width: 62%;
            height: 62%;
            object-fit: contain;
        }

    .match-card-team-name {
        display: block;
        font-weight: 700;
        font-size: clamp(0.68rem, 3vw, 0.82rem);
        color: #1a3b8f;
        overflow-wrap: normal;
        word-break: normal;
        white-space: normal;
        line-height: 1.2;
    }

    .match-card-vs {
        min-width: 0;
        text-align: center;
        padding-top: 4px;
    }

        .match-card-vs .table-vs-badge {
            margin: 0 auto 4px;
        }

    .match-card-score-hint {
        display: block;
        font-size: 11px;
        color: var(--text-muted);
        font-variant-numeric: tabular-nums;
    }

    /* Row 3: single consolidated prediction row (actual score and
       status already appear in the header/score-hint above, so they
       don't need their own repeated rows here). */
    .match-card-prediction-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: var(--bg-soft);
        border-radius: 10px;
        padding: 10px 14px;
        margin-bottom: 14px;
    }

    .match-card-prediction-label {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .match-card-action .btn-predict {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 40px;
        box-shadow: 0 8px 18px rgba(220, 38, 38, 0.3);
    }

    /* One-time hint below the whole card list, not per-card. */
    .match-cards-hint {
        display: block;
        text-align: center;
        font-size: 0.8rem;
        color: var(--text-muted);
        line-height: 1.5;
        margin-top: 12px;
        padding: 0 16px;
    }
}

/* ── Notice Card (注意事项) ── */
.notice-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .notice-card h3 i {
        color: var(--primary-red);
    }

.notice-card ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.65;
    font-weight: 600;
    color: #31435f;
}

/* ── Prediction Modal Polish ── */
.prediction-modal {
    width: 440px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.top_header {
    border-bottom: 1px solid var(--primary-red-light);
}

.modal-vs-header {
    background: linear-gradient(180deg, #fff9f9 0%, #fff 100%);
}

.modal-team {
    width: 150px;
}

    .modal-team-name,
    .modal-team span,
    .modal-team p {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

.modal-team-logo {
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    box-shadow: inset 0 0 0 4px #fff;
}

    .modal-team-logo img {
        padding: 14px;
        box-sizing: border-box;
    }

.modal-team strong {
    letter-spacing: 0.3px;
}

.modal-vs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: 16px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.modal-match-time {
    font-weight: 600;
}

    .modal-match-time i {
        display: inline-block;
        color: var(--primary-red);
        margin-right: 6px;
    }

.guess-label {
    font-size: 15px;
}

.score-display-box {
    border: 1.5px solid var(--border-subtle);
    font-size: 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .score-display-box:hover {
        border-color: var(--primary-red);
        box-shadow: 0 0 0 3px var(--primary-red-light);
    }

.submit-predict-btn {
    box-shadow: 0 8px 18px rgba(233, 23, 23, 0.3);
}

/* ── Hero Banner (mobile): framed like the section cards ── */
@media (max-width: 768px) {
    .hero-banner {
        border: 2px solid #fff;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 0 0 1px var(--border-subtle), 0 8px 24px rgba(15, 23, 42, 0.12);
        margin-bottom: 20px;
        background-clip: padding-box;
    }
}

:root[data-lang="en"] .hero-banner,
:root:not([data-lang]) .hero-banner {
    background-image: url('../image/banner/banner_en.png');
}

:root[data-lang="zh"] .hero-banner {
    background-image: url('../image/banner/banner_cn.png');
}