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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: #f5f5f5;
    background-image: url('public/background.png');
    background-repeat: repeat;
    background-size: 200px 200px;
    image-rendering: pixelated;
    color: #333;
    line-height: 1.8;
}

/* Header */
header {
    background-color: #2a2a2a;
    border-bottom: 0.5px solid #444;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    image-rendering: pixelated;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.625rem;
    padding: 10px 15px;
    transition: color 0.3s;
}

nav a:hover {
    color: #ccc;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #333;
}

.subtitle {
    font-size: 0.75rem;
    color: #666;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 60px;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.625rem;
    border: 2px solid #ddd;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #999;
}

.search-input::placeholder {
    color: #999;
}

/* Categories */
.categories-container {
    margin-bottom: 80px;
}

.categories-container h2 {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 2px 2px 0px #333;
    margin-bottom: 40px;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    image-rendering: pixelated;
    object-fit: contain;
}

.category-card h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 0.5rem;
    color: #666;
    line-height: 1.6;
}

/* Disabled Category Card */
.category-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.category-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #ddd;
}

.badge-coming-soon {
    position: absolute;
    top: 10px;
    right: -30px;
    background-color: #ff4444;
    color: #fff;
    font-size: 0.4rem;
    padding: 5px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    font-family: 'Press Start 2P', cursive;
}

/* Games Section */
.games-section {
    margin-bottom: 80px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.back-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.625rem;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.back-button:hover {
    border-color: #999;
    transform: translateX(-3px);
}

.section-header h2 {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 2px 2px 0px #333;
    flex-grow: 1;
    text-align: center;
}

.sort-container {
    margin-left: auto;
}

.sort-select {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

.sort-select:hover {
    border-color: #999;
}

/* Genre Filters */
.genre-filters {
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 12px;
}

.genre-filter-title {
    font-size: 0.7rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.genre-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-button {
    padding: 8px 16px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.genre-button:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.genre-button.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.game-card {
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: #999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 12px;
    image-rendering: auto;
    border: 1px solid #ddd;
    display: block;
}

.game-card h3 {
    font-size: 0.6rem;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-card p {
    font-size: 0.45rem;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1;
}

.load-more-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.625rem;
    padding: 15px 30px;
    background-color: #555;
    color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 30px auto;
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.load-more-button:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background-color: #2a2a2a;
    border-top: 0.5px solid #444;
    padding: 40px 20px;
    text-align: center;
}

footer p {
    font-size: 0.625rem;
    color: #ccc;
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 0.5rem;
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .category-card {
        padding: 20px 15px;
    }

    .category-card img {
        width: 60px;
        height: 60px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.25rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .category-card h3 {
        font-size: 0.75rem;
    }

    .category-card p {
        font-size: 0.4rem;
    }
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #444;
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    color: #fff;
    margin-top: 20px;
    font-size: 0.75rem;
}

/* Game Detail Page */
.game-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    background-image: url('public/background.png');
    background-repeat: repeat;
    background-size: 200px 200px;
    image-rendering: pixelated;
    display: none;
    z-index: 10000;
    overflow-y: auto;
}

.game-detail-modal.active {
    display: block;
}

.game-detail-content {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    border: 2px solid #ddd;
    position: relative;
    min-height: calc(100vh - 40px);
}

.game-detail-close,
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    background-color: transparent;
    color: #333;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.game-detail-close:hover,
.close-modal:hover {
    color: #666;
}

.game-detail-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.game-detail-cover {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3/4;
    object-fit: contain;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 2px solid #ddd;
    margin: 0 auto;
}

.game-detail-info {
    flex: 1;
}

.game-detail-info h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.game-detail-info p {
    font-size: 0.6rem;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.8;
}

.game-detail-download {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    padding: 15px 25px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    width: fit-content;
    margin: 20px auto 0;
    text-decoration: none;
    text-align: center;
}

.game-detail-download:hover {
    background-color: #555;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .game-card h3 {
        font-size: 0.7rem;
    }

    .game-detail-header {
        flex-direction: row;
        gap: 30px;
    }

    .game-detail-cover {
        width: 250px;
        margin: 0;
    }
}

@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}