/* --- GLOBAL VARIABLES & FONTS --- */
:root {
    --bg-top: #548C90;
    --bg-bottom: #3A757A;
    --accent-pink: #FF8A80;
    --accent-cream: #FFF3E0;
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-card-bg: rgba(0, 0, 0, 0.15);
    
    /* Default Font (English) */
    --main-font: 'Fredoka', sans-serif;
}

/* Farsi Override */
html[lang="fa"] {
    --main-font: 'Vazirmatn', sans-serif;
}

/* --- RESET & BASICS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--main-font);
    background: radial-gradient(circle at center top, #5faeb5 0%, #326c74 100%);
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
    color: var(--accent-cream);
    overflow-x: hidden;
    
    /* LOGICAL PROPERTY: Automatically aligns Left for EN and Right for FA */
    text-align: start; 
}

/* --- BACKGROUND --- */
.background-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

.star {
    position: absolute; background: #fff; border-radius: 50%;
    opacity: 0.8; animation: twinkle 4s infinite ease-in-out;
}
/* Star positions remain absolute as they are decorative */
.s1 { top: 10%; left: 10%; width: 3px; height: 3px; }
.s2 { top: 20%; right: 20%; width: 4px; height: 4px; }
.s3 { top: 60%; left: 5%; width: 2px; height: 2px; }
.s4 { bottom: 15%; right: 10%; width: 3px; height: 3px; }
.s5 { top: 40%; left: 50%; width: 2px; height: 2px; }

.planet-bg { position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.7; }
.p1 { top: 15%; left: 12%; width: 40px; height: 40px; background: #a65c5c; }
.p2 { bottom: 30%; right: 8%; width: 25px; height: 25px; background: #FF8A80; }

/* --- NAVIGATION --- */
header {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 90%;
    max-width: 900px;
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.brand {
    display: flex;
    align-items: center;
    /* Removed gap, handling spacing via margin on image for better control */
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

/* Farsi Brand Tweaks */
html[lang="fa"] .brand { font-weight: 700; font-size: 1.2rem; }

/* UPDATED: Targets the IMG tag now, not SVG */
.brand img {
    height: 40px; /* Slightly larger for visibility */
    width: auto;
    vertical-align: middle;
    /* LOGICAL PROPERTY: Adds margin to the "End" of the icon (Right in EN, Left in FA) */
    margin-inline-end: 10px; 
}

.nav-links { display: flex; gap: 25px; align-items: center; }

.nav-links a {
    text-decoration: none;
    color: var(--accent-cream);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-links a:hover { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.5); }

.lang-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem; line-height: 1;
    text-decoration: none; color: #fff;
    font-family: 'Fredoka', sans-serif; /* Always Fredoka for "EN/FA" text */
}

.lang-btn:hover { background: var(--accent-pink); border-color: var(--accent-pink); }
.lang-btn svg { width: 16px; height: 16px; }

/* --- LAYOUT --- */
section {
    min-height: 100vh; width: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 80px 20px;
}

.container {
    width: 100%; max-width: 1000px; margin: 0 auto;
    text-align: center;
}

h2 {
    font-size: 2.5rem; margin-bottom: 40px;
    color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.glass-card {
    background: var(--glass-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* --- SECTIONS --- */
#home { padding-top: 120px; }

.hero-planet {
    width: 100%; max-width: 350px; 
    margin-left: auto; margin-right: auto; margin-bottom: 30px;
    animation: floatMain 6s ease-in-out infinite; 
    display: block; 
}

/* UPDATED: Ensures the image fits the container */
.hero-planet img {
    width: 100%;
    height: auto;
    display: block;
}

h1 {
    font-size: 3.5rem; line-height: 1.2; font-weight: 600;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2); margin-bottom: 20px;
}
html[lang="fa"] h1 { line-height: 1.4; font-weight: 700; }

.hero-subtitle { font-size: 1.2rem; opacity: 0.9; }

/* --- GAMES SECTION --- */
.game-layout {
    display: flex; align-items: center; gap: 50px;
    /* LOGICAL PROPERTY: Text aligns to Start (Left in EN, Right in FA) */
    text-align: start; 
}

.game-visual {
    flex: 1; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: transform 0.3s ease;
}
.game-visual:hover { transform: scale(1.02); }

/* UPDATED: Targets the IMG tag */
.game-visual img { 
    width: 100%; 
    height: auto; 
    display: block; 
}

.game-info { flex: 1; }
.game-info h3 { font-size: 2rem; margin-bottom: 15px; color: var(--accent-pink); }
.game-info p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 25px; opacity: 0.9; }
html[lang="fa"] .game-info p { line-height: 1.8; }

.btn {
    display: inline-block; background: var(--accent-pink);
    color: #fff; padding: 12px 30px; border-radius: 50px;
    text-decoration: none; font-weight: 600;
    transition: all 0.3s; border: none; cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 138, 128, 0.4);
    font-family: inherit; /* Inherits Vazirmatn in FA */
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255, 138, 128, 0.6); }

/* --- FORMS & FOOTER --- */
.about-content { max-width: 700px; margin: 0 auto; }
.about-content p { font-size: 1.2rem; line-height: 1.8; margin-bottom: 20px; }

.form-wrapper { max-width: 500px; margin: 0 auto; width: 100%; }
.input-group { display: flex; flex-direction: column; gap: 15px; }

input[type="email"], input[type="text"] {
    padding: 15px 20px; border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.1); color: #fff;
    font-size: 1rem; outline: none; transition: 0.3s;
    font-family: inherit;
    
    /* LOGICAL PROPERTY: Input text aligns correctly per language */
    text-align: start; 
}
input:focus { border-color: var(--accent-pink); background: rgba(0,0,0,0.2); }

footer { padding: 50px 20px; background: rgba(0,0,0,0.2); text-align: center; }
.social-icons { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.social-icons a {
    width: 50px; height: 50px; background: rgba(255,255,255,0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: 0.3s; border: 1px solid rgba(255,255,255,0.2);
}
.social-icons a:hover { background: var(--accent-pink); transform: translateY(-3px); }
.social-icons svg { width: 24px; height: 24px; fill: #fff; }

/* --- ANIMATIONS --- */
@keyframes floatMain {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* --- RESPONSIVE --- */
.mobile-only { display: none; }
.desktop-only { display: flex; }

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .mobile-only { display: flex; }
    .desktop-only { display: none; }

    .glass-nav {
        padding: 10px 15px; flex-wrap: wrap;
        justify-content: center; gap: 10px; position: relative;
    }

    .brand { width: 100%; justify-content: center; margin-bottom: 5px; }

    .mobile-only {
        position: absolute;
        top: 12px;
        /* LOGICAL PROPERTY: Puts button on Right in EN, Left in FA */
        inset-inline-end: 20px; 
    }

    .nav-links {
        width: 100%; overflow-x: auto;
        justify-content: flex-start; padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }
    .nav-links::-webkit-scrollbar { display: none; }

    .game-layout { flex-direction: column; }
    .game-visual { width: 100%; }
    
    /* Make sure the logo doesn't get too huge on mobile */
    .hero-planet { width: 220px; height: auto; }
}