/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

/* Particelle animate */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #c0a062;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 7s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 9s; }
.particle:nth-child(4) { left: 40%; animation-delay: 0.5s; animation-duration: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 1.5s; animation-duration: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 2.5s; animation-duration: 7s; }
.particle:nth-child(7) { left: 70%; animation-delay: 3s; animation-duration: 9s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.8s; animation-duration: 6s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1.8s; animation-duration: 8s; }
.particle:nth-child(10) { left: 95%; animation-delay: 2.8s; animation-duration: 7s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    z-index: 1000;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(192, 160, 98, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.studio-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    cursor: pointer;
    width: fit-content;
    transform-origin: center center;
}

.studio-logo:hover {
    transform: scale(1.05);
}

.studio-logo-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #c0a062;
    background: rgba(20, 20, 20, 0.95);
    padding: 5px;
}

.studio-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #c0a062;
    text-shadow: 0 0 10px rgba(192, 160, 98, 0.3);
}

/* Contenuto principale */
.main-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 20px;
}

.background-page .main-content {
    padding: 20px; /* Reset del padding per la pagina background */
}

.hero-section {
    text-align: center;
    max-width: 800px;
    width: 100%;
    position: relative; /* Aggiunto per supportare il positioning assoluto */
}

/* Logo del server */
.server-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.server-logo {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    border: 3px solid #c0a062;
    background: rgba(20, 20, 20, 0.95);
    padding: 20px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.server-logo:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 20px 40px rgba(192, 160, 98, 0.3);
}

.logo-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #c0a062, transparent, #c0a062);
    border-radius: 25px;
    opacity: 0.3;
    transition: opacity 0.1s ease;
    z-index: 1;
    animation: rotate 4s linear infinite;
}

/*.server-logo-container:hover .logo-glow {
    opacity: 0.6;
}*/

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Titoli */
.server-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: #c0a062;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(192, 160, 98, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
    opacity: 1;
    text-align: center;
    transition: none;
    white-space: nowrap;
    line-height: 1.2;
}

.server-title.typing {
    opacity: 1;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(192, 160, 98, 0.5); }
    100% { text-shadow: 0 0 30px rgba(192, 160, 98, 0.8), 0 0 40px rgba(192, 160, 98, 0.3); }
}

.server-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 50px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Pulsanti */
.action-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #c0a062;
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-width: 150px;
    justify-content: center;
    /* Uniforma il font per tutti i pulsanti */
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.btn span {
    /* Assicura che il testo sia uniforme */
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(192, 160, 98, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(192, 160, 98, 0.3);
    border-color: #d4b76a;
    background: rgba(192, 160, 98, 0.1);
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: scale(1.2);
}


.btn-discord:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: #5865f2;
}

.btn-lore:hover {
    background: rgba(192, 160, 98, 0.2);
    border-color: #d4b76a;
    box-shadow: 0 10px 25px rgba(192, 160, 98, 0.4);
}

.btn-trailer {
    position: relative;
}

.coming-soon-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    color: #c0a062;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #c0a062;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.coming-soon-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #c0a062;
}

.btn-trailer:hover .coming-soon-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.btn-trailer:hover {
    background: rgba(192, 160, 98, 0.1);
    cursor: not-allowed;
}

/* Decorazioni angolari */
.decorative-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.corner-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid #c0a062;
    opacity: 0.3;
}

.corner-decoration.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 20px;
}

.corner-decoration.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 20px;
}

.corner-decoration.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 20px;
}

.corner-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 20px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(192, 160, 98, 0.2);
    z-index: 1000;
}

.footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .server-title:not([style*="font-size"]) {
        font-size: 2.5rem;
        white-space: normal;
    }
    
    .studio-logo-img {
        width: 40px;
        height: 40px;
    }
    
    .studio-name {
        font-size: 1rem;
    }
    
    .server-logo {
        width: 150px;
        height: 150px;
    }
    
    .server-title {
        font-size: 2.5rem;
        white-space: normal;
        text-align: center;
        width: 100%;
        line-height: 1.2; /* Mantieni la stessa line-height */
        /* Assicura che l'altezza sia stabile */
        box-sizing: border-box;
    }
    
    .server-subtitle {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .corner-decoration {
        width: 60px;
        height: 60px;
    }
    
    .main-content {
        padding: 80px 15px 80px;
    }

    .hero-section {
        text-align: center;
        max-width: 100%;
        width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .server-title {
        font-size: 2rem;
        white-space: normal;
        line-height: 1.2;
    }

    .server-title:not([style*="font-size"]) {
        font-size: 2rem;
        white-space: normal;
    }
    
    .server-logo {
        width: 120px;
        height: 120px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .corner-decoration {
        width: 40px;
        height: 40px;
    }
}

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

.hero-section > *:not(.server-title) {
    animation: fadeInUp 0.8s ease forwards;
}

/*.server-logo-container {
    animation-delay: 0.2s;
}*/

/*.server-subtitle {
    animation-delay: 0.6s;
}*/

.action-buttons {
    animation-delay: 0.8s;
}

/* Effetti hover aggiuntivi */
.btn-discord::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(88, 101, 242, 0.3) 0%, transparent 70%);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
}

.btn-discord:hover::after {
    width: 200px;
    height: 200px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #c0a062;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4b76a;
}

/* MODAL TRAILER STYLES */
.trailer-modal, .lore-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: 3% auto;
    width: 90%;
    max-width: 900px;
    background: rgba(20, 20, 20, 0.98);
    border: 3px solid #c0a062;
    border-radius: 20px;
    padding: 0;
    animation: modalSlideIn 0.4s ease;
    box-shadow: 0 20px 60px rgba(192, 160, 98, 0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid rgba(192, 160, 98, 0.3);
    background: rgba(192, 160, 98, 0.1);
    border-radius: 17px 17px 0 0;
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    color: #c0a062;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(192, 160, 98, 0.5);
}

.close-modal {
    color: #c0a062;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
}

.close-modal:hover {
    color: #ffffff;
    background: rgba(192, 160, 98, 0.2);
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    margin: 20px 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 0 17px 17px;
    background: #000;
}

/* Stili per quando il trailer è attivo */
.trailer-active {
    background: rgba(192, 160, 98, 0.15) !important;
    border-color: #d4b76a !important;
    animation: trailerPulse 2.5s ease-in-out infinite;
}

.trailer-active:hover {
    background: rgba(192, 160, 98, 0.25) !important;
    cursor: pointer !important;
    transform: translateY(-3px) scale(1.02) !important;
    animation: none; /* Ferma il pulse durante l'hover */
}

.trailer-active .coming-soon-tooltip {
    display: none !important;
}

.trailer-active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(192, 160, 98, 0.2) 0%, transparent 70%);
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes trailerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(192, 160, 98, 0.4);
        border-color: #c0a062;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(192, 160, 98, 0);
        border-color: #d4b76a;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(192, 160, 98, 0);
        border-color: #c0a062;
    }
}

/* Responsive per il modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .close-modal {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 15% auto;
        width: 98%;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h2 {
        font-size: 1rem;
    }
}

/* Effetto loading per il video */
.video-container::before {
    content: 'Caricamento...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #c0a062;
    font-size: 1.2rem;
    z-index: 1;
}

.video-container iframe[src]:not([src=""]) + ::before {
    display: none;
}

/* LORE MODAL CONTENT */
.lore-content {
    padding: 20px 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.lore-text p {
    color: #ffffff;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.lore-intro {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem !important;
    color: #c0a062 !important;
    text-align: center !important;
    font-weight: 600 !important;
    margin-bottom: 30px !important;
}

.lore-finale {
    color: #c0a062 !important;
    font-weight: 500 !important;
    font-style: italic !important;
    text-align: center !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
}

.lore-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(192, 160, 98, 0.3);
}

.lore-section h4 {
    font-family: 'Cinzel', serif;
    color: #c0a062;
    font-size: 1.3rem;
    margin-bottom: 25px;
    text-align: center;
}

.location-item {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(192, 160, 98, 0.05);
    border-radius: 10px;
    border-left: 3px solid #c0a062;
}

.location-item h5 {
    color: #c0a062;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.location-item p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
}

.discord-login-container {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.btn-discord-login {
    background: #5865F2 !important;
    border-color: #5865F2 !important;
    padding: 10px 20px !important;
}

.btn-discord-login:hover {
    background: #4752C4 !important;
    border-color: #4752C4 !important;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 1; /* Permetti al profilo di ridursi */
    min-width: 0; /* Importante per permettere al testo di essere troncato */
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #c0a062;
}

.username {
    color: white;
    font-weight: 500;
    flex-shrink: 1; /* Permetti al nome di ridursi */
    min-width: 0; /* Importante per text-overflow */
}

.btn-logout {
    background: transparent;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    flex-shrink: 0; /* Il pulsante logout non si riduce */
}

.btn-logout:hover {
    background: rgba(255, 77, 77, 0.1);
}

/* Form per il background */
.btn-background {
    background: rgba(192, 160, 98, 0.2) !important;
    border-color: #c0a062 !important;
}

.btn-background:hover {
    background: rgba(192, 160, 98, 0.3) !important;
}

/* Form Background */
.background-form-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.background-form {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #c0a062;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.background-form h2 {
    color: #c0a062;
    margin-bottom: 25px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #c0a062;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid #333;
    border-radius: 6px;
    color: white !important;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #c0a062;
    background: rgba(192, 160, 98, 0.05);
    color: white !important;
}

.date-inputs {
    display: flex;
    gap: 10px;
}

.date-inputs select,
.date-inputs input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
}

.date-inputs select option {
    background: #1a1a1a;
    color: white;
}

.date-inputs input::-webkit-outer-spin-button,
.date-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.date-inputs input[type=number] {
    -moz-appearance: textfield;
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    grid-column: span 2;
}

/* Animazioni */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .background-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .guidelines-container {
        flex: none;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .btn-background span {
        display: none;
    }
    
    .btn-background .btn-icon {
        margin-right: 0;
    }
    
    .background-wrapper {
        padding: 0 10px;
    }
    
    .guidelines-container {
        padding: 20px;
    }
    
    .guidelines-container h2 {
        font-size: 1.3rem;
    }
    
    .guideline-section h3 {
        font-size: 1rem;
    }
}

.background-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 100px;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

.background-main {
    flex: 1;
    min-height: calc(100vh - 100px);
    width: 100vw; /* Forza larghezza completa */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    overflow-y: auto;
}

.background-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    width: 100%;
    padding: 0 20px;
    align-items: flex-start;
    justify-content: center;
}

.background-container {
    flex: 1;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #c0a062;
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.6s ease forwards;
}

.guidelines-container {
    flex: 0 0 400px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #c0a062;
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(192, 160, 98, 0.2);
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeInUp 0.8s ease forwards;
    position: sticky;
    top: 20px;
}

.guidelines-container h2 {
    font-family: 'Cinzel', serif;
    color: #c0a062;
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 0 10px rgba(192, 160, 98, 0.5);
}

.guidelines-content {
    color: #ffffff;
}

.guideline-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(192, 160, 98, 0.2);
}

.guideline-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.guideline-section h3 {
    color: #c0a062;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.guideline-section p {
    line-height: 1.6;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
}

.guideline-section strong {
    color: #c0a062;
}

.guideline-section.example {
    background: rgba(192, 160, 98, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(192, 160, 98, 0.3);
}

.guideline-section ul {
    margin: 15px 0;
    padding-left: 20px;
    text-align: left;
}

.guideline-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.structure-example {
    margin-top: 20px;
}

.template-item {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(192, 160, 98, 0.08);
    border-radius: 8px;
    border-left: 2px solid #c0a062;
}

.template-item h4 {
    color: #c0a062;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.template-item ul {
    margin: 10px 0;
    padding-left: 20px;
}

.template-item li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.example-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(192, 160, 98, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(192, 160, 98, 0.4);
    color: #c0a062 !important;
    font-style: italic;
    text-align: center !important;
}

/* Sistema notifiche personalizzate eleganti */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.notification-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.notification-content {
    background: linear-gradient(145deg, rgba(10, 10, 10, 0.98), rgba(25, 25, 25, 0.95));
    border: 1px solid rgba(192, 160, 98, 0.3);
    border-radius: 32px;
    padding: 32px 36px;
    text-align: center;
    max-width: 480px;
    min-width: 360px;
    position: relative;
    animation: notificationSlideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(192, 160, 98, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.notification-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(192, 160, 98, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: iconGlow 0.8s ease-out;
    filter: drop-shadow(0 0 12px currentColor);
}

@keyframes iconGlow {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.notification-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #c0a062;
    margin-bottom: 8px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.notification-message {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.notification-progress {
    width: 100%;
    height: 3px;
    background: rgba(192, 160, 98, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 16px;
    position: relative;
}

.notification-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c0a062, #d4b76a, #c0a062);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    animation: progressSlide 3s ease infinite;
    position: relative;
    z-index: 1;
}

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

/* Stili specifici per successo con tonalità più eleganti */
.notification-success {
    border-color: rgba(76, 175, 80, 0.4);
}

.notification-success::before {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, transparent 50%);
}

.notification-success .notification-title {
    color: #66BB6A;
    text-shadow: 0 1px 4px rgba(76, 175, 80, 0.3);
}

.notification-success .notification-icon {
    color: #66BB6A;
}

.notification-success .notification-progress-bar {
    background: linear-gradient(90deg, #4CAF50, #66BB6A, #4CAF50);
    background-size: 200% 100%;
    animation: progressSlide 3s ease infinite;
}

/* Stili specifici per errore con tonalità più eleganti */
.notification-error {
    border-color: rgba(244, 67, 54, 0.4);
}

.notification-error::before {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.08) 0%, transparent 50%);
}

.notification-error .notification-title {
    color: #EF5350;
    text-shadow: 0 1px 4px rgba(244, 67, 54, 0.3);
}

.notification-error .notification-icon {
    color: #EF5350;
}

.notification-error .notification-progress-bar {
    background: linear-gradient(90deg, #f44336, #EF5350, #f44336);
    background-size: 200% 100%;
    animation: progressSlide 3s ease infinite;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .notification-overlay {
        top: 10px;
        right: 10px;
        left: 10px;
        justify-content: center;
    }
    
    .notification-content {
        max-width: none;
        min-width: auto;
        width: 100%;
        margin: 0 10px;
    }
    
    .notification-icon {
        font-size: 2.2rem;
        margin-right: 12px;
    }
    
    .notification-title {
        font-size: 1.2rem;
    }
    
    .notification-message {
        font-size: 0.9rem;
    }
}

.background-container h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: #c0a062;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(192, 160, 98, 0.5);
}

.background-container .subtitle {
    color: #b8b8b8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.username {
    cursor: pointer;
    transition: color 0.3s ease;
}

.username:hover {
    color: #c0a062;
}

.background-form {
    text-align: left;
    width: 100%;
    max-width: 100%;
    /* Centra il form all'interno del container */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    /* Assicura che la griglia sia centrata */
    justify-self: center;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: #c0a062;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(192, 160, 98, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #c0a062;
    box-shadow: 0 0 10px rgba(192, 160, 98, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Contatore caratteri */
.character-counter {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #b8b8b8;
}

.character-counter.warning {
    color: #ffa500;
}

.character-counter.error {
    color: #ff4444;
}

.character-counter.success {
    color: #4CAF50;
}

/* Pulsanti del form */
.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-cancel,
.btn-submit {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-submit {
    background: linear-gradient(135deg, #c0a062, #d4b876);
    color: #000;
    border: 1px solid #c0a062;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #d4b876, #e8cc8a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(192, 160, 98, 0.4);
}

.btn-submit:disabled {
    background: rgba(192, 160, 98, 0.5);
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    .background-page {
        padding-top: 80px; /* Header più piccolo su mobile */
    }
    
    .background-main {
        min-height: calc(100vh - 80px);
        padding: 1rem;
    }
    
    .background-container {
        padding: 2rem;
        margin: 0; /* Rimuovi margin su mobile per usare tutto lo spazio */
        width: 100%;
        max-width: none; /* Permetti di usare tutta la larghezza disponibile */
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .background-container {
        padding: 1.5rem;
    }
    
    .background-container h1 {
        font-size: 2rem;
    }
    
    .background-container .subtitle {
        font-size: 1rem;
    }
}

.header-content.logged-in {
    gap: 8px; /* Riduci gap quando loggato */
}

.header-content.logged-in .header-right {
    gap: 8px; /* Riduci gap tra gli elementi */
    flex-wrap: nowrap; /* Evita il wrap */
    align-items: center;
}

/* Responsive per utente loggato */
@media (max-width: 768px) {
    .header-content.logged-in {
        gap: 5px;
    }
    
    .header-content.logged-in .header-right {
        gap: 5px;
        flex-shrink: 1; /* Permetti di ridursi */
    }
    
    /* Quando loggato, riduci il pulsante Background */
    .header-content.logged-in .btn-background {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .header-content.logged-in .btn-background span {
        display: none; /* Nascondi testo del pulsante Background */
    }
    
    .header-content.logged-in .btn-background .btn-icon {
        margin-right: 0;
        width: 16px;
        height: 16px;
    }
    
    /* Riduci elementi del profilo utente */
    .header-content.logged-in .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .header-content.logged-in .username {
        font-size: 0.9rem;
        max-width: 120px; /* Aumentato per vedere più caratteri */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1; /* Permetti di ridursi se necessario */
    }
    
    .header-content.logged-in .btn-logout {
        padding: 6px; /* Solo padding, senza testo */
        font-size: 0;
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
    }
    
    .header-content.logged-in .logout-icon {
        width: 16px;
        height: 16px;
        color: #ff4d4d;
    }
}

@media (max-width: 480px) {
    .header-content.logged-in .header-right {
        gap: 3px;
    }
    
    /* Pulsante Background solo icona */
    .header-content.logged-in .btn-background {
        width: 30px;
        height: 30px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-content.logged-in .btn-background .btn-icon {
        width: 14px;
        height: 14px;
    }
    
    /* Profilo utente più compatto */
    .header-content.logged-in .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .header-content.logged-in .username {
        max-width: 80px;
        font-size: 0.8rem;
    }
    
    .header-content.logged-in .btn-logout {
        padding: 4px;
        min-width: 28px;
        height: 28px;
    }
    
    .header-content.logged-in .logout-icon {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 400px) {
    /* Per schermi molto piccoli, stack su due righe */
    .header-content.logged-in {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px 0;
    }

    .header-content.logged-in .username {
        max-width: none;
        font-size: 0.9rem;
    }
    
    .header-content.logged-in .btn-logout {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: auto;
        height: auto;
    }
    
    /* Mostra testo nel layout a due righe */
    .header-content.logged-in .btn-logout::after {
        content: "Logout";
        margin-left: 5px;
        font-size: 0.8rem;
    }
    
    .header-content.logged-in .studio-logo {
        order: 1;
    }
    
    .header-content.logged-in .header-right {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    /* Aumenta padding per compensare header più alto */
    .background-page {
        padding-top: 140px;
    }
    
    .main-content {
        padding-top: 140px;
    }
}

.logout-icon {
    transition: all 0.3s ease;
    color: #ff4d4d;
}

.btn-logout:hover .logout-icon {
    color: #ff6666;
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .header-content.logged-in .username {
        max-width: 100px;
        font-size: 0.85rem;
    }
    
    .header-content.logged-in .btn-logout {
        padding: 5px;
        min-width: 30px;
        height: 30px;
    }
    
    .header-content.logged-in .logout-icon {
        width: 14px;
        height: 14px;
    }
}

/* Popup Discord Join */
.discord-join-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.discord-join-popup {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    border: 2px solid #c0a062;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    color: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: popupSlideIn 0.3s ease;
}

.popup-header h3 {
    color: #c0a062;
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    font-family: 'Cinzel', serif;
}

.popup-content p {
    margin: 10px 0;
    line-height: 1.6;
    color: #ccc;
}

.popup-content p:last-child {
    color: #c0a062;
    font-weight: 600;
    margin-bottom: 25px;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-discord-join {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-discord-join:hover {
    background: linear-gradient(135deg, #4752c4, #3c45a5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}

.btn-retry {
    background: linear-gradient(135deg, #c0a062, #a68b4b);
    color: #1a1a1a;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: linear-gradient(135deg, #d4b76e, #c0a062);
    transform: translateY(-1px);
}

.btn-cancel-popup {
    background: transparent;
    color: #999;
    border: 1px solid #555;
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-popup:hover {
    color: #fff;
    border-color: #c0a062;
    background: rgba(192, 160, 98, 0.1);
}

/* Loading Message */
.loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.loading-content {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #c0a062;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: #c0a062;
    min-width: 250px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(192, 160, 98, 0.3);
    border-top: 3px solid #c0a062;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.loading-content p {
    margin: 0;
    font-size: 1rem;
    color: #ccc;
}

/* Animazioni aggiuntive */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Container per pulsante background separato */
.background-button-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    width: 100%;
}

.background-button-container .btn-background {
    animation: backgroundGlow 3s ease-in-out infinite alternate;
}

@keyframes backgroundGlow {
    0% {
        box-shadow: 0 0 20px rgba(192, 160, 98, 0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(192, 160, 98, 0.6);
    }
}

/* Responsive per popup */
@media (max-width: 768px) {
    .discord-join-popup {
        padding: 20px;
        margin: 20px;
    }
    
    .popup-actions {
        gap: 12px;
    }
    
    .btn-discord-join {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .background-button-container {
        margin-top: 20px;
    }
}
