:root {
    --primary-color: #ff416c;
    --secondary-color: #00bcd4;
    --dark-bg: #1e1e2f;
    --light-bg: #f4f7fa;
    --text-dark: #333;
    --text-light: #fdfdfd;
    --border-radius: 12px;
    --gradient-primary: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --gradient-accent: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header & Navbar */
header {
    background-color: var(--dark-bg);
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
}

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

.language-switcher select {
    background-color: #4a5a6a;
    color: var(--text-light);
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    color: var(--text-light);
    padding: 8rem 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 118, 117, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideInUp 0.8s ease-out;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 400;
    letter-spacing: 0.5px;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: var(--text-light);
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out 0.4s both;
}

.btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-cta:hover::before {
    left: 100%;
}

.btn-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.6);
}

.btn-cta:active {
    transform: translateY(-1px) scale(1.02);
}

/* Add floating particles effect */
.hero::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    top: 20%;
    left: 10%;
    animation: particle1 4s infinite ease-in-out;
}

@keyframes particle1 {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-20px) translateX(10px);
        opacity: 1;
    }
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2.125rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-bg);
}

/* Game Grid & Cards */
#game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.game-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

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

.game-card-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem;
    text-align: center;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.controls input[type="search"],
.controls select {
    padding: 0.6rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
}

.controls input[type="search"]:focus,
.controls select:focus {
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* --- Play Page Styles --- */
.play-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.7);
    transform: scale(1.1);
    z-index: -1;
}

.game-launch-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 70px); /* Adjust for header height */
    padding: 20px;
    position: relative;
    z-index: 1;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.game-launch-card {
    background-color: rgba(30, 30, 50, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.game-cover-xl {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.launch-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.launch-category {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.launch-description {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.btn-gradient {
    background-image: var(--gradient-accent);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-frame-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-frame-container.hidden {
    display: none;
}

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

/* Overlay back button when game is open */
.overlay-back-button {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1001;
    color: #fff;
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.overlay-back-button:hover {
    background-color: rgba(0, 0, 0, 0.65);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }

    #game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .game-launch-card {
        padding: 20px;
        max-width: 90%;
    }

    .launch-title {
        font-size: 1.5rem;
    }

    .hero {
        padding: 6rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .btn-cta {
        padding: 14px 32px;
        font-size: 1rem;
    }
}
