/* ========================================
   TOPBAR CONTROLS - CONSOLIDATO
   Gestisce: header layout, bottoni fase, CFU
   ======================================== */

/* ========================================
   HEADER LAYOUT - FIX CFU POSITION
   ======================================== */

#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.85);
    border-bottom: 2px solid rgba(0, 200, 255, 0.5);
    position: relative;
    z-index: 100;
    gap: 15px;
}

/* Turn Info - Sinistra */
#turn-info {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 600;
    color: #00d4ff;
}

/* Phase Indicator - Sinistra-Centro */
#phase-indicator {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

/* Container bottoni - Centro */
#phase-buttons-container {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: center; /* ⭐ CENTRA I BOTTONI */
    max-width: 600px;
}

/* CFU Info - Destra ma NON all'estremo */
#cfu-info {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 700;
    color: #ffcc00;
    margin-right: 140px; /* ⭐ SPAZIO PER FULLSCREEN + EXIT */
}

/* ========================================
   BOTTONI NELLA TOPBAR
   ======================================== */

/* Stile comune per tutti i bottoni */
.topbar-button {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.topbar-button:active {
    transform: scale(0.95);
}

/* Bottone Conferma Setup (Verde) */
#confirm-setup-btn-topbar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

#confirm-setup-btn-topbar:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Bottone Next Phase (Blu) */
#next-phase-btn-topbar {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

#next-phase-btn-topbar:hover {
    background: linear-gradient(135deg, #00bfff 0%, #0088bb 100%);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

/* Bottone Trasferisci Mood (Arancione) */
#mood-transfer-btn-topbar {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

#mood-transfer-btn-topbar:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Nascondi classe .show se non necessaria */
.topbar-button.show {
    display: inline-flex;
}

.topbar-button:not(.show) {
    display: none;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    #game-header {
        padding: 8px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    #turn-info,
    #phase-indicator {
        font-size: 13px;
    }
    
    #cfu-info {
        font-size: 14px;
        margin-right: 110px; /* ⭐ RIDOTTO PER MOBILE */
    }
    
    .topbar-button {
        padding: 7px 14px;
        font-size: 12px;
        gap: 5px;
    }
    
    #phase-buttons-container {
        gap: 8px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #game-header {
        padding: 6px 10px;
    }
    
    #turn-info,
    #phase-indicator {
        font-size: 11px;
    }
    
    #cfu-info {
        font-size: 12px;
        margin-right: 90px;
    }
    
    .topbar-button {
        padding: 6px 12px;
        font-size: 11px;ls
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */

@media (max-width: 896px) and (orientation: landscape) {
    #game-header {
        padding: 6px 12px;
    }
    
    .topbar-button {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    #cfu-info {
        margin-right: 100px;
    }
}
/* ========================================
   FIX URGENTE - Force Topbar Position
   ======================================== */

/* Container bottoni DEVE stare in topbar */
#phase-buttons-container {
    position: relative !important;
    display: flex !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
}

/* Bottoni DEVONO essere inline nella topbar */
#confirm-setup-btn-topbar,
#next-phase-btn-topbar,
#mood-transfer-btn-topbar {
    position: relative !important;
    display: inline-block !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 5px !important;
}
