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

/* Light Mode (Default) - Red Theme */
:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;
    --accent-color: #f97316;
    --background: #fafafa;
    --surface: #ffffff;
    --surface-light: #f5f5f5;
    --surface-hover: #fef2f2;
    --text-primary: #0a0a0a;
    --text-secondary: #525252;
    --text-muted: #737373;
    --border-color: #e5e5e5;
    --success: #16a34a;
    --warning: #f59e0b;
    
    /* Spacing & Design Tokens */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease;
}

/* Dark Mode - Red Theme with Dark Background */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ef4444;
        --primary-dark: #dc2626;
        --primary-light: #f87171;
        --accent-color: #fb923c;
        --background: #0a0a0a;
        --surface: #171717;
        --surface-light: #262626;
        --surface-hover: #450a0a;
        --text-primary: #fafafa;
        --text-secondary: #a3a3a3;
        --text-muted: #737373;
        --border-color: #404040;
        --success: #22c55e;
        --warning: #fbbf24;
        
        /* Dark mode shadows */
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
        --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

main {
    min-height: calc(100vh - 400px);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header - Clean WordPress Style */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.logo a:hover {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.938rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: var(--surface-light);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

@media (prefers-color-scheme: dark) {
    .search-box:focus-within {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    }
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.938rem;
    width: 200px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
}

.search-box button:hover {
    color: var(--primary-color);
}

/* Buttons - WordPress Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.938rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    line-height: 1.5;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn.ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn.ghost:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--surface-hover);
}

@media (prefers-color-scheme: dark) {
    .btn.ghost:hover {
        background: rgba(239, 68, 68, 0.1);
    }
}

.btn.pill {
    padding: 0.75rem 2rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.btn.pill:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.mobile-menu-toggle:hover {
    background: var(--surface-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Hero Section - Clean & Minimal */
.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 5rem 0;
    margin-bottom: 3rem;
}

.hero-card {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-color);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

@media (prefers-color-scheme: dark) {
    .eyebrow {
        background: rgba(239, 68, 68, 0.15);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Categories Section */
.categories-section {
    padding: 3rem 0 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -0.025em;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
.category-card:hover {
        background: var(--surface-light);
    }
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.game-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Games Section */
.games-section {
    padding: 3rem 0 4rem;
    background: var(--surface-light);
    border-top: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header .section-title {
    text-align: left;
    margin-bottom: 0;
    font-size: 1.875rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meta-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.select-wrap {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.select-wrap::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.75rem;
}

.input-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.938rem;
    padding: 0.625rem 2.75rem 0.625rem 1rem;
    outline: none;
    appearance: none;
    cursor: pointer;
    font-weight: 500;
}

/* Game Cards - Clean WordPress Style */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.game-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-light);
    overflow: hidden;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.08);
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

@media (prefers-color-scheme: dark) {
    .game-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

.play-button {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-card:hover .play-button {
    transform: scale(1);
}

.play-button i {
    margin-left: 3px;
}

.game-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.game-category {
    padding: 0.375rem 0.75rem;
    background: var(--surface-light);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--warning);
    font-weight: 600;
    font-size: 0.875rem;
}

.load-more {
    text-align: center;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Footer - Clean WordPress Style */
.footer {
    background: var(--surface);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.footer-section h3 {
    font-size: 1.375rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.footer-section h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.938rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    font-size: 0.938rem;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Page Headers (Category, Search, etc.) */
.page-header {
    background: var(--surface);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Search Results */
.search-results {
    padding: 2rem 0 4rem;
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    }

.results-count {
    color: var(--text-secondary);
    font-size: 0.938rem;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.no-results i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    font-weight: 700;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Game Page */
.game-page {
    background: var(--background);
    padding: 2rem 0 4rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.938rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    }

.back-button:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateX(-4px);
}

.game-container {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    }
    
.game-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    }
    
.game-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    letter-spacing: -0.02em;
}

.game-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    }
    
.game-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    }
    
.tag {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    }
    
.game-frame-container {
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    }
    
.game-frame {
    width: 100%;
    height: 80vh;
    border: none;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.75rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links,
    .search-box {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-actions {
        flex-direction: column;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }

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

    .section-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
}

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

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

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.875rem;
}

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

.page-title {
        font-size: 2rem;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    /* Improve readability */
    .game-card,
    .category-card {
        background: var(--surface);
}

    .game-card:hover,
    .category-card:hover {
        border-color: var(--primary-light);
}

    /* Button improvements */
    .btn.primary {
        box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5);
}

    .btn.primary:hover {
        box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.5), var(--shadow-md);
    }
    
    /* Improve borders */
    .hero,
    .page-header,
    .footer {
        border-color: var(--border-color);
}

    /* Ensure images don't appear too bright */
    .game-thumbnail img {
        opacity: 0.95;
}

    .game-card:hover .game-thumbnail img {
        opacity: 1;
}
}
