:root {
    --primary-green: #7CB342;
    --dark-green: #355B2E;
    --bg-light: #F9FBE7;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

header {
    padding: 24px 0;
    background: transparent;
    position: absolute;
    width: 100%;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-green);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-flag {
    width: 3px;
    height: 28px;
    background: #EBEDC9;
    position: relative;
    margin-left: 8px;
    border-radius: 4px;
    transform-origin: bottom center;
    animation: flagSway 4s ease-in-out infinite;
}

.logo-flag::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 10px;
    background: #FF8A65;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    animation: flagWave 2s ease-in-out infinite;
    transform-origin: left center;
}

@keyframes flagSway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes flagWave {
    0%, 100% { transform: scaleX(1) skewY(0deg); }
    50% { transform: scaleX(0.8) skewY(5deg); }
}

.logo span {
    display: inline-block;
    transform-origin: center;
}

.logo span:first-child {
    color: var(--dark-green);
    animation: puttWiggle 2.5s ease-in-out infinite;
}

.logo span:last-child {
    color: var(--primary-green);
    animation: popWiggle 2.5s ease-in-out infinite;
}

@keyframes puttWiggle {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    33% { transform: rotate(-6deg) translateY(-4px) scale(1.05); }
    66% { transform: rotate(3deg) translateY(2px) scale(0.98); }
}

@keyframes popWiggle {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    33% { transform: rotate(6deg) translateY(4px) scale(0.95); }
    66% { transform: rotate(-3deg) translateY(-2px) scale(1.02); }
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
}

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

/* Page Layouts */
main {
    padding-top: 0;
}

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    background: linear-gradient(135deg, #F9FBE7 0%, #F1F8E9 100%);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 82px;
    line-height: 1.1;
    color: var(--dark-green);
    margin-bottom: 24px;
    font-weight: 800;
}

.hero p {
    font-size: 22px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.btn {
    display: inline-block;
    padding: 18px 48px;
    background-color: var(--dark-green);
    color: var(--white);
    text-decoration: none;
    border-radius: 99px;
    font-weight: 700;
    font-size: 20px;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(53, 91, 46, 0.2);
}

.btn:hover {
    transform: translateY(-4px) scale(1.05);
    background-color: var(--primary-green);
    box-shadow: 0 15px 30px rgba(53, 91, 46, 0.3);
}

/* App Store Buttons */
.store-badges {
    margin-top: 54px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.app-store-btn {
    background-color: #000;
    color: #fff;
    padding: 12px 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    border: 1.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    text-decoration: none;
}

.app-store-btn:not(.coming-soon):hover {
    transform: translateY(-5px);
    background-color: #111;
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.2);
}

.app-store-btn.coming-soon {
    opacity: 0.5;
    filter: grayscale(0.8);
    cursor: default;
}

.app-store-btn .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-store-btn .text {
    text-align: left;
}

.app-store-btn .text .small {
    display: block;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: -2px;
    opacity: 0.9;
}

.app-store-btn .text .large {
    display: block;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Content Pages */
.page-content {
    padding: 160px 0 100px;
}

.page-title {
    font-size: 64px;
    color: var(--dark-green);
    margin-bottom: 60px;
    font-weight: 800;
}

.content-section {
    padding: 120px 0;
}


.content-box h1 {
    font-size: 48px;
    color: var(--dark-green);
    margin-bottom: 40px;
}

.content-box h2 {
    font-size: 32px;
    color: var(--dark-green);
    margin: 40px 0 20px;
}

.content-box h3 {
    font-size: 24px;
    color: var(--dark-green);
    margin: 32px 0 16px;
}

.content-box p {
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--text-muted);
}

/* Footer Styling */
footer {
    padding: 160px 0 40px;
    background-color: var(--dark-green);
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 80px;
    margin-bottom: 80px;
}

.footer-logo {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
}

.footer-links h4 {
    font-size: 20px;
    margin-bottom: 24px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

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

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}

/* Screenshot Gallery */
.gallery {
    padding: 100px 0;
    overflow: hidden;
}

.screenshot-track {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    padding: 60px 10vw;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.screenshot-track::-webkit-scrollbar {
    display: none;
}

.screenshot-card {
    flex: 0 0 280px;
    height: 600px;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(53, 91, 46, 0.12);
    scroll-snap-align: center;
    transition: var(--transition);
    background: #000;
}

.screenshot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.screenshot-card:hover {
    transform: translateY(-12px) scale(1.01);
    box-shadow: 0 40px 80px rgba(53, 91, 46, 0.18);
}

/* Mechanics Section & Animations */
.mechanics {
    padding: 100px 0;
}

.physics-stage-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.grid-3x3 {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 360px;
    height: 360px;
    margin: 0 auto;
    background: #7CB342;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(53, 91, 46, 0.15);
}

.tile {
    width: 120px;
    height: 120px;
}

.tile-light { background-color: #B2D864; }
.tile-dark { background-color: #A3D14D; }

/* Hole & Flag */
.hole-tile {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 120px;
    height: 120px;
}

.hole {
    width: 68px;
    height: 68px;
    background: #2D3A22;
    border-radius: 50%;
    border: 4px solid #EBEDC9;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: inset 0 6px 12px rgba(0,0,0,0.3);
    z-index: 5;
}

.flag {
    width: 6px;
    height: 48px;
    background: #F6F7DB;
    position: absolute;
    bottom: 24px; /* Higher anchor for visibility */
    left: calc(50% - 3px);
    border-radius: 99px;
    transform-origin: bottom center;
    animation: flagSway 4s ease-in-out infinite;
}

.flag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 20px;
    height: 14px;
    background: #FF8A65;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    animation: flagWave 2s ease-in-out infinite;
    transform-origin: left center;
}

.confetti-burst {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -20px;
    left: -20px;
    pointer-events: none;
    z-index: 20;
}

.confetti-burst div {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
}

.confetti-burst .c1 { background: #FFD54F; left: 50%; top: 50%; animation: burst-1 6s infinite; }
.confetti-burst .c2 { background: #4DD0E1; left: 50%; top: 50%; animation: burst-2 6s infinite; }
.confetti-burst .c3 { background: #FF8A65; left: 50%; top: 50%; animation: burst-3 6s infinite; }
.confetti-burst .c4 { background: #FFFFFF; left: 50%; top: 50%; animation: burst-4 6s infinite; }

@keyframes burst-1 { 75% { opacity: 0; transform: translate(0,0); } 80% { opacity: 1; transform: translate(-30px, -40px) rotate(45deg); } 90% { opacity: 0; } }
@keyframes burst-2 { 75% { opacity: 0; transform: translate(0,0); } 80% { opacity: 1; transform: translate(30px, -40px) rotate(-45deg); } 90% { opacity: 0; } }
@keyframes burst-3 { 75% { opacity: 0; transform: translate(0,0); } 80% { opacity: 1; transform: translate(-20px, -60px) rotate(20deg); } 90% { opacity: 0; } }
@keyframes burst-4 { 75% { opacity: 0; transform: translate(0,0); } 80% { opacity: 1; transform: translate(20px, -60px) rotate(-20deg); } 90% { opacity: 0; } }

.physics-ball {
    position: absolute;
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 20px;
    color: #2D3A22;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 10;
    animation: real-game-loop 6s ease-in-out infinite;
}

.mirror {
    width: 72px;
    height: 72px;
    background: #355B2E;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
    border: 2px solid #B2D864;
    animation: mirror-rotate 6s ease-in-out infinite;
}

.mirror-container {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hand-icon {
    position: absolute;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.4);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 256c0-114.9-93.1-208-208-208S48 141.1 48 256s93.1 208 208 208 208-93.1 208-208zm-208 160c-88.4 0-160-71.6-160-160s71.6-160 160-160 160 71.6 160 160-71.6 160-160 160z"/></svg>') no-repeat center;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 256c0-114.9-93.1-208-208-208S48 141.1 48 256s93.1 208 208 208 208-93.1 208-208zm-208 160c-88.4 0-160-71.6-160-160s71.6-160 160-160 160 71.6 160 160-71.6 160-160 160z"/></svg>') no-repeat center;
    background-size: contain;
    z-index: 20;
    backdrop-filter: blur(2px);
    animation: hand-tap 6s ease-in-out infinite;
}

@keyframes mirror-rotate {
    0%, 15% { transform: rotate(0deg); }
    30%, 100% { transform: rotate(-90deg); }
}

@keyframes hand-tap {
    0% { opacity: 0; transform: translate(20px, 20px) scale(0.8); }
    10% { opacity: 1; transform: translate(0, 0) scale(1.1); }
    18% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 0; }
}

@keyframes real-game-loop {
    0%, 35% { left: 36px; top: 276px; opacity: 0; transform: scale(0.8); }
    38% { opacity: 1; transform: scale(1); }
    55% { left: 276px; top: 276px; }
    75% { left: 276px; top: 36px; opacity: 1; transform: scale(1); }
    85% { left: 276px; top: 36px; opacity: 0; transform: scale(0.5); }
    100% { opacity: 0; }
}

/* Feature Section Spacing */
.features {
    padding: 120px 0 160px; /* Strong bottom padding for card-to-footer gap */
    background-color: var(--bg-light);
    position: relative;
    z-index: 5;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.content-box {
    position: relative;
    background: var(--white);
    padding: 60px 40px;
    border-radius: 32px;
    text-align: left;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.03);
}

.features-grid .content-box {
    text-align: center;
}

.content-box ul {
    margin-bottom: 24px;
    padding-left: 24px;
    list-style-type: disc;
}

.content-box li {
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--text-muted);
}

.content-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(53, 91, 46, 0.12);
}

.card-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(124, 179, 66, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 179, 66, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.feature-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.grid-icon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 48px;
    height: 48px;
}

.grid-icon span {
    background: #7CB342;
    border-radius: 4px;
    transition: 0.3s ease;
}

.content-box:hover .grid-icon span {
    transform: scale(1.1);
    background: #4D7A28;
}

.ball-skin-preview {
    width: 64px;
    height: 64px;
    background: var(--white);
    border-radius: 50%;
    border: 4px solid #FF8A65;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 800;
    color: #FF8A65;
    box-shadow: 0 8px 16px rgba(255, 138, 101, 0.2);
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-box:hover .ball-skin-preview {
    transform: rotate(360deg);
    background: #FF8A65;
    color: white;
}

.trophy-icon {
    width: 60px;
    height: 60px;
    background: #FFD54F;
    clip-path: polygon(10% 0, 90% 0, 90% 40%, 50% 100%, 10% 40%);
    position: relative;
    transition: 0.3s ease;
}

.trophy-icon::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 10%;
    width: 80%;
    height: 5px;
    background: #FFD54F;
    border-radius: 99px;
}

.content-box:hover .trophy-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(255, 213, 79, 0.5);
}

/* Animations */
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.floating-ball {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--bg-light);
    border-radius: 50%;
    box-shadow: inset -10px -10px 30px rgba(0,0,0,0.05);
    z-index: 1;
    animation: bob 4s ease-in-out infinite;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--dark-green);
    border-radius: 99px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    .hero h1 { font-size: 56px; }
    .menu-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 24px; font-weight: 700; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    
    .page-content { padding: 120px 0 60px; }
    .page-title { font-size: 38px; margin-bottom: 32px; text-align: center; }
    
    .content-box { padding: 24px; border-radius: 20px; }
    .content-box h2 { font-size: 28px; }
    .content-box h3 { font-size: 20px; }
    
    h2 { font-size: 32px !important; }
}

@media (max-width: 500px) {
    h2 { font-size: 32px !important; }
    
    .grid-3x3 {
        width: 300px;
        height: 300px;
    }
    
    .tile {
        width: 100px;
        height: 100px;
    }
    
    .physics-ball {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .hole {
        width: 56px;
        height: 56px;
    }
    
    .mirror {
        width: 60px;
        height: 60px;
    }
    
    .mirror-container {
        width: 100px;
        height: 100px;
    }
    
    .hole-tile {
        width: 100px;
        height: 100px;
    }

    .flag {
        height: 36px;
        bottom: 16px;
    }

    @keyframes real-game-loop {
        0%, 35% { left: 32px; top: 232px; opacity: 0; transform: scale(0.8); }
        38% { opacity: 1; transform: scale(1); }
        55% { left: 232px; top: 232px; }
        75% { left: 232px; top: 32px; opacity: 1; transform: scale(1); }
        85% { left: 232px; top: 32px; opacity: 0; transform: scale(0.5); }
        100% { opacity: 0; }
    }
}
