/* Base styles and reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background-color: #070b19;
    color: #e0e0ff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Stars animation background */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#stars, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

#stars {
    background-image: radial-gradient(2px 2px at 20px 30px, #eeeeff, rgba(0,0,0,0)), 
                      radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 90px 40px, #ffffaa, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.5;
    animation: twinkle 4s infinite;
}

#stars2 {
    background-image: radial-gradient(2px 2px at 120px 90px, #ffffff, rgba(0,0,0,0)), 
                      radial-gradient(2px 2px at 200px 130px, #ddddff, rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 300px 190px, #aaaaff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 400px 400px;
    opacity: 0.3;
    animation: twinkle 6s infinite;
}

#stars3 {
    background-image: radial-gradient(2px 2px at 320px 240px, #ffffff, rgba(0,0,0,0)), 
                      radial-gradient(3px 3px at 450px 350px, #ffffdd, rgba(0,0,0,0)),
                      radial-gradient(1px 1px at 520px 480px, #aaddff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 600px 600px;
    opacity: 0.2;
    animation: twinkle 10s infinite;
}

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

/* Layout */
.page-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.logo-container {
    flex: 0 0 200px;
}

.logo {
    max-width: 100%;
    height: auto;
    transition: all 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(93, 23, 235, 0.3));
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(93, 23, 235, 0.7));
}

.logo-pulse {
    animation: logo-pulse 3s infinite;
}

.logo-glowing {
    animation: logo-glow 2s infinite alternate;
}

.logo-rotating {
    animation: logo-rotate 10s linear infinite;
}

@keyframes logo-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes logo-glow {
    from { filter: drop-shadow(0 0 5px rgba(93, 23, 235, 0.3)); }
    to { filter: drop-shadow(0 0 15px rgba(162, 57, 234, 0.8)); }
}

@keyframes logo-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.nav-link {
    color: #a0a0ff;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #5d17eb;
    transition: width 0.3s;
}

.nav-link:hover:after, .nav-link.active:after {
    width: 100%;
}

.user-panel {
    display: flex;
    align-items: center;
}


.login-btn {
    background: linear-gradient(135deg, #5d17eb, #a239ea);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 23, 235, 0.4);
}

/* Account Dropdown */
.account-dropdown {
    position: relative;
    display: inline-block;
}

.account-btn {
    background: linear-gradient(135deg, #5d17eb, #a239ea);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 23, 235, 0.4);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background: linear-gradient(145deg, #1a1a3a, #10102a);
    min-width: 180px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 8px 0;
}

.account-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    color: #a0a0ff;
    text-decoration: none;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.9rem;
    font-family: 'Exo 2', sans-serif;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 80px 0;
    position: relative;
}

.hero-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(93, 23, 235, 0.7);
}

.subtitle {
    font-size: 1.5rem;
    color: #a0a0ff;
    max-width: 700px;
    margin: 0 auto;
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
}

.glitch-text:before, .glitch-text:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text:before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch-text:after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(16px, 9999px, 82px, 0); }
    5% { clip: rect(96px, 9999px, 99px, 0); }
    10% { clip: rect(101px, 9999px, 8px, 0); }
    15% { clip: rect(34px, 9999px, 36px, 0); }
    20% { clip: rect(31px, 9999px, 69px, 0); }
    25% { clip: rect(0, 9999px, 0, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(70px, 9999px, 16px, 0); }
    5% { clip: rect(69px, 9999px, 87px, 0); }
    10% { clip: rect(5px, 9999px, 59px, 0); }
    15% { clip: rect(85px, 9999px, 36px, 0); }
    20% { clip: rect(90px, 9999px, 99px, 0); }
    25% { clip: rect(0, 9999px, 0, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #ffffff;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-header h2:after {
    content: '';
    position: absolute;
    width: 60%;
    height: 3px;
    bottom: 0;
    left: 20%;
    background: linear-gradient(90deg, transparent, #5d17eb, transparent);
}

/* Join Section */
.join-section {
    padding: 60px 0;
}

.join-options {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.join-card {
    width: 300px;
    height: 200px;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.join-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    padding: 20px;
}

.card-front {
    background: linear-gradient(145deg, #1a1a3a, #10102a);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-back {
    background: linear-gradient(145deg, #2a1a4a, #15102a);
    transform: rotateY(180deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.join-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #a239ea;
}

.join-form {
    width: 100%;
}

.game-code-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 20px;
    border: 2px solid #5d17eb;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    font-size: 1rem;
}

.join-btn, .create-btn {
    background: linear-gradient(135deg, #5d17eb, #a239ea);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.join-btn:hover, .create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 23, 235, 0.4);
}

.create-options {
    width: 100%;
}

/* Games Section */
.games-section {
    padding: 60px 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background: linear-gradient(145deg, #1a1a3a, #10102a);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.game-img {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.game-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-img img {
    transform: scale(1.05);
}

.game-info {
    padding: 20px;
}

.game-info h3 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 10px;
    color: #ffffff;
}

.game-info p {
    color: #a0a0ff;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #8888aa;
}

.play-btn {
    background: linear-gradient(135deg, #5d17eb, #a239ea);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 23, 235, 0.4);
}

.coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff9f43);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.coming-soon .play-btn {
    background: linear-gradient(135deg, #888, #aaa);
    cursor: not-allowed;
}

.coming-soon .play-btn:hover {
    transform: none;
    box-shadow: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a3a, #10102a);
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #a0a0ff;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ffffff;
}

#modalTitle {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #8888aa;
}

.footer a {
    color: #a0a0ff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #ffffff;
}

.dmca-badge {
    display: inline-block;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .join-options {
        gap: 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .join-card {
        width: 100%;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        max-width: 320px;
    }
}
