/* =========================================
   1. RESET E GENERALI
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace; 
}

body {
    overflow: hidden;
    height: 100vh;
    background: #000;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: -1;
    object-fit: cover;
    filter: brightness(0.4);
}

/* =========================================
   2. OVERLAY (SCHERMATA INIZIALE)
   ========================================= */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    cursor: pointer;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

/* Immagine sfondo overlay (Scura e quasi invisibile) */
#overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3; /* Si vede appena */
    filter: grayscale(100%) brightness(0.4) contrast(1.2); 
    z-index: 0; 
    pointer-events: none;
}

/* Testo "click to enter" (Luminoso e Fermo) */
#overlay p {
    font-size: 1.5rem;
    letter-spacing: 3px;
    font-weight: bold;
    color: #fff;
    z-index: 102; 
    position: relative;
    /* Glow bianco intenso */
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 255, 255, 0.7),
        0 0 40px rgba(255, 255, 255, 0.5);
}

/* =========================================
   3. NEVE / NEBBIA (Veloce)
   ========================================= */
#snow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 101; 
}

.snowflake {
    position: absolute;
    top: -20px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: snowfall linear infinite;
    /* Effetto movimento/scia */
    filter: blur(1.5px); 
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
    will-change: transform, opacity;
}

@keyframes snowfall {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(50vh) translateX(15px); }
    100% { transform: translateY(105vh) translateX(-15px); }
}

/* =========================================
   4. CONTENUTO PRINCIPALE & ANIMAZIONI
   ========================================= */
#main-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

/* Card Profilo */
.profile-card {
    background: rgba(0, 0, 0, 0.2); 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1); 
    width: 100%;
    max-width: 480px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);

    /* --- ANIMAZIONE D'ENTRATA --- */
    /* Stato finale (Visibile) */
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s ease;
}

/* Stato iniziale (Nascosto) */
#main-content.hidden .profile-card {
    transform: scale(0.9) translateY(40px); /* Parte dal basso */
    opacity: 0;
}

/* Link Archivio (Top Right) */
.top-right-link {
    position: fixed;
    top: 30px;
    right: 40px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 200;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.top-right-link:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Credits */
#credits {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    
    /* Entrata ritardata */
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
    animation-delay: 0.3s;
}

/* =========================================
   5. AVATAR
   ========================================= */
.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 25px auto;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}

.decoration {
    position: absolute;
    width: 148px;
    height: 148px;
    top: -14px;
    left: -14px;
    z-index: 2;
    pointer-events: none;
}

/* =========================================
   6. TESTI E LINK
   ========================================= */
/* Nome con Shine */
.username {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    background: linear-gradient(to right, #888 20%, #fff 50%, #888 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.bio {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 5px; 
    font-weight: 500;
}

.sub-bio {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 25px; 
    font-weight: 400;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    padding: 0;
}

.links a:hover {
    color: #fff;
    transform: scale(1.25);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
}

.views-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    cursor: default;
}

.views-container:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

/* =========================================
   7. PLAYER
   ========================================= */
#spotify-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 200;
    width: 280px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#spotify-player:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Nascosto */
#spotify-player.hidden {
    opacity: 0 !important;
    transform: translateY(20px);
    pointer-events: none;
}

.album-cover img {
    width: 50px;
    height: 50px;
    border-radius: 8px; 
    object-fit: cover;
}

.song-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.song-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.song-artist {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.controls i {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.controls i:hover {
    color: #fff;
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

/* =========================================
   8. ANIMAZIONI
   ========================================= */
.hidden { 
    pointer-events: none;
    /* Opacità gestita dal CSS sopra */
}

@keyframes shine { to { background-position: 200% center; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
    .profile-card { width: 90%; padding: 30px; }
    #spotify-player { bottom: 10px; right: 10px; width: auto; padding: 8px; }
    .song-info { display: none; }
}