/* ===== CSS Variables ===== */
:root {
    --bg-dark: #0d1b2a;
    --bg-medium: #1b263b;
    --bg-light: #415a77;
    --accent-purple: #6366f1;
    --accent-light: #818cf8;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --ghost-white: #e8e8e8;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
    --success-green: #10b981;
    --coin-gold: #ffd700;

    /* Rarity Colors */
    --rarity-common: #9e9e9e;
    --rarity-uncommon: #4caf50;
    --rarity-rare: #2196f3;
    --rarity-epic: #9c27b0;
    --rarity-legendary: #ffd700;

    --font-pixel: 'DotGothic16', sans-serif;
    --font-pixel-en: 'Press Start 2P', cursive;

    --shadow-pixel: 4px 4px 0 rgba(0, 0, 0, 0.5);
    --border-pixel: 3px solid;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-pixel);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

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

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--bg-light);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-family: var(--font-pixel-en);
    font-size: 14px;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s;
    padding: 8px 0;
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, white, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent);
    background-size: 350px 200px;
    animation: twinkle 4s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.floating-ghosts {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-ghost {
    position: absolute;
    width: 60px;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.ghost-1 { top: 15%; left: 10%; animation-delay: 0s; }
.ghost-2 { top: 25%; right: 15%; animation-delay: 1.5s; }
.ghost-3 { bottom: 30%; left: 5%; animation-delay: 3s; }
.ghost-4 { bottom: 20%; right: 10%; animation-delay: 4.5s; }
.ghost-5 { top: 40%; left: 3%; animation-delay: 2s; }
.ghost-6 { top: 10%; right: 5%; animation-delay: 3.5s; }
.ghost-7 { bottom: 40%; right: 3%; animation-delay: 5s; }
.ghost-8 { bottom: 10%; left: 15%; animation-delay: 1s; }

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

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.pixel-title {
    font-size: 48px;
    line-height: 1.3;
    margin-bottom: 24px;
}

.highlight {
    color: var(--accent-light);
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Pixel Buttons */
.pixel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-pixel);
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.pixel-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid;
    border-color: rgba(255,255,255,0.6) transparent transparent rgba(255,255,255,0.6);
}

.pixel-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid;
    border-color: transparent rgba(0,0,0,0.4) rgba(0,0,0,0.4) transparent;
}

.pixel-btn:hover {
    transform: translate(2px, 2px);
}

.pixel-btn:hover::before,
.pixel-btn:hover::after {
    border-color: transparent;
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}

.btn-primary:hover {
    box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.btn-secondary {
    background: var(--bg-light);
    color: white;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}

/* Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
}

.phone-mockup {
    width: 280px;
    height: 560px;
    background: #1a1a2e;
    border-radius: 40px;
    padding: 12px;
    border: 4px solid #3d4757;
    box-shadow: var(--shadow-pixel), 0 20px 60px rgba(99, 102, 241, 0.2);
    position: relative;
}

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

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1b263b 0%, #0d1b2a 100%);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    overflow: hidden;
}

.coffin-animation {
    position: relative;
    width: 120px;
    height: 180px;
}

.coffin {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 15%, 100% 100%, 0% 100%, 0% 15%);
    border: 3px solid #8d6e63;
    position: relative;
}

.coffin::before {
    content: '†';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #8d6e63;
}

.hero-ghost {
    position: absolute;
    width: 80px;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    animation: ghostBob 2s ease-in-out infinite;
}

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

.timer-display {
    font-family: var(--font-pixel-en);
    font-size: 24px;
    color: var(--text-primary);
    background: rgba(0,0,0,0.3);
    padding: 12px 24px;
    border: 2px solid var(--bg-light);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 3px solid var(--text-muted);
    border-bottom: 3px solid var(--text-muted);
    transform: rotate(45deg);
}

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

/* ===== Section Styles ===== */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 36px;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 60px;
}

/* ===== Features Section ===== */
.features {
    background: var(--bg-medium);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--bg-dark);
    padding: 32px;
    border: 3px solid var(--bg-light);
    box-shadow: var(--shadow-pixel);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
    border-color: var(--accent-purple);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.feature-ghost {
    width: 64px;
    height: 64px;
}

.pixel-phone {
    width: 32px;
    height: 48px;
    background: var(--bg-light);
    border: 3px solid var(--text-secondary);
    border-radius: 4px;
    position: relative;
}

.pixel-phone::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
}

.pixel-warning {
    width: 48px;
    height: 48px;
    background: var(--warning-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--bg-dark);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.pixel-book,
.pixel-coin,
.pixel-friends {
    font-size: 48px;
}

.pixel-coin {
    color: var(--coin-gold);
    text-shadow: 2px 2px 0 #b8860b;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

/* ===== How It Works ===== */
.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 220px;
    max-width: 260px;
    text-align: center;
    padding: 24px;
    background: var(--bg-medium);
    border: 3px solid var(--bg-light);
    box-shadow: var(--shadow-pixel);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent-purple);
    color: white;
    font-family: var(--font-pixel-en);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 3px solid rgba(255,255,255,0.3);
}

.step-content h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

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

.step-visual {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.step-ghost {
    width: 60px;
    animation: float 3s ease-in-out infinite;
}

.coffin-icon {
    width: 40px;
    height: 60px;
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 100%);
    clip-path: polygon(15% 0%, 85% 0%, 100% 12%, 100% 100%, 0% 100%, 0% 12%);
    border: 2px solid #8d6e63;
}

.flip-animation .phone-flip {
    width: 30px;
    height: 50px;
    background: var(--bg-light);
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    animation: flip 2s ease-in-out infinite;
}

@keyframes flip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.ascend-animation {
    position: relative;
}

.ascending-ghost {
    width: 50px;
    animation: ascend 3s ease-in-out infinite;
}

@keyframes ascend {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-20px); opacity: 0.7; }
}

.halo {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 10px;
    border: 3px solid var(--coin-gold);
    border-radius: 50%;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px var(--coin-gold); }
    100% { box-shadow: 0 0 15px var(--coin-gold), 0 0 30px var(--coin-gold); }
}

.step-arrow {
    font-size: 32px;
    color: var(--accent-purple);
    align-self: center;
    margin-top: 50px;
}

/* ===== Collection Section ===== */
.collection {
    background: var(--bg-medium);
}

.rarity-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.rarity-card {
    background: var(--bg-dark);
    padding: 24px;
    border: 3px solid;
    box-shadow: var(--shadow-pixel);
    text-align: center;
    transition: transform 0.3s;
}

.rarity-card:hover {
    transform: translateY(-5px);
}

.rarity-card.common { border-color: var(--rarity-common); }
.rarity-card.uncommon { border-color: var(--rarity-uncommon); }
.rarity-card.rare { border-color: var(--rarity-rare); }
.rarity-card.epic { border-color: var(--rarity-epic); }
.rarity-card.legendary {
    border-color: var(--rarity-legendary);
    animation: legendaryGlow 2s ease-in-out infinite alternate;
}

@keyframes legendaryGlow {
    0% { box-shadow: 4px 4px 0 rgba(0,0,0,0.5), 0 0 10px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 4px 4px 0 rgba(0,0,0,0.5), 0 0 20px rgba(255, 215, 0, 0.5); }
}

.rarity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.rarity-label {
    font-weight: bold;
    font-size: 14px;
}

.common .rarity-label { color: var(--rarity-common); }
.uncommon .rarity-label { color: var(--rarity-uncommon); }
.rare .rarity-label { color: var(--rarity-rare); }
.epic .rarity-label { color: var(--rarity-epic); }
.legendary .rarity-label { color: var(--rarity-legendary); }

.rarity-chance {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-medium);
    padding: 4px 8px;
}

.rarity-ghosts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ghost-emoji {
    font-size: 32px;
}

.ghost-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.ghost-img:hover {
    transform: scale(1.2);
}

.rarity-card p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Stats Section ===== */
.stats {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #4338ca 100%);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 20px;
}

.stat-number {
    font-family: var(--font-pixel-en);
    font-size: 48px;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

/* ===== Download Section ===== */
.download {
    text-align: center;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-medium);
    padding: 16px 32px;
    border: 3px solid var(--bg-light);
    box-shadow: var(--shadow-pixel);
    transition: transform 0.2s, box-shadow 0.2s;
}

.store-btn:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
    border-color: var(--accent-purple);
}

.store-icon {
    width: 32px;
    height: 32px;
}

.store-icon svg {
    width: 100%;
    height: 100%;
}

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

.store-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.store-name {
    display: block;
    font-size: 18px;
    font-weight: bold;
}

.coming-soon {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Footer ===== */
.footer {
    background: #0a1628;
    padding: 40px 0 20px;
    border-top: 3px solid var(--bg-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bg-light);
    margin-bottom: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 32px;
    height: 32px;
}

.footer-name {
    font-family: var(--font-pixel-en);
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rarity-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 20px;
        border-bottom: 2px solid var(--bg-light);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

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

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

    .phone-mockup {
        width: 240px;
        height: 480px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }

    .step {
        max-width: 100%;
    }

    .step-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .rarity-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .pixel-title {
        font-size: 26px;
    }

    .section-title {
        font-size: 28px;
    }

    .rarity-cards {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 36px;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .store-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}
