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

:root {
    --bg: #F3F1F8;
    --card-bg: #ECEAF4;
    --card-bg-hover: #E3E0EE;
    --surface: #FFFFFF;
    --accent: #6C63FF;
    --accent-light: #8B85FF;
    --accent-soft: rgba(108, 99, 255, 0.12);
    --accent-softer: rgba(108, 99, 255, 0.06);
    --text: #2D2B3A;
    --text-secondary: #8E8BA0;
    --text-tertiary: #B5B2C6;
    --border: rgba(108, 99, 255, 0.08);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================
   NAV
   ============================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(243, 241, 248, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

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

/* ============================
   HERO
   ============================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 520px;
}

.hero-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 420px;
    margin-bottom: 32px;
}

.hero-cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

.hero-cta:hover {
    background: var(--accent-light);
    transform: scale(1.04);
}

.hero-cta:active {
    transform: scale(0.97);
}

/* Hero visual — abstract falling blocks */
.hero-visual {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(3, 64px);
    gap: 10px;
}

.grid-block {
    border-radius: var(--radius-sm);
    animation: float 4s ease-in-out infinite;
}

.b1 { background: var(--accent); opacity: 0.9; animation-delay: 0s; }
.b2 { background: var(--accent-light); opacity: 0.7; animation-delay: 0.3s; }
.b3 { background: var(--accent); opacity: 0.5; animation-delay: 0.6s; }
.b4 { background: var(--accent-light); opacity: 0.6; animation-delay: 0.15s; }
.b5 { background: var(--accent); opacity: 1; animation-delay: 0.45s; }
.b6 { background: var(--accent-light); opacity: 0.8; animation-delay: 0.75s; }
.b7 { background: var(--accent); opacity: 0.4; animation-delay: 0.2s; }
.b8 { background: var(--accent-light); opacity: 0.65; animation-delay: 0.5s; }
.b9 { background: var(--accent); opacity: 0.85; animation-delay: 0.7s; }

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

/* ============================
   SECTIONS — shared
   ============================ */
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 100px 24px;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 48px;
}

/* ============================
   GAMES
   ============================ */
.games {
    background: var(--surface);
}

.game-card {
    display: flex;
    gap: 48px;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    border: 1px solid var(--border);
}

.game-card-visual {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-preview {
    width: 240px;
    height: 300px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.game-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, var(--accent-soft) 100%);
}

.preview-blocks {
    display: grid;
    grid-template-columns: repeat(4, 36px);
    grid-template-rows: repeat(3, 36px);
    gap: 4px;
    position: relative;
    z-index: 1;
}

.pb {
    border-radius: 6px;
    animation: float 3s ease-in-out infinite;
}

.r1c1 { grid-column: 1; grid-row: 1; background: var(--accent); animation-delay: 0.1s; }
.r1c2 { grid-column: 2; grid-row: 1; background: var(--accent); animation-delay: 0.2s; }
.r2c1 { grid-column: 1; grid-row: 2; background: var(--accent-light); animation-delay: 0.3s; }
.r2c2 { grid-column: 2; grid-row: 2; background: var(--accent-light); animation-delay: 0.4s; }
.r2c3 { grid-column: 3; grid-row: 2; background: var(--accent); animation-delay: 0.5s; }
.r3c2 { grid-column: 2; grid-row: 3; background: var(--accent); opacity: 0.7; animation-delay: 0.6s; }
.r3c3 { grid-column: 3; grid-row: 3; background: var(--accent-light); opacity: 0.8; animation-delay: 0.7s; }
.r3c4 { grid-column: 4; grid-row: 3; background: var(--accent); animation-delay: 0.8s; }

.game-card-info {
    flex: 1;
}

.game-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}

.game-name {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.game-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 440px;
}

.game-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.mode-pill {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.game-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.store-badge img {
    display: block;
    height: 44px;
    width: auto;
}

.store-badge:hover {
    opacity: 0.85;
    transform: scale(1.04);
}

.store-badge:active {
    transform: scale(0.97);
}

/* ============================
   ABOUT
   ============================ */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-card:hover {
    transform: translateY(-4px);
}

.about-icon {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--accent);
}

.about-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.about-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================
   CONTACT
   ============================ */
.contact {
    background: var(--surface);
    text-align: center;
}

.contact .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    margin-top: -32px;
}

.contact-email {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 14px 32px;
    border-radius: var(--radius-md);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

.contact-email:hover {
    background: var(--accent-softer);
    transform: scale(1.04);
}

/* ============================
   FOOTER
   ============================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
}

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

.footer-logo {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.3px;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================
   TOAST
   ============================ */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: var(--surface);
    font-size: 14px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    z-index: 200;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================
   CLICK RIPPLE
   ============================ */
.ripple-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.click-ripple {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.25) 0%, rgba(108, 99, 255, 0) 80%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    animation: ripple-expand 0.6s ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* ============================
   SCROLL ANIMATIONS
   ============================ */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   RESPONSIVE — Tablet
   ============================ */
@media (max-width: 860px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
        gap: 40px;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .game-card {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .game-card-visual {
        flex: 0 0 auto;
    }

    .game-card-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .game-modes {
        justify-content: center;
    }

    .game-buttons {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
    }
}

/* ============================
   RESPONSIVE — Mobile
   ============================ */
@media (max-width: 520px) {
    .nav-inner {
        padding: 0 16px;
        height: 56px;
    }

    .nav-links {
        gap: 20px;
    }

    .section-inner {
        padding: 72px 16px;
    }

    .hero {
        padding: 100px 16px 48px;
        min-height: auto;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero-grid {
        grid-template-columns: repeat(3, 48px);
        grid-template-rows: repeat(3, 48px);
        gap: 8px;
    }

    .game-card {
        padding: 24px;
        gap: 32px;
    }

    .game-preview {
        width: 200px;
        height: 240px;
    }

    .preview-blocks {
        grid-template-columns: repeat(4, 28px);
        grid-template-rows: repeat(3, 28px);
    }

    .game-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .store-badge img {
        height: 36px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
