/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-pink: #FF90A1;
    --primary-cyan: #A0F3F6;
    --white: #FFFFFF;
    --black: #000000;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-cyan) 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(255, 144, 161, 0.1) 0%, rgba(160, 243, 246, 0.1) 100%);
    
    /* Neutrals */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Spacing */
    --container-width: 1400px;
    --padding-section: 80px;
    --padding-mobile: 40px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .studio {
    font-weight: 600;
    opacity: 0.8;
}

nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: color var(--transition-fast);
}

nav a:hover {
    color: var(--primary-pink);
}

.cta-btn {
    background: var(--gradient-primary);
    color: var(--white) !important;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--gradient-overlay);
    padding: var(--padding-section) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 144, 161, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(160, 243, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 25s infinite ease-in-out reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.hero-title .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--gray-700);
    max-width: 600px;
    margin: 0 auto 40px;
}

.scroll-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ============================================
   GAMES SECTION
   ============================================ */
.games-section {
    padding: var(--padding-section) 0;
    min-height: 600px;
}

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

/* Loading State */
.loading-state, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p, .empty-state p {
    color: var(--gray-700);
    font-size: 18px;
}

/* Empty State */
.empty-state svg {
    stroke: var(--gray-200);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--gray-900);
}

/* Game Card */
.game-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

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

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.play-icon {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

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

.play-icon svg {
    width: 36px;
    height: 36px;
    fill: var(--primary-pink);
    margin-left: 4px;
}

.game-info {
    padding: 24px;
}

.game-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.game-description {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    width: 95vw;
    height: 95vh;
    max-width: 1600px;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
    display: flex;
    flex-direction: column;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.modal-close:hover {
    transform: scale(1.1);
    background: var(--gray-100);
}

.modal-close svg {
    stroke: var(--gray-700);
}

.modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

#modal-game-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

.fullscreen-btn {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.fullscreen-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary-pink);
    color: var(--primary-pink);
}

.fullscreen-btn svg {
    stroke: currentColor;
}

.game-frame-container {
    flex: 1;
    position: relative;
    background: var(--black);
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.game-loading {
    position: absolute;
    inset: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.game-loading.hidden {
    display: none;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

footer p {
    margin-bottom: 8px;
}

.footer-tagline {
    color: var(--gray-200);
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    :root {
        --padding-section: 60px;
    }
    
    .hero-title {
        font-size: 40px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    nav {
        gap: 16px;
    }
    
    nav a:not(.cta-btn) {
        display: none;
    }
    
    .modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    #modal-game-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .fullscreen-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}
