/* ═══════════════════════════════════════════════════════════
   SalaGiochi — Banner di Navigazione
   Include in ogni gioco con <link rel="stylesheet" href="../nav-banner.css">
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

.sg-nav-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    height: 44px;
    background: linear-gradient(135deg, rgba(13, 2, 33, 0.95), rgba(20, 10, 50, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(123, 44, 191, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(123, 44, 191, 0.1);
    transition: transform 0.3s ease;
}

.sg-nav-banner.sg-hidden {
    transform: translateY(-100%);
}

/* Logo / Home Link */
.sg-nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: all 0.2s;
    padding: 6px 10px;
    border-radius: 8px;
}

.sg-nav-home:hover {
    background: rgba(123, 44, 191, 0.2);
    color: #c084fc;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

.sg-nav-home-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Centro — Nome gioco corrente */
.sg-nav-center {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.sg-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.sg-nav-btn:hover {
    background: rgba(123, 44, 191, 0.3);
    border-color: rgba(123, 44, 191, 0.6);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(123, 44, 191, 0.3);
}

.sg-nav-title {
    color: #e0d0ff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

/* Destra — Toggle banner */
.sg-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sg-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sg-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ccc;
}

/* Floating button when banner hidden */
.sg-nav-show-btn {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 99998;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(123, 44, 191, 0.4);
    background: rgba(13, 2, 33, 0.9);
    backdrop-filter: blur(8px);
    color: #c084fc;
    font-size: 1rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.sg-nav-show-btn.sg-visible {
    display: flex;
}

.sg-nav-show-btn:hover {
    background: rgba(123, 44, 191, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(123, 44, 191, 0.3);
}

/* Spacer da aggiungere al body per non coprire il contenuto */
.sg-nav-spacer {
    height: 44px;
    flex-shrink: 0;
    /* NO width: 100% — in flex-row bodies (es. Snake) causerebbe uno spostamento
       orizzontale del 100% del viewport, spingendo il gioco fuori schermo a destra.
       I layout block e flex-column usano già la larghezza automatica corretta. */
}

/* Responsive */
@media (max-width: 500px) {
    .sg-nav-home span:not(.sg-nav-home-icon) {
        display: none;
    }
    .sg-nav-title {
        font-size: 0.75rem;
        min-width: 80px;
    }
}
