/* ============================================
   🎮 Skills Arena - Responsive Design
   ============================================ */

/* ── Extra Large Screens (1400px+) ── */
@media (min-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Large Screens (1200px) ── */
@media (max-width: 1200px) {
    :root {
        --font-size-6xl: 3.5rem;
        --font-size-5xl: 2.8rem;
    }

    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Medium Screens / Tablets (992px) ── */
@media (max-width: 992px) {
    :root {
        --font-size-6xl: 3rem;
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
    }

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

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

    .hero-stats {
        gap: var(--space-2xl);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-links-group a:hover {
        transform: none;
    }
}

/* ── Small Tablets (768px) ── */
@media (max-width: 768px) {
    :root {
        --font-size-6xl: 2.5rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --header-height: 70px;
    }

    .container {
        padding: 0 var(--space-lg);
    }

    /* Navigation */
    .nav-links {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background: var(--color-bg-secondary);
        border-left: 1px solid var(--color-border);
        flex-direction: column;
        padding: var(--space-xl);
        gap: var(--space-md);
        transition: right var(--transition-base);
        z-index: var(--z-modal);
        overflow-y: auto;
    }

    .nav-links.open {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-link {
        font-size: var(--font-size-base);
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--color-divider);
        width: 100%;
    }

    .nav-link::after {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + var(--space-3xl));
        padding-bottom: var(--space-3xl);
    }

    .hero-content {
        padding: var(--space-md);
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

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

    .hero-stats {
        gap: var(--space-xl);
        flex-wrap: wrap;
    }

    .hero-gradient-orb.orb-1 {
        width: 300px;
        height: 300px;
    }

    .hero-gradient-orb.orb-2 {
        width: 250px;
        height: 250px;
    }

    .hero-gradient-orb.orb-3 {
        width: 200px;
        height: 200px;
    }

    .scroll-indicator {
        display: none;
    }

    /* Games Grid */
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    /* Filter Bar */
    .filter-bar {
        padding: var(--space-xs);
        gap: var(--space-xs);
    }

    .filter-btn {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-xs);
    }

    /* Section Header */
    .section-title {
        font-size: var(--font-size-2xl);
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .dash-card {
        padding: var(--space-lg);
    }

    .dash-card-value {
        font-size: var(--font-size-2xl);
    }

    /* Results Panel */
    .result-stats {
        gap: var(--space-lg);
    }

    /* Modal */
    .modal {
        margin: var(--space-md);
        border-radius: var(--radius-xl);
    }
}

/* ── Mobile Phones (576px) ── */
@media (max-width: 576px) {
    :root {
        --font-size-6xl: 2rem;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
        --font-size-2xl: 1.125rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Games Grid - Single column on mobile */
    .games-grid {
        grid-template-columns: 1fr;
    }

    /* Dashboard - Single column */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Game Card adjustments */
    .game-card-header {
        padding: var(--space-lg) var(--space-lg) var(--space-sm);
    }

    .game-card-body {
        padding: 0 var(--space-lg) var(--space-md);
    }

    .game-card-footer {
        padding: var(--space-sm) var(--space-lg);
    }

    .game-card-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.3rem;
    }

    .game-card-title {
        font-size: var(--font-size-base);
    }

    /* Category header */
    .category-header {
        flex-wrap: wrap;
    }

    .category-count {
        margin-right: 0;
    }

    /* Hero Stats */
    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }

    .hero-stat-number {
        font-size: var(--font-size-2xl);
    }

    /* Filter bar scrollable */
    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    /* Search */
    .search-container {
        margin-bottom: var(--space-lg);
    }

    /* Result Panel */
    .result-panel {
        padding: var(--space-xl);
    }

    .result-icon {
        font-size: 3rem;
    }

    .result-title {
        font-size: var(--font-size-xl);
    }

    .result-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    /* Toast */
    .toast-container {
        right: var(--space-md);
        left: var(--space-md);
        transform: none;
    }

    .toast {
        min-width: auto;
    }

    /* Footer */
    .footer-content {
        gap: var(--space-xl);
    }

    .footer-links-group {
        width: 100%;
    }
}

/* ── Very Small Devices (380px) ── */
@media (max-width: 380px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .btn-lg {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--font-size-base);
    }
}

/* ── Landscape orientation on mobile ── */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-xl);
    }

    .hero-stats {
        display: none;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-gradient-orb {
        animation: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ── Print Styles ── */
@media print {
    .header,
    .hero-bg,
    .scroll-indicator,
    .filter-bar,
    .search-container,
    .footer {
        display: none !important;
    }

    body {
        background: white;
        color: #333;
    }

    .game-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
