/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-card: #161618;
    --bg-card-hover: #1c1c1f;
    --text-primary: #f0f0f2;
    --text-secondary: #a0a0a8;
    --text-muted: #6a6a72;
    --accent: #e63946;
    --accent-gold: #d4a017;
    --accent-glow: rgba(230, 57, 70, 0.3);
    --gold-glow: rgba(212, 160, 23, 0.3);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        #0a0a0b 0%,
        #12090e 25%,
        #0d0d12 50%,
        #0f0a08 75%,
        #0a0a0b 100%
    );
    background-size: 400% 400%;
    animation: gradientBreathing 12s ease-in-out infinite;
    z-index: -2;
}

@keyframes gradientBreathing {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: grainShift 0.5s steps(10) infinite;
}

@keyframes grainShift {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 0%); }
    30% { transform: translate(0%, 1%); }
    40% { transform: translate(-1%, 1%); }
    50% { transform: translate(1%, -1%); }
    60% { transform: translate(-1%, 0%); }
    70% { transform: translate(0%, -1%); }
    80% { transform: translate(1%, 1%); }
    90% { transform: translate(-1%, -1%); }
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 999;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.nav-logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-logo-container {
    position: relative;
    margin-bottom: 10px;
}

.hero-logo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(230, 57, 70, 0.15);
    animation: logoFloat 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #ccc 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: titleShimmer 3s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes titleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-title .accent {
    -webkit-text-fill-color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 1px;
}

/* ===== CODE BLOCK ===== */
.code-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.code-block:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.code-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.code-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.copy-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== CTA BUTTONS ===== */
.cta-buttons {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #c0392b);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 20px var(--gold-glow);
}

.btn-icon {
    flex-shrink: 0;
}

/* ===== BENEFITS SECTION ===== */
.benefits {
    padding: 80px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: 1px;
}

.section-title .accent {
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.benefit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.benefit-card:hover::before {
    opacity: 1;
}

.benefit-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 14px;
    margin-bottom: 18px;
    color: var(--accent);
    transition: var(--transition);
}

.benefit-card:hover .benefit-icon {
    background: rgba(230, 57, 70, 0.15);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.05);
}

.benefit-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.benefit-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== SOCIALS SECTION ===== */
.socials {
    padding: 60px 24px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.socials-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

.social-card:hover {
    transform: translateY(-3px);
}

.social-card.discord:hover {
    border-color: #5865F2;
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
    color: #5865F2;
}

.social-card.kick:hover {
    border-color: #53FC18;
    box-shadow: 0 4px 20px rgba(83, 252, 24, 0.3);
    color: #53FC18;
}

.social-card.twitter:hover {
    border-color: #fff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    background: rgba(0, 0, 0, 0.3);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--accent);
}

.footer-disclaimer {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-disclaimer a {
    color: var(--accent);
    text-decoration: none;
}

.footer-disclaimer a:hover {
    text-decoration: underline;
}

.footer-copy p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== LEADERBOARD ===== */
.leaderboard-section {
    min-height: 100vh;
    padding: 120px 24px 60px;
    max-width: 900px;
    margin: 0 auto;
}

.leaderboard-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -32px;
    margin-bottom: 40px;
    font-size: 1rem;
}

.leaderboard-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.leaderboard-table-wrapper {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
    padding: 14px 24px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.leaderboard-table tbody tr {
    transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-weight: 700;
    width: 60px;
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
}

.rank-badge.top-1 {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #FFD700;
}

.rank-badge.top-2 {
    background: rgba(192, 192, 192, 0.15);
    border: 1px solid rgba(192, 192, 192, 0.4);
    color: #C0C0C0;
}

.rank-badge.top-3 {
    background: rgba(205, 127, 50, 0.15);
    border: 1px solid rgba(205, 127, 50, 0.4);
    color: #CD7F32;
}

.player-name {
    font-weight: 600;
}

.wager-amount {
    font-weight: 600;
    color: var(--accent-gold);
}

.leaderboard-error {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
    }

    .nav-logo-text {
        font-size: 1.1rem;
    }

    .hero-title {
        font-size: 2.8rem;
        letter-spacing: 4px;
    }

    .hero-logo {
        width: 120px;
        height: 120px;
    }

    .hero-glow {
        width: 160px;
        height: 160px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .code-block {
        flex-wrap: wrap;
        justify-content: center;
    }

    .socials-grid {
        flex-direction: column;
        align-items: center;
    }

    .social-card {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }

    .hero-logo {
        width: 100px;
        height: 100px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* ===== ANIMATIONS ON SCROLL ===== */
.benefit-card,
.social-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.benefit-card:nth-child(1) { animation-delay: 0.1s; }
.benefit-card:nth-child(2) { animation-delay: 0.2s; }
.benefit-card:nth-child(3) { animation-delay: 0.3s; }
.benefit-card:nth-child(4) { animation-delay: 0.4s; }
.benefit-card:nth-child(5) { animation-delay: 0.5s; }

.social-card:nth-child(1) { animation-delay: 0.1s; }
.social-card:nth-child(2) { animation-delay: 0.2s; }
.social-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}