/* หน้าดูบอลสด — Partner Football API */

.fb-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px 48px;
    color: #f5f5f5;
}

.fb-page__hero {
    margin: 8px 0 28px;
    padding: 24px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a3d1f 0%, #0f1f12 45%, #1a1e21 100%);
    border: 1px solid rgba(76, 175, 80, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.fb-page__hero-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.fb-page__hero-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.fb-page__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fb-page__subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.fb-page__stat {
    margin-left: auto;
    text-align: center;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fb-page__stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4caf50;
    line-height: 1.1;
}

.fb-page__stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.fb-page__main {
    margin-top: 0;
    margin-bottom: 40px;
}

/* กรองลีก — แถบเมนูกดเลือก */
.fb-league-filter {
    margin: 0 0 10px;
    padding: 8px 0 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.fb-league-filter__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 0 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fb-league-filter__label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
}

.fb-league-filter__result {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.48);
}

.fb-league-bar {
    padding: 6px 0 0;
    -webkit-overflow-scrolling: touch;
}

.fb-league-bar__track {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 14px 2px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.fb-league-bar__track::-webkit-scrollbar {
    height: 6px;
}

.fb-league-bar__track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 3px;
}

.fb-league-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    min-height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(30, 34, 38, 0.95);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fb-league-chip__logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.fb-league-chip__text {
    display: inline-block;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-league-chip:hover {
    border-color: rgba(76, 175, 80, 0.45);
    color: #fff;
}

.fb-league-chip:focus-visible {
    outline: 2px solid #4caf50;
    outline-offset: 2px;
}

.fb-league-chip.is-active {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.25);
}

.fb-match-card--hidden {
    display: none !important;
}

.fb-section--empty {
    display: none !important;
}

.fb-page__other {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fb-other-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Sections */
.fb-section {
    margin-bottom: 32px;
}

.fb-section--highlight {
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.08) 0%, transparent 100%);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.fb-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.35);
}

.fb-section__head--other {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    margin-bottom: 20px;
}

.fb-section__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.fb-section__count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
}

/* Match grid */
.fb-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Match card */
.fb-match-card.schedule {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    cursor: default;
    border-radius: 14px;
    overflow: hidden;
    background: #1e2226;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.fb-match-card.schedule:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(76, 175, 80, 0.35);
    background: #23282e;
}

.fb-match-card--live {
    border-color: rgba(220, 53, 69, 0.45);
    box-shadow: 0 4px 24px rgba(220, 53, 69, 0.15);
}

.fb-match-card__top {
    padding: 12px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fb-match-card__league {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.fb-match-card__league img {
    object-fit: contain;
    flex-shrink: 0;
}

.fb-match-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fb-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: fb-pulse 1.2s ease infinite;
}

@keyframes fb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.fb-badge--live {
    background: #dc3545;
    color: #fff;
}

.fb-badge--hot {
    background: #ff9800;
    color: #111;
}

.fb-badge--phase {
    background: rgba(255, 255, 255, 0.12);
    color: #ffc107;
}

.fb-badge--muted {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
}

.fb-badge--stream {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.35);
}

.fb-match-card__body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 12px;
    background: linear-gradient(180deg, rgba(57, 23, 23, 0.5) 0%, transparent 100%);
    border-top: 1px solid rgba(106, 49, 49, 0.4);
    border-bottom: 1px solid rgba(106, 49, 49, 0.25);
}

.fb-match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fb-match-card__team img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.fb-match-card__team-name {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fb-match-card__center {
    text-align: center;
    padding: 0 4px;
}

.fb-match-card__score {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #fff;
    line-height: 1.1;
}

.fb-match-card__vs {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
}

.fb-match-card__countdown {
    margin-top: 6px;
    min-height: 1.25rem;
    padding: 0 !important;
    height: auto !important;
    line-height: 1.3 !important;
    font-size: 0.72rem !important;
}

.fb-match-card__countdown .schedule-countdown-text {
    font-size: 0.72rem;
}

.fb-ball-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    line-height: 1;
    color: #ff6b6b;
    animation: fb-ball-spin 1s linear infinite;
    transform-origin: 50% 50%;
}

@keyframes fb-ball-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ห้ามใช้ <footer> — ชน min-height ของ footer หลักเว็บ (~320px) */
.fb-match-card .fb-match-card__footer {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 6px 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    display: block;
    box-sizing: border-box;
}

.fb-match-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    max-height: 2.6em;
    font-size: 0.68rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.48);
    overflow: hidden;
}

.fb-match-card__venue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-match-card__venue svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.fb-match-card__time {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.42);
}

.fb-match-card__venue + .fb-match-card__time::before {
    content: "·";
    margin: 0 6px;
    opacity: 0.55;
}

.fb-match-card__watch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 12px 12px;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    width: calc(100% - 28px);
}

.fb-match-card__watch:hover {
    filter: brightness(1.08);
    color: #fff;
}

/* Empty state */
.fb-empty {
    text-align: center;
    padding: 48px 24px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.fb-empty__icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.fb-empty__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.fb-empty__text {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Play page — เต็มความกว้าง ผู้เล่นใหญ่ รองรับมือถือ/ทีวี */
main:has(.fb-play-page) > .content-container {
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 0;
    margin: 0;
    gap: 0;
}

main:has(.fb-play-page) > h1,
main:has(.fb-play-page) > .content-container > h1 {
    display: none;
}

main:has(.fb-play-page) > .site-intro-strip {
    display: none;
}

.fb-play-page {
    --fb-play-top: 52px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px));
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.fb-play-stage {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
}

.fb-play-stage__top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    pointer-events: none;
}

.fb-play-stage__top > * {
    pointer-events: auto;
}

.fb-play-stage__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.fb-play-stage__back:hover {
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border-color: transparent;
}

.fb-play-stage__screen {
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    min-height: min(52dvh, calc(100vw * 9 / 16));
    max-height: min(88dvh, calc(100vw * 9 / 16));
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-play-stage--empty .fb-play-stage__screen {
    min-height: 40dvh;
    max-height: 50dvh;
}

.fb-play-stage__media {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    object-fit: contain;
    background: #000;
}

.fb-play-stage__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.fb-play-alert {
    margin: 12px 16px 0;
    max-width: 720px;
    align-self: center;
    width: calc(100% - 32px);
}

.fb-play-details {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 16px 8px;
    box-sizing: border-box;
}

.fb-play-details__match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.fb-play-details__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.fb-play-details__team img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.fb-play-details__team span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fb-play-details__center {
    text-align: center;
    padding: 0 8px;
}

.fb-play-details__score {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
}

.fb-play-details__vs {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
}

.fb-play-details__minute {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #ffc107;
}

.fb-play-details__title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.35;
}

.fb-play-details__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.fb-play-details__meta li {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    line-height: 1.35;
    max-width: 100%;
}

.fb-play-details__label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .fb-play-stage__screen {
        min-height: min(60dvh, calc(min(100vw, 1400px) * 9 / 16));
        max-height: min(82dvh, calc(min(100vw, 1400px) * 9 / 16));
        width: min(100%, 1400px);
    }

    .fb-play-details__score {
        font-size: 2.5rem;
    }

    .fb-play-details__team img {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 1200px) {
    .fb-play-stage__screen {
        max-height: min(85dvh, calc(1600px * 9 / 16));
        width: min(100%, 1600px);
    }
}

@media (max-width: 480px) {
    .fb-play-stage__top {
        transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
    }

    .fb-play-stage__top.fb-play-stage__top--auto-hidden {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        pointer-events: none;
    }

    .fb-play-stage__top.fb-play-stage__top--auto-hidden > * {
        pointer-events: none;
    }

    .fb-play-details__match {
        gap: 8px;
    }

    .fb-play-details__score {
        font-size: 1.65rem;
    }
}

/* Home page compact grid inside football schedule area */
.home-football-schedule-inner .fb-match-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.home-football-schedule-inner .fb-match-card__watch {
    font-size: 0.82rem;
    padding: 8px 12px;
}

@media (max-width: 576px) {
    .fb-page__hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .fb-page__stat {
        margin-left: 0;
    }

    .fb-match-grid {
        grid-template-columns: 1fr;
    }
}
