/* Scoped to this page to avoid touching header/sidebar */
.page-all-games {
    --bg: #fff;
    --ink: #0f172a; /* slate-900 */
    --ink-700: #334155; /* slate-700 */
    --line: #e5e7eb; /* gray-200 */
    --tile: #f8fafc; /* slate-50 */
    --brand: #ff8b14; /* warm orange accent */
    --brand-ink: #1f2937;
    --yellow-soft: #fff7d6;
    --yellow-border: #ffe8a3;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 16px 56px;
    color: var(--ink);
    background: #faf9f5;
}

    .page-all-games * {
        box-sizing: border-box;
    }

/* Section nav (top chips) */
.section-nav {
    position: relative;
    margin: 8px auto 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .section-nav ul {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .section-nav a {
        display: inline-block;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--ink-700);
        text-decoration: none;
        font-weight: 600;
        line-height: 1;
    }

        .section-nav a:hover,
        .section-nav a:focus-visible {
            border-color: var(--brand);
            outline: none;
        }

/* Titles & intro */
.page-title {
    margin: 10px 0 12px;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--brand-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.page-intro {
    margin: 0 auto 24px;
    max-width: 720px;
    text-align: center;
    color: var(--ink-700);
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Quick Links - Plain List */
.quick-links {
    margin: 0 auto 32px;
    max-width: 800px;
}

.quick-links__grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 640px) {
    .quick-links__grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

.quick-links__section h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--brand-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.quick-links__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.quick-link:hover,
.quick-link:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* Featured cards - coolmathgames-like tiles */
.featured-games {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 26px;
}

@media (min-width: 640px) {
    .featured-games {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 980px) {
    .featured-games {
        grid-template-columns: repeat(3, 1fr);
    }
}

.featured-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: var(--tile);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 100px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

    .featured-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        border-color: rgba(0, 0, 0, 0.15);
    }

    .featured-card-image {
        flex-shrink: 0;
        width: 100px;
        height: 100px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: visible;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.6);
        padding: 6px;
        transition: transform 0.3s ease;
        position: relative;
    }

    .featured-card:hover .featured-card-image {
        transform: scale(1.05);
    }

    .featured-card-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        transition: filter 0.3s ease;
    }

    .featured-card:hover .featured-card-image img {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    }

    @media (max-width: 639px) {
        .featured-card-image {
            width: 80px;
            height: 80px;
        }
    }

    .featured-card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    .featured-card-content h2 {
        margin: 0 0 4px;
        font-size: 1.125rem;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: -0.01em;
        color: inherit;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }

    .featured-card-content p {
        margin: 0 0 4px;
        color: var(--ink-700);
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .featured-card:visited {
        color: inherit;
    }

    .featured-card:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }

.promo-button {
    justify-self: start;
    display: inline-block;
    text-align: left;
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 4px;
    padding: 0;
    background: transparent !important;
    transition: color 0.2s ease;
}

.promo-button .promo-text {
    text-decoration: underline;
}

.promo-button:hover,
.promo-button:focus-visible {
    color: #2563eb;
    outline: none;
}

.featured-card .promo-button {
    background: transparent !important;
}

/* Featured color accents - removed backgrounds */

.ag-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    z-index: 10;
    pointer-events: none;
}

.game-card .ag-tag {
    left: 8px;
    right: auto;
}

.ag-tag--new {
    background: #16a34a;
}
/* green */
.ag-tag--hard {
    background: #ef4444;
}
/* red */

/* Daily banner */
.daily-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--yellow-border);
    background: var(--yellow-soft);
    border-radius: 14px;
    padding: 20px;
    margin: 10px 0 28px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .daily-banner {
        flex-direction: row;
        align-items: center;
        gap: 24px;
        padding: 24px;
    }
}

.daily-banner__image {
    flex-shrink: 0;
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .daily-banner__image {
        width: 280px;
        max-width: none;
    }
}

.daily-banner__image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.daily-banner__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    text-align: center;
}

@media (min-width: 768px) {
    .daily-banner__content {
        text-align: left;
    }
}

    .daily-banner h2 {
        margin: 0 0 8px;
        font-size: 1.5rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
        color: var(--brand-ink);
    }

    @media (min-width: 768px) {
        .daily-banner h2 {
            font-size: 1.625rem;
        }
    }

    .daily-banner p {
        margin: 0 0 16px;
        color: var(--ink-700);
        font-size: 1rem;
        line-height: 1.5;
    }

    @media (min-width: 768px) {
        .daily-banner p {
            font-size: 1.0625rem;
        }
    }

    .daily-banner .cta {
        display: inline-block;
        padding: 12px 20px;
        border-radius: 999px;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        color: #fff;
        background: linear-gradient(90deg,#ec4899,#f43f5e);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        align-self: center;
    }

    @media (min-width: 768px) {
        .daily-banner .cta {
            align-self: flex-start;
        }
    }

        .daily-banner .cta:hover,
        .daily-banner .cta:focus-visible {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
            outline: none;
        }

/* Section header */
.mc-section {
    margin: 26px 0;
}

.mc-header {
    margin-bottom: 10px;
}

.section-title {
    margin: 0 0 4px;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--brand-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Override styles.css .mc-section h2 with more specific selector */
.page-all-games .mc-section h2,
.page-all-games .section-title {
    font: 600 1.75rem/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    letter-spacing: -0.015em;
    color: var(--brand-ink);
    margin-bottom: 0.25rem;
}

.section-subtitle {
    margin: 0;
    color: var(--ink-700);
}

/* Game grid */
.game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (min-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

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

@media (min-width: 640px) {
    .grid-tight {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Horizontal Game Card - matching hub pages */
.game-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
    will-change: transform;
    min-height: 80px;
}

    .game-card:hover,
    .game-card:focus-visible {
        transform: translateY(-3px);
        border-color: var(--brand);
        box-shadow: 0 6px 16px rgba(0,0,0,0.1);
        outline: none;
    }

    .game-card .thumb {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        border-radius: 10px;
        overflow: hidden;
        background: #f8fafc;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        line-height: 1;
        padding-top: 0 !important;
    }

    .game-card .thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .game-card .card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        min-width: 0;
    }

    .game-card .title {
        text-align: left;
        font-weight: 600;
        font-size: 1.0625rem;
        line-height: 1.3;
        letter-spacing: -0.01em;
        margin: 0 0 2px;
        padding: 0 !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }

        .game-card .title .muted {
            font-weight: 500;
            color: var(--ink-700);
            font-size: .85em;
        }

        .game-card .title.small {
            font-size: .9rem;
        }

    .game-card .desc {
        display: block;
        text-align: left;
        color: var(--ink-700);
        font-size: 0.85rem;
        line-height: 1.3;
        margin: 0 0 4px;
    }

    .game-card .play-now {
        display: inline-block;
        text-align: left;
        color: #3b82f6;
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: underline;
        margin-top: 4px;
    }

/* Play pill - keep for backward compatibility but hide if play-now exists */
.play-btn {
    display: none;
}

.game-card:not(:has(.play-now)) .play-btn {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    line-height: 1;
}

/* Expanders (details) */
.expanders {
    margin-top: 20px;
}

details {
    border: none;
    border-radius: 10px;
    padding: 8px 0;
    background: transparent;
    margin-bottom: 24px;
}

    details + details {
        margin-top: 24px;
    }

summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
    list-style: none;
    position: relative;
    padding: 12px 16px;
    background: #fff;
    border: none;
    border-radius: 10px;
    transition: background-color 120ms ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

    summary:hover {
        background-color: #f8fafc;
    }

    summary::-webkit-details-marker {
        display: none;
    }

    summary:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 2px;
    }

    /* Arrow indicator */
    summary::after {
        content: "▼";
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.8rem;
        color: var(--ink-700);
        transition: transform 120ms ease;
    }

details[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

details[open] {
    border: none;
}

details .game-grid {
    margin-top: 16px;
    padding: 10px;
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* FAQ */
.faq-item {
    margin: 8px 0;
}

    .faq-item > summary {
        font-weight: 600;
        font-size: 1.0625rem;
        letter-spacing: -0.01em;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }

    .faq-item > p {
        margin: 8px 0 0;
        color: var(--ink-700);
    }

/* Hub Pages Links */
.hub-pages-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.hub-page-link {
    display: inline-block;
    padding: 10px 16px;
    text-decoration: none;
    color: #1e40af;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 150ms ease;
}

.hub-page-link:hover,
.hub-page-link:focus-visible {
    color: #1e3a8a;
    border-color: #1e40af;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* Game Search Styles */
.game-search {
    margin: 24px auto 32px;
    max-width: 600px;
}

.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid var(--line);
    border-radius: 12px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 139, 20, 0.1);
}

.search-icon {
    position: absolute;
    right: 16px;
    font-size: 1.2rem;
    color: var(--ink-700);
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--ink-700);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 200ms ease;
}

.clear-search:hover {
    background-color: #f3f4f6;
}

.search-hint {
    margin: 6px 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-700);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-700);
}

.close-results {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--ink-700);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 200ms ease;
}

.close-results:hover {
    background-color: #e5e7eb;
}

.search-results-list {
    padding: 8px 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--ink);
    transition: background-color 200ms ease;
    border-bottom: 1px solid #f3f4f6;
}

.search-result-item:hover {
    background-color: #f8fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--ink);
}

.search-result-title mark {
    background-color: #fef3c7;
    padding: 1px 2px;
    border-radius: 2px;
}

.search-result-description {
    font-size: 0.9rem;
    color: var(--ink-700);
    margin-bottom: 6px;
    line-height: 1.4;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}

.search-result-category {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.search-result-age {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-700);
}

.no-results-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.no-results-text {
    font-weight: 600;
    margin-bottom: 8px;
}

.no-results-suggestion {
    font-size: 0.9rem;
    color: var(--ink-700);
}

/* Search dropdown sections */
.search-dropdown-sections {
    padding: 16px 0;
}

.search-section {
    margin-bottom: 20px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    padding: 0 16px 12px;
    margin-bottom: 4px;
}

.search-section-games {
    display: flex;
    flex-direction: column;
}

.search-section-games .search-result-item {
    border-bottom: 1px solid #f3f4f6;
}

.search-section-games .search-result-item:last-child {
    border-bottom: none;
}

/* A11y focus for all links in this page scope */
.page-all-games a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}


