/* Games Hub Styles - ChuonChuonTV */
:root {
    --gh-bg: #f5fbf0;
    --gh-surface: #ffffff;
    --gh-panel: rgba(255, 255, 255, 0.94);
    --gh-text: #223629;
    --gh-text-muted: rgba(34, 54, 41, 0.7);
    --gh-accent: #21973d;
    --gh-accent-light: #8ac63f;
    --gh-accent-soft: rgba(138, 198, 63, 0.14);
    --gh-accent-border: rgba(138, 198, 63, 0.32);
    --gh-gold: #f59e0b;
    --gh-gold-light: #fef3c7;
    --gh-radius-xl: 32px;
    --gh-radius-lg: 24px;
    --gh-radius-md: 18px;
    --gh-radius-sm: 12px;
    --gh-radius-pill: 999px;
    --gh-shadow-sm: 0 4px 16px rgba(31, 47, 30, 0.06);
    --gh-shadow-md: 0 12px 32px rgba(31, 47, 30, 0.08);
    --gh-shadow-lg: 0 20px 48px rgba(31, 47, 30, 0.12);
}

.games-page {
    background:
        radial-gradient(circle at 10% 8%, rgba(232, 247, 205, 0.85) 0%, rgba(232, 247, 205, 0) 36%),
        radial-gradient(circle at 88% 12%, rgba(225, 241, 255, 0.85) 0%, rgba(225, 241, 255, 0) 36%),
        linear-gradient(180deg, #f9fff4 0%, #f2fbff 50%, #fbfdf7 100%);
    min-height: 100vh;
    color: var(--gh-text);
}

.games-main {
    padding-bottom: 4rem;
}

/* Breadcrumb */
.games-breadcrumb {
    padding-top: 1.2rem;
    padding-bottom: 0.4rem;
}

.games-breadcrumb__list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gh-text-muted);
}

.games-breadcrumb__list a {
    color: var(--gh-accent);
    text-decoration: none;
}

.games-breadcrumb__list a:hover {
    text-decoration: underline;
}

.games-breadcrumb__sep {
    opacity: 0.4;
}

/* Hero Section */
.games-hero {
    padding: clamp(1.8rem, 3.5vw, 2.8rem) 0;
}

.games-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(245, 252, 238, 0.96));
    border: 1.5px solid var(--gh-accent-border);
    border-radius: var(--gh-radius-xl);
    padding: clamp(1.8rem, 3vw, 2.8rem);
    box-shadow: var(--gh-shadow-md);
    position: relative;
    overflow: hidden;
}

.games-hero__inner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(140, 198, 63, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.games-hero__copy {
    flex: 1 1 36rem;
    display: grid;
    gap: 0.75rem;
}

.games-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.95rem;
    border-radius: var(--gh-radius-pill);
    background: var(--gh-accent-soft);
    color: #1b6e2c;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.games-hero__badge-icon {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    margin-right: 4px;
    object-fit: contain;
}

.games-hero__title {
    margin: 0;
    font-family: 'Baloo 2', cursive;
    font-size: clamp(2.2rem, 4.2vw, 3.3rem);
    line-height: 1.1;
    color: #1e3a24;
}

.games-hero__desc {
    margin: 0;
    color: var(--gh-text-muted);
    font-size: clamp(1rem, 1.4vw, 1.12rem);
    line-height: 1.6;
    max-width: 44rem;
}

.games-hero__badges {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.games-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: var(--gh-radius-pill);
    background: #ffffff;
    border: 1px solid var(--gh-accent-border);
    font-size: 0.88rem;
    font-weight: 700;
    color: #216d2e;
    box-shadow: 0 2px 8px rgba(31, 47, 30, 0.04);
}

.games-hero__stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.games-hero__stat-pill {
    padding: 1.2rem 1.6rem;
    border-radius: var(--gh-radius-lg);
    background: #ffffff;
    border: 1.5px solid var(--gh-accent-border);
    text-align: center;
    display: flex;
    flex-direction: column;
    min-width: 110px;
    box-shadow: var(--gh-shadow-sm);
}

.games-hero__stat-pill strong {
    font-family: 'Baloo 2', cursive;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--gh-accent);
}

.games-hero__stat-pill span {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gh-text-muted);
    margin-top: 0.25rem;
}

/* Game show entry */
.games-show-banner {
    margin-bottom: 2.5rem;
}

.games-show-banner__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    background: #fff;
    border: 1px solid #dfe6dc;
    border-radius: 12px;
    padding: 24px;
    color: #26342b;
}

.games-show-banner__left {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.games-show-banner__title {
    margin: 0;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
    color: #26342b;
}

.games-show-banner__desc {
    margin: 0;
    color: #637067;
    font-size: 14px;
    line-height: 1.6;
}

.games-show-banner__right {
    display: flex;
    align-items: center;
}

.games-show-banner__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #286f3b;
    border-radius: 8px;
    background: #286f3b;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    transition: background-color .15s ease;
    white-space: nowrap;
}

.games-show-banner__cta:hover,
.games-show-banner__cta:focus-visible {
    background: #205b30;
    border-color: #205b30;
    color: #fff;
}

.games-show-banner__cta:focus-visible {
    outline: 2px solid #286f3b;
    outline-offset: 3px;
}

.games-show-banner__cta-arrow {
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
}

/* Toolbar: Search, Select Dropdown & Filter Tabs */
.games-toolbar {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background: #ffffff;
    border: 1px solid rgba(135, 194, 86, 0.22);
    border-radius: 24px;
    padding: 1.5rem 1.6rem;
    box-shadow: 0 4px 20px rgba(36, 65, 41, 0.05);
}

.games-toolbar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(135, 194, 86, 0.16);
}

.games-toolbar__title {
    margin: 0 0 0.2rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a4223;
}

.games-toolbar__subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}

.games-toolbar__status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.games-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #f0f7ec;
    color: #21973d;
    font-size: 0.82rem;
    font-weight: 700;
}

.games-status-badge strong {
    font-size: 0.92rem;
}

.games-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #fee2e2;
    border: none;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.games-reset-btn svg {
    width: 13px;
    height: 13px;
}

.games-reset-btn:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* Controls: Search + Category Select side by side */
.games-toolbar__controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.games-search-bar {
    position: relative;
    flex: 1 1 320px;
}

.games-search-bar__input {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 1.2rem 0.7rem 3rem;
    border-radius: 14px;
    border: 1.5px solid rgba(135, 194, 86, 0.28);
    background: #fafdf8;
    font-size: 0.95rem;
    font-family: inherit;
    color: #244129;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.games-search-bar__input:focus {
    outline: none;
    background: #ffffff;
    border-color: #21973d;
    box-shadow: 0 0 0 3px rgba(33, 151, 61, 0.15);
}

.games-search-bar__icon {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #21973d;
    pointer-events: none;
}

/* Dropdown Select */
.games-category-select-wrap {
    position: relative;
    flex: 0 0 280px;
    max-width: 100%;
}

.games-category-select {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 2.4rem 0.7rem 2.8rem;
    border-radius: 14px;
    border: 1.5px solid rgba(135, 194, 86, 0.28);
    background: #fafdf8;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 700;
    color: #244129;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.games-category-select:hover {
    border-color: #21973d;
    background: #ffffff;
}

.games-category-select:focus {
    outline: none;
    background: #ffffff;
    border-color: #21973d;
    box-shadow: 0 0 0 3px rgba(33, 151, 61, 0.15);
}

.games-category-select__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #21973d;
    pointer-events: none;
}

.games-category-select__arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
}

/* Category Filter Tabs: FLEX-WRAP, ZERO HORIZONTAL SCROLL! */
.games-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    overflow: visible;
    padding: 0;
    margin: 0;
}

.games-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    background: #f1f8ed;
    border: 1px solid rgba(135, 194, 86, 0.28);
    color: #2c4a30;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.games-filter-tab:hover {
    background: #ffffff;
    border-color: #21973d;
    color: #21973d;
    transform: translateY(-1px);
}

.games-filter-tab.is-active {
    background: #21973d;
    border-color: #21973d;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(33, 151, 61, 0.25);
}

.games-filter-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: rgba(33, 151, 61, 0.12);
    color: #1a742c;
    font-size: 0.74rem;
    font-weight: 800;
}

.games-filter-tab.is-active .games-filter-tab__count {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

@media (max-width: 768px) {
    .games-toolbar {
        padding: 1.2rem;
        border-radius: 20px;
    }
    .games-category-select-wrap {
        flex: 1 1 100%;
    }
    .games-search-bar {
        flex: 1 1 100%;
    }
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.game-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafff4 100%);
    border: 1.5px solid rgba(135, 194, 86, 0.28);
    border-radius: var(--gh-radius-lg);
    box-shadow: 0 10px 24px rgba(31, 47, 30, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(31, 47, 30, 0.12);
    border-color: var(--gh-accent);
}

.game-card--gameshow {
    background: linear-gradient(180deg, #ffffff 0%, #f4f6fc 100%);
    border-color: rgba(245, 158, 11, 0.4);
}

.game-card--gameshow:hover {
    border-color: #f59e0b;
    box-shadow: 0 18px 36px rgba(245, 158, 11, 0.18);
}

.game-card__link {
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.game-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(145deg, rgba(234, 247, 219, 0.85), rgba(225, 243, 255, 0.85));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card[data-category="gameshow"] .game-card__thumb { background: #f7faf4; }
.game-card[data-category="image-reveal"] .game-card__thumb { background: linear-gradient(135deg, #E7FAFF 0%, #FFE3A6 100%); }
.game-card[data-category="type-answer"] .game-card__thumb { background: #fff7d7; }
.game-card[data-category="crossword"] .game-card__thumb { background: #E2E8F0; }
.game-card[data-category="quiz-choice"] .game-card__thumb { background: #DCFCE7; }
.game-card[data-category="drag-drop"] .game-card__thumb { background: #CCFBF1; }
.game-card[data-category="find-match"] .game-card__thumb { background: linear-gradient(180deg, #E9F8FF 0%, #FFE9A6 100%); }
.game-card[data-category="flashcards"] .game-card__thumb { background: #fff8dd; }
.game-card[data-category="i-spy"] .game-card__thumb { background: #E0E7FF; }
.game-card[data-category="matching"] .game-card__thumb { background: #E0F2FE; }
.game-card[data-category="memory-flip"] .game-card__thumb { background: #FFE4E6; }
.game-card[data-category="rank-order"] .game-card__thumb { background: #F3E8FF; }
.game-card[data-category="sentence-order"] .game-card__thumb { background: #FEF3C7; }
.game-card[data-category="wordsearch"] .game-card__thumb { background: #FFEDD5; }

.game-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card__thumb img {
    transform: scale(1.04);
}

.game-card__thumb-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 0.25rem 0.75rem;
    border-radius: var(--gh-radius-pill);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(31, 47, 30, 0.1);
    font-size: 0.75rem;
    font-weight: 800;
    color: #1a742c;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
}

.game-card--gameshow .game-card__thumb-badge {
    background: #f59e0b;
    color: #0c1638;
    border-color: #f59e0b;
    font-weight: 900;
}

.game-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.5rem;
}

.game-card__category {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #177d2d;
}

.game-card--gameshow .game-card__category {
    color: #b45309;
}

.game-card__title {
    margin: 0;
    font-family: 'Baloo 2', cursive;
    font-size: 1.32rem;
    line-height: 1.2;
    color: #213728;
}

.game-card__summary {
    margin: 0;
    color: var(--gh-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card__footer {
    margin-top: auto;
    padding-top: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed rgba(135, 194, 86, 0.25);
}

.game-card__play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gh-accent);
    font-weight: 800;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.game-card--gameshow .game-card__play-btn {
    color: #b45309;
}

.game-card__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gh-accent-soft);
    color: var(--gh-accent);
    font-size: 0.95rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.game-card:hover .game-card__arrow {
    transform: translateX(3px);
    background: var(--gh-accent);
    color: #ffffff;
}

.game-card--gameshow:hover .game-card__arrow {
    background: #f59e0b;
    color: #0c1638;
}

/* Empty State */
.games-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border: 1.5px dashed var(--gh-accent-border);
    border-radius: var(--gh-radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.games-empty-state__icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.games-empty-state h3 {
    margin: 0;
    font-family: 'Baloo 2', cursive;
    font-size: 1.6rem;
    color: #223629;
}

.games-empty-state p {
    margin: 0;
    color: var(--gh-text-muted);
    font-size: 1rem;
    max-width: 28rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .games-hero__inner {
        padding: 1.5rem;
        border-radius: 26px;
    }
}

@media (max-width: 640px) {
    .games-show-banner__card {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 20px;
    }

    .games-show-banner__title {
        font-size: 22px;
    }

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

    .games-hero__stats {
        width: 100%;
    }

    .games-hero__stat-pill {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .games-show-banner__cta {
        width: 100%;
    }
}
