: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: #0019ff;
    --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);
    }
}

/* Game Page Specifics */
body.game-active {
    overflow: hidden;
    /* Prevent scrolling in game */
}

/* Hide header on game page */
.game-active header {
    display: none !important;
}

#game-over-screen,
#victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 31, 0.95);
    /* Transparent/Glassy as requested */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
    /* Below spaceship (10001) */
    pointer-events: auto;
    cursor: none;
    /* Hide mouse, use spaceship */
    backdrop-filter: blur(5px);
}

#game-over-screen h2,
#victory-screen h2 {
    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);
}

#game-over-screen p,
#victory-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.about-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Original Spaceship Design */
.spaceship {
    position: fixed;
    width: 80px;
    height: 30px;
    pointer-events: none;
    z-index: 10001;
    /* Higher than game over screen */
    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;
        filter: drop-shadow(0 0 15px #fff);
    }

    50% {
        opacity: 0.3;
    }
}

/* Enhanced Bullet */
.bullet {
    position: fixed;
    width: 4px;
    height: 25px;
    background: linear-gradient(to bottom, #fff, var(--neon-blue));
    border-radius: 4px;
    z-index: 999;
    pointer-events: none;
    box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    will-change: transform;
}

/* Enemy Definition - Will be set via JS mostly but base style here */
.enemy {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 25;
    filter: drop-shadow(0 0 5px rgba(255, 50, 50, 0.4));
}

.enemy-basic {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><linearGradient id="enemyRed" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:%23ff4d4d;stop-opacity:1" /><stop offset="100%" style="stop-color:%23990000;stop-opacity:1" /></linearGradient></defs><g><path d="M50 15 L90 40 L50 90 L10 40 Z" fill="url(%23enemyRed)" stroke="%23ff9999" stroke-width="2" /><circle cx="50" cy="40" r="12" fill="%23330000" /><circle cx="50" cy="40" r="5" fill="%23ff0000" opacity="0.8"><animate attributeName="opacity" values="0.4;1;0.4" dur="1s" repeatCount="indefinite" /></circle></g></svg>');
}

.enemy-fast {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 10 L80 30 L50 80 L20 30 Z" fill="%23ffaa00" stroke="%23ffff00" stroke-width="2" /><path d="M20 30 L10 10 M80 30 L90 10" stroke="%23ffaa00" stroke-width="3" /></svg>');
}

.enemy-tank {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="20" y="20" width="60" height="60" rx="10" fill="%23800080" stroke="%23ff00ff" stroke-width="3" /><circle cx="50" cy="50" r="20" fill="%234a004a" stroke="%23ff00ff" stroke-width="2" /><rect x="45" y="70" width="10" height="20" fill="%23ff00ff" /></svg>');
}

/* Explosion Particles */
/* Explosion Shockwave - used by main.js interactions */
.explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(168, 85, 247, 0) 70%);
    box-shadow: 0 0 20px var(--neon-purple);
    animation: shockwave 0.4s ease-out forwards;
    z-index: 998;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

@keyframes shockwave {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--neon-purple);
    border-radius: 50%;
    animation: particle-fade 0.8s forwards ease-out;
}

@keyframes particle-fade {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.planet-hit {
    animation: planetExplode 0.5s forwards;
}

@keyframes planetExplode {
    0% {
        transform: scale(1);
        filter: brightness(1) hue-rotate(0deg);
    }

    50% {
        transform: scale(1.1);
        filter: brightness(2) hue-rotate(90deg);
    }

    100% {
        transform: scale(1);
        filter: brightness(1) hue-rotate(0deg);
    }
}

/* Powerups */
.powerup {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #fff, var(--neon-blue));
    border-radius: 50%;
    z-index: 24;
    box-shadow: 0 0 15px var(--neon-blue);
    animation: pulse-powerup 1s infinite alternate;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

@keyframes pulse-powerup {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px var(--neon-blue);
    }

    100% {
        transform: scale(1.2);
        box-shadow: 0 0 20px var(--neon-blue);
    }
}

@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;
    }

    #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;
    }

    footer {
        padding-bottom: 4rem;
    }
}

/* Solo dispositivi mobili reali (touchscreen) */
@media (pointer: coarse),
(hover: none) {
    .spaceship {
        display: none !important;
    }

    body,
    #game-over-screen,
    #victory-screen {
        cursor: auto !important;
    }
}

#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;
}

/* Removed duplicate game screen styles */

/* Fully removed duplicate game styles to fix Victory Screen layout */

#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);
    }
}

.privacy-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--glass-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-light);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    z-index: 90;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.privacy-box:hover {
    background: rgba(20, 20, 40, 0.9);
    border-color: var(--neon-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

@media (max-width: 480px) {
    .privacy-box {
        bottom: 10px;
        right: 10px;
        font-size: 0.65rem;
        padding: 6px 12px;
    }
}