/* ==========================================================================
   DAYZ ITALIA - STYLE.CSS (RESTORED & FIXED FOR MOBILE)
   ========================================================================== */
/* --- LOCAL FONTS (GDPR COMPLIANT) --- */

/* ROBOTO (v50) */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/roboto-v50-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/roboto-v50-latin-700.woff2') format('woff2');
}

/* RAJDHANI (v17) */
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/rajdhani-v17-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/rajdhani-v17-latin-700.woff2') format('woff2');
}

/* INTER (v20) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
}

:root {
    --primary: #2ecc71;
    --primary-hover: #27ae60;
    --accent: #e74c3c;
    --discord: #5865F2;
    --dark-bg: #0b0c10;
    --text-main: #eee;
    --font-head: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    color: var(--text-main); font-family: var(--font-body);
    /* Fallback background se PHP fallisce */
    background: #0b0c10; 
    min-height: 100vh;
}

body::before {
    content: ''; position: fixed; inset: 0;
    background: rgba(11, 12, 16, 0.92); z-index: -1;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* --- LAYOUT GENERALE --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px; /* Distanza standard per Desktop */
    display: block !important;
}

/* --- RESPONSIVE MOBILE (Sotto i 768px) --- */
@media (max-width: 768px) {
    .container {
        padding: 10px; /* DIMEZZATO: da 20px a 10px per lato */
    }

    .live-content {
        padding: 15px; /* Riduciamo anche lo spazio interno alla card per guadagnare spazio */
    }

    .live-header {
        flex-direction: row; /* Manteniamo logo e titolo sulla stessa riga se possibile */
        align-items: center;
        gap: 12px;
    }

    .live-logo-img {
        width: 50px; /* Logo leggermente più piccolo */
        height: 50px;
    }

    .live-title-block a[data-role="name"] {
        font-size: 1.2rem; /* Testo titolo più piccolo per non andare a capo */
    }

    .live-actions-block {
        width: 100%;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    .status-badge {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    
    /* RIMOSSO IL BLOCCO CHE NASCONDEVA IL TASTO PLAY/SITO */
    
    /* Opzionale: Allarga il tasto info o discord per occupare lo spazio vuoto */
    .live-buttons {
        justify-content: flex-end;
        width: 100%;
    }
}

/* HEADER */
header { padding: 40px 20px; text-align: center; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); }
header h1 { margin: 0; font-family: var(--font-head); font-size: 3.5rem; text-transform: uppercase; color: #fff; text-shadow: 0 0 20px rgba(46,204,113,0.4); }

.main-nav { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.main-nav a { padding: 8px 16px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #ccc; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { background: var(--primary); color: #000; border-color: var(--primary); }

/* --- SERVER CARDS (FIX LARGHEZZA) --- */
.live-server-card {
    position: relative; width: 100%; min-height: 200px; margin-bottom: 30px;
    border-radius: 12px; overflow: hidden;
    background-color: #111; background-size: cover; background-position: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.live-server-card:hover { transform: translateY(-5px); border-color: rgba(46, 204, 113, 0.5); }
.live-server-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15,17,26,0.95) 0%, rgba(15,17,26,0.8) 60%, rgba(15,17,26,0.4) 100%);
    z-index: 1;
}

.live-content { position: relative; z-index: 2; padding: 25px; height: 100%; display: flex; flex-direction: column; gap: 15px; }

/* CARD HEADER */
.live-header { display: flex; align-items: center; gap: 20px; }
.live-logo-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0; background: #000; }

.live-title-block { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.live-title-block a[data-role="name"] {
    font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: #fff;
    text-shadow: 1px 1px 2px #000; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-title-block a[data-role="name"]:hover { color: var(--primary); }

.live-status-row { display: flex; align-items: center; gap: 10px; }
.server-tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* BADGES */
.status-badge { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.status-online { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.status-offline { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }
.status-dead { background: #333; color: #aaa; border: 1px solid #555; }

.tag-badge { font-size: 0.65rem; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #ccc; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.5px; }

.badge-rank {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #f1c40f, #f39c12); color: #000;
    padding: 5px 12px; border-radius: 6px; font-weight: 800; font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.4); margin-bottom: 5px;
}

/* ACTIONS & BUTTONS */
.live-actions-block { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.live-buttons { display: flex; gap: 8px; }

.live-btn { font-size: 0.75rem; font-weight: 700; padding: 8px 14px; border-radius: 6px; display: flex; align-items: center; gap: 6px; transition: 0.2s; border: 1px solid transparent; }
.live-btn-play { background: rgba(46, 204, 113, 0.1); border-color: var(--primary); color: #fff; }
.live-btn-play:hover { background: var(--primary); color: #000; }
.live-btn-discord { background: rgba(88, 101, 242, 0.2); border-color: var(--discord); color: #ccc; }
.live-btn-discord:hover { background: var(--discord); color: #fff; }
.live-btn-info { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: #aaa; padding: 8px 12px; }
.live-btn-info:hover { border-color: #fff; color: #fff; }

.btn-text-desktop { display: none; margin-left: 4px; }

/* INFO ROW & CHART */
.live-info-row { display: flex; justify-content: space-between; align-items: flex-end; font-size: 0.9rem; color: #ccc; margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; }
.live-info-item { display: flex; align-items: center; gap: 6px; }
.live-icon { color: #f1c40f; }

.live-chart-wrapper { width: 100%; height: 60px; margin-top: 10px; opacity: 0.8; }
.live-chart-wrapper canvas { width: 100% !important; height: 100% !important; }

/* TIME (Giorno/Notte) */
[data-role="time"] { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #aaa; }
[data-role="time"] .day-icon { color: #f1c40f !important; text-shadow: 0 0 10px rgba(241, 196, 15, 0.6); }
[data-role="time"] .night-icon { color: inherit; }

/* --- COMPONENTI EXTRA (Prefazione, Descrizione, Footer) --- */
/* --- PREFAZIONE HOME (Versione Compatta) --- */
.preface-card {
    background: rgba(26, 29, 41, 0.95);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    
    /* MODIFICA QUI: Spazio interno (Sopra/Sotto, Destra/Sinistra) */
    padding: 15px 20px; /* Era 25px 30px -> Ridotto */
    
    /* MODIFICA QUI: Distanza dal primo server sotto */
    margin-bottom: 20px; /* Era 30px -> Ridotto */
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    color: #e1e1e6;
    font-size: 0.95rem; /* Font leggermente più piccolo per occupare meno spazio */
    line-height: 1.5;
    position: relative;
}

/* Gestione paragrafi interni: riduciamo lo spazio tra le righe di testo */
.preface-card p {
    margin: 0 0 8px 0; /* Era 15px -> Dimezzato lo spazio tra i paragrafi */
}

.preface-card p:last-child {
    margin-bottom: 0;
}

/* --- DESCRIZIONE SERVER (Stile Discord) --- */
.desc-box {
    background: rgba(47, 49, 54, 0.6); /* Sfondo simile ai messaggi embed di Discord */
    border-left: 4px solid var(--discord); /* Bordo laterale "Discord Blue" */
    border-radius: 8px;
    padding: 20px; /* Spazio interno contenuto */
    margin-top: 15px;
    
    /* Tipografia Discord */
    color: #dcddde; /* Colore testo standard Discord */
    font-family: 'Inter', sans-serif; /* Font pulito sans-serif */
    font-size: 1rem; /* Dimensione base (16px) */
    line-height: 1.375; /* Interlinea compatta (non troppo spaziata) */
    word-wrap: break-word;
}

/* Gestione Paragrafi: Niente spazi enormi */
.desc-box p {
    margin: 0 0 6px 0; /* Solo 6px di spazio sotto ogni riga/invio */
}
.desc-box p:last-child { margin-bottom: 0; }

/* Gestione Emojis: Le rendiamo leggermente più grandi del testo se sono immagini */
.desc-box img {
    vertical-align: bottom; /* Allinea le emoji alla base del testo */
    max-width: 100%; 
    height: auto;
    border-radius: 4px;
}

/* Se usi il plugin emoji di Quill che crea spans, o per emoji testo */
.desc-box span {
    line-height: 1.4;
}

/* Titoli interni alla descrizione: Compatti e chiari */
.desc-box h1, .desc-box h2, .desc-box h3 {
    color: #fff;
    margin: 15px 0 8px 0; /* Spazio ridotto sopra/sotto */
    font-weight: 700;
    line-height: 1.2;
}
.desc-box h1 { font-size: 1.4rem; border-bottom: 1px solid #4f545c; padding-bottom: 5px; }
.desc-box h2 { font-size: 1.2rem; color: #fff; }
.desc-box h3 { font-size: 1.1rem; color: #b9bbbe; text-transform: uppercase; font-weight: 800; font-size: 0.75rem; }

/* Liste: Compatte come in chat */
.desc-box ul, .desc-box ol {
    margin: 5px 0 10px 20px; /* Spazio ridotto */
    padding-left: 0;
}
.desc-box li {
    margin-bottom: 2px; /* Righe lista vicine */
}
.desc-box ul li::marker { color: var(--discord); } /* Pallini blu discord */

/* Link: Semplici e blu */
.desc-box a {
    color: #00b0f4; /* Azzurro link Discord */
    text-decoration: none;
}
.desc-box a:hover { text-decoration: underline; }

/* Citazioni (Blockquote) */
.desc-box blockquote {
    border-left: 4px solid #4f545c;
    background: inherit; /* Nessuno sfondo extra, solo la barra */
    margin: 5px 0;
    padding: 0 10px;
    color: #a3a6aa; /* Testo leggermente più scuro */
    font-style: normal;
}

.btn-chart {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #aaa; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-weight: 600;
}
.btn-chart.active { background: var(--primary); color: #000; border-color: var(--primary); }

footer { margin-top: 60px; padding: 30px; background: #08090b; text-align: center; color: #666; font-size: 0.85rem; border-top: 1px solid #222; }

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    .btn-text-desktop { display: inline; }
}

@media (max-width: 768px) {
    .live-header { flex-direction: column; align-items: flex-start; }
    .live-actions-block { width: 100%; align-items: center; flex-direction: row; justify-content: space-between; margin-top: 15px; }
    .live-info-row { flex-direction: column; gap: 10px; align-items: flex-start; }
    .live-info-row .right-col { text-align: left !important; width: 100%; display: flex; justify-content: space-between; }
}
/* --- Supporto Allineamento Quill (Editor) --- */
.ql-align-center {
    text-align: center;
}
.ql-align-right {
    text-align: right;
}
.ql-align-justify {
    text-align: justify;
}
/* mostra sito web */
@media (max-width: 768px) {
    .btn-text-desktop { display: none; }
}