/* ==========================================
   RESET & GLOBAL VALUES
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #121212;
    color: white;
}

body.default {
    background: #121212;
}

/* ==========================================
   MAIN STRUCTURAL LAYOUT
========================================== */
.app {
    width: 100%;
    height: 100vh;
    display: flex;
    position: relative;
    z-index: 2;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================
   BACKGROUND LAYER & EFFECTS
========================================== */
.bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.bg-stars {
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.08) 2px, transparent 2px);
    background-size: 300px 300px;
    opacity: 0.45;
    animation: drift 120s linear infinite;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-300px); }
}

/* ==========================================
   SIDEBAR CONFIGURATIONS
========================================== */
.sidebar {
    width: 340px;
    min-width: 340px;
    background: rgba(30, 30, 30, 0.88);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.active-theme-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.active-theme-label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #888;
    white-space: nowrap;
}

#active-theme-name {
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.Web-Logo {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: auto;
    border-radius: 26px;
}

#search-bar {
    width: 100%;
    padding: 14px;
    border: none;
    outline: none;
    border-radius: 16px;
    background: #1e1e1e;
    color: white;
    font-size: 15px;
    transition: 0.3s ease;
}

#search-bar::placeholder {
    color: #888;
}

#search-bar:focus {
    background: #252525;
    transform: scale(1.02);
}

.disclaimer {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.72;
}

/* ==========================================
   CONVEYOR BAR SLIDER
========================================== */
.conveyor {
    height: 100px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    position: relative;
}

.conveyor-track {
    display: flex;
    gap: 18px;
    width: max-content;
    animation: scrollConveyor 45s linear infinite;
}

.conveyor:hover .conveyor-track {
    animation-play-state: paused;
}

@keyframes scrollConveyor {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.mini-card {
    min-width: 180px;
    height: 65px;
    background: #1e1e1e;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
    padding: 10px;
    text-align: center;
}

.mini-card:hover {
    transform: translateY(-4px);
}

/* ==========================================
   MAIN GAME DISPLAY AREA
========================================== */
.game-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.game-list {
    display: grid;
    /* Balanced floor to secure 5 columns at default layout, widening out when zooming */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-container {
    background: #1e1e1e;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: 0.35s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.08);
}

.game-banner {
    width: 100%;
    height: auto;
    /* Fills the element space seamlessly without stretching distortion */
    object-fit: cover;
    /* Keeps a crisp vertical gaming poster shape no matter the zoom/grid scale */
    aspect-ratio: 2 / 3;
    background: #111;
    display: block;
}

.game-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.game-description {
    color: #ccc;
    text-align: center;
    flex: 1;
    font-size: 14px;
    margin-bottom: 15px;
}

/* ==========================================
   DOWNLOAD BUTTON SYSTEM
========================================== */
.download-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.download-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #000;
    color: white;
    padding: 15px 28px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    margin: 0 auto;
}

/* ==========================================
   POPOVERS, MENUS & OVERLAYS
========================================== */
#dark-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transition: 0.3s;
}

#dark-overlay.active {
    opacity: 1;
}

.floating-btn {
    position: fixed;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #1e1e1e;
    border: 1px solid #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: 0.3s ease;
}

.floating-btn:hover {
    transform: scale(1.08);
}

#dark-toggle { bottom: 20px; }
#theme-toggle { bottom: 90px; }
#suggest-btn { bottom: 160px; }
#toggle-conveyor { top: 20px; left: 20px; }

#theme-menu {
    position: fixed;
    right: 90px;
    bottom: 80px;
    width: 240px;
    background: #1a1a1a;
    border-radius: 18px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

#theme-menu.show {
    display: flex;
}

/* Theme Menu Scrollbar Customization */
#theme-menu::-webkit-scrollbar { width: 8px; }
#theme-menu::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 10px; }
#theme-menu::-webkit-scrollbar-thumb { background: #555; border-radius: 10px; }
#theme-menu::-webkit-scrollbar-thumb:hover { background: #777; }

.theme-header {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #999;
    margin-top: 6px;
    padding-left: 4px;
}

.theme-btn {
    border: none;
    padding: 12px;
    border-radius: 12px;
    background: #252525;
    color: white;
    cursor: pointer;
    text-align: left;
    transition: 0.25s ease;
}

.theme-btn:hover {
    background: #333;
    transform: translateX(4px);
}

#event-popup {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 15px 25px;
    z-index: 99999;
    display: none;
}

/* ==========================================
   RESPONSIVE MOBILE VIEWPORTS
========================================== */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .app {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    .game-list {
        grid-template-columns: 1fr;
    }

    #theme-menu {
        right: 20px;
        bottom: 90px;
        width: calc(100% - 40px);
        max-height: 45vh;
    }
}

