* { 
    box-sizing: border-box; 
}

/* ELIMINA SCROLL ORIZZONTALE */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
}

/* Assicura che nessun elemento vada oltre lo schermo */
* {
    max-width: 100%;
}

/* BODY - elimina banda bianca e supporta footer fixed */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    min-height: 100vh;
    overflow-y: auto;
    background-color: #000;
    padding-bottom: 90px;
    width: 100%;
}

/* OVERLAY - sfondo continuo, niente tagli */
.overlay {
    background-image: url('immagini/sfondo.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: rgba(0,0,0,0.55);
    background-blend-mode: darken;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 90px;
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

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

.nav-links a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.nav-links a:hover {
    color: white;
    transform: translateY(-2px);
}

.auth-buttons a, .auth-buttons span {
    margin-left: 12px;
    padding: 7px 14px;
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: 0.3s;
    display: inline-block;
}

.auth-buttons a:hover {
    background-color: white;
    transform: scale(1.05);
}

.auth-buttons span {
    background-color: transparent;
    color: #ffcc00;
    border: 1px solid #ffcc00;
}

/* GRID CENTER */
.center-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 420px 1fr 200px;
    place-items: center;
    padding: 20px;
    max-width: 100vw;
}

/* LEFT COLUMN: LATEST GEAR */
.latest-gear, .top-gear {
    width: 400px;
    max-width: 100%;
    background-color: rgba(255,255,255,0.12);
    padding: 25px;
    border-radius: 12px;
    backdrop-filter: blur(3px);
    margin-bottom: 20px;
}

.latest-gear h3, .top-gear h3 {
    color: #ffcc00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
    text-shadow: 0 0 4px #ffcc00, 0 0 8px #ffcc00, 0 0 12px rgba(255,204,0,0.6);
}

.gear-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    gap: 14px;
    transition: 0.3s;
    cursor: pointer;
}

.gear-item:hover {
    transform: translateX(6px);
}

.gear-item img {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gear-item:hover img {
    transform: scale(1.08);
}

.gear-name {
    font-size: 16px;
    font-weight: bold;
}

.gear-user {
    font-size: 13px;
    opacity: 0.7;
}

/* CENTER: QUOTE */
.quote {
    text-align: center;
    font-size: 22px;
    opacity: 0.9;
    animation: fadeIn 1.5s ease;
    padding: 20px;
    margin-top: 120px;
}

.quote p {
    text-shadow: 0 0 4px #ffcc00, 0 0 8px #ffcc00, 0 0 12px rgba(255,204,0,0.6);
}

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

/* RIGHT: BUTTONS VERTICAL */
.stats {
    text-align: center;
}

.stat-number {
    font-size: 40px;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 4px #ffcc00, 0 0 8px #ffcc00, 0 0 12px rgba(255,204,0,0.6);
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.vertical-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.vertical-buttons a {
    padding: 10px 20px;
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.3s;
}

.vertical-buttons a:hover {
    background-color: white;
    transform: scale(1.05);
}

/* FOOTER (rimane fixed) */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

footer a {
    color: #ffcc00;
    text-decoration: none;
    font-size: 14px;
}

.footer-sponsor {
    margin-left: 40px;
    padding: 6px 14px;
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid rgba(255, 204, 0, 0.35);
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(3px);
}

/* RESET */
html, body {
    margin: 0;
    padding: 0;
}

/* ============================================================
   RESPONSIVE DESIGN - MOBILE PERFETTAMENTE CENTRATO
   ============================================================ */

/* TABLET (max 900px) */
@media (max-width: 900px) {
    header {
        padding: 0 20px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .nav-links a {
        font-size: 14px;
    }
    
    .center-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
        max-width: 100vw;
    }
    
    .latest-gear, .top-gear {
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .stats {
        margin-bottom: 30px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* MOBILE (max 768px) - TUTTO PERFETTAMENTE CENTRATO */
@media (max-width: 768px) {
    body {
        padding-bottom: 50px;
    }
    
    .overlay {
        padding-bottom: 50px;
    }
    
    header {
        flex-direction: column;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    .nav-links a {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .auth-buttons {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    /* GRID MOBILE - UNA COLONNA CENTRATA */
    .center-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
        width: 100%;
        place-items: center;
    }
    
    /* Quote compatta */
    .quote {
        font-size: 16px;
        margin-top: 20px;
        padding: 10px;
    }
    
    /* LATEST GEAR - CENTRATO */
    .latest-gear {
        width: 95%;
        max-width: 400px;
        padding: 15px;
        margin: 10px auto;
    }
    
    .latest-gear h3 {
        font-size: 18px;
    }
    
    /* GEAR OF THE WEEK - CENTRATO */
    .top-gear {
        width: 95%;
        max-width: 400px;
        padding: 15px;
        margin: 10px auto;
    }
    
    .top-gear h3 {
        font-size: 18px;
    }
    
    /* STATS - CENTRATO */
    .stats {
        width: 95%;
        max-width: 300px;
        margin: 15px auto;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .vertical-buttons {
        width: 100%;
    }
    
    .vertical-buttons a {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    footer {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        height: auto;
        width: 100%;
    }
    
    footer a {
        font-size: 12px;
        margin: 0 8px;
    }
    
    .footer-sponsor {
        margin: 10px 0 0 0;
        font-size: 11px;
    }
}

/* MOBILE PICCOLI (max 480px) */
@media (max-width: 480px) {
    .latest-gear {
        width: 98%;
        padding: 12px;
    }
    
    .top-gear {
        width: 98%;
        padding: 12px;
    }
    
    .quote {
        font-size: 14px;
        padding: 10px 5px;
    }
    
    .stats {
        width: 98%;
    }
}

/* ACCESSIBILITA */
.gear-name,
.stat-label,
.gear-user {
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

a:focus,
button:focus {
    outline: 2px solid #ffcc00;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* IMMAGINI E CONTENUTI - NON ESCONO MAI DALLO SCHERMO */
img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
}

table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* CONTAINER E BOX */
.container, .box, div {
    max-width: 100vw;
}
