:root {
    /* Color Variables */
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --background-color: #111827;
    --card-background: #1f2937;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    
    /* Spacing Variables */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Animation Variables */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;

    /* Game Card Variables */
    --card-width: 131px;
    --card-height: 115px;
    --card-scale: 1.2;
}

/* Base Styles */
body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Category Section */
.category-section {
    position: relative;
    padding: var(--spacing-xl) 0;
    perspective: 1000px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transform-style: preserve-3d;
}

.category-header .flex {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.category-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.category-title i {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.category-icon {
    width: 2rem;
    height: 2rem;
    margin-right: var(--spacing-md);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 0 var(--spacing-lg);
    transform-style: preserve-3d;
    margin-bottom: var(--spacing-xl);
}

/* Category Page Specific Styles */
.category-page .game-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 0;
    margin-bottom: 2rem;
}

/* Game Card */
.game-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.game-image-container {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 1rem;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.game-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.stars i {
    color: #fbbf24;
    font-size: 0.9rem;
}

.rating-value {
    color: #9ca3af;
    font-size: 0.9rem;
}

.game-plays {
    color: #f97316;
    font-size: 0.9rem;
}

.game-plays span {
    font-weight: 600;
}

/* Parallax Effect */
.parallax-container {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: translateZ(-10px) scale(2);
    z-index: -1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.875rem;
    }
    .category-page .game-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 900px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
    .category-page .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    :root {
        --card-width: 110px;
        --card-height: 98px;
    }

    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
        padding: 0 var(--spacing-md);
    }
    
    .category-page .game-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 0;
    }

    .game-card {
        width: var(--card-width);
        height: calc(var(--card-height) + 2rem);
    }

    .game-title {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    :root {
        --card-width: 95px;
        --card-height: 83px;
    }

    .game-grid {
        gap: 0.5rem;
        padding: 0 var(--spacing-sm);
    }
    
    .category-page .game-grid {
        padding: 0;
    }

    .game-title {
        font-size: 0.7rem;
    }
}

/* Loading State */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(17, 24, 39, 0.98);
    z-index: 100;
    overflow-y: auto;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.search-container {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 1rem;
}

.search-header {
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.search-icon {
    color: #9ca3af;
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.125rem;
    outline: none;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.search-close-btn:hover {
    color: white;
}

.search-results {
    background-color: rgba(31, 41, 55, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
}

.search-results-title {
    color: #9ca3af;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    padding: 0 1rem;
}

.no-results {
    text-align: center;
    padding: 3rem 0;
    color: #9ca3af;
}

/* Game Grid in Search Results */
.search-results .game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .search-container {
        margin: 1rem auto;
        padding: 0.5rem;
    }

    .search-results {
        padding: 1rem;
    }

    .search-results .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .search-input {
        font-size: 1rem;
    }

    .search-results-title {
        font-size: 1rem;
    }
}

/* Game Info Page Styles */
.game-info-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem;
}

@media (min-width: 768px) {
    .game-info-container {
        grid-template-columns: 1fr 2fr;
        padding: 2rem;
    }
}

.game-preview {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-preview img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.game-details {
    padding: 1rem;
}

.game-details h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #fff;
}

.game-details .game-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    border-radius: 0.5rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 1rem;
}

.game-details p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 2rem;
}

#playButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    color: #fff;
    transition: all 0.3s ease;
}

#playButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Related Games Section */
.related-games {
    margin-top: 2rem;
    padding: 1rem;
}

.related-games h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: #fff;
}

#relatedGames {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 0;
}

#relatedGames .game-card {
    width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

#relatedGames .game-image-container {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

#relatedGames .game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#relatedGames .game-info {
    padding: 0.75rem;
}

#relatedGames .game-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Design for Related Games */
@media (max-width: 1200px) {
    #relatedGames {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    #relatedGames {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    #relatedGames {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .related-games {
        padding: 0.5rem;
    }
    
    .related-games h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    #relatedGames {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Game Stats Styles */
.game-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 0.25rem;
}

.stars i {
    color: #fbbf24;
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.3));
}

.plays {
    margin-top: 0.5rem;
    font-size: 1.25rem;
    color: #f97316;
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.plays span {
    font-weight: 700;
} 