:root {
    --primary: #00ff41;
    --secondary: #0088ff;
    --danger: #ff0055;
    --dark: #0a0e27;
    --darker: #05070f;
    --light: #ffffff;
    --gray: #8892b0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--darker);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Stars Background */
.stars, .twinkling {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background: #000 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="10" cy="10" r="1" fill="white" opacity="0.3"/><circle cx="30" cy="25" r="1" fill="white" opacity="0.5"/><circle cx="50" cy="15" r="0.5" fill="white" opacity="0.4"/><circle cx="70" cy="40" r="1" fill="white" opacity="0.3"/><circle cx="85" cy="70" r="0.5" fill="white" opacity="0.6"/><circle cx="20" cy="60" r="1" fill="white" opacity="0.4"/><circle cx="45" cy="80" r="0.5" fill="white" opacity="0.3"/><circle cx="90" cy="20" r="1" fill="white" opacity="0.5"/></svg>') repeat;
    z-index: 0;
}

.twinkling {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><circle cx="40" cy="60" r="1.5" fill="white" opacity="0.8"/><circle cx="120" cy="30" r="1" fill="white" opacity="0.6"/><circle cx="180" cy="140" r="1.5" fill="white" opacity="0.7"/></svg>') repeat;
    z-index: 1;
    animation: move-twink-back 200s linear infinite;
}

@keyframes move-twink-back {
    from { background-position: 0 0; }
    to { background-position: -10000px 5000px; }
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px var(--primary);
}

.logo i {
    font-size: 2rem;
}

.nav-btn {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.nav-btn:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    width: 100%;
    padding: 40px 20px;
}

.hero {
    margin-bottom: 60px;
}

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
}

.glitch {
    position: relative;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary);
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 2px); }
    94% { transform: translate(2px, -2px); }
    96% { transform: translate(-2px, -2px); }
    98% { transform: translate(2px, 2px); }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    font-weight: 600;
}

.description {
    font-size: 1.1rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00cc33);
    color: var(--dark);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.6);
}

.btn-secondary {
    background: rgba(0, 136, 255, 0.2);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary);
    color: var(--light);
    transform: translateY(-3px);
}

.btn-block {
    width: 100%;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.feature {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--light);
}

.feature p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Auth Section */
.auth-section {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.auth-card {
    background: rgba(10, 14, 39, 0.9);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary);
}

/* Form */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
}

.error-message {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--dark);
    border: 2px solid var(--primary);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-size: 1.2rem;
}

/* Leaderboard */
.leaderboard-table {
    width: 100%;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.leaderboard-rank {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.leaderboard-rank.gold { color: #FFD700; }
.leaderboard-rank.silver { color: #C0C0C0; }
.leaderboard-rank.bronze { color: #CD7F32; }

.leaderboard-info {
    flex: 1;
    margin-left: 20px;
}

.leaderboard-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.leaderboard-stats {
    font-size: 0.9rem;
    color: var(--gray);
}

.leaderboard-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

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

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .description {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .auth-card {
        padding: 30px 20px;
    }

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