/* gamestore.css - Premium Game Library Builder Styles */

/* Custom Variables */
:root {
    --store-accent: #ff6600;
    --store-accent-glow: rgba(255, 102, 0, 0.4);
    --store-bg: #0a0a0a;
    --card-bg: rgba(20, 20, 20, 0.95);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --neon-green: #00ff88;
    --neon-cyan: #00d4ff;
}

body {
    background-color: var(--store-bg);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Header Background */
.navbar {
    background-color: #000;
    position: relative;
    border-bottom: 1px solid rgba(255, 102, 0, 0.3);
}

/* Overlay removed */

/* Overlay removed */

.nav-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    /* Ensure full width to space items out */
}

/* 3-Column Layout: Left Icon, Center Logo, Right Icon */
.nav-title {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    /* Left */
    align-items: center;
    /* Vertical Center */
    font-size: 1.8rem;
    color: var(--store-accent);
    text-shadow: 0 0 15px var(--store-accent-glow);
}

.nav-logo-link {
    flex: 1;
    display: flex;
    justify-content: center;
    /* Center */
    align-items: center;
    /* Vertical Center */
}

.back-link {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    /* Right */
    align-items: center;
    /* Vertical Center */
    font-size: 1.6rem;
    color: #fff;
    transition: all 0.3s;
    margin-top: 15px;
    /* Explicitly push down */
}

.nav-logo {
    height: 45px;
    /* Slightly larger logo for center stage */
}

.back-link:hover {
    color: var(--store-accent);
    transform: scale(1.1);
}

/* Hidden/Visible State for Capacity Step */
.capacity-step.hidden {
    display: none;
}

.capacity-step.visible {
    display: block;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated Background */
.gamestore-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 102, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 102, 0, 0.03) 0%, transparent 70%);
    z-index: -1;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.gamestore-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    padding-bottom: 120px;
    position: relative;
}

/* --- Configuration Panel --- */
.config-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.config-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 102, 0, 0.03), transparent 30%);
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    100% {
        transform: rotate(360deg);
    }
}

.page-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #fff 0%, var(--store-accent) 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -1px;
    animation: shimmer 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

.config-step {
    margin-bottom: 45px;
    position: relative;
    z-index: 1;
}

.config-step h3 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.config-step h3 i {
    color: var(--store-accent);
    font-size: 1.3rem;
    filter: drop-shadow(0 0 8px var(--store-accent-glow));
}

/* Device Selector */
.device-selector {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.device-option input,
.capacity-option input {
    display: none;
}

.device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 130px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.device-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 102, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.device-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.device-card:hover::before {
    opacity: 1;
}

.device-card i {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.device-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 1;
}

.device-option input:checked+.device-card {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.15) 0%, rgba(255, 102, 0, 0.05) 100%);
    border-color: var(--store-accent);
    box-shadow:
        0 0 30px var(--store-accent-glow),
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-8px) scale(1.02);
}

.device-option input:checked+.device-card i {
    color: var(--store-accent);
    filter: drop-shadow(0 0 15px var(--store-accent-glow));
    transform: scale(1.1);
}

.device-option input:checked+.device-card span {
    color: #fff;
}

/* Capacity Selector */
.capacity-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.cap-btn {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    min-width: 90px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.cap-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.capacity-option input:checked+.cap-btn {
    background: linear-gradient(135deg, var(--store-accent) 0%, #ff8533 100%);
    color: #000;
    font-weight: 700;
    border-color: transparent;
    box-shadow:
        0 0 25px var(--store-accent-glow),
        0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px) scale(1.05);
}

/* --- Sticky Storage Monitor --- */
.storage-monitor {
    position: sticky;
    top: 85px;
    z-index: 900;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 102, 0, 0.2);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 40px;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(255, 102, 0, 0.1);
    transition: all 0.3s;
}

.storage-monitor:hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(255, 102, 0, 0.15);
}

.monitor-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.storage-values {
    font-weight: 700;
    color: #fff;
}

.progress-bar-container {
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-green) 0%, var(--neon-cyan) 100%);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.4s;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-bar.warning {
    background: linear-gradient(90deg, #ffcc00 0%, #ff9900 100%);
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.4);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #ff4444 0%, #cc0000 100%);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.4);
    animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {

    0%,
    100% {
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.6);
    }
}

.monitor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#game-count {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.btn-checkout {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.4);
}

.btn-checkout:active {
    transform: scale(0.98);
}

/* --- Game Filters --- */
.game-filters {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

#game-search {
    width: 100%;
    max-width: 550px;
    padding: 16px 28px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#game-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#game-search:focus {
    border-color: var(--store-accent);
    box-shadow: 0 0 30px var(--store-accent-glow);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Game Grid --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.game-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 102, 0, 0.1);
}

.game-card.selected {
    border-color: var(--store-accent);
    box-shadow:
        0 0 40px var(--store-accent-glow),
        0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px) scale(1.02);
}

.game-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.08);
}

.size-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--neon-green);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    z-index: 2;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.tick-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.4) 0%, rgba(255, 102, 0, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
}

.game-card.selected .tick-overlay {
    opacity: 1;
}

.tick-icon {
    font-size: 4rem;
    color: white;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    animation: tickPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tickPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-info {
    padding: 15px;
    position: relative;
    z-index: 2;
    background: linear-gradient(0deg, var(--card-bg) 0%, transparent 100%);
    margin-top: -40px;
}

.game-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

/* Card Stagger Animation */
@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-card {
    animation: cardSlideUp 0.5s ease-out backwards;
}

/* Loading State */
.loading-games {
    text-align: center;
    padding: 60px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .gamestore-container {
        padding-top: 30px;
        /* Headroom */
        padding-bottom: 80px;
        /* Less bottom space */
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 25px;
        margin-top: 10px;
    }

    .config-panel {
        padding: 20px 15px;
    }

    .device-selector {
        gap: 8px;
    }

    .device-card {
        width: 45%;
        max-width: 140px;
        height: 100px;
    }

    .device-card i {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .device-card span {
        font-size: 0.8rem;
    }

    /* Fix Capacity Selector Overlap */
    .capacity-selector {
        gap: 12px;
        row-gap: 25px;
        /* Maximum vertical gap */
    }

    .cap-btn {
        padding: 10px 10px;
        min-width: 70px;
        font-size: 0.85rem;
        flex: 1 1 auto;
        margin-bottom: 0;
        /* Let gap handle spacing */
    }

    /* Disable scale on mobile to prevent overlap */
    .capacity-option input:checked+.cap-btn {
        transform: translateY(0) scale(1.0) !important;
        box-shadow: 0 0 15px var(--store-accent-glow) !important;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .storage-monitor {
        padding: 15px 20px;
    }
}

/* --- Mobile Storage FAB & Popup --- */

/* Default: Hidden on Desktop */
.mobile-storage-fab,
.mobile-storage-popup {
    display: none;
}

@media (max-width: 768px) {

    /* Hide Desktop Monitor */
    #storage-monitor {
        display: none !important;
    }

    /* Show FAB */
    .mobile-storage-fab {
        display: flex;
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: var(--card-bg);
        /* Center bg */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.1);
        overflow: hidden;
        transition: transform 0.2s;
    }

    .mobile-storage-fab:active {
        transform: scale(0.95);
    }

    /* Conic Gradient Border/Fill Effect */
    .mobile-storage-fab::before {
        content: '';
        position: absolute;
        inset: -5px;
        background: conic-gradient(var(--store-accent) var(--fill-percent, 0%),
                rgba(255, 255, 255, 0.1) 0%);
        z-index: 0;
        transition: background 0.3s;
    }

    /* Inner circle */
    .mobile-storage-fab::after {
        content: '';
        position: absolute;
        inset: 4px;
        background: #111;
        border-radius: 50%;
        z-index: 1;
    }

    .fab-content {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: #fff;
    }

    .fab-content i {
        font-size: 1.2rem;
        color: var(--store-accent);
    }

    .fab-content span {
        font-size: 0.75rem;
        font-weight: 700;
    }

    /* Popup */
    .mobile-storage-popup {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        z-index: 1001;
        align-items: flex-end;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .mobile-storage-popup.active {
        opacity: 1;
        pointer-events: all;
    }

    .popup-content {
        width: 100%;
        background: #1a1a1a;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding: 30px;
        border-top: 1px solid var(--store-accent);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-storage-popup.active .popup-content {
        transform: translateY(0);
    }

    .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .popup-header h3 {
        margin: 0;
        color: var(--store-accent);
    }

    .close-popup {
        font-size: 1.5rem;
        padding: 5px;
    }

    .storage-ring-limit {
        font-size: 1.5rem;
        font-weight: 700;
        text-align: center;
        margin-bottom: 20px;
    }

    .btn-checkout-mobile {
        width: 100%;
        padding: 15px;
        background: #25D366;
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 1.1rem;
        font-weight: 700;
    }
}

/* --- Game Grid --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.game-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 102, 0, 0.1);
}

.game-card.selected {
    border-color: var(--store-accent);
    box-shadow:
        0 0 40px var(--store-accent-glow),
        0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px) scale(1.02);
}

.game-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.08);
}

.size-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--neon-green);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    z-index: 2;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.tick-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.4) 0%, rgba(255, 102, 0, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
}

.game-card.selected .tick-overlay {
    opacity: 1;
}

.tick-icon {
    font-size: 4rem;
    color: white;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    animation: tickPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tickPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-info {
    padding: 15px;
    position: relative;
    z-index: 2;
    background: linear-gradient(0deg, var(--card-bg) 0%, transparent 100%);
    margin-top: -40px;
}

.game-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

/* Card Stagger Animation */
@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-card {
    animation: cardSlideUp 0.5s ease-out backwards;
}

/* Loading State */
.loading-games {
    text-align: center;
    padding: 60px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .config-panel {
        padding: 25px;
    }

    .device-card {
        width: 120px;
        height: 100px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .storage-monitor {
        padding: 15px 20px;
    }
}

/* --- Mobile Storage FAB & Popup --- */

/* --- Storage Popup (Shared Desktop & Mobile) --- */
.mobile-storage-fab {
    display: none;
}

.mobile-storage-popup {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    /* Center for Desktop */
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-storage-popup.active {
    opacity: 1;
    pointer-events: all;
}

.popup-content {
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border-radius: 20px;
    /* Full rounded for Desktop */
    padding: 30px;
    border: 1px solid var(--store-accent);
    transform: scale(0.95);
    /* Scale effect for Desktop */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.mobile-storage-popup.active .popup-content {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.popup-header h3 {
    margin: 0;
    color: var(--store-accent);
}

.close-popup {
    font-size: 1.5rem;
    padding: 5px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-popup:hover {
    color: var(--store-accent);
}

.storage-ring-limit {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

/* Popup Visual Bar */
.popup-storage-visual {
    margin-bottom: 15px;
    padding: 0 10px;
}

.popup-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.popup-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--store-accent), #ff3300);
    border-radius: 6px;
    box-shadow: 0 0 15px var(--store-accent-glow);
    transition: width 0.4s ease-out;
}

/* Popup Game List */
.popup-game-list {
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.popup-game-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.popup-game-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.popup-game-info {
    flex: 1;
}

.popup-game-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

.popup-game-size {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.popup-remove-btn {
    background: none;
    border: none;
    color: #ff3333;
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.popup-remove-btn:hover {
    transform: scale(1.1);
}

.btn-checkout-mobile {
    width: 100%;
    padding: 15px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-checkout-mobile:hover {
    background: #1ebc57;
}

/* Secondary Button for Desktop */
.monitor-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* --- Mobile Specific Overrides --- */
@media (max-width: 768px) {

    /* Hide Desktop Monitor */
    #storage-monitor {
        display: none !important;
    }

    /* Show FAB */
    .mobile-storage-fab {
        display: flex;
        /* Flex instead of none */
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: var(--card-bg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.1);
        overflow: hidden;
        transition: transform 0.2s;
    }

    /* Popup Bottom Sheet Style Override */
    .mobile-storage-popup {
        align-items: flex-end;
        /* Bottom */
    }

    .popup-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        transform: translateY(100%);
        /* Slide up effect */
    }

    .mobile-storage-popup.active .popup-content {
        transform: translateY(0);
    }
}