:root {
    --bg-color: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ff4d00;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* PRELOADER */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-content {
    text-align: center;
    width: 300px;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: 0.2em;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.loading-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

/* VIDEOS */
#video-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1;
    background: #000;
    transform: scale(1.05);
}

.cinematic-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
}

.cinematic-video.active {
    opacity: 1;
    visibility: visible;
}

/* HIGH QUALITY STATIC FRAMES */
.hq-static-frame {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    z-index: 2; /* Sopra ai video, ma sotto la vignettatura */
}

/* CINEMATIC VIGNETTE */
.vignette-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 35%, rgba(0,0,0,0.95) 110%);
    box-shadow: inset 0 0 150px rgba(0,0,0,0.8);
    z-index: 5; /* Sotto l'HUD (10) e il menu (50) */
}

.cinematic-video.active {
    visibility: visible;
}

/* HUD OVERLAY */
.hud-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 4rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.interior-disclaimer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: center;
    width: 90%;
    letter-spacing: 0.05em;
}
.interior-disclaimer.active {
    opacity: 1;
}

.btn-primary:hover {
    background: #e64500;
}

.hero-titles {
    position: absolute;
    top: calc(50% - 50px);
    left: 4rem;
    transform: translateY(-50%);
}

.main-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 5rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* FORZA HORIZON / NFS RACING MENU */
.forza-menu {
    position: absolute;
    bottom: 2rem;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 50;
}

.forza-item {
    position: relative;
    background: rgba(10, 10, 10, 0.85);
    padding: 12px 30px 12px 20px;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    align-items: center;
    width: 220px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.forza-item:hover {
    background: rgba(20, 20, 20, 0.95);
    transform: translateX(8px);
    width: 235px;
}

.forza-item.active {
    background: linear-gradient(90deg, rgba(255,77,0,0.9) 0%, rgba(255,77,0,0.2) 100%);
    width: 260px;
    transform: translateX(12px);
    border-top: 1px solid rgba(255, 77, 0, 0.5);
    border-bottom: 1px solid rgba(255, 77, 0, 0.5);
}

.forza-accent {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.forza-item:hover .forza-accent {
    background: rgba(255, 255, 255, 0.5);
}

.forza-item.active .forza-accent {
    background: #ff4d00;
    box-shadow: 0 0 10px #ff4d00;
}

.forza-content {
    display: flex;
    align-items: center;
    gap: 12px;
    transform: skewX(-5deg);
}

.forza-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease;
}

.forza-item.active .forza-number {
    color: #fff;
    font-weight: 800;
}

.forza-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.forza-item:hover .forza-text {
    color: #fff;
}

.forza-item.active .forza-text {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}



.forza-action-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
    transition: all 0.3s ease;
}

.forza-action-btn:hover, .forza-action-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.action-icon {
    margin-right: 5px;
}


/* SPECS PANEL */
.specs-panel {
    position: absolute;
    bottom: 9rem;
    right: 4rem;
    display: flex;
    gap: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 2.5rem;
    border-radius: 4px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.spec-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.spec-value small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.spec-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

/* RESPONSIVE & MOBILE GAMING UX */
@media (max-width: 1024px) {
    .hud-overlay { padding: 1.5rem; }
    .main-title { font-size: 3.5rem; }
    .forza-menu { bottom: 1.5rem; left: 1.5rem; }
    .specs-panel { display: none; }
}

/* 1. ORIENTATION LOCK (PORTRAIT) */
.orientation-lock {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #050505;
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.orientation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 2rem;
}

.flame-rotate-icon {
    animation: pulse-flame 2s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 15px rgba(255, 77, 0, 0.4));
}

@keyframes pulse-flame {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 77, 0, 0.2)); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(255, 77, 0, 0.8)); }
}

.orientation-content h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 0.1em;
    margin: 0;
}

.orientation-content p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) and (orientation: portrait) {
    .orientation-lock {
        display: flex;
    }
}

/* 2. MOBILE LANDSCAPE GAMING UX */
@media (max-height: 500px) and (orientation: landscape) {
    .top-bar { padding: 0.5rem 1rem; }
    .logo { font-size: 1rem; }
    .btn-primary { padding: 6px 16px; font-size: 0.7rem; }
    
    .hero-titles {
        top: 25% !important;
        left: 20px !important;
        transform: translateY(-50%) !important;
    }
    .main-title { 
        font-size: 1.2rem; 
    }
    .subtitle {
        font-size: 0.5rem;
        letter-spacing: 0.15em;
    }

    /* Forza sidebar optimized for left thumb */
    .forza-menu {
        bottom: 10px;
        left: 10px;
        gap: 0px;
    }

    .forza-item {
        padding: 5px 15px 5px 10px;
        width: 120px;
    }

    .forza-item:hover, .forza-item.active {
        width: 135px;
    }

    .forza-text {
        font-size: 0.7rem;
    }
    
    .forza-number {
        font-size: 0.5rem;
    }

    /* Actions optimized for right thumb */
    .forza-actions {
        display: flex;
        position: fixed;
        bottom: 70px; /* Leave space for sound button from parent */
        right: 10px;
        left: auto;
        flex-direction: column;
        gap: 5px;
        margin: 0;
        padding: 0;
        z-index: 100;
    }
    
    .forza-action-btn {
        padding: 6px 12px;
        font-size: 0.6rem;
    }

    .vignette-overlay {
        background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.4) 100%);
        box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    }
}

@keyframes elegant-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
        transform: scale(1) translateX(0);
    }
    50% {
        box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.2);
        transform: scale(1.02) translateX(3px);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1) translateX(0);
    }
}

.pulse-anim {
    animation: elegant-pulse 2s infinite ease-in-out;
}


/* Hardware acceleration and anti-flicker for video transitions */
.cinematic-video, .hq-static-frame, #empty-garage-bg {
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-transform: translate3d(0,0,0) !important;
    transform: translate3d(0,0,0) !important;
    background: #000 !important;
}
#video-container, body, html {
    background: #000 !important;
}

