:root {
    --bg-dark: #0f0f1f;
    --glass-dark: rgba(20, 20, 40, 0.7);
    --glass-light: rgba(255, 255, 255, 0.15);
    --neon-blue: #00f5ff;
    --neon-purple: #a855f7;
    --neon-pink: #ff00ff;
    --deep-space: #1a1a3e;
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --star-glow: rgba(255, 255, 255, 0.8);
    --enterprise-primary: #4d6b93;
    --enterprise-secondary: #7eb6ff;
    --enterprise-accent: #d4e4ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 245, 255, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.05) 0%, transparent 30%);
    cursor: none;
}

.star {
    position: absolute;
    background-color: var(--star-glow);
    border-radius: 50%;
    animation: twinkle var(--duration) infinite ease-in-out;
    z-index: 1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.glass-card {
    background: var(--glass-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--glass-light);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    z-index: 10;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 62, 0.3) 0%,
        rgba(40, 40, 90, 0.3) 100%
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(26, 26, 62, 0.6);
    border-color: rgba(168, 85, 247, 0.3);
}

.glass-card:hover::before {
    opacity: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 20;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    position: relative;
}

.welcome-accent {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
    animation: accent-glow 3s ease-in-out infinite;
}

@keyframes accent-glow {
    0%, 100% { opacity: 0.6; width: 100px; }
    50% { opacity: 1; width: 150px; }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 1.5rem;
}

.planet-system {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.planet {
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    cursor: pointer;
    position: relative;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.planet-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.planet-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.planet-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.planet:hover .planet-icon {
    transform: scale(1.3);
    text-shadow: 0 0 15px var(--neon-purple);
}

.planet::after {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: orbit 15s linear infinite;
    z-index: -1;
}

@keyframes orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spaceship {
    position: fixed;
    width: 80px;
    height: 30px;
    pointer-events: none;
    z-index: 1000;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 80"><defs><linearGradient id="enterpriseBody" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:%234d6b93;stop-opacity:1" /><stop offset="100%" style="stop-color:%232a436b;stop-opacity:1" /></linearGradient></defs><g><path fill="url(%23enterpriseBody)" d="M100,10 L180,40 L100,70 L20,40 Z" /><rect x="90" y="30" width="20" height="20" fill="%237eb6ff" /><circle cx="100" cy="40" r="8" fill="%23d4e4ff" /><path d="M60,40 L80,40 M120,40 L140,40" stroke="%237eb6ff" stroke-width="3" /></g></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
    filter: drop-shadow(0 0 8px rgba(126, 182, 255, 0.7));
}

.spaceship.invincible {
    animation: invincible-blink 0.2s infinite;
}

@keyframes invincible-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.bullet {
    position: fixed;
    width: 3px;
    height: 20px;
    background-color: var(--enterprise-secondary);
    border-radius: 2px;
    z-index: 999;
    pointer-events: none;
    box-shadow: 0 0 10px var(--enterprise-secondary), 0 0 20px var(--enterprise-secondary);
}

.explosion {
    position: absolute;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, var(--enterprise-secondary) 10%, var(--enterprise-primary) 60%, transparent 70%);
    border-radius: 50%;
    animation: explode 0.5s forwards;
    z-index: 998;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

@keyframes explode {
    0% { transform: scale(0.1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.planet-hit {
    animation: planetExplode 0.5s forwards;
}

@keyframes planetExplode {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@media (max-width: 1024px) {
    .planet-system {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--glass-light);
    border: 1px solid var(--glass-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.btn {
    background: var(--neon-purple);
    color: var(--text-primary);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.2);
}

.contact-card {
    padding: 3rem 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-width: 800px;
    margin: 2rem auto;
}

.about-card {
    padding: 2rem 3rem;
    max-width: 800px;
    margin: 2rem auto;
}

.about-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--neon-purple);
    text-align: center;
}

.about-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--neon-purple);
}

.about-card p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-buttons {
    text-align: center;
    margin-top: 2rem;
}

.about-buttons .btn {
    margin: 0 0.5rem;
}


#email-container {
    text-align: center;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#email-link {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--neon-purple);
    text-decoration: none;
    border-right: 2px solid var(--neon-purple);
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

#email-link:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 15px var(--neon-blue);
}

.blink {
    animation: blink-caret 0.75s step-end infinite;
    color: var(--neon-purple);
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--neon-purple); }
}



footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 20;
}

footer a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--neon-purple);
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        justify-content: flex-start;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    .planet {
        padding: 1.5rem;
    }
    
    .spaceship, #game-trigger {
        display: none;
    }
}

@media (max-width: 480px) {
    .planet-system {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .planet {
        padding: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .spaceship {
        width: 50px;
        height: 20px;
    }

    footer {
        padding-bottom: 4rem;
    }
}

#game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#game-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    z-index: 51;
}

.enemy {
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23ff4d4d" d="M50 10L70 40 90 50 70 60 50 90 30 60 10 50 30 40z"/><circle cx="50" cy="50" r="10" fill="%23ffb8b8"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 25;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 31, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 52;
    pointer-events: all;
}

#start-screen h2, #game-over-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: var(--neon-pink);
    margin-bottom: 1rem;
}

#game-over-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

#game-trigger {
    position: fixed;
    width: 5px; /* Leggermente più grande di una stella normale */
    height: 5px;
    background-color: var(--star-glow);
    border-radius: 50%;
    z-index: 30;
    cursor: pointer;
    box-shadow: 0 0 8px var(--neon-blue); /* Un bagliore per distinguerla */
    animation: float-game-trigger 25s infinite ease-in-out, pulse-game-trigger 1.5s infinite ease-in-out;
}

@keyframes float-game-trigger {
    0% { top: 10%; left: 10%; }
    25% { top: 20%; left: 80%; }
    50% { top: 80%; left: 90%; }
    75% { top: 70%; left: 20%; }
    100% { top: 10%; left: 10%; }
}

@keyframes pulse-game-trigger {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px var(--neon-blue); }
    50% { transform: scale(1.5); box-shadow: 0 0 12px var(--neon-blue); }
}
