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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;

    --tile-red: #ef4444;
    --tile-blue: #3b82f6;
    --tile-yellow: #eab308;
    --tile-black: #1e293b;

    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 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);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--dark);
    background-image: url('assets/darker-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

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

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); text-align: center; margin-bottom: 3rem; }
h3 { font-size: 1.25rem; }

.hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 800;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.5), 0 0 80px rgba(236, 72, 153, 0.3);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
    filter: drop-shadow(0 0 30px rgba(192, 132, 252, 0.5));
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
}

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

.nav-links a {
    color: var(--gray-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--white);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--gradient);
    color: var(--white);
}

.btn-small:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Language Selector */
.lang-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-selector select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray);
    color: var(--light);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lang-selector select:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.lang-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.lang-selector::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-light);
    pointer-events: none;
}

.lang-selector select option {
    background: var(--dark);
    color: var(--light);
    padding: 0.5rem;
}

/* Hero Section */
.hero-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: float-orb 8s ease-in-out infinite;
}

.hero-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: float-orb 8s ease-in-out infinite reverse;
}

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

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    animation: fade-in-up 1s ease-out;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--light);
    margin: 1.5rem 0 2.5rem;
    line-height: 1.7;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.store-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.store-badge {
    display: block;
    height: 50px;
    transition: transform 0.2s, opacity 0.2s;
}

.store-badge img {
    height: 100%;
    width: auto;
    display: block;
}

.store-badge:hover {
    transform: translateY(-3px) scale(1.02);
    opacity: 0.95;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fade-in-up 1s ease-out 0.3s backwards;
}

/* Phone Mockup */
.phone-mockup {
    width: 280px;
    height: 580px;
    background: linear-gradient(145deg, #3d4a5c, #1a202c);
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(99, 102, 241, 0.4),
        0 0 150px rgba(236, 72, 153, 0.2);
    position: relative;
    animation: phone-float 6s ease-in-out infinite;
}

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

.phone-mockup::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 24px;
    background: #0f172a;
    border-radius: 20px;
    z-index: 10;
}

.phone-mockup::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 42px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), transparent 50%);
    pointer-events: none;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.phone-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.game-preview {
    display: flex;
    gap: 8px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.tile {
    width: 50px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow);
    animation: float 3s ease-in-out infinite;
}

.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.4s; }
.tile:nth-child(4) { animation-delay: 0.6s; }

.tile-red { background: var(--tile-red); }
.tile-blue { background: var(--tile-blue); }
.tile-yellow { background: var(--tile-yellow); color: #1e293b; }
.tile-black { background: var(--tile-black); border: 2px solid #334155; }

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

/* Features Section */
.features {
    padding: 100px 24px;
    background: rgba(30, 41, 59, 0.85);
}

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

.feature-card {
    background: var(--dark);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--gray-light);
}

/* How to Play Section */
.how-to-play {
    padding: 100px 24px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

.step h3 {
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--gray-light);
}

/* Screenshots Section */
.screenshots {
    padding: 100px 24px;
    background: rgba(30, 41, 59, 0.85);
}

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

.screenshot-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--dark);
    transition: transform 0.3s, box-shadow 0.3s;
}

.screenshot-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.2);
}

.screenshot-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px 16px 0 0;
}

.screenshot-label {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--light);
    background: var(--dark);
}

/* Download Section */
.download {
    padding: 100px 24px;
    text-align: center;
    background: var(--gradient);
}

.download h2 {
    color: var(--white);
}

.download p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.download .store-badge {
    border-radius: 8px;
}

.download .store-badges {
    justify-content: center;
}

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0.95);
    padding: 60px 24px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--gray-light);
    margin-top: 0.5rem;
}

.footer-logo {
    height: 45px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
}

/* Legal Pages (Privacy Policy, Terms, etc.) */
.legal-page {
    padding: 120px 24px 80px;
    min-height: calc(100vh - 200px);
}

.legal-page h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.5rem;
}

.legal-page .last-updated {
    color: var(--gray-light);
    margin-bottom: 3rem;
}

.legal-content {
    max-width: 800px;
    background: rgba(30, 41, 59, 0.7);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-content h2 {
    font-size: 1.5rem;
    text-align: left;
    margin: 2rem 0 1rem;
    color: var(--white);
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--light);
}

.legal-content p {
    color: var(--gray-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
    color: var(--gray-light);
    margin: 0 0 1rem 1.5rem;
    line-height: 1.8;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content ol {
    list-style-type: decimal;
}

.legal-content a {
    color: var(--primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        order: 1;
    }

    .hero-image {
        order: 0;
        margin-bottom: 2rem;
    }

    .store-badges {
        justify-content: center;
    }

    .phone-mockup {
        width: 220px;
        height: 460px;
    }

    .tile {
        width: 40px;
        height: 56px;
        font-size: 1.25rem;
    }

    .nav-links a:not(.btn) {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .store-badges {
        flex-direction: column;
        align-items: center;
    }

    .phone-mockup {
        width: 200px;
        height: 420px;
    }
}
