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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #a0aec0;
    font-size: 1.1rem;
}

.clear-search {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Filters Section */
.filters-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.view-btn {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #a0aec0;
}

.view-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.view-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.view-btn.active:hover {
    color: white;
}

.results-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.9rem;
}

/* Games Container */
.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
}

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

/* Game Card */
.game-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.game-card.list-view {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.game-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px 10px 0 0;
}

.game-card:hover .game-image img {
    transform: scale(1.05);
}

/* Loading animation for game images */
.game-image img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fallback icon when image fails to load */
.game-image i {
    font-size: 3rem;
    color: white;
    opacity: 0.8;
}

.game-card.list-view .game-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.game-card.list-view .game-image img {
    border-radius: 10px;
}

.game-info {
    padding: 1.5rem;
}

.game-card.list-view .game-info {
    flex: 1;
    padding: 0;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.game-description {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card.list-view .game-description {
    -webkit-line-clamp: 2;
}

.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.game-card:hover .play-button {
    opacity: 1;
}

/* Loading and No Results */
.loading, .no-results {
    text-align: center;
    padding: 3rem;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    height: calc(100% - 80px);
    padding: 0;
}

.game-frame-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    text-align: center;
    color: #718096;
}

/* Game Detail Page Styles */
.game-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.game-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-detail-image {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

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

.game-detail-image:hover img {
    transform: scale(1.05);
}

.game-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.game-detail-description {
    font-size: 1.1rem;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.game-detail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.game-detail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.play-game-btn, .back-to-home-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.play-game-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.play-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.back-to-home-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.back-to-home-btn:hover {
    background: #f7fafc;
    border-color: #667eea;
    color: #667eea;
}

.game-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.game-screenshots, .game-info-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-screenshots h3, .game-info-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

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

.screenshots-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.screenshots-grid img:hover {
    transform: scale(1.05);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.info-value {
    color: #718096;
}

/* Fullscreen Game Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.fullscreen-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fullscreen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.fullscreen-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.fullscreen-controls {
    display: flex;
    gap: 1rem;
}

.fullscreen-btn, .close-fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover, .close-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-modal-body {
    flex: 1;
    padding: 0;
}

#fullscreenGameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Recommended Games Section */
.recommended-games-section {
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.recommended-games-section h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.recommended-game-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.recommended-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recommended-game-image {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

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

.recommended-game-card:hover .recommended-game-image img {
    transform: scale(1.1);
}

.recommended-game-info {
    padding: 1rem;
}

.recommended-game-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.category-tag.small {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 3rem;
    color: white;
}

.error-container i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.error-container h3 {
    margin-bottom: 0.5rem;
}

/* Responsive Design for Game Detail */
@media (max-width: 768px) {
    .game-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .game-detail-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .game-detail-title {
        font-size: 2rem;
    }
    
    .game-detail-actions {
        justify-content: center;
    }
    
    .game-detail-content {
        grid-template-columns: 1fr;
    }
    
    .recommended-games-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .fullscreen-modal-header {
        padding: 1rem;
    }
    
    .fullscreen-modal-header h2 {
        font-size: 1.2rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-toggle {
        margin-left: 0;
        justify-content: center;
    }
    
    .games-container {
        grid-template-columns: 1fr;
    }
    
    .game-card.list-view {
        flex-direction: column;
        text-align: center;
    }
    
    .game-card.list-view .game-image {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
    }
    
    .filters-section {
        padding: 1rem;
    }
    
    .game-info {
        padding: 1rem;
    }
}

/* ==========================================================================
   Navigation, home page and static pages
   ========================================================================== */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --ink: #2d3748;
    --muted: #718096;
    --line: #e2e8f0;
    --radius: 15px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Accessibility helpers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 5000;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #ffe082;
    outline-offset: 2px;
}

/* Header navigation */
.header-content {
    gap: 1.25rem;
}

.logo {
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
}

.header .site-title {
    font-size: 1.45rem;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    color: #4a5568;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: #f0f2ff;
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.header .search-container {
    max-width: 320px;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.nav-toggle:hover {
    border-color: var(--primary);
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #4a5568;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.header.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.header.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Shared buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.8rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-light {
    background: #ffffff;
    color: #5a45b8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.btn-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.65);
    color: #ffffff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.16);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.35);
}

/* Home hero */
.home-main {
    padding: 0;
}

.hero {
    padding: 3.5rem 0 2.5rem;
    color: #ffffff;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.85rem;
    font-weight: 500;
}

.hero-title {
    margin: 1.1rem 0 0;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.hero-highlight {
    color: #ffe082;
}

.hero-subtitle {
    max-width: 560px;
    margin: 1.1rem 0 2rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-visual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.hero-tile {
    padding: 1.3rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    animation: heroFloat 6s ease-in-out infinite;
}

.hero-tile:nth-child(2) {
    animation-delay: 1.2s;
}

.hero-tile:nth-child(3) {
    animation-delay: 2.1s;
}

.hero-tile:nth-child(4) {
    animation-delay: 3s;
}

.hero-tile i {
    font-size: 1.7rem;
    color: #ffe082;
}

.hero-tile span {
    display: block;
    margin-top: 0.6rem;
    font-weight: 600;
}

@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-tile {
        animation: none;
    }
}

/* Stats */
.stats-strip {
    padding-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.stat-item {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #ffffff;
}

.stat-item + .stat-item {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

/* Home sections */
.section {
    padding: 2.75rem 0;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    color: #ffffff;
}

.section-header-centered {
    justify-content: center;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
}

.section-subtitle {
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.98rem;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.section-link:hover {
    color: #ffe082;
}

.games-container .loading {
    grid-column: 1 / -1;
}

/* Category cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1.35rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 0.55rem;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.15rem;
}

.category-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.category-count {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Feature cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    padding: 1.75rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.4rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--ink);
    font-size: 1.15rem;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* CTA banner */
.cta-banner {
    padding: 2.75rem 2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
    text-align: center;
}

.cta-banner h2 {
    color: var(--ink);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.cta-banner p {
    margin: 0.5rem auto 1.5rem;
    max-width: 520px;
    color: var(--muted);
}

.cta-banner-inline {
    margin-top: 1.5rem;
}

/* Page hero (list, detail, static pages) */
.page-hero {
    padding: 0 0 1.5rem;
    color: #ffffff;
}

.page-hero h1 {
    margin-bottom: 0.4rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
}

.page-hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.02rem;
}

.page-hero-compact h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.breadcrumb a {
    color: #ffffff;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #ffe082;
    text-decoration: underline;
}

.breadcrumb-dark {
    color: rgba(255, 255, 255, 0.85);
}

/* Game cards as links */
.game-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.game-card.list-view .play-button {
    position: static;
    transform: none;
    opacity: 1;
    flex-shrink: 0;
    margin-left: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.game-card:active {
    transform: scale(0.995);
}

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

.recommended-game-image i {
    font-size: 2.4rem;
    color: #ffffff;
    opacity: 0.85;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Detail page additions */
.back-to-home-btn {
    text-decoration: none;
}

.detail-section-title {
    margin-bottom: 1.5rem;
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 600;
}

.recommended-games-section .detail-section-title {
    font-size: 1.8rem;
    text-align: center;
}

/* Static content pages */
.content-main {
    padding-bottom: 0;
}

.content-page {
    padding-bottom: 3.5rem;
}

.content-card {
    padding: 2.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
    color: #4a5568;
}

.content-card + .content-card,
.contact-grid + .content-card {
    margin-top: 1.5rem;
}

.content-title {
    margin-bottom: 1rem;
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 600;
}

.content-card > p {
    margin-bottom: 1rem;
}

.content-card > p:last-child {
    margin-bottom: 0;
}

/* Prose (about + privacy) */
.prose h2 {
    margin: 1.8rem 0 0.75rem;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 600;
}

.prose h2:first-of-type {
    margin-top: 0;
}

.prose h3 {
    margin: 1.2rem 0 0.5rem;
    color: var(--ink);
    font-size: 1.08rem;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul {
    margin: 0 0 1rem 1.25rem;
}

.prose li {
    margin-bottom: 0.45rem;
}

.prose a {
    color: var(--primary);
    font-weight: 500;
}

.policy-updated {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #4a5568;
    font-size: 0.9rem;
}

.value-list li {
    padding-left: 0.2rem;
}

/* About page */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.about-card {
    padding: 1.4rem;
    border: 1px solid rgba(102, 126, 234, 0.16);
    border-radius: 14px;
    background: rgba(102, 126, 234, 0.07);
}

.about-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.1rem;
}

.about-card h3 {
    margin-bottom: 0.4rem;
    color: var(--ink);
    font-size: 1.08rem;
}

.about-card p {
    color: var(--muted);
    font-size: 0.94rem;
}

/* Contact page */
.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.contact-info {
    padding: 2.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
}

.contact-info .content-title {
    margin-bottom: 1.25rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: 14px;
    background: rgba(102, 126, 234, 0.07);
}

.contact-item + .contact-item {
    margin-top: 1rem;
}

.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.05rem;
}

.contact-item h3 {
    margin-bottom: 0.25rem;
    color: var(--ink);
    font-size: 1rem;
}

.contact-item p {
    color: var(--muted);
    font-size: 0.94rem;
}

.contact-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-form-card {
    padding: 2.2rem;
}

.form-hint {
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 0.97rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.16);
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

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

.form-status {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.form-status-success {
    color: #2f855a;
    font-weight: 500;
}

.form-status-error {
    color: #c53030;
    font-weight: 500;
}

/* Footer */
.site-footer {
    padding: 2.5rem 0 0;
    text-align: left;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-brand .site-title {
    font-size: 1.3rem;
}

.footer-brand p {
    max-width: 360px;
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.footer-col h4 {
    margin-bottom: 0.85rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    list-style: none;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.94rem;
    text-decoration: none;
}

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

.footer-bottom {
    padding: 1.1rem 0;
    border-top: 1px solid var(--line);
}

.footer-bottom p {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Detail page refinements */
.game-detail-container {
    padding-top: 0;
}

.error-container h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

/* Responsive: navigation and new page layouts */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        text-align: left;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        order: 3;
        display: none;
        width: 100%;
        padding-top: 0.35rem;
        border-top: 1px solid var(--line);
    }

    .header.nav-open .main-nav {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.35rem 0;
    }

    .nav-link {
        padding: 0.9rem 1rem;
        border-radius: 10px;
        font-size: 1rem;
    }

    .header .search-container {
        order: 4;
        width: 100%;
        max-width: 100%;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-visual {
        max-width: 460px;
    }

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

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

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .section {
        padding: 2.25rem 0;
    }

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

    .section-header-centered {
        align-items: center;
    }

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

    .stat-item + .stat-item {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-left: none;
    }

    .stat-number {
        font-size: 1.7rem;
    }

    .feature-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .content-card,
    .contact-info,
    .contact-form-card {
        padding: 1.5rem;
    }

    .game-card.list-view .play-button {
        margin: 1rem 0 0;
    }
}

@media (max-width: 480px) {
    .header .site-title {
        font-size: 1.15rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

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

    .hero-tile {
        padding: 1rem;
    }

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

@media (max-width: 360px) {
    .header .site-title {
        font-size: 1rem;
    }
}