/* ═══════════════════════════════════════════════════
   PREMIUM GAMING — Desktop Layout Overrides
   Only active at ≥768px. Mobile styles remain untouched.
   ═══════════════════════════════════════════════════ */

@media (min-width: 768px) {

    /* ── Remove mobile constraints ── */
    body {
        max-width: 100%;
        border: none;
        background: var(--color-bg);
    }

    /* ── Desktop Shell ── */
    .desktop-shell {
        display: flex;
        min-height: 100vh;
    }

    /* ── Sidebar Navigation ── */
    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        min-width: 240px;
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        background: var(--color-surface);
        border-right: 1px solid var(--color-border-light);
        padding: var(--space-6) 0;
        z-index: 200;
        overflow-y: auto;
    }

    .desktop-sidebar__logo {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: 0 var(--space-6);
        margin-bottom: var(--space-8);
    }

    .desktop-sidebar__logo-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, var(--color-primary), var(--color-accent-coral));
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: var(--font-weight-bold);
        font-size: var(--font-size-lg);
    }

    .desktop-sidebar__brand {
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-bold);
        color: var(--color-text-primary);
        letter-spacing: -0.02em;
    }

    .desktop-sidebar__nav {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
        padding: 0 var(--space-3);
    }

    .desktop-sidebar__item {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
        color: var(--color-text-secondary);
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-medium);
        cursor: pointer;
        transition: all var(--transition-fast);
        border: none;
        background: none;
        width: 100%;
        text-align: left;
    }

    .desktop-sidebar__item:hover {
        background: var(--color-surface-muted);
        color: var(--color-text-primary);
    }

    .desktop-sidebar__item.active {
        background: var(--color-primary-lighter);
        color: var(--color-primary);
        font-weight: var(--font-weight-semibold);
    }

    .desktop-sidebar__item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .desktop-sidebar__footer {
        padding: var(--space-4) var(--space-6);
        margin-top: auto;
        border-top: 1px solid var(--color-divider);
    }

    .desktop-sidebar__user {
        display: flex;
        align-items: center;
        gap: var(--space-3);
    }

    .desktop-sidebar__user-info {
        flex: 1;
        min-width: 0;
    }

    .desktop-sidebar__user-name {
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-semibold);
        color: var(--color-text-primary);
    }

    .desktop-sidebar__user-id {
        font-size: var(--font-size-xs);
        color: var(--color-text-tertiary);
    }

    /* ── Hide mobile header & bottom nav ── */
    .app-header {
        display: none !important;
    }

    .bottom-nav {
        display: none !important;
    }

    /* ── Desktop Header ── */
    .desktop-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-5) var(--space-8);
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border-light);
        margin-left: 240px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .desktop-header__left {
        display: flex;
        align-items: center;
        gap: var(--space-4);
    }

    .desktop-header__page-title {
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-bold);
        color: var(--color-text-primary);
    }

    .desktop-header__right {
        display: flex;
        align-items: center;
        gap: var(--space-4);
    }

    .desktop-header__search {
        width: 280px;
        padding: var(--space-2) var(--space-4);
        padding-left: 36px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-full);
        font-size: var(--font-size-sm);
        color: var(--color-text-primary);
        background: var(--color-surface-muted);
        transition: all var(--transition-fast);
    }

    .desktop-header__search:focus {
        outline: none;
        border-color: var(--color-primary);
        background: var(--color-surface);
        box-shadow: 0 0 0 3px rgba(232, 131, 107, 0.1);
    }

    .desktop-header__search::placeholder {
        color: var(--color-text-tertiary);
    }

    .desktop-header__search-wrap {
        position: relative;
    }

    .desktop-header__search-wrap svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        color: var(--color-text-tertiary);
        pointer-events: none;
    }

    /* ── Main content area ── */
    .app-main {
        margin-left: 240px;
        padding-top: 0;
        padding-bottom: var(--space-8);
        min-height: 100vh;
    }

    .screen {
        padding: var(--space-8);
        max-width: 1200px;
        margin: 0 auto;
    }

    /* ═══════ HOME DASHBOARD — Desktop Grid ═══════ */
    .screen-home .home-top-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
        align-items: start;
    }

    .screen-home .home-top-left {
        display: flex;
        flex-direction: column;
        gap: var(--space-5);
    }

    .screen-home .home-top-right {
        display: flex;
        flex-direction: column;
        gap: var(--space-5);
    }

    .screen-home .quick-actions {
        margin-top: 0;
    }

    .screen-home .greeting__name {
        font-size: var(--font-size-2xl);
    }

    .screen-home .section {
        margin-top: var(--space-6);
    }

    .featured-games-scroll {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .featured-games-scroll .game-card {
        min-width: 300px;
    }

    .screen-home .home-bottom-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
        margin-top: var(--space-6);
    }

    /* ═══════ GAME LOBBY — Desktop Grid ═══════ */
    .game-lobby-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }

    .game-card__image {
        height: 180px;
    }

    /* ═══════ GAME DETAIL — Desktop Layout ═══════ */
    .screen-game-detail .game-detail-desktop-layout {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: var(--space-8);
        align-items: start;
    }

    .screen-game-detail .game-detail-hero {
        margin: 0;
        border-radius: var(--radius-xl);
        overflow: hidden;
    }

    .screen-game-detail .game-detail-hero img {
        height: 280px;
    }

    .game-detail-sidebar {
        position: sticky;
        top: var(--space-8);
    }

    /* ═══════ WALLET — Desktop Layout ═══════ */
    .screen-wallet .wallet-desktop-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
        align-items: start;
    }

    .screen-wallet .wallet-balance {
        text-align: left;
        padding: var(--space-8) 0;
    }

    /* ═══════ PROFILE — Desktop Layout ═══════ */
    .screen-profile .profile-desktop-layout {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: var(--space-8);
        align-items: start;
    }

    .screen-profile .profile-desktop-left {
        position: sticky;
        top: var(--space-8);
        background: var(--color-surface);
        border-radius: var(--radius-xl);
        padding: var(--space-8);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--color-border-light);
    }

    .screen-profile .profile-desktop-left .profile-header {
        padding: 0;
    }

    /* ═══════ SUPPORT — Desktop Layout ═══════ */
    .screen-support .support-desktop-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    /* ── Game Play Modal (Desktop Optimized) ── */
    .game-modal {
        max-width: 560px;
    }
}

/* ── Hide desktop elements on mobile ── */
@media (max-width: 767px) {

    .desktop-sidebar,
    .desktop-header,
    .desktop-only {
        display: none !important;
    }

    .home-top-row,
    .home-top-left,
    .home-top-right,
    .home-bottom-row {
        display: contents;
    }
}

/* ═══════════════════════════════════════════
   Game Play Modal — Full Overlay
   ═══════════════════════════════════════════ */
.game-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 46, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.game-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.game-modal {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(12px);
    transition: transform var(--transition-spring);
}

.game-modal-overlay.active .game-modal {
    transform: scale(1) translateY(0);
}

.game-modal__header {
    position: relative;
}

.game-modal__image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.game-modal__close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background var(--transition-fast);
}

.game-modal__close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.game-modal__close svg {
    width: 18px;
    height: 18px;
}

.game-modal__body {
    padding: var(--space-6);
}

.game-modal__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.game-modal__subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-5);
}

.game-modal__info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.game-modal__info-card {
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-muted);
    border-radius: var(--radius-md);
    text-align: center;
}

.game-modal__info-value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.game-modal__info-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.game-modal__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.game-modal__status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-success-bg);
    border-radius: var(--radius-md);
    color: var(--color-success);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.game-modal__status .status-dot {
    width: 8px;
    height: 8px;
}

/* ═══════ Wider desktop tweaks ═══════ */
@media (min-width: 1280px) {
    .desktop-sidebar {
        width: 260px;
        min-width: 260px;
    }

    .app-main {
        margin-left: 260px;
    }

    .desktop-header {
        margin-left: 260px;
    }

    .screen {
        max-width: 1400px;
    }
}