:root {
    --steam-color: #1b2838;
    --steam-blue: #66c0f4;
    --bg-dark: #0a0a0a;
    --upcoming-gold: #ffd700;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: #fff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- HEADER --- */
header {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    z-index: 1000;
    height: 70px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 55px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Testo fallback NASCOSTO sempre — visibile solo via JS se img fallisce */
.logo-text {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    display: none;
}

.btn-contact {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 2px;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 9px 20px;
    text-transform: uppercase;
    transition: 0.3s;
    white-space: nowrap;
}

.btn-contact:hover {
    background: #fff;
    color: #000;
}

/* --- HERO VIDEO FULLSCREEN --- */
.hero-video {
    position: relative;
    width: 100vw;
    height: calc(100vh - 70px);
    margin-top: 70px; /* parte subito sotto l'header fisso */
    overflow: hidden;
    background-color: #000;
}

/* Overlay gradiente sopra il video */
.hero-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.2) 0%,
        rgba(0,0,0,0.0) 40%,
        rgba(0,0,0,0.65) 100%
    );
    z-index: 5;
    pointer-events: none;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

/* 
   FULLSCREEN FIX: 
   L'iframe deve sempre coprire tutto lo schermo.
   Usiamo la tecnica del padding-top 56.25% (rapporto 16:9)
   con l'iframe assolutamente posizionato e sovradimensionato.
*/
.video-background iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Sempre più grande dello schermo per coprire tutto */
    width: max(100vw, 177.78vh);
    height: max(100vh, 56.25vw);
    border: none;
    pointer-events: none;
}

.overlay-content {
    position: absolute;
    bottom: 10vh;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
}

.animated-hero {
    animation: heroFadeIn 1.5s ease forwards;
}

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

.btn-steam {
    background: var(--steam-color);
    border: 1px solid var(--steam-blue);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-steam:hover {
    box-shadow: 0 0 30px rgba(102, 192, 244, 0.55);
    transform: translateY(-3px);
    border-color: #fff;
}

.btn-steam img {
    height: 20px;
}

/* --- GAME CARDS --- */
.games-grid {
    padding: 100px 5% 60px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: #111;
    border: 1px solid rgba(255,255,255,0.07);
    overflow: hidden; /* FONDAMENTALE: impedisce alle immagini di uscire */
    transition: border-color 0.4s ease, background 0.4s ease;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    border-radius: 2px;
}

.game-card:hover {
    border-color: var(--steam-blue);
    background: #151515;
}

/* --- CARD PREVIEW IMAGE --- */
/* Tutte le preview hanno la stessa altezza fissa per coerenza visiva */
.card-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: #0a0a0a;
}

.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease, filter 0.4s ease;
    filter: brightness(0.8) saturate(0.9);
}

.game-card:hover .card-preview img {
    transform: scale(1.06);
    filter: brightness(1) saturate(1.1);
}

.card-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, transparent, #111);
    pointer-events: none;
    transition: background 0.4s;
}

.game-card:hover .card-preview::after {
    background: linear-gradient(to bottom, transparent, #151515);
}

/* Variante logo Crumb Criminals: stessa altezza, logo centrato con contain */
.card-preview--logo {
    background: radial-gradient(ellipse at 50% 60%, #2e1f00 0%, #0d0900 70%);
}

.card-preview--logo img {
    object-fit: contain !important;
    padding: 24px 32px;
    filter: brightness(1) saturate(1) !important;
    transform: none !important;
}

.game-card:hover .card-preview--logo img {
    transform: scale(1.03) !important;
    filter: brightness(1.08) !important;
}

/* game-info area */
.game-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 28px;
}

.badge {
    font-size: 0.6rem;
    font-weight: 800;
    background: var(--steam-blue);
    padding: 4px 10px;
    color: #000;
    margin-bottom: 20px;
    align-self: flex-start;
    letter-spacing: 1px;
}

.badge-upcoming {
    background: var(--upcoming-gold);
}

.game-card h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    font-weight: 900;
}

.game-card p {
    color: #888;
    margin-bottom: 25px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.btn-minimal {
    color: var(--steam-blue);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    transition: gap 0.2s;
}

.btn-minimal:hover {
    gap: 14px;
}

.status-tag {
    font-size: 0.7rem;
    color: var(--upcoming-gold);
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: auto;
}

/* --- BRANDING / WORD ANIMATION --- */
.content {
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.main-brand {
    font-size: clamp(5rem, 20vw, 12rem);
    font-weight: 900;
    opacity: 0.03;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    user-select: none;
}

.loading-container {
    position: relative;
    z-index: 2;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-text {
    font-size: clamp(1rem, 4vw, 2.5rem);
    letter-spacing: 12px;
    font-weight: 300;
}

/* --- FOOTER --- */
footer {
    padding: 40px 5%;
    text-align: center;
    background: #050505;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-copy {
    font-size: 0.6rem;
    color: #444;
}

/* --- REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.game-card:nth-child(1) { transition-delay: 0.0s; }
.game-card:nth-child(2) { transition-delay: 0.15s; }
.game-card:nth-child(3) { transition-delay: 0.3s; }

@keyframes wordFade {
    0%   { opacity: 0; transform: translateY(10px);  filter: blur(5px); }
    30%  { opacity: 1; transform: translateY(0);     filter: blur(0);   }
    70%  { opacity: 1; transform: translateY(0);     filter: blur(0);   }
    100% { opacity: 0; transform: translateY(-10px); filter: blur(5px); }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-video { height: 100svh; }
    .games-grid {
        grid-template-columns: 1fr;
        padding-top: 80px;
    }
    .loading-text { letter-spacing: 6px; }
    .btn-steam {
        width: 90%;
        font-size: 0.78rem;
        justify-content: center;
    }
}

/* --- HERO CTA BUTTON (sotto il video) --- */
.hero-cta {
    background: #0d0d0d;
    padding: 32px 5%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}