/* ==========================================================================
   Lumen Arcade — Responsive Layout
   Game grids: 4 → 3 → 2 columns (mobile keeps 2 per row)
   ========================================================================== */

@media (max-width: 1200px) {
    .grid-layout,
    #related-grid.grid-layout {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .hero-section .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-panel {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }

    .review-container {
        grid-template-columns: 1fr;
    }

    .review-sidebar {
        position: static;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .page-hero .hero-title,
    .category-hero .hero-title {
        font-size: 2.25rem;
    }

    .play-shell {
        grid-template-columns: 1fr;
    }

    .play-embed {
        min-height: 520px;
    }

    .editorial-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .editorial-sidebar,
    .editorial-main {
        order: unset;
    }

    .editorial-sidebar {
        order: -1;
    }

    .grid-layout,
    #related-grid.grid-layout,
    #game-grid,
    #categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3);
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-nav {
        grid-template-columns: 1fr 1fr;
    }

    .nav-toggle {
        display: inline-flex;
        order: 4;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        width: min(280px, calc(100vw - 32px));
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--surface);
        box-shadow: var(--shadow-xl);
        display: none;
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
        z-index: 150;
        animation: lumen-fade-in-soft 0.25s ease both;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-item {
        display: block;
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        background: var(--bg-color);
    }

    .nav-item:hover,
    .nav-item.active {
        background: var(--primary-light);
    }

    .search-container-nav {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        margin-left: 0;
        order: 2;
    }

    .search-field {
        margin-bottom: 8px;
    }

    .hero-section {
        padding: 48px 0;
    }

    .page-hero,
    .category-hero {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header .header-line {
        width: 100%;
        max-width: none;
    }

    .search-results {
        max-height: 55vh;
    }

    .play-stage {
        padding: 20px;
    }

    .play-stage-header {
        flex-direction: column;
        align-items: stretch;
    }

    .play-embed {
        min-height: 420px;
    }

    /* Mobile: 2 game cards per row (compact) */
    .grid-layout,
    #related-grid.grid-layout,
    #game-grid,
    #categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .game-card {
        border-radius: var(--radius-sm);
    }

    .game-card .card-content {
        padding: 10px;
    }

    .game-card .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 6px;
    }

    .game-card .card-rating {
        padding: 3px 8px;
    }

    .game-card .rating-stars {
        font-size: 0.62rem;
    }

    .game-card .rating-score {
        font-size: 0.68rem;
    }

    .game-card .card-title {
        font-size: 0.88rem;
        margin-bottom: 4px;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .game-card .card-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0;
    }

    .game-card .card-tag {
        font-size: 0.62rem;
    }

    .category-card .category-count {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .category-card .article-link {
        font-size: 0.72rem;
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .article-card .article-info {
        padding: 12px;
    }

    .article-card .article-title {
        font-size: 0.95rem;
    }

    .article-card .article-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .contact-form {
        padding: var(--space-4);
    }

    .legal-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .nav-container {
        gap: 10px;
    }

    .logo {
        flex-shrink: 0;
        font-size: 1.2rem;
    }

    .logo-accent {
        width: 22px;
        height: 6px;
    }

    .search-container-nav {
        min-width: 120px;
    }

    .search-field input {
        padding: 12px 14px;
        padding-left: 44px;
        font-size: 0.92rem;
    }

    .search-meta {
        font-size: 0.72rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .play-embed {
        min-height: 320px;
    }

    .game-meta-card {
        padding: var(--space-3);
    }

    .footer-nav {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .review-container {
        padding: var(--space-5) var(--space-2);
    }

    .deep-content {
        padding: 0 var(--space-2);
    }

    /* Narrow phones: still 2 columns, tighter gap */
    .grid-layout,
    #related-grid.grid-layout,
    #game-grid,
    #categories-grid {
        gap: 8px;
    }

    .game-card .card-img-wrapper {
        padding-top: 72%;
    }
}

/* Very wide screens: optional 5-col for category hub only */
@media (min-width: 1400px) {
    #categories-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
