/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Lexend', sans-serif;
    font-weight: 400;
    background-color: #332752;
    overflow-x: hidden;
}

/* Logo Styles */
.logo-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo-container.at-top {
    top: 30px;
    transform: translate(-50%, 0);
}

.logo {
    opacity: 0;
    width: 500px;
    height: auto;
    transition: opacity 0.15s ease-out, width 0.15s ease-out;
}

.logo.visible {
    opacity: 1;
    width: 600px;
}

.logo-container.at-top .logo {
    width: 300px;
}

/* Main Content */
.main-content {
    padding-top: 180px;
    padding-bottom: 100px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    padding: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.game-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Game Box */
.game-box {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    background: linear-gradient(135deg, #5a4a8a 0%, #3d2d5a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                box-shadow 0.3s ease-out,
                opacity 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    overflow: hidden;
}

.game-box.visible {
    opacity: 1;
    transform: scale(1);
}

.game-box:hover {
    transform: scale(1.04);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.game-box:not(:hover) {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                box-shadow 0.3s ease-out,
                opacity 0.3s ease-out;
}

.game-box-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    padding: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Game Info (player count and duration) */
.game-info {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.game-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.game-info-item i {
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Filter Button & Panel */
.filter-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.filter-container.visible {
    opacity: 1;
    transform: translateX(0);
}

.filter-btn {
    background: linear-gradient(135deg, #6b5b95 0%, #4a3a6a 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.filter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.filter-panel {
    position: absolute;
    top: 60px;
    right: 0;
    background: linear-gradient(135deg, #5a4a8a 0%, #3d2d5a 100%);
    border-radius: 20px;
    padding: 25px;
    min-width: 320px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.filter-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-label {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label i {
    font-size: 1.1rem;
}

.filter-range-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-input {
    width: 70px;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.9rem;
    font-weight: 400;
    text-align: center;
    transition: background 0.2s ease-out;
}

.filter-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

.filter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.filter-separator {
    color: white;
    font-weight: 500;
}

.dual-range-slider {
    position: relative;
    width: 100%;
    height: 8px;
    margin-top: 12px;
}

.filter-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.filter-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-out;
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.filter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.filter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.filter-slider-min::-webkit-slider-thumb {
    z-index: 3;
}

.filter-slider-max::-webkit-slider-thumb {
    z-index: 4;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 400;
    background: linear-gradient(to top, rgba(70, 54, 112, 0.9) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease-out;
}

.footer a:hover {
    color: white;
}

/* Hidden state for filtering */
.game-box.filtered-out {
    opacity: 0 !important;
    transform: scale(0.8) !important;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-container.at-top {
        left: 20px;
        transform: translate(0, 0);
    }
    
    .logo-container.at-top .logo {
        width: 200px;
    }
    
    .main-content {
        padding-top: 140px;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .filter-panel {
        min-width: 280px;
        right: -10px;
    }
    
    .game-box-title {
        font-size: 1.2rem;
    }
}
