/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00ffff;
    --secondary-color: #ff00ff;
    --accent-color: #ffff00;
    --bg-dark: #0a0a0a;
    --bg-medium: #1a1a1a;
    --bg-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --glow-color: #00ffff;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #00ffff 0%, #ff00ff 100%);
}

body {
    font-family: 'Space Mono', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        100px 100px white, 200px 150px white, 300px 50px white,
        400px 200px white, 500px 100px white, 600px 250px white,
        700px 150px white, 800px 300px white, 900px 200px white,
        1000px 100px white, 1100px 250px white, 1200px 150px white,
        150px 300px white, 250px 400px white, 350px 350px white,
        450px 450px white, 550px 400px white, 650px 500px white,
        750px 450px white, 850px 550px white, 950px 500px white;
    animation: twinkle 3s infinite;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    animation: grid-move 10s linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    position: relative;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(0, 255, 255, 1);
}

.logo-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    opacity: 0;
    animation: glitch 3s infinite;
}

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

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-2);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    z-index: 10;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.title-line {
    display: block;
    opacity: 0;
    animation: slideInLeft 0.8s ease forwards;
}

.title-line:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }
.title-line:nth-child(3) { animation-delay: 0.6s; }

.title-line.highlight {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
}

.cta-button {
    position: relative;
    padding: 15px 30px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.cta-button.primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.cta-button.secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover .button-glow {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.5);
}

.cta-button.primary:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

.cta-button.secondary:hover {
    background: var(--secondary-color);
    color: var(--bg-dark);
}

/* Hero Visual */
.hero-visual {
    flex: 1;
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hero-battle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 2;
    pointer-events: auto;
}

.starfront-ship {
    position: relative;
    width: 120px;
    height: 120px;
    animation: shipFloat 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.starfront-ship:hover {
    transform: scale(1.1);
}

.ship-body {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    animation: rainbowShift 3s ease infinite;
    clip-path: polygon(50% 0%, 87.5% 87.5%, 50% 56%, 12.5% 87.5%);
    left: 20px;
    top: 20px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

.ship-cockpit {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    left: 54px;
    top: 30px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.ship-wing {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    animation: rainbowShift 3s ease infinite;
    clip-path: polygon(50% 0%, 100% 87.5%, 50% 50%, 0% 87.5%);
    left: 20px;
    top: 20px;
}

.ship-engine {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #00ffff, #ff00ff);
    border-radius: 50%;
    left: 50px;
    top: 90px;
    animation: engineGlow 0.5s ease infinite alternate;
    box-shadow: 0 0 20px #00ffff;
}

.ship-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.3), transparent);
    opacity: 0;
    animation: shipGlitch 2s infinite;
    pointer-events: none;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shipFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(15px) rotate(5deg); }
}

@keyframes engineGlow {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 20px #00ffff;
    }
    100% { 
        transform: scale(1.2);
        box-shadow: 0 0 30px #ff00ff;
    }
}

@keyframes shipGlitch {
    0%, 85%, 100% { 
        opacity: 0; 
        transform: translateX(0); 
    }
    87% { 
        opacity: 0.8; 
        transform: translateX(-3px); 
    }
    89% { 
        opacity: 0.6; 
        transform: translateX(3px); 
    }
    91% { 
        opacity: 0.4; 
        transform: translateX(-2px); 
    }
    93% { 
        opacity: 0; 
        transform: translateX(0); 
    }
}

/* Enemy Ships */
.enemy-ships-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.enemy-ship {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0;
}

.enemy-ship-body {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #dc2626, #991b1b, #7f1d1d);
    clip-path: polygon(50% 100%, 87.5% 12.5%, 50% 25%, 12.5% 12.5%);
    left: 5px;
    top: 5px;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
}

.enemy-ship-cockpit {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 100, 100, 0.8);
    border-radius: 50%;
    left: 21px;
    top: 21px;
    box-shadow: 0 0 5px rgba(255, 100, 100, 0.5);
}

.enemy-ship-engine {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ff6600, #ff3300);
    border-radius: 50%;
    left: 19px;
    top: 0px;
    animation: enemyEngineGlow 0.4s ease infinite alternate;
    box-shadow: 0 0 15px #ff6600;
}

@keyframes enemyEngineGlow {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 15px #ff6600;
    }
    100% { 
        transform: scale(1.3);
        box-shadow: 0 0 25px #ff3300;
    }
}

/* Laser Blasts */
.blasts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
}

.laser-blast {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
}

.player-blast {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #00ffff, #0099cc);
    box-shadow: 0 0 10px #00ffff;
}

.enemy-blast {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ff4444, #cc0000);
    box-shadow: 0 0 8px #ff4444;
}

.explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffaa00, #ff6600, transparent);
    opacity: 0;
    animation: explode 0.6s ease-out;
}

@keyframes explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Flying Animation Classes */
.starfront-ship.flying-mode {
    animation: none !important;
    z-index: 10;
}

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

/* Games Section */
.games-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
    position: relative;
    z-index: 2;
    margin-top: -1px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 60px;
    text-transform: uppercase;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.game-card {
    position: relative;
    background: var(--bg-light);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 300px;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.3);
}

.game-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
}

.circuit-pattern {
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, var(--primary-color) 1px, transparent 1px),
        linear-gradient(0deg, var(--primary-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

.game-card-content {
    position: relative;
    z-index: 10;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.game-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.game-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.play-now {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
}

.arrow {
    transition: transform 0.3s ease;
}

.game-card:hover .arrow {
    transform: translateX(10px);
}

.coming-soon-badge {
    background: var(--secondary-color);
    color: var(--bg-dark);
    padding: 10px 20px;
    border-radius: 25px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 20px;
}

.game-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-card-glow {
    opacity: 1;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background: var(--bg-dark);
    position: relative;
    z-index: 2;
    margin-top: -1px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.about-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.features {
    display: flex;
    gap: 30px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.rotating-cube {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    animation: rotate3d 10s linear infinite;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.8);
}

@keyframes rotate3d {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

/* Footer */
.footer {
    background: var(--bg-medium);
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.footer-logo .logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

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

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.social-link:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 20px 50px;
    }
    
    .hero-visual {
        height: 300px;
        margin-top: 50px;
    }
    
    .cta-container {
        justify-content: center;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .features {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
}
