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

:root {
    --primary-color: #ff0000; /* Rosso acceso tipico del gaming */
    --bg-dark: #0f1923;
    --bg-card: #1a242f;
    --text-light: #ece8e1;
    --text-muted: #b8c2cc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

/* =========================================
   Header & Navigazione
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(15, 25, 35, 0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-light);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    height: 70vh;
    background: linear-gradient(rgba(15, 25, 35, 0.7), rgba(15, 25, 35, 0.9)), 
                url('../site-images/c64.webp') center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: var(--text-muted);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #b80000; /* Rosso con contrasto > 6:1 sul bianco (100% PageSpeed) */
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #ff0000;
    transform: translateY(-3px);
}

/* =========================================
   Griglia Principale e Card
   ========================================= */
.container {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

/* CSS Grid per renderla Responsiva */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgb(174 116 120 / 0.2);
}

/* Effetto Hover sull'Immagine */
.card-image {
    width: 100%;
    height: 320px;
    overflow: hidden; /* Nasconde l'immagine che esce dai bordi durante lo zoom */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .card-image img {
    transform: scale(1.1); /* L'immagine si ingrandisce quando passi col mouse sulla card */
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #d1d9e0; /* Tutto il testo della card diventa uniforme e nitido */
}

.platform {
    display: inline-block;
    font-size: 0.8rem;
    /*background-color: var(--primary-color);*/
    background-color: #000000;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 1rem;
    font-weight: bold;
}

.card-content p {
    /*color: var(--text-muted);*/
    color: #d1d9e0;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.read-more {
    /*color: var(--primary-color);*/
    color: #ff6b6b;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: white;
}

/* =========================================
   TEMPLATE ARTICOLO
   ========================================= */

/* Contenitore per ottimizzare la lettura */
.article-container {
    max-width: 900px; /* Non troppo largo, facilita la lettura del testo */
    margin: 3rem auto;
    padding: 0 5%;
}

/* Intestazione */
.article-header h1 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-meta span {
    color: white;
    font-weight: bold;
}

/* Tipografia del contenuto */
.article-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem 0;
    color: white;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem 0;
    color: #d1d5db;
}

.article-content p {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

/* Container Video (Aspetto 16:9 Responsivo) */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Proprietà CSS moderna per i video */
    margin-bottom: 2.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================
   TABELLA SPECIFICHE TECNICHE
   ========================================= */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2.5rem 0;
    /*background-color: var(--bg-card);*/
    background-color: #0f1923;
    color: white;
    border-radius: 8px;
    overflow: hidden; /* Permette ai bordi arrotondati di funzionare */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.specs-table th,
.specs-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-table th {
    background-color: #000000;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Effetto strisce zebrate (colora le righe alterne per migliore leggibilità) */
.specs-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.specs-table tbody tr:hover {
    background-color: rgba(255, 70, 85, 0.1);
}

.specs-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================
   GALLERIA E LIGHTBOX (Immagini zoomabili)
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 3rem;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer; /* Fa capire che è cliccabile */
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    filter: brightness(1.2); /* Illumina l'immagine al passaggio del mouse */
}

/* Struttura nascosta del Modal (Lightbox) */
.modal {
    display: none; /* Nascosta di default */
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Sfondo nero semi-trasparente */
    align-items: center;
    justify-content: center;
}

/* Mostra il modal quando JS aggiunge la classe "active" */
.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh; /* Si adatta alla risoluzione / altezza dello schermo */
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    border-radius: 4px;
    animation: zoomIn 0.3s ease; /* Effetto animato all'apertura */
}

/* Animazione di apertura immagine */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
}

/* =========================================
   INTESTAZIONI PAGINE INTERNE (Es. arcades.html)
   ========================================= */
.page-header {
    background: linear-gradient(rgba(15, 25, 35, 0.8), rgba(15, 25, 35, 1)),
    url('https://images.unsplash.com/photo-1579373903781-fd5c0c30c4cd?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    padding: 4rem 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
}

.page-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* =========================================
   FOOTER & SOCIAL LINKS
   ========================================= */
footer {
    text-align: center;
    padding: 2.5rem 5%;
    background-color: #080d12;
    color: var(--text-muted);
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Leggera linea di separazione */
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.5rem; /* Dimensione delle icone */
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

/* Effetto al passaggio del mouse: si colorano di rosso e fanno un saltello */
.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* =========================================
   PULSANTI DI CONDIVISIONE (SHARE) - CORRETTO
   ========================================= */
.share-section {
    margin: 3rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    /* Centratura generale del blocco */
    display: flex;
    align-items: center; /* Centra verticalmente il testo H4 con i bottoni */
    justify-content: center; /* NOVITÀ: Centra orizzontalmente l'intero blocco nella pagina */
    gap: 15px;
}

.share-section h4 {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1; /* Evita che il testo sembri più alto rispetto ai bottoni */
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    /* Centratura millimetrica dell'icona nel cerchio */
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #191717;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    padding: 0; /* Rimuove eventuali spazi interni predefiniti */
}

/* NOVITÀ: Forza l'icona a non avere sbavature di altezza */
.share-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 1px; /* Opzionale: FontAwesome a volte richiede 1px di spinta per sembrare otticamente perfetto */
}

.share-btn:hover {
    transform: translateY(-4px);
    color: white;
}

/* Colori ufficiali */
.share-btn.facebook:hover { background-color: #1877F2; }
.share-btn.twitter:hover { background-color: #14171A; }
.share-btn.whatsapp:hover { background-color: #25D366; }
.share-btn.telegram:hover { background-color: #0088cc; }


/* =========================================
   YOUTUBE FACADE (Zero Cookie & Fast Load)
   ========================================= */
.youtube-facade {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.youtube-facade:hover img {
    filter: brightness(0.75);
    transform: scale(1.02);
}

.play-btn {
    position: absolute;
    z-index: 2;
    width: 72px;
    height: 50px;
    background-color: #b80000; /* Il rosso primario del sito */
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.play-btn i {
    margin-left: 3px; /* Centra otticamente il triangolino del play */
}

.youtube-facade:hover .play-btn {
    transform: scale(1.12);
    background-color: var(--primary-color);
}

/* =========================================
   Media Queries (Design Responsivo)
   ========================================= */
@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    .share-section {
        flex-direction: column;
        align-items: center; /* Prima era flex-start (sinistra), ora è centrato */
        text-align: center;
        gap: 15px;
    }
}