        @import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@400;600;700;800;900&display=swap');
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            opacity: 0;
            font-family: 'Nunito', 'Fredoka', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
            font-weight: 600;
            text-transform: none;
            letter-spacing: 0;
            background: linear-gradient(135deg, #F0FFF0, #E0FFFF);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px;
            user-select: none;
            overflow-x: hidden;
			    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
        }

        /*
         * Classe applicata al body quando viene aperta una finestra modale.
         * Disabilita lo scroll della pagina e blocca lo spostamento del layout
         * quando appare la tastiera su dispositivi mobili.
         */
        body.modal-open {
            overflow: hidden;
            position: fixed;
            width: 100%;
            touch-action: none;
        }

        .game-container {
            visibility: hidden;
            width: 100%;
            max-width: 600px;
            text-align: center;
            display: flex;
            flex-direction: column;
min-height: calc(100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
height: auto;
            position: relative;
			    overflow-x: hidden;
    box-sizing: border-box;
	    padding: 0 12px; 

        }
/* 🚫 PREVIENE SCROLL ORIZZONTALE */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* ⚡ ELIMINA DELAY 300ms AL TAP SU TUTTI I BOTTONI */
button, a, [onclick], [role="button"] {
    touch-action: manipulation;
}

* {
    box-sizing: border-box;
}
        .header-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px;
            margin-bottom: 8px;
            position: relative;
            z-index: 100;
			padding-top: calc(8px + var(--safe-area-inset-top));

        }

  .title {
    color: #FFFFFF; /* Bianco per contrasto */
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8); /* Ombra più scura per leggibilità */
    flex: 1;
    text-align: center;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.3); /* Sfondo semitrasparente dietro il testo */
    padding: 8px 16px;
    border-radius: 15px;
    backdrop-filter: blur(5px); /* Effetto vetro smerigliato */
}

.settings-button {
    width: clamp(60px, 12vw, 80px);
    height: clamp(60px, 12vw, 80px);
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    border: 4px solid #7D3C98;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(28px, 6vw, 36px);
    color: white;
    box-shadow: 0 4px 20px rgba(155,89,182,0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 700;
    position: relative;
    /* ✨ NIENTE ROTAZIONE! */
}

.back-button {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: #2C7873;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
    flex-shrink: 0;
}
.back-button:active { transform: scale(0.92); }

:root {
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

@keyframes gentle-hint {
    0%, 85% { transform: translateX(-50%) scale(1); }
    90% { transform: translateX(-50%) scale(1.05); }
    95% { transform: translateX(-50%) scale(1.02); }
    100% { transform: translateX(-50%) scale(1); }
}
/* ✨ Hover semplice */

@keyframes settings-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
       
.nutritionist-character {
    width: clamp(60px, 12vw, 80px);
    height: clamp(60px, 12vw, 80px);
    background: linear-gradient(135deg, #FFE4B5, #DEB887);
    border: 4px solid #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(28px, 6vw, 36px);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    
    /* ✨ NESSUNA ANIMAZIONE - Il bordo si animerà dinamicamente */
}

/* ✅ NUOVA CLASSE: Bordo animato durante antispam */
.nutritionist-character.antispam-active {
    border-color: #FF8C00;
    animation: antispam-border 2s ease-out;
}

@keyframes antispam-border {
    0% { 
        border-color: #FF4444;
        box-shadow: 0 4px 20px rgba(255, 68, 68, 0.6);
    }
    100% { 
        border-color: #FFD700;
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    }
}

/* Animazione pulse ogni 4 secondi */
@keyframes gentle-pulse {
    0%, 90% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    }
    95% { 
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    }
}

/* ✨ HOVER PIÙ EVIDENTE */


/* ✨ ETICHETTA "CONSIGLI" SEMPRE VISIBILE */
.nutritionist-character::after {
    content: var(--advice-text, '💡 Consigli');
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 1; /* ✅ SEMPRE VISIBILE */
    pointer-events: none;
    letter-spacing: 0.5px;
    border: 2px solid #FFD700; /* ✅ BORDO FISSO */
}

/* ✨ PICCOLA ICONA CHAT nell'angolo */
.nutritionist-character::before {
    content: '💬';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: chat-bounce 2s infinite;
}

/* Animazione per l'icona chat */
@keyframes chat-bounce {
    0%, 80% { transform: scale(1); }
    90% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ✨ RESPONSIVE: Su mobile più grande e accessibile */
@media (max-width: 768px) {
    .nutritionist-character {
        width: clamp(70px, 15vw, 90px);
        height: clamp(70px, 15vw, 90px);
        border-width: 5px;
    }
    
    .nutritionist-character::after {
        bottom: -30px;
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .nutritionist-character::before {
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: -10px;
        right: -10px;
    }
}

        @keyframes bounce-talk {
            0%, 100% { transform: scale(1) rotate(0deg); }
            25% { transform: scale(1.1) rotate(-3deg); }
            50% { transform: scale(1.15) rotate(0deg); }
            75% { transform: scale(1.1) rotate(3deg); }
        }

        .speech-bubble {
            position: absolute;
            top: 90px;
            right: 10px;
            background: white;
            border: 4px solid #FF6B6B;
            border-radius: 20px;
            padding: 15px;
            max-width: 250px;
            font-size: clamp(14px, 3vw, 18px);
            font-weight: 700;
            color: #333;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 9999;
            text-align: center;
            letter-spacing: 1px;
        }

        .speech-bubble::after {
            content: '';
            position: absolute;
            top: -10px;
            right: 25px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 10px solid white;
        }

        .settings-panel {
    position: absolute;
    top: 90px;
    left: 10px;
    background: linear-gradient(135deg, #F8F9FA, #E9ECEF);
    border: 4px solid #9B59B6;
    border-radius: 20px;
padding: 35px 15px 8px 15px;
    max-width: 320px;
    min-width: 280px;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 700;
    color: #333;
    box-shadow: 0 8px 30px rgba(155,89,182,0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    text-align: left;
    line-height: 1.5;
	    pointer-events: none; 
}
.settings-close-x {
    position: absolute;
top: 30px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #FF6B6B, #E55D75);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    z-index: 10000;
}

.settings-panel.show {
    opacity: 1;
    transform: translateY(0);
	    pointer-events: auto; 
}

.settings-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E9ECEF;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-title {
    color: #9B59B6;
    font-size: clamp(16px, 3.5vw, 18px);
    margin-bottom: 8px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #CCC;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: #32CD32;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toggle-switch.active::before {
    transform: translateX(24px);
}

.settings-close-btn {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
    width: 100%;
}

        .speech-bubble.show, .info-bubble.show {
            opacity: 1;
            transform: translateY(0);
        }
.mode-selector {
    background: linear-gradient(135deg, #2C3E50, #34495E);
    border-radius: 12px;
    padding: 6px 10px;
    margin: 4px 0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    border: 3px solid #E67E22;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 40px;
    width: 100%;
    max-width: 100%;
}

.mode-selector label {
    font-size: clamp(12px, 2.8vw, 16px);
    font-weight: 700;
    color: #ECF0F1;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.mode-selector select {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: clamp(12px, 3vw, 16px);
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.3px;
    font-family: inherit;
    min-height: 44px;
    min-width: 180px;
    max-width: 220px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

@media (min-width: 769px) {
    .mode-selector select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
}

.mode-selector select:focus {
    outline: 3px solid #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.5), 0 2px 8px rgba(0,0,0,0.3);
}

.mode-selector select option {
    background: white;
    color: #333;
    font-weight: 700;
    padding: 8px;
    font-size: 12px;
}

/* MOBILE - AREA CLICCABILE MASSIMA */
@media (max-width: 768px) {
    .mode-selector {
        padding: 8px 12px;
        min-height: 60px;
        margin: 4px 0;
        gap: 8px;
        background: linear-gradient(135deg, #2C3E50, #34495E);
        border: 3px solid #E67E22;
        position: relative;
        z-index: 10;
    }
    
    .mode-selector label {
        font-size: clamp(12px, 3vw, 16px);
        color: #ECF0F1;
        pointer-events: none; /* Evita che la label interferisca */
    }
    
    .mode-selector select {
        min-height: 50px; /* AREA MOLTO PIÙ GRANDE */
        min-width: 160px;
        max-width: 200px;
        padding: 12px 16px; /* PADDING AUMENTATO */
        padding-right: 40px;
        font-size: clamp(12px, 3vw, 16px);
        background-size: 16px;
        background-position: right 12px center;
        border: 3px solid #2C7873;
        border-radius: 12px;
        
        /* Rimuove appearance su mobile per area più grande */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        
        /* Forza l'area touch */
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
        
        /* MASSIMA COMPATIBILITÀ TOUCH */
        position: relative;
        z-index: 100;
        cursor: pointer;
        box-sizing: border-box;
        width: 100%;
        height: 50px;
        margin: 0;
        outline: none;
    }
}

/* MOBILE PICCOLO - AREA TOUCH MASSIMIZZATA */
@media (max-width: 480px) {
    .mode-selector {
        padding: 12px 16px;
        min-height: 80px; /* PIÙ ALTO */
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        background: linear-gradient(135deg, #2C3E50, #34495E);
        position: relative;
        z-index: 10;
    }
    
    .mode-selector label {
        font-size: 16px;
        min-width: auto;
        text-align: center;
        color: #ECF0F1;
        pointer-events: none; /* Evita interferenze */
    }
    
    .mode-selector select {
        min-height: 56px; /* AREA TOUCH ENORME */
        min-width: 100%;
        max-width: 100%;
        font-size: 16px; /* TESTO PIÙ GRANDE */
        padding: 16px 20px; /* PADDING MASSIMO */
        padding-right: 50px;
        background-size: 20px;
        background-position: right 16px center;
        border-radius: 16px;
        border: 3px solid #2C7873;
        
        /* Ottimizzazioni touch mobile */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.4);
        
        /* FORZA L'AREA TOUCH SU TUTTO IL RETTANGOLO */
        position: relative;
        z-index: 100;
        cursor: pointer;
        
        /* Estende l'area cliccabile */
        box-sizing: border-box;
        width: 100% !important;
        height: 56px !important;
        
        /* Rimuove margini che potrebbero interferire */
        margin: 0;
        outline: none;
        
        /* Forza il browser a rendere tutta l'area tappabile */
        background-clip: padding-box;
    }
    
    /* Overlay per estendere ulteriormente l'area touch */
    .mode-selector select::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        z-index: -1;
        pointer-events: none;
    }
    
    /* Forza il focus su tutto il select */
    .mode-selector select:focus,
    .mode-selector select:active {
        z-index: 200;
        outline: 3px solid #FFD700;
        outline-offset: 2px;
    }
}

/* MOBILE MOLTO PICCOLO - AREA TOUCH DEFINITIVA */
@media (max-width: 360px) {
    .mode-selector select {
        min-height: 60px; /* ANCORA PIÙ GRANDE */
        font-size: 18px;
        padding: 18px 24px;
        padding-right: 54px;
        
        /* MASSIMA COMPATIBILITÀ TOUCH */
        width: 100% !important;
        height: 60px !important;
        box-sizing: border-box;
        display: block;
        
        /* Elimina qualsiasi interferenza */
        position: relative;
        z-index: 999;
        margin: 0;
        
        /* Forza il rendering come elemento nativo */
        -webkit-appearance: menulist;
        -moz-appearance: menulist;
        appearance: menulist;
    }
    
    /* Su schermi molto piccoli, torna all'appearance nativa per massima usabilità */
    .mode-selector select {
        background-image: none !important;
        padding-right: 24px !important;
    }
}       .message {
    background: #FFE5B4;
    border: 4px solid #FFA500;
    border-radius: 20px;
    padding: 12px;
margin: clamp(6px, 1.5vh, 10px) 0;
    font-size: clamp(16px, 3.5vw, 20px);
    font-weight: 700;
    color: #333;
min-height: clamp(60px, 12vh, 80px);
max-height: clamp(60px, 12vh, 80px);
    line-height: 1.2;     /* 🔧 ottimizza densità */
    overflow: hidden;     /* 🔒 evita righe extra */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
    letter-spacing: 1px;
}

        .message.positive {
            background: #90EE90;
            border-color: #32CD32;
            color: #006400;
        }

     
.hint-message {
    background: linear-gradient(135deg, #FFE4B5, #F0E68C);
    border: 3px solid #DAA520;
    border-radius: 15px;
    padding: 8px 12px;
    margin: 6px 0;
    font-size: clamp(12px, 2.8vw, 16px);
    font-weight: 600;
    color: #8B4513;
    text-align: center;
    box-shadow: 0 3px 12px rgba(218, 165, 32, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    line-height: 1.3;
    animation: hint-glow 4s infinite;
}

@keyframes hint-glow {
    0%, 70% { 
        box-shadow: 0 3px 12px rgba(218, 165, 32, 0.3);
        transform: scale(1);
    }
    85% { 
        box-shadow: 0 5px 20px rgba(218, 165, 32, 0.5);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 3px 12px rgba(218, 165, 32, 0.3);
        transform: scale(1);
    }
}

/* Nascondi hint dopo primo uso */
.hint-message.used {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

        .meal-selector {
            background: rgba(255,255,255,0.95);
            border-radius: 20px;
            padding: 12px;
            margin: 8px 0;
            backdrop-filter: blur(15px);
            box-shadow: 0 6px 25px rgba(0,0,0,0.15);
            text-align: center;
            flex-shrink: 0;
            border: 3px solid rgba(255,255,255,0.8);
        }

        .current-meal {
            text-align: center;
            font-size: clamp(18px, 4vw, 24px);
            font-weight: 700;
            color: #FF6B6B;
            margin: 5px 0;
            letter-spacing: 2px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
        }

        .plate-container {
            position: relative;
            margin: 12px 0;
            flex-shrink: 0;
            display: flex;
            justify-content: center;
        }

        .plate {
width: clamp(240px, 50vw, 350px);
height: clamp(240px, 50vw, 350px);
  background: conic-gradient(
    rgba(255,193,7,1) 0deg 90deg,      /* 🍞 Carboidrati in alto a destra */
    rgba(244,67,54,1) 90deg 180deg,   /* 🍗 Proteine in basso a destra */
    rgba(76,175,80,1) 180deg 360deg   /* 🥦 Verdure a sinistra */
  );   border: 6px solid #E6E6FA;
    border-radius: 50%;
    position: relative;
    overflow: visible;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.2),
        inset 0 3px 10px rgba(255,255,255,0.8);
    transition: all 0.5s ease;
            font-size: clamp(14px, 3vw, 18px);
            color: #666;
            box-shadow: 
                0 10px 30px rgba(0,0,0,0.2),
                inset 0 3px 10px rgba(255,255,255,0.8);
            transition: all 0.5s ease;
            position: relative;
            overflow: visible;
        }


     .plate-food {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
    position: absolute;
    
    width: clamp(50px, 12vw, 70px);
    height: clamp(50px, 12vw, 70px);
    font-size: clamp(35px, 8vw, 55px);
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    margin-left: calc(clamp(50px, 12vw, 70px) / -2);
    margin-top: calc(clamp(50px, 12vw, 70px) / -2);
    /* ✅ Resto uguale */
    animation: plateFood 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10;
}

        @keyframes plateFood {
            0% {
                transform: scale(0) rotate(-180deg);
                opacity: 0;
            }
            50% {
                transform: scale(1.3) rotate(-90deg);
                opacity: 0.8;
            }
            100% {
                transform: scale(1) rotate(0deg);
                opacity: 1;
            }
        }

        .plate-message {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: clamp(18px, 5vw, 28px);
            text-align: center;
            z-index: 5;
            transition: opacity 0.3s ease;
            font-weight: 700;
            letter-spacing: 1px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
                display: none !important;

            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .plate-icon {
            font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
            font-size: clamp(24px, 6vw, 36px);
            margin-bottom: 5px;
        }

        .plate.celebration-mode {
            animation: plate-celebration 2s ease-in-out;
        }

        @keyframes plate-celebration {
            0%, 100% { transform: scale(1) rotate(0deg); }
            25% { transform: scale(1.05) rotate(-2deg); }
            50% { transform: scale(1.1) rotate(0deg); }
            75% { transform: scale(1.05) rotate(2deg); }
        }
/* ✨ SEZIONI HARVARD DEL PIATTO */
.plate-section {
    position: absolute;
    border: none;
    pointer-events: none;
}

.section-carbs {
    top: 10%;
    right: 10%;
    width: 35%;
    height: 35%;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 0 20px 0 0;
}

.section-proteins {
    bottom: 10%;
    right: 10%;
    width: 35%;
    height: 35%;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 0 0 20px 0;
}


        .foods-container {
            display: flex;
            flex-direction: row;
			 align-items: center; /* ✅ questa riga centra verticalmente i food-item */
            overflow-x: auto;
            overflow-y: hidden;
            gap: 12px;
            scroll-snap-type: x mandatory;
padding: clamp(16px, 4vh, 24px) 12px;
min-height: clamp(140px, 20vh, 180px);
            min-width: 100%;
            background: rgba(255,255,255,0.3);
            border-radius: 20px;
            margin: 8px 0;
            backdrop-filter: blur(10px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.1);
            border: 3px solid rgba(255,255,255,0.5);
            scrollbar-width: none;
            -ms-overflow-style: none;
			   -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    touch-action: pan-x; /* ✨ Consente solo scroll orizzontale */
        }

        .foods-container::-webkit-scrollbar {
            display: none;
        }
/* ⚡ OTTIMIZZAZIONI MOBILE - PERFORMANCE */
@media (max-width: 768px) {
    /* Stop animazioni pesanti su mobile */
    .zone-illuminate,
    .zone-highlight,
    .zone-clickable-hint {
        animation: none !important;
        transform: none !important;
        box-shadow: none !important;
        border: 4px solid #FFD700 !important;
        background: rgba(255, 215, 0, 0.2) !important;
    }
    
    /* Selezione cibo più leggera */
    .food-item.selected-food {
        animation: none !important;
        transform: scale(1.1) !important;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
        border: 4px solid #FFD700 !important;
    }
    
    /* Hardware acceleration */
    .food-item,
    .plate-section {
        will-change: transform;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Transizioni ridotte */
    .food-item,
    .plate-section,
    .zone-illuminate {
        transition: border 0.2s ease, background 0.2s ease !important;
    }
}
       .food-scroll-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px; 
    box-sizing: border-box;
}
/* Mobile: nascondi frecce perché si usa il touch */
@media (max-width: 768px) {
    .arrow {
        display: none; /* Le frecce non servono su mobile */
    }
    
    .food-scroll-wrapper {
        padding: 0; /* Rimuovi padding su mobile */
    }
}

        .arrow {
            background: white;
            border: 2px solid #ccc;
            font-size: 26px;
            font-weight: bold;
            padding: 8px 14px;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            transition: transform 0.2s ease;
            user-select: none;
        }


.hidden {
  display: none !important;
}
        .food-item {
            font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
            width: 100%;
            aspect-ratio: 1;
            max-width: 120px;
            max-height: 120px;
            min-width: 80px;
            min-height: 80px;
            border-radius: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: clamp(28px, 7vw, 40px);
            margin: 0 auto;
            cursor: pointer;
            background: linear-gradient(135deg, #F0F8FF, #E6E6FA);
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            user-select: none;
            border: 3px solid transparent;
            flex: 0 0 auto;
            scroll-snap-align: start;
            margin: 0;
			    touch-action: manipulation; /* Evita zoom ma consente long press */
        }

        /* Cibo con immagine reale: stesso sfondo delle emoji, img senza sfondo proprio */
        .food-item.has-img {
            background: linear-gradient(135deg, #F0F8FF, #E6E6FA);
        }
        .food-item.has-img img {
            width: 58px;
            height: 58px;
            object-fit: contain;
            display: block;
            flex-shrink: 0;
            background: transparent;
            mix-blend-mode: multiply;
        }

        /* NUOVO: Bordi colorati per modalità facile */
        .food-item.healthy {
            border: 4px solid #32CD32 !important;
        }

        .food-item.unhealthy {
            border: 4px solid #FF6B6B !important;
        }

        /* NUOVO: Modalità sfida - bordo neutro */
        .food-item.challenge-mode {
            border: 3px solid #E6E6FA !important;
        }

        .food-label {
            font-size: clamp(10px, 2.3vw, 14px);
            margin-top: 4px;
            font-weight: 700;
            color: #333;
            text-align: center;
            letter-spacing: 0.2px;
            line-height: 1.1;
            max-width: 100%;
            padding: 0 3px;
            overflow-wrap: anywhere;
            word-break: break-word;
            hyphens: auto;
        }

        @keyframes food-click {
            0% { transform: scale(1); }
            50% { transform: scale(0.9); }
            100% { transform: scale(1); }
        }

        .food-item:active {
            animation: food-click 0.3s ease;
        }


    .food-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}


.food-info-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #E8F5E8, #F0FFF0);
    border: 4px solid #32CD32;
    border-radius: 20px;
    padding: 20px;
    max-width: 320px;
    min-width: 280px;
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: 600;
    color: #2F4F2F;
    text-align: center;
    box-shadow: 0 10px 30px rgba(50, 205, 50, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    line-height: 1.4;
}

.food-info-popup.unhealthy {
    background: linear-gradient(135deg, #FFE4E1, #FFF0F5);
    border-color: #FF6B6B;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.food-info-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.food-info-popup .food-emoji {
    font-size: clamp(40px, 8vw, 60px);
    margin-bottom: 10px;
    display: block;
}

.food-info-popup .food-name {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 700;
    color: #FF6B6B;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.food-info-popup .food-description {
    margin-bottom: 20px;
    line-height: 1.5;
}

.food-info-popup .close-btn {
    background: linear-gradient(135deg, #32CD32, #90EE90);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}


.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.popup-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* ═══════════════════════════════════════════
   LONG-PRESS SPOTLIGHT HINT — una-tantum
═══════════════════════════════════════════ */

/* tooltip con freccia */
.lp-tooltip {
    position: fixed;
    z-index: 99992;
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border: 3px solid #FFD700;
    border-radius: 18px;
    padding: 12px 18px;
    max-width: 210px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #5d4037;
    line-height: 1.4;
    box-shadow: 0 6px 24px rgba(0,0,0,0.28);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.lp-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.lp-tooltip .lp-finger {
    display: block;
    font-size: 26px;
    margin-bottom: 4px;
    animation: lpFingerBounce 1s ease-in-out infinite;
}
@keyframes lpFingerBounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
.lp-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
}
.lp-tooltip.arrow-down::after {
    top: 100%;
    border-top-color: #FFD700;
}
.lp-tooltip.arrow-up::after {
    bottom: 100%;
    border-bottom-color: #FFD700;
}

/* ═══════════════════════════════════════════
   SCHEDA ALIMENTO — Il Piatto Sano
   Font: Fredoka (titoli) + Nunito (testo)
   Palette: vivace ma leggibile, no ALL-CAPS
═══════════════════════════════════════════ */
.scheda-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.78);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    animation: schedaPopIn 0.36s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes schedaPopIn {
    from { opacity: 0; transform: scale(0.82) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.scheda-card {
    background: #ffffff;
    border-radius: 28px;
    width: 100%;
    max-width: 560px;
    max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    box-shadow: 0 32px 72px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.08);
    font-family: 'Nunito', 'Fredoka', sans-serif;
    display: flex;
    flex-direction: column;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.scheda-card::-webkit-scrollbar { width: 4px; }
.scheda-card::-webkit-scrollbar-track { background: transparent; }
.scheda-card::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
@media (max-height: 600px) {
    .scheda-card { max-height: 95vh; border-radius: 18px; }
    .scheda-header { padding: 14px 16px 10px; }
    .scheda-emoji-big { font-size: 42px; }
    .scheda-body { padding: 8px 12px 6px; gap: 6px; }
    .scheda-row { padding: 8px 12px 9px; }
}
/* ── Header ── */
.scheda-header {
    border-radius: 28px 28px 0 0;
    padding: 26px 22px 18px;
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.scheda-verdict-icon {
    display: none; /* rimosso dall'HTML, tenuto per compatibilità */
}
.scheda-emoji-big {
    font-size: 62px;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
    margin-bottom: 2px;
}
.scheda-nome {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(22px, 5.5vw, 30px);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1.1;
}
.scheda-sub {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 700;
    background: rgba(255,255,255,0.24);
    border-radius: 20px;
    padding: 3px 14px;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.scheda-verdict-msg {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(13px, 3vw, 15px);
    font-weight: 700;
    background: rgba(0,0,0,0.22);
    border-radius: 12px;
    padding: 8px 16px;
    margin-top: 8px;
    line-height: 1.45;
    max-width: 100%;
    text-align: center;
}
/* ── Body sections ── */
.scheda-body {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.scheda-row {
    border-radius: 16px;
    padding: 12px 15px 13px;
}
.scheda-row-label {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(11px, 2.6vw, 13px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.scheda-row-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(14px, 3.4vw, 16px);
    font-weight: 500;
    line-height: 1.55;
    color: #2c2c2c;
    /* NO uppercase, NO bold — leggibilità massima */
    text-transform: none;
    letter-spacing: 0;
}
/* Row colors */
.scheda-row-green  { background: #f0faf4; }
.scheda-row-blue   { background: #f0f6ff; }
.scheda-row-yellow { background: linear-gradient(135deg,#fffce8,#fff8cc); }
/* ── Footer ── */
.scheda-footer {
    padding: 8px 16px 16px;
}
.scheda-btn-ok {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 15px 20px;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(15px, 3.8vw, 18px);
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: #fff;
    touch-action: manipulation;
    transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.scheda-btn-ok:active { transform: scale(.97); }


        @keyframes shine {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
            50% { opacity: 1; }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
        }

        .celebration {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255,215,0,0.1);
            pointer-events: none;
            z-index: 9999;
            opacity: 0;
        }

        .celebration.active {
            animation: celebrate 1s ease-in-out;
        }

        @keyframes celebrate {
            0%, 100% { opacity: 0; }
            50% { opacity: 1; }
        }

        .confetti {
            position: absolute;
            width: 12px;
            height: 12px;
            background: #FFD700;
            animation: confetti-fall 3s linear infinite;
        }

        @keyframes confetti-fall {
            0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
            100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
        }

        .completion-banner, .final-victory-banner {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.85);
            border: 5px solid;
            border-radius: 30px;
            padding: 25px 35px;
            font-size: clamp(20px, 4vw, 26px);
            font-weight: 700;
            color: #fff;
            text-align: center;
            text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
            z-index: 2001;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
            max-width: 350px;
            letter-spacing: 2px;
        }

        .completion-banner {
            background: linear-gradient(135deg, #32CD32, #90EE90, #98FB98);
            border-color: #228B22;
            box-shadow: 0 15px 40px rgba(50,205,50,0.4);
        }

        .final-victory-banner {
            background: linear-gradient(135deg, #FF69B4, #FFB6C1, #87CEEB);
            border-color: #FF1493;
            box-shadow: 0 15px 40px rgba(255,20,147,0.4);
            animation: rainbow-border 2s infinite;
        }
/* ✨ DESKTOP: Bottone sotto al messaggio */
/* ✨ DESKTOP: Layout ottimizzato */
@media (min-width: 769px) {
    .final-victory-banner {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 25px;
        padding: 35px 45px 45px;
        max-width: 420px; /* ✨ Larghezza controllata */
        min-height: 300px; /* ✨ Altezza minima */
        line-height: 1.4; /* ✨ Spaziatura linee migliore */
    }
    
    .final-victory-banner .restart-btn {
        margin-top: 25px;
        align-self: center;
        width: 100%; /* ✨ Larghezza piena del container */
        max-width: 280px; /* ✨ Ma limitata */
        min-width: 250px;
        padding: 18px 30px; /* ✨ Padding ottimizzato */
        font-size: clamp(16px, 2.5vw, 20px); /* ✨ Font responsive */
        white-space: nowrap; /* ✨ Evita il wrap del testo */
        overflow: hidden; /* ✨ Nasconde overflow */
        text-overflow: ellipsis; /* ✨ Punti se troppo lungo */
        border-radius: 35px; /* ✨ Più arrotondato */
        box-shadow: 0 8px 25px rgba(255,165,0,0.4); /* ✨ Ombra più morbida */
    }
}

/* Mobile: mantieni layout normale */
@media (max-width: 768px) {
    .final-victory-banner .restart-btn {
        margin-top: 20px;
        width: 90%;
    }
}
        @keyframes rainbow-border {
            0% { border-color: #FF1493; }
            25% { border-color: #00CED1; }
            50% { border-color: #FFD700; }
            75% { border-color: #32CD32; }
            100% { border-color: #FF1493; }
        }

  .completion-banner .restart-btn,
.final-victory-banner .restart-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    border: 4px solid #FF8C00;
    padding: 18px 34px;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(255,165,0,0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    font-family: 'Fredoka', sans-serif;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.25);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: bounce-glow 1.8s infinite;
}

@keyframes bounce-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px rgba(255, 165, 0, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 140, 0, 0.8);
    }
}


        .completion-banner.show, .final-victory-banner.show {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: auto;
        }

        /* Responsive Design Ottimizzato */
        
        /* Tablet */
        @media (min-width: 768px) and (max-width: 1024px) {
            .game-container {
                max-width: 700px;
                padding: 0 20px;
            }
            
            .foods-container {
                grid-template-columns: repeat(4, 1fr);
                gap: 15px;
                padding: 20px;
            }
            
            .food-item {
                max-width: 140px;
                max-height: 140px;
            }
        }

        /* Desktop */
        @media (min-width: 1025px) {
            body {
                padding: 20px;
            }
            
            .game-container {
                max-width: 800px;
                padding: 0 30px;
            }
            
            .food-item {
                max-width: 130px;
                max-height: 130px;
            }
        }

        /* Mobile Piccolo */
        @media (max-width: 480px) {
            .foods-container {
                grid-template-columns: repeat(3, 1fr);
                gap: 10px;
                padding: 12px;
            }
            
            .food-item {
                min-width: 75px;
                min-height: 75px;
                max-width: 100px;
                max-height: 100px;
            }
        }

        /* Mobile Molto Piccolo */
        @media (max-width: 360px) {
            .game-container {
                 padding: 0 8px;
            }
            
            .foods-container {
                grid-template-columns: repeat(3, 1fr);
                gap: 8px;
                padding: 10px;
            }
            
            .food-item {
                min-width: 70px;
                min-height: 70px;
                max-width: 90px;
                max-height: 90px;
            }
        }

        /* Orientamento Landscape per Mobile */
        @media (max-height: 600px) and (orientation: landscape) {
            .game-container {
                max-height: none;
                height: auto;
            }
            
            .foods-container {
                grid-template-columns: repeat(6, 1fr);
                gap: 8px;
                padding: 10px;
            }
            
            .food-item {
                min-width: 60px;
                min-height: 60px;
                max-width: 80px;
                max-height: 80px;
            }
            
            .plate {
                width: clamp(150px, 35vw, 200px);
                height: clamp(150px, 35vw, 200px);
            }
        }
		
#main-intro, #mode-intro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #F0FFF0, #E0FFFF);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--safe-area-inset-top)) 8px calc(8px + var(--safe-area-inset-bottom));
  animation: fadeIn 0.5s ease;
  overflow-y: auto;
}

/* Schermata "A COSA GIOCHIAMO?" (#mode-selection-screen, creata via JS):
   centra verticalmente il riquadro col metodo sicuro (auto-margin: centra se c'è
   spazio, ma non taglia mai la parte alta se il contenuto supera lo schermo).
   In CSS così funziona anche se il JS resta vecchio in cache. */
#mode-selection-screen > div { margin: auto 0; }


#intro-bubble {
  position: relative;
  background: white;
  border: 4px solid #4ECDC4;
  border-radius: 20px;
  padding: 18px;
  width: 90vw;
  max-width: min(94vw, 760px);
  /* Dimensione STANDARD: fissa e coerente tra le slide, scroll interno se serve */
  height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
  margin: 10px;
  overflow: hidden;
}

/* 📱 Mobile: bubble = viewport pieno, contenuto scorre INTERNAMENTE, nav SEMPRE in fondo */
@media (max-width: 600px) {
  #main-intro, #mode-intro {
    align-items: stretch !important;
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh;            /* dvh = si adatta a barra indirizzi mobile */
    padding: 0 !important;
    background: white !important;
  }
  #intro-bubble {
    height: 100dvh;
    min-height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    overflow: hidden;
    padding: 14px 14px calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .intro-text-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
    padding: 6px 4px 12px !important;
  }
  /* Nav SEMPRE nello stesso punto (in fondo al bubble), non si sposta tra le slide */
  .ob-nav {
    position: absolute !important;
    left: 0; right: 0;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: linear-gradient(to top, #ffffff 65%, rgba(255,255,255,0)) !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 5;
  }
  .ob-nav .ob-back, .ob-nav .ob-next { width:54px; height:54px; }
  /* Chip allergie più compatti su mobile (esempi più piccoli) */
  .allergen-chip { padding: 8px 14px 8px 10px !important; }
  .allergen-chip .chip-examples {
    font-size: 10px !important;
    line-height: 1.15 !important;
    margin-top: 2px !important;
    padding-top: 2px !important;
  }
}


/* IMMAGINE SERAFINA — fissa (no bounce), grande, in cima al bubble */
.serafina-intro-img {
  width: clamp(110px, 14vw, 150px);
  height: clamp(110px, 14vw, 150px);
  object-fit: cover;
  border-radius: 22px;
  border: 4px solid #4ECDC4;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  margin-bottom: 12px;
  margin-top: 4px;
  animation: none !important;
  flex-shrink: 0;
}

* CONTENUTO CHE SI ESPANDE/RESTRINGE */
.intro-text-content {
  flex: 1;
  min-height: 0;            /* permette al figlio flex di restringersi e attivare overflow */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* scroll fluido su iOS */
  overscroll-behavior: contain;
  touch-action: pan-y;       /* abilita scroll verticale al touch */
  padding: 10px 10px 90px;
  line-height: 1.4;
  width: 100%;

  /* FORZA SCROLL DALL'ALTO */
  scroll-behavior: smooth;
  overflow-anchor: none; /* Evita auto-scroll */

  /* ANIMAZIONE FLUIDA quando cambia contenuto */
  transition: opacity 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes serafinaBounce {
  0%, 100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}

.serafina-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}


#intro-bubble .restart-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    border: 4px solid #E55D75;
    padding: 16px 32px;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

#intro-bubble .restart-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Effetto brillante al passaggio del mouse */
#intro-bubble .restart-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

@keyframes button-shine {
    0% { 
        transform: translateX(-100%) translateY(-100%) rotate(45deg); 
        opacity: 0; 
    }
    50% { 
        opacity: 1; 
    }
    100% { 
        transform: translateX(100%) translateY(100%) rotate(45deg); 
        opacity: 0; 
    }
}

/* Versione mobile-friendly */
@media (max-width: 480px) {
    #intro-bubble .restart-btn {
        padding: 18px 28px;
        font-size: 18px;
        border-radius: 20px;
        margin-top: 16px;
        min-height: 56px;
        width: auto;
        letter-spacing: 1px;
    }
}


#intro-bubble .start-btn {
    background: linear-gradient(135deg, #32CD32, #90EE90);
    color: white;
    border: 4px solid #228B22;
    padding: 18px 36px;
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    margin: 20px 0;              /* ✅ Modificato: rimosso 'auto' per allinearsi a .continue-btn */
    box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4);
    transition: all 0.3s ease;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-block;       /* ✅ Cambiato da 'block' a 'inline-block' come .continue-btn */
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

#intro-bubble .start-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(50, 205, 50, 0.5);
}


/* Effetto brillante */
#intro-bubble .start-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

@keyframes start-button-shine {
    0% { 
        transform: translateX(-100%) translateY(-100%) rotate(45deg); 
        opacity: 0; 
    }
    50% { 
        opacity: 1; 
    }
    100% { 
        transform: translateX(100%) translateY(100%) rotate(45deg); 
        opacity: 0; 
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    #intro-bubble .start-btn {
        padding: 20px 32px;
        font-size: 20px;
        border-radius: 25px;
        margin-top: 18px;
        min-height: 60px;
        letter-spacing: 1.5px;
    }
}


#intro-bubble .continue-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border: 3px solid #2C7873;
    padding: 14px 28px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    transition: all 0.3s ease;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    text-decoration: none;
    animation: continue-glow 2s infinite;
}

#intro-bubble .continue-btn:active {
    transform: translateY(0) scale(0.98);
}

@keyframes continue-glow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(78, 205, 196, 0.6);
    }
}

/* Mobile */
@media (max-width: 480px) {
    #intro-bubble .continue-btn {
        padding: 16px 24px;
        font-size: 18px;
        margin-top: 14px;
        min-height: 54px;
    }
}
/* Mattino - Colazione */
body.morning-time {
    background: url('../images/breakfast-bg.webp') center/cover no-repeat;
    position: relative;
}

/* Mezzogiorno - Pranzo */  
body.noon-time {
    background: url('../images/lunch-bg.webp') center/cover no-repeat;
    position: relative;
}

/* Sera - Cena */
body.evening-time {
    background: url('../images/dinner-bg.webp') center/cover no-repeat;
    position: relative;
}

/* Overlay semitrasparente per migliorare la leggibilità del testo */
body.morning-time::before,
body.noon-time::before,
body.evening-time::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: -1;
}

/* Rimuovi le stelline CSS dato che sono già nell'immagine della cena */
@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* 🩺 QUESTIONARIO SALUTE FIGO */
#health-questionnaire {
  background: white;
  border: 4px solid #4ECDC4;
  border-radius: 20px;
  padding: 15px;     /* ✨ RIDUCI ANCHE QUI */
  max-width: 600px;
  max-height: 55vh;  /* ✨ RIDUCI ANCHE QUI */
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.questionnaire-header h2 {
    color: #FF6B6B;
    font-size: clamp(15px, 3.4vw, 19px);
    margin-bottom: 4px;
    line-height: 1.2;
}

.questionnaire-header p {
    color: #666;
    font-size: clamp(11px, 2.4vw, 13px);
    margin-bottom: 8px;
}

.allergy-section, .intolerance-section {
    margin: 6px 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.allergy-section h3 {
    color: #FF6B6B;
    font-size: clamp(13px, 2.8vw, 15px);
    margin-bottom: 6px;
}

.intolerance-section h3 {
    color: #FF8C00;
    font-size: clamp(13px, 2.8vw, 15px);
    margin-bottom: 6px;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 6px;
    margin: 4px 0;
}

.food-selector {
    background: white;
    border: 2px solid #E6E6FA;
    border-radius: 11px;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    user-select: none;
}

.food-selector.selected {
    border-color: #32CD32;
    background: #F0FFF0;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(50,205,50,0.4);
}

.allergy-grid .food-selector.selected {
    border-color: #FF6B6B;
    background: #FFE4E1;
    box-shadow: 0 8px 25px rgba(255,107,107,0.4);
}

.intolerance-grid .food-selector.selected {
    border-color: #FFA500;
    background: #FFF4E6;
    box-shadow: 0 8px 25px rgba(255,165,0,0.4);
}

/* ===== CHIP COMPATTI per allergie/intolleranze (pattern UX moderno) ===== */
.allergy-grid, .intolerance-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 720px;
    margin: 4px auto 0;
}
.allergen-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 12px;
    background: white;
    border: 2px solid #E6E6FA;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    font-family: inherit;
}
.allergen-chip .chip-emoji {
    font-size: 22px;
    line-height: 1;
}
.allergen-chip .chip-name {
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 700;
    color: #333;
    letter-spacing: 0.3px;
}
.allergen-chip:active { transform: scale(0.96); }

/* ===== Esempi inline (es. 🥛🧀🍦) ===== */
.allergen-chip { flex-direction: column; align-items: stretch; }
.allergen-chip .chip-main { display: inline-flex; align-items: center; gap: 8px; }
.allergen-chip .chip-examples {
    display: block;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px dashed rgba(0,0,0,0.10);
    text-align: center;
    font-size: clamp(10px, 2vw, 12px);
    font-weight: 500;
    color: #666;
    line-height: 1.2;
    font-style: italic;
    letter-spacing: 0.2px;
}
.allergen-chip.selected .chip-examples { color: rgba(255,255,255,0.92); border-top-color: rgba(255,255,255,0.45); font-style: normal; }
/* Hover su desktop/LIM: peek degli esempi anche se non selezionato */
@media (hover: hover) and (pointer: fine) {
    .allergen-chip:hover .chip-examples {
        display: block;
        opacity: 0.7;
        border-top-color: rgba(0,0,0,0.1);
    }
    .allergen-chip { transition: transform 0.12s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s; }
    .allergen-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
}

/* Selected: ALLERGIA (rosso) */
.allergen-chip.selected {
    background: linear-gradient(135deg, #FF6B6B, #E74C3C);
    border-color: #C0392B;
    box-shadow: 0 4px 14px rgba(231,76,60,0.35);
}
.allergen-chip.selected .chip-name { color: white; }

/* Selected: INTOLLERANZA (arancio) */
.allergen-chip.intol.selected {
    background: linear-gradient(135deg, #FFA726, #FB8C00);
    border-color: #E65100;
    box-shadow: 0 4px 14px rgba(251,140,0,0.35);
}

/* 📱 Mobile: chip in GRIGLIA 2 colonne uniformi (niente più wrap caotico) */
@media (max-width: 600px) {
    .allergy-grid, .intolerance-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        max-width: 100% !important;
        justify-content: stretch !important;
    }
    .allergen-chip {
        padding: 8px 10px;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
    .allergen-chip .chip-main { justify-content: center; }
    .allergen-chip .chip-emoji { font-size: 20px; }
    .allergen-chip .chip-name  { font-size: 12.5px; }
}

.food-emoji {
    font-size: clamp(22px, 5vw, 32px);
    margin-bottom: 2px;
    line-height: 1;
}

.food-name {
    font-size: clamp(10px, 2.3vw, 12px);
    font-weight: 800;
    color: #333;
    margin-bottom: 1px;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.food-subtext {
    font-size: clamp(8px, 1.8vw, 10px);
    color: #888;
    font-weight: 500;
    line-height: 1.15;
}
/* 🚀 BOTTONI SUPER FIGHI */
.questionnaire-buttons {
    position: absolute;
    bottom: 14px;
    right: 14px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 6;
    display: flex;
    gap: 10px;
    align-items: center;
}
.questionnaire-buttons .super-btn.primary {
    min-width: auto;
    padding: 12px 22px;
    font-size: clamp(13px, 2.6vw, 16px);
    box-shadow: 0 6px 18px rgba(34,139,34,0.4);
}
/* ===== ONBOARDING STEPPER (1/4 → 4/4) ===== */
.ob-stepper {
    display:flex;align-items:center;justify-content:center;gap:6px;
    margin: 4px 0 14px;width:100%;
}
.ob-close-menu {
    position:absolute;top:10px;left:10px;z-index:20;
    width:34px;height:34px;border-radius:50%;
    background:rgba(255,255,255,0.92);border:1.5px solid #e0e6ec;
    color:#7a8a93;font-size:16px;font-weight:900;font-family:inherit;
    cursor:pointer;display:flex;align-items:center;justify-content:center;
    box-shadow:0 2px 8px rgba(0,0,0,0.10);
    transition:all .15s ease;line-height:1;
}
.ob-close-menu:hover { background:#fff;color:#E74C3C;border-color:#E74C3C; }
.ob-close-menu:active { transform:scale(0.92); }
@media (min-width: 1024px) {
    .ob-close-menu { width:40px;height:40px;font-size:18px;top:14px;left:14px; }
}
.ob-stepper .ob-dot {
    width:8px;height:8px;border-radius:50%;background:#dde5ea;transition:all .3s ease;
}
.ob-stepper .ob-dot.done { background:#4ECDC4; }
.ob-stepper .ob-dot.active { background:#2C7873;width:26px;border-radius:6px; }
.ob-step-label {
    font-size:11px;color:#7a8a93;font-weight:700;letter-spacing:0.5px;
    text-transform:uppercase;margin-left:8px;
}

/* ===== TITOLO BIG ONBOARDING ===== */
.ob-title {
    font-size:clamp(18px,4.6vw,24px);
    font-weight:900;color:#1a3a5c;letter-spacing:0.3px;text-align:center;
    margin: 0 0 4px;line-height:1.15;
}
.ob-subtitle {
    font-size:clamp(11px,2.6vw,13px);color:#667;text-align:center;
    line-height:1.35;margin: 0 6px 12px;font-weight:500;
}

/* ===== CARD DIETA (stile quiz) ===== */
.diet-cards {
    display:flex;flex-direction:column;gap:10px;width:100%;max-width:380px;margin:0 auto 4px;
}
.diet-card {
    position:relative;border-radius:18px;overflow:hidden;
    border:3px solid transparent;cursor:pointer;
    box-shadow:0 3px 12px rgba(0,0,0,0.08);
    height:clamp(112px, 20vh, 176px);
    transition:transform .15s ease, box-shadow .2s ease, border-color .2s ease;
    text-align:left;
}
.diet-card:active { transform:scale(0.98); }
.diet-card .diet-img {
    position:absolute;inset:0;
    display:flex;align-items:center;justify-content:center;
    font-size:54px;background:#f5fbfa;
}
.diet-card .diet-img img { width:100%;height:100%;object-fit:cover; }
.diet-card .diet-body {
    position:absolute;left:0;right:0;bottom:0;z-index:2;
    padding:14px 14px 10px;text-align:center;
    background:linear-gradient(to top,rgba(255,255,255,0.97) 60%,rgba(255,255,255,0) 100%);
}
.diet-card .diet-name {
    font-size:clamp(16px,4.2vw,20px);font-weight:900;letter-spacing:0.4px;
    margin-bottom:3px;line-height:1.15;text-transform:uppercase;
}
.diet-card .diet-desc {
    font-size:clamp(11px,2.6vw,12px);color:#556;line-height:1.3;font-weight:500;
}
.diet-card.omni { border-color:#E74C3C; }
.diet-card.omni .diet-name { color:#C0392B; }
.diet-card.veget { border-color:#F39C12; }
.diet-card.veget .diet-name { color:#D68910; }
.diet-card.vegan { border-color:#27AE60; }
.diet-card.vegan .diet-name { color:#1E8449; }
.diet-card.selected {
    box-shadow:0 0 0 4px rgba(78,205,196,0.25), 0 4px 16px rgba(0,0,0,0.12);
    transform:scale(1.02);
}
.diet-card.selected::after {
    content:'✓';position:absolute;top:8px;right:10px;
    background:#4ECDC4;color:white;font-weight:900;font-size:14px;
    width:22px;height:22px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;line-height:1;
    box-shadow:0 2px 6px rgba(0,0,0,0.18);
}

/* ===== NAV BAR onboarding (← + → / GIOCHIAMO) ===== */
.ob-nav {
    position:absolute;left:0;right:0;bottom:12px;
    display:flex;align-items:center;justify-content:space-between;
    padding:0 16px;gap:10px;pointer-events:none;
}
.ob-nav > * { pointer-events:auto; }
.ob-nav .ob-back, .ob-nav .ob-next {
    background:linear-gradient(135deg,#4ECDC4,#2C7873);color:white;
    border:none;border-radius:50%;width:56px;height:56px;
    font-size:24px;font-weight:800;
    cursor:pointer;box-shadow:0 6px 18px rgba(78,205,196,0.4);
    font-family:inherit;display:flex;align-items:center;justify-content:center;line-height:1;
    transition:opacity .2s ease, transform .15s ease;
}
.ob-nav .ob-back:active, .ob-nav .ob-next:active { transform:scale(0.95); }
.ob-nav .ob-next[disabled] { opacity:0.35;cursor:not-allowed;box-shadow:0 3px 8px rgba(0,0,0,0.08); }
.ob-nav .ob-next:not([disabled]):active { transform:scale(0.95); }
.ob-nav .ob-play {
    background:linear-gradient(135deg,#4ECDC4,#2C7873);color:white;
    border:none;border-radius:28px;height:56px;padding:0 28px;
    font-size:clamp(14px,3.4vw,17px);font-weight:900;letter-spacing:0.8px;
    cursor:pointer;box-shadow:0 8px 22px rgba(44,120,115,0.42),0 2px 6px rgba(0,0,0,0.08);
    font-family:inherit;display:flex;align-items:center;justify-content:center;
    text-align:center;line-height:1;
    animation:primary-pulse 2s infinite;
}
.ob-nav .ob-play:active { transform:scale(0.97); }
.ob-nav .ob-spacer { width:48px;height:48px; }

/* ===== Recap 4/4: footer FISSO (difficoltà + GIOCHIAMO sempre visibili, niente scroll) ===== */
#intro-bubble.ob-recap-screen { padding-bottom: 18px !important; }
.recap-footer {
    flex-shrink: 0;
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    padding: 12px 14px 2px;
    margin-top: 4px;
    border-top: 1px solid rgba(0,0,0,0.07);
    background: #fff;
}
.recap-footer .recap-nav {
    position: static !important;
    left: auto !important; right: auto !important; bottom: auto !important;
    padding: 0 !important;
    margin-top: 22px !important;
    margin-bottom: 0 !important;
}
.recap-footer .recap-nav .ob-play { flex: 1; }
.recap-serafina {
    width: clamp(82px, 13vh, 132px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12));
    animation: recap-bob 3.2s ease-in-out infinite;
}
@keyframes recap-bob {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) { .recap-serafina { animation: none; } }
/* Mobile: Serafina molto più grande (c'è spazio bianco da riempire) */
@media (max-width: 768px) {
    .recap-serafina { width: clamp(150px, 44vw, 220px) !important; }
}

/* Freccia "indietro slide" (FAB) per tornare alla slide precedente del questionario */
.qhealth-prev {
    background: rgba(255,255,255,0.95);
    border: 2px solid #4ECDC4;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    color: #2C7873;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.food-item.intolerance-warning {
    border-color: #FFD700 !important;
    border-width: 4px !important;
}
.intolerance-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: #FFD700;
    border: 2px solid #FFA500;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #7a5800;
    line-height: 20px;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}
.super-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border: none;
    border-radius: 25px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 250px;
	max-width: 90%;    

    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.super-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.super-btn.primary {
    background: linear-gradient(135deg, #32CD32, #90EE90, #98FB98);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    border: 4px solid #228B22;
    animation: primary-pulse 2s infinite;
    min-width: 280px;  /* ✨ STESSO WIDTH */
}

.super-btn.secondary {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    border: 4px solid #2C7873;
    min-width: 280px;  /* ✨ STESSO WIDTH */
}}

.btn-icon {
    font-size: clamp(20px, 5vw, 28px);
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.btn-text {
    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: 700;
}

@keyframes primary-pulse {
    0%, 70% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    85% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15), 0 0 0 8px rgba(50,205,50,0.3);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15), 0 0 0 16px rgba(50,205,50,0);
    }
}

/* 📱 MOBILE RESPONSIVE */
@media (max-width: 480px) {
    .super-btn {
        min-width: 200px;   /* ✨ PIÙ PICCOLO */
        max-width: 85%;     
        padding: 14px 20px; /* ✨ PADDING RIDOTTO */
        gap: 8px;           /* ✨ GAP RIDOTTO */
    }
    
    .questionnaire-buttons {
        gap: 12px;
        padding: 0 10px;    
    }
}

/* ✨ EFFETTO CLICK */
.super-btn:active {
    transform: translateY(1px) scale(0.98);
    transition: all 0.1s ease;
}
.questionnaire-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

@media (max-width: 480px) {
    .food-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .food-selector {
        padding: 10px 5px;
    }
    

}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Bottone questionario verde come il start-btn originale */
#intro-bubble .continue-btn:first-of-type {
    background: linear-gradient(135deg, #32CD32, #90EE90) !important;
    border: 4px solid #228B22 !important;
    box-shadow: 0 8px 25px rgba(50, 205, 50, 0.4) !important;
}

/* ✨ ZONE ESTERNE PER FRUTTA E GRASSI */
.external-food-top {
    position: absolute;
    top: -50px;
    left: 20%;
    width: 60%;
    height: 40px;
}

.external-food-bottom {
    position: absolute;
    bottom: -50px;
    left: 20%;
    width: 60%;
    height: 40px;
}

.external-food-left {
    position: absolute;
    left: -50px;
    top: 20%;
    width: 40px;
    height: 60%;
}

.external-food-right {
    position: absolute;
    right: -50px;
    top: 20%;
    width: 40px;
    height: 60%;
}

.section-vegetables::after {
    content: var(--vegetables-label, "Verdure");
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.section-carbs::after {
    content: var(--carbs-label, "Carbo");
    position: absolute;
    top: 5px;
    right: 5px;
    /* stesso stile di sopra */
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.section-proteins::after {
    content: var(--proteins-label, "Proteine");
    position: absolute;
    bottom: 5px;
    right: 5px;
    /* stesso stile */
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}


.fruit-container {
    position: absolute;
    top: 10px;
    right: 100px!important;
    width: 80px;
    height: 100px;
    /* ✅ RIMOSSO: sfondo, bordo, ombra - solo container invisibile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Etichetta in alto, frutta sotto */
    gap: 5px;
}

.fruit-label {
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255, 165, 0, 0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 10px;
    border: 2px solid #FF8C00;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.fruit-label::before {
    content: var(--fruits-label, "Frutta");
}

.fruit-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Mobile standard */
@media (max-width: 768px) {
    .fruit-container {
        top: -15px;
        right: 80px;
        z-index: 150;
        width: 75px;
    }
}

/* Mobile piccolo - il tuo fix */
@media (max-width: 480px) {
    .fruit-container {
        top: 15px;
        right: 280px !important; /* Il tuo valore che funziona */
    }
}

/* Galaxy S8+ - deve essere PIÙ A DESTRA quindi right più basso */
@media (max-width: 400px) {
    .fruit-container {
        right: 260px !important; /* Più a destra di 280px */
    }
}

/* Schermi ultra-piccoli - ancora più a destra */
@media (max-width: 360px) {
    .fruit-container {
        right: 240px !important; /* Ancora più a destra */
    }
}

.fruit-container {
    position: absolute !important;
    top: 5px !important;
    right: clamp(10px, 3vw, 40px) !important; /* Più vicino al bordo */
    width: clamp(70px, 16vw, 95px) !important;
    height: 110px !important; /* Altezza adeguata per label + rettangolo frutta */
    z-index: 150 !important;
}
/* ✅ MOBILE: Riduci dimensioni cibi nel piatto */
@media (max-width: 768px) {
    .plate-food {
        font-size: clamp(50px, 11vw, 75px); /* ✅ Era clamp(55px, 12vw, 85px) */
    }
}

/* ✅ MOBILE PICCOLO: Ancora più piccoli */
@media (max-width: 480px) {
    .plate-food {
        font-size: clamp(45px, 10vw, 60px); /* ✅ Ancora più piccoli */
    }
}
@media (max-width: 360px) {
    .fruit-container {
        right: 70px;   /* ✅ Ancora più centrato */
        width: 70px;
        top: -10px;
    }
}


/* ✅ Durante la colazione, l'etichetta diventa "Frutta" */
body.morning-time .section-vegetables::after {
    content: var(--fruits-label, "Frutta") !important;
    background: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

/* ✅ Nascondi il container frutta originale durante la colazione */
body.morning-time .fruit-container {
    display: none !important;
}

/* ✅ BORDO SCURO durante i consigli */
.nutritionist-character.giving-advice {
    border-color: #FF8C00;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.6);
}

/* ✅ FIX: Animazione hover/focus su mobile */
@media (max-width: 768px) {
    .settings-button:active .difficulty-badge-text,
    .settings-button:focus .difficulty-badge-text {
        transform: translateX(-50%) scale(1.15) !important;
        transition: transform 0.3s ease !important;
    }
    
    /* ✅ Forza l'animazione gentle-hint anche su mobile */
    .difficulty-badge-text {
        animation: gentle-hint 8s infinite, mobile-badge-visible 0.5s ease-out !important;
    }
}

/* ✅ NUOVA: Animazione di apparizione per mobile */
@keyframes mobile-badge-visible {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) scale(0.8); 
    }
    100% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1); 
    }
}

/* ✅ Migliora l'animazione gentle-hint per mobile */
@media (max-width: 768px) {
    @keyframes gentle-hint {
        0%, 80% { transform: translateX(-50%) scale(1); }
        90% { transform: translateX(-50%) scale(1.08); } /* ✅ PIÙ EVIDENTE */
        95% { transform: translateX(-50%) scale(1.04); }
        100% { transform: translateX(-50%) scale(1); }
    }
}

/* ✅ SEZIONI HARVARD DEL PIATTO - POSIZIONI CORRETTE (blindate con !important) */
.plate-section {
    position: absolute !important;
    border: none;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ✅ VERDURE: Lato sinistro del piatto */
.section-vegetables {
    top: 10% !important;
    left: 10% !important;
    right: auto !important;
    bottom: auto !important;
    width: 35% !important;
    height: 80% !important;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 20px 0 0 20px;
}

/* ✅ CARBOIDRATI: Angolo alto destro */
.section-carbs {
    top: 10% !important;
    right: 10% !important;
    left: auto !important;
    bottom: auto !important;
    width: 35% !important;
    height: 35% !important;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 0 20px 0 0;
}

/* ✅ PROTEINE: Angolo basso destro */
.section-proteins {
    bottom: 10% !important;
    right: 10% !important;
    top: auto !important;
    left: auto !important;
    width: 35% !important;
    height: 35% !important;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 0 0 20px 0;
}

.section-center {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: 30% !important;
    height: 30% !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(248, 248, 248, 0.95) !important; /* Quasi bianco */
    border-radius: 50%;
    border: none !important;
}

/* ✅ ETICHETTE - Posizioni corrette */
.section-vegetables::after {
    content: var(--vegetables-label, "Verdure");
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
    transition: opacity 0.3s ease; 
}

.section-carbs::after {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.section-proteins::after {
    content: var(--proteins-label, "Proteine");
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.section-center::after {
    content: var(--fats-label, "Grassi sani");
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);
    color: #333;
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    pointer-events: none;
}

.fruit-label {
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255, 165, 0, 0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 10px;
    border: 2px solid #FF8C00;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.fruit-label::before {
    content: var(--fruits-label, "Frutta");
}

/* ✅ GESTIONE VISIBILITÀ CONTAINER FRUTTA */
/* Durante colazione: nascondi container frutta esterno */
body.morning-time .fruit-container {
    display: none !important;
}

/* Durante pranzo/cena: mostra container frutta esterno */
body.noon-time .fruit-container,
body.evening-time .fruit-container {
    display: flex !important;
}

/* ✅ EVIDENZIAZIONI MODALITÀ FACILE */
.zone-highlight {
    background: rgba(255, 215, 0, 0.4) !important;
    border: 4px solid #FFD700 !important;
    animation: zone-pulse-easy 1.2s infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

@keyframes zone-pulse-easy {
    0%, 100% { 
        opacity: 0.8;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
    }
}

/* ✅ EVIDENZIAZIONI MODALITÀ DIFFICILE */
.zone-highlight-all {
    border: 3px solid #FF6B6B !important;
    animation: zone-pulse-hard 2s infinite;
}

@keyframes zone-pulse-hard {
    0%, 100% { 
        border-color: #FF6B6B;
    }
    50% { 
        border-color: #FF8E8E;
    }
}

/* ✅ AREA CLICCABILE MIGLIORATA */
.plate-zone-clickable {
    position: relative;
    z-index: 10;
    min-height: 60px;
    min-width: 60px;
}

/* ✅ MESSAGGIO ISTRUZIONI */
.message.instruction {
    background: #E8F4FD;
    border-color: #4ECDC4;
    color: #2C7873;
    animation: instruction-glow 2s infinite;
}

@keyframes instruction-glow {
    0%, 100% { 
        border-color: #4ECDC4;
        box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    }
    50% { 
        border-color: #2C7873;
        box-shadow: 0 6px 20px rgba(78, 205, 196, 0.5);
    }
}

/* ✅ DURANTE LA COLAZIONE: la sezione verdure mostra "Frutta" */
/* Durante colazione: la sezione verdure diventa area frutta */
body.morning-time .section-vegetables::after {
    content: var(--fruits-label, "Frutta") !important;
    background: rgba(255,255,255,0.9) !important;  /* ✅ Sfondo bianco */
    border: 1px solid rgba(0,0,0,0.1) !important;  /* ✅ Bordo sottile */
}

/* ✅ DURANTE LA COLAZIONE: nascondi il container frutta originale */
body.morning-time .fruit-container {
    display: none !important;
}

/* ✅ Durante pranzo/cena: mostra il container frutta */
body.noon-time .fruit-container,
body.evening-time .fruit-container {
    display: flex !important;

}


/* ✅ CIBO SELEZIONATO - EVIDENZIAZIONE POTENTE - PRIORITÀ MASSIMA */
.food-item.selected-food {
    border: 6px solid #FFD700 !important;
    background: linear-gradient(135deg, #FFF9C4, #FFEB3B) !important;
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 0.8) !important,
        0 0 50px rgba(255, 215, 0, 0.4) !important;
    animation: selected-pulse-strong 1.5s infinite !important;
    transform: scale(1.2) !important;
    z-index: 1000 !important;
    position: relative !important;
    cursor: pointer !important;
}

/* ✅ KEYFRAMES con priorità */
@keyframes selected-pulse-strong {
    0%, 100% { 
        box-shadow: 
            0 0 25px rgba(255, 215, 0, 0.8) !important,
            0 0 50px rgba(255, 215, 0, 0.4) !important;
        transform: scale(1.2) !important;
        border-color: #FFD700 !important;
    }
    50% { 
        box-shadow: 
            0 0 35px rgba(255, 215, 0, 1) !important,
            0 0 70px rgba(255, 215, 0, 0.6) !important;
        transform: scale(1.25) !important;
        border-color: #FFA500 !important;
    }
}

/* 🔧 FORZA STILE SELEZIONATO - BACKUP */
.food-item[class*="selected"] {
    border: 6px solid #FFD700 !important;
    background: linear-gradient(135deg, #FFF9C4, #FFEB3B) !important;
    transform: scale(1.2) !important;
    z-index: 1000 !important;
    animation: selected-pulse-strong 1.5s infinite !important;
}

fruit-container {
    position: absolute;
    top: 20px !important;
    left: 65%;                    
    transform: translateX(-50%);  
    width: 100px;
    height: 90px;
    /* resto del codice rimane uguale... */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 150;
    border: none !important;
    border-radius: 20px;
    background: transparent !important;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: none !important;
}

/* Mobile: sposta leggermente più a destra */
@media (max-width: 768px) {
    .fruit-container {
        left: 70%;
        width: 90px;
        top: 15px !important;
    }
}

@media (max-width: 480px) {
    .fruit-container {
        left: 75%;
        width: 80px;
        top: 10px !important;
    }
}

@media (max-width: 360px) {
    .fruit-container {
        left: 80%;
        width: 70px;
        top: 5px !important;
    }
}


body.noon-time .fruit-container,
body.evening-time .fruit-container {
    display: flex !important;
}
/* ✨ APPARE SOLO QUANDO SELEZIONATO */
.fruit-container.zone-clickable-hint {
    border: 4px dashed #FFD700 !important;
    background: rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4) !important;
    animation: gentle-pulse-hint 3s infinite !important;
}

/* 🏷️ ETICHETTA RIMANE SEMPRE VISIBILE */
.fruit-label {
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    background: rgba(255,255,255,0.9);  /* ✅ Sfondo bianco come le altre */
    color: #333;
    padding: 4px 8px;
    border-radius: 8px;  /* ✅ Border radius come le altre */
    border: 1px solid rgba(0,0,0,0.1);  /* ✅ Bordo sottile come le altre */
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);  /* ✅ Ombra neutra */
}

/* 🍎 AREA FRUTTA - Rettangolo dove cliccare per mettere la frutta */
.fruit-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    min-height: 65px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px dashed rgba(0,0,0,0.15);
    background: rgba(255, 165, 0, 0.08);
    transition: all 0.3s ease;
}

/* ✨ ILLUMINAZIONE ZONE quando cibo selezionato */
.zone-illuminate {
    background: rgba(255, 215, 0, 0.3) !important;
    border: 4px solid #FFD700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6) !important;
    animation: zone-glow 2s infinite;
}

.zone-illuminate-correct {
    background: rgba(50, 205, 50, 0.4) !important;
    border: 4px solid #32CD32 !important;
    box-shadow: 0 0 25px rgba(50, 205, 50, 0.8) !important;
    animation: zone-correct-pulse 1s infinite;
}

@keyframes zone-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
        transform: scale(1.02);
    }
}

@keyframes zone-correct-pulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(50, 205, 50, 0.8);
    }
    50% { 
        box-shadow: 0 0 35px rgba(50, 205, 50, 1);
    }
}

/* ⚡ ANIMAZIONE ERRORE */
.zone-error {
    background: rgba(255, 107, 107, 0.4) !important;
    border: 4px solid #FF6B6B !important;
    animation: zone-shake 0.5s ease-in-out;
}

@keyframes zone-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 📱 MOBILE: Effetto tocco */
@media (max-width: 768px) {
    .zone-illuminate {
        animation: zone-mobile-pulse 1.5s infinite;
    }
    
    @keyframes zone-mobile-pulse {
        0%, 100% { opacity: 0.8; }
        50% { opacity: 1; }
    }
}


.zone-clickable-hint {
    border: 6px solid #FFD700 !important;
    background: rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.9) !important;
    animation: gentle-pulse-hint 2s infinite !important;
    cursor: pointer !important;
    z-index: 1000 !important;
}

@keyframes gentle-pulse-hint {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: scale(1.02);  /* Scaling più delicato */
        opacity: 1;
    }
}
@keyframes chef-glow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6);
    }
}

/* ✨ PATCH ANTI-FLASH BIANCO - AGGIUNGI IN FONDO */
body {
    transition: background-image 0.8s ease-in-out !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Durante la transizione, mantieni lo sfondo precedente */
body.transitioning {
    transition: none !important;
}

/* Fallback con gradienti per evitare il bianco - gradiente semi-trasparente sopra l'immagine */
body.morning-time {
    background: linear-gradient(135deg, rgba(255,228,181,0.15), rgba(255,248,220,0.15)), url('../images/breakfast-bg.webp') center/cover no-repeat !important;
}

body.noon-time {
    background: linear-gradient(135deg, rgba(135,206,235,0.15), rgba(152,251,152,0.15)), url('../images/lunch-bg.webp') center/cover no-repeat !important;
}

body.evening-time {
    background: linear-gradient(135deg, rgba(75,0,130,0.15), rgba(138,43,226,0.15)), url('../images/dinner-bg.webp') center/cover no-repeat !important;
}


/* ✨ TRANSIZIONI FLUIDE ETICHETTE */
.section-vegetables::after,
.section-carbs::after,
.section-proteins::after,
.section-center::after {
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out !important;
}


body.morning-time.transitioning .section-vegetables::after {
    opacity: 0 !important;
    transform: scale(0.8) !important;
}

/* ✅ MANTIENI VISIBILE durante lunch → dinner */
body.noon-time.transitioning .section-vegetables::after,
body.evening-time.transitioning .section-vegetables::after {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* 🎯 ANIMAZIONE BADGE DELICATA */
@keyframes badge-pulse {
    0%, 85% { 
        transform: translateX(-50%) scale(1) !important;
    }
    90% { 
        transform: translateX(-50%) scale(1.06) !important;
    }
    95% { 
        transform: translateX(-50%) scale(1.03) !important;
    }
    100% { 
        transform: translateX(-50%) scale(1) !important;
    }
}

.animated-badge {
    animation: badge-pulse 8s infinite !important;
}

/* ✅ SOLUZIONE ROBUSTA - Container frutta sempre visibile */
.fruit-container {
    position: absolute;
    top: 10px;

    right: min(100px, 25vw); /* Mai oltre 100px, ma si adatta ai schermi stretti */
    width: 80px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    z-index: 150;
    /* ✅ IMPORTANTE: Previeni overflow */
    max-width: calc(100vw - 20px); /* Non supera mai la larghezza schermo */
}

/* ✅ MOBILE: Adattamento fluido */
@media (max-width: 768px) {
    .fruit-container {
        top: -15px;
        /* ✅ Sistema più intelligente: usa la larghezza disponibile */
        right: max(20px, min(80px, 20vw));
        width: min(75px, 18vw); /* Si ridimensiona con lo schermo */
        z-index: 150;
    }
}

/* ✅ CELLULARI STRETTI: Priorità alla visibilità */
@media (max-width: 480px) {
    .fruit-container {
        top: 15px;
        /* ✅ Formula magica: sempre visibile, mai tagliato */
        right: clamp(15px, 12vw, 60px);
        width: clamp(60px, 15vw, 70px);
    }
}

/* ✅ CELLULARI ULTRA-STRETTI: Sicurezza totale */
@media (max-width: 360px) {
    .fruit-container {
        /* ✅ Posizionamento sicuro al 100% */
        right: max(10px, 8vw); /* Minimo 10px dal bordo */
        width: min(60px, 16vw); /* Non supera mai lo schermo */
        top: -10px;
    }
}

/* ✅ ETICHETTA FRUTTA: stile uniforme alle altre sezioni del piatto */
.fruit-label {
    font-size: clamp(10px, 2.5vw, 12px) !important;
    font-weight: 700 !important;
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    pointer-events: none;
    white-space: nowrap;
}

/* ✅ ALTERNATIVA: Posizionamento centrato per schermi molto stretti */
@media (max-width: 320px) {
    .fruit-container {
        /* ✅ Su schermi ultra-piccoli, centra completamente */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        top: 5px;
        width: min(250px, 80vw); /* Occupa max 80% dello schermo */
    }
    
    /* ✅ Etichetta ancora più compatta */
    .fruit-label {
        font-size: clamp(8px, 2vw, 10px);
        padding: 2px 4px;
    }
}

/* ===== FIX FUMETTI INIZIALI RESPONSIVE ===== */

/* 🎈 FUMETTI BASE - Dimensioni fluide */
.speech-bubble {
    /* ✅ Larghezza adattiva invece di fissa */
    width: clamp(280px, 45vw, 400px); /* Min 280px, max 400px */
    max-width: calc(100vw - 40px); /* Mai oltre lo schermo */
    min-height: clamp(120px, 15vh, 180px);
    
    /* ✅ Testo responsive */
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.4;
    padding: clamp(15px, 3vw, 25px);
    
    /* ✅ Posizionamento sicuro */
    box-sizing: border-box;
}

/* 🎭 FUMETTO NUTRITIONIST - Adattamento intelligente */
.speech-bubble.nutritionist-bubble {
    /* ✅ Posizione fluida */
    left: clamp(20px, 5vw, 50px);
    top: clamp(80px, 12vh, 120px);
    
    /* ✅ Su tablet/mobile, più centrato */
    @media (max-width: 768px) {
        left: 50%;
        transform: translateX(-50%);
        top: clamp(60px, 8vh, 100px);
        width: clamp(260px, 80vw, 350px);
    }
}

/* 👨‍🍳 FUMETTO CHEF - Simmetrico e responsive */
.speech-bubble.chef-bubble {
    /* ✅ Posizione da destra fluida */
    right: clamp(20px, 5vw, 50px);
    top: clamp(80px, 12vh, 120px);
    
    /* ✅ Su mobile, stack verticale */
    @media (max-width: 768px) {
        right: 50%;
        transform: translateX(50%);
        top: clamp(200px, 25vh, 280px); /* Sotto il primo fumetto */
        width: clamp(260px, 80vw, 350px);
    }
}

/* 📱 MOBILE VERTICALE - Layout ottimizzato */
@media (max-width: 480px) {
    .speech-bubble {
        width: clamp(240px, 90vw, 320px);
        font-size: clamp(13px, 3.5vw, 16px);
        padding: clamp(12px, 4vw, 20px);
        border-radius: 15px; /* Più compatto */
    }
    
    .speech-bubble.nutritionist-bubble {
        top: clamp(40px, 6vh, 80px);
    }
    
    .speech-bubble.chef-bubble {
        top: clamp(160px, 20vh, 220px);
    }
    
    /* ✅ Coda fumetto più piccola */
    .speech-bubble::after {
        border-width: 8px 12px 8px 0; /* Coda ridotta */
    }
}

/* 📵 CELLULARI MINI - Contenuto essenziale */
@media (max-width: 360px) {
    .speech-bubble {
        width: clamp(220px, 95vw, 280px);
        font-size: clamp(12px, 4vw, 15px);
        padding: 10px 15px;
        min-height: 80px;
    }
    
    /* ✅ Testo più conciso se necessario */
    .speech-bubble .long-text {
        display: none; /* Nascondi parti non essenziali */
    }
    
    .speech-bubble .short-text {
        display: block; /* Mostra versione breve */
    }
}

/* 🖥️ DESKTOP GRANDE - Sfrutta lo spazio */
@media (min-width: 1200px) {
    .speech-bubble {
        width: clamp(350px, 25vw, 450px);
        font-size: clamp(16px, 1.2vw, 20px);
        padding: clamp(20px, 2vw, 30px);
    }
    
    /* ✅ Posizionamento più spazioso */
    .speech-bubble.nutritionist-bubble {
        left: clamp(80px, 8vw, 120px);
    }
    
    .speech-bubble.chef-bubble {
        right: clamp(80px, 8vw, 120px);
    }
}

/* 🎨 ANIMAZIONI RESPONSIVE - Più delicate su mobile */
@media (max-width: 768px) {
    .speech-bubble {
        animation-duration: 0.6s; /* Più veloce su mobile */
    }

    /* ✅ Riduce movimento su schermi piccoli */

}

/* ============================================================
   💻  LAPTOP / NOTEBOOK (max-height ≤ 820px) — fai stare tutto nel viewport
   evita che bottom-bar Windows / barra del browser nascondano contenuti
   ============================================================ */
@media (max-height: 820px) {
    /* Body usa dynamic viewport height: non viene mai coperto dalle barre */
    body { min-height: 100dvh; padding: 4px; }
    .game-container { min-height: calc(100dvh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom)); }

    /* ===== Mode-selection screen (A cosa giochiamo?) ===== */
    /* NB: NON forzare margin-top:0 né justify-content qui — toglie il centraggio
       verticale su desktop/laptop (altezza ≤820). Lasciamo agire il margin:auto 0
       di riga ~1678: centra se c'è spazio, scrolla dall'alto se il box è più alto
       del viewport (es. col bottone "Hai già un codice"). */
    #mode-selection-screen { padding: 6px !important; }
    #mode-selection-screen > div {
        padding: 8px 14px !important;
    }
    /* Logo SANE più piccoli */
    #mode-selection-screen img[src*="logo2"] { width: clamp(48px, 9vw, 64px) !important; }
    #mode-selection-screen img[src*="logo3"] { width: clamp(82px, 16vw, 105px) !important; }
    /* Titolo + sottotitolo carosello più compatti */
    #mode-selection-screen a[href*="sane-italia"] { margin: 0 auto 6px !important; padding: 2px 8px !important; font-size: 11px !important; }
    #mode-selection-screen [style*="background-clip:text"] { font-size: clamp(18px, 4.5vw, 24px) !important; margin-bottom: 6px !important; }
    /* Tabs Alimentazione/Allergie compatte */
    #mode-selection-screen [style*="background:#f2f2f2"] { margin-bottom: 8px !important; }
    #mode-selection-screen [style*="background:#f2f2f2"] button { padding: 7px 6px !important; }
    /* CAROSELLO: card più piccole (no più aspect-ratio 1:1 enorme) */
    #carousel-track > div {
        flex: 0 0 clamp(220px, 38vh, 300px) !important;
        aspect-ratio: 1 / 1 !important;
    }
    /* Box ⚙ in alto a destra rimpicciolito */
    #mode-selection-screen button[onclick*="showMiniSettings"] {
        width: 36px !important; height: 36px !important; font-size: 18px !important;
    }

    /* ===== Schermo di gioco "Il Piatto Sano" ===== */
    .header-section { padding: 4px 8px !important; margin-bottom: 4px !important; }
    .header-section .title { font-size: clamp(16px, 3vw, 22px) !important; padding: 4px 10px !important; }
    .settings-button { width: clamp(46px, 8vw, 60px) !important; height: clamp(46px, 8vw, 60px) !important; }
    .plate-container { margin: 4px 0 !important; }
    .plate { width: clamp(180px, 32vh, 260px) !important; height: clamp(180px, 32vh, 260px) !important; }
    .plate-food { width: clamp(40px, 6vh, 56px) !important; height: clamp(40px, 6vh, 56px) !important; font-size: clamp(26px, 4.5vh, 42px) !important; }
    .foods-container { padding: 8px !important; gap: 8px !important; }
    .food-item { max-width: 100px !important; max-height: 100px !important; }

    /* ===== Onboarding bubble (Serafina) ===== */
    .serafina-intro-img { width: clamp(80px, 11vh, 110px) !important; height: clamp(80px, 11vh, 110px) !important; margin-bottom: 6px !important; }
    .ob-title { margin-bottom: 4px !important; }
    .ob-subtitle { margin-bottom: 8px !important; }

    /* Recap mini-card più compatte su laptop */
    .recap-mini { min-height: 76px !important; padding: 9px 10px !important; }
    .recap-difficulty > div { padding: 12px 10px !important; }
    .recap-difficulty > div > div:first-child { font-size: 22px !important; margin-bottom: 2px !important; }
}

/* ============================================================
   🖥️  LIM / DESKTOP (≥1024px) — sfrutta lo spazio nelle 4 schermate setup
   ============================================================ */
@media (min-width: 1024px) {
    /* Card dieta — 3 colonne affiancate, immagine a tutto sfondo */
    /* Sblocca la larghezza piena SOLO sulla schermata dieta (non tocca le altre slide) */
    .intro-text-content:has(.diet-cards) { width: 100% !important; }
    .diet-cards {
        flex-direction: row !important;
        max-width: 760px;
        gap: 22px;
        margin: 10px auto 12px;
    }
    .diet-card {
        flex: 1;
        height: auto;
        aspect-ratio: 1/1;
    }
    .diet-card .diet-name { font-size: 22px; }
    .diet-card .diet-desc { font-size: 14px; }

    /* Allergeni & intolleranze — chip più grandi, spazio respira */
    .allergy-grid, .intolerance-grid {
        max-width: 900px;
        gap: 12px;
        padding: 8px 4px;
    }
    .allergen-chip {
        padding: 14px 22px 14px 16px;
        gap: 10px;
    }
    .allergen-chip .chip-emoji { font-size: 28px; }
    .allergen-chip .chip-name  { font-size: 16px; }

    /* Recap 4/4 — 3 mini-card affiancate */
    .recap-grid { grid-template-columns: 1fr 1fr 1fr !important; gap: 14px !important; }
    .recap-mini { min-height: 130px !important; padding: 16px 14px 14px !important; }
    .recap-mini > div:first-of-type span:last-child { font-size: 13px !important; }

    /* Difficoltà — più grandi su LIM */
    .recap-difficulty { max-width: 600px; margin: 0 auto !important; gap: 18px !important; }
    .recap-difficulty > div { padding: 16px 16px !important; }
    .recap-difficulty > div > div:first-child { font-size: 28px !important; }
    .recap-footer { max-width: 1080px; margin-left: auto; margin-right: auto; }
    .recap-footer .recap-nav { max-width: 600px; margin-left: auto; margin-right: auto; }

    /* Bubble più larga per accogliere il layout 3-col */
    .speech-bubble.intro-bubble,
    #intro-bubble { max-width: 1080px; }

    /* Titoli setup più "balla" */
    .ob-title { font-size: 30px !important; }
    .ob-subtitle { font-size: 16px !important; max-width: 720px; margin: 0 auto 14px !important; }
}

/* ============================================================
   🖥️ LIM / DESKTOP (≥1024px) — gioco "Il Coraggio di Agire"
   Ingrandisce header + contenuti (figli diretti dell'overlay)
   così le schermate sono leggibili da lontano in classe.
   Mobile resta gestito dai clamp() inline. ============================================================ */
@media (min-width: 1024px) {
    #qt-story-screen { overflow-x: hidden; }
    #qt-story-screen > div { zoom: 1.22; }
}

/* ============================================================
   🖥️ DESKTOP / LIM (≥1024px) — Quiz, Piramide, Stagionalità
   Colonna più compatta (su PC tutto risultava troppo largo/grande)
   + spazio sotto così il bottone "prossima/siguiente" non finisce
   dietro la barra delle applicazioni del PC.
   ============================================================ */
@media (min-width: 1024px) {
    #quiz-screen, #semaforo-screen, #stagionalita-screen { padding-bottom: 90px !important; }
    /* Quiz: colonna più stretta (su PC le card uscivano dallo schermo) */
    #quiz-screen > div, #quiz-content { max-width: 620px !important; }
    /* Piramide + Stagionalità: colonna decisamente più compatta */
    #semaforo-screen > div, #semaforo-content,
    #stagionalita-screen > div, #stagionalita-content { max-width: 600px !important; }
    /* La stagionalità aveva uno scroll interno che incollava il bottone al fondo
       del viewport (e quindi dietro la barra): lascialo fluire nello scroll esterno */
    #stagionalita-content { max-height: none !important; overflow: visible !important; }
}

/* === SISTEMA PREMIUM CHAT === */
.premium-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(5px);
}

.premium-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.premium-dialog {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border: 4px solid #2C7873;
    border-radius: 25px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.premium-dialog.show {
    transform: scale(1);
    opacity: 1;
}

.premium-dialog h3 {
    color: white;
    font-size: clamp(20px, 4vw, 24px);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.premium-password-input {
    width: 100%;
    padding: 15px;
    font-size: clamp(16px, 3vw, 18px);
    border: 3px solid #2C7873;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    background: white;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.premium-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.premium-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: clamp(14px, 3vw, 16px);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.premium-btn.confirm {
    background: linear-gradient(135deg, #32CD32, #90EE90);
    color: white;
    border: 3px solid #228B22;
}

.premium-btn.cancel {
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
    border: 3px solid #E55D75;
}

/* Disabilita l'animazione di entrata per il pannello password */
#password-panel {
    transition: none !important;
}


@keyframes glow-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 12px rgba(255, 200, 0, 0.95),
      0 0 28px rgba(255, 200, 0, 0.75),
      0 0 48px rgba(255, 200, 0, 0.45);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 16px rgba(255, 200, 0, 1),
      0 0 36px rgba(255, 200, 0, 0.9),
      0 0 64px rgba(255, 200, 0, 0.6);
  }
}
#password-panel {
    transition: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}
#password-panel {
    z-index: 10002 !important;
}
.privacy-section {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.privacy-section h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.privacy-section p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== SANE ITALIA SPLASH SCREEN ===== */
#sane-splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #f8fff8 0%, #e8f8ee 50%, #d4f0dc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    cursor: pointer;
    transition: opacity 0.7s ease;
    padding: calc(20px + var(--safe-area-inset-top)) 20px calc(20px + var(--safe-area-inset-bottom));
}
#sane-splash.hiding {
    opacity: 0;
    pointer-events: none;
}
.sane-splash-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sane-logo-img {
    width: clamp(200px, 70vw, 300px);
    height: auto;
    margin-bottom: 20px;
    animation: sane-fadein 0.8s ease forwards;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.12));
    border-radius: 16px;
}
.sane-logo3-img {
    width: clamp(140px, 45vw, 200px);
    height: auto;
    margin-bottom: 24px;
    animation: sane-fadein 0.8s ease 0.3s both;
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.1));
    border-radius: 50%;
}
@keyframes sane-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sane-url {
    display: inline-block;
    font-size: clamp(13px, 3.5vw, 16px);
    font-weight: 700;
    color: #1a6b3c;
    text-decoration: none;
    background: white;
    border: 2px solid #27ae60;
    border-radius: 30px;
    padding: 10px 28px;
    margin-bottom: 22px;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 12px rgba(39,174,96,0.2);
    transition: all 0.2s;
    animation: sane-fadein 0.6s ease 0.5s both;
}

.sane-tap-hint {
    font-size: clamp(10px, 2.5vw, 13px);
    color: #555;
    opacity: 0;
    animation: sane-appear 1s ease 1.5s forwards, sane-pulse-opacity 2s ease 2.5s infinite;
}
@keyframes sane-appear {
    to { opacity: 0.5; }
}
@keyframes sane-pulse-opacity {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.15; }
}

    

/* ===== HOVER: solo su dispositivi con mouse (non LIM/touch) ===== */
@media (hover: hover) {
    .settings-button:hover {
        transform: scale(1.1);
        background: linear-gradient(135deg, #8E44AD, #9B59B6);
        box-shadow: 0 6px 25px rgba(155,89,182,0.6);
    }
    .settings-button:hover::after {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 3px 12px rgba(0,0,0,0.3);
    }
    .nutritionist-character:hover {
        transform: scale(1.15) rotate(5deg);
        border-color: #FFA500;
        box-shadow: 0 8px 30px rgba(255, 140, 0, 0.8);
        animation: none; /* Ferma il pulse durante hover */
    }
    .settings-close-x:hover {
        transform: scale(1.1) rotate(90deg);
        background: linear-gradient(135deg, #E55D75, #C44569);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
    }
    .toggle-container:hover {
        border-color: #9B59B6;
        background: rgba(255,255,255,0.9);
    }
    .settings-close-btn:hover {
        background: linear-gradient(135deg, #8E44AD, #7D3C98);  
        transform: translateY(-2px);
    }
    .mode-selector select:hover {
        background: linear-gradient(135deg, #44A08D, #2C7873);
        transform: translateY(-1px);
    }
    .arrow:hover {
                transform: scale(1.1);
            }
    .food-item:hover {
                transform: scale(1.05);
                box-shadow: 0 6px 20px rgba(0,0,0,0.25);
            }
    .food-item:hover::before {
        animation: shine 0.6s ease-in-out;
    }
    .food-info-popup .close-btn:hover {
        background: linear-gradient(135deg, #90EE90, #32CD32);
        transform: translateY(-2px);
    }
    .scheda-btn-ok:hover  { transform: translateY(-2px) scale(1.01); box-shadow: 0 10px 28px rgba(0,0,0,0.22); }
    .completion-banner .restart-btn:hover,
    .final-victory-banner .restart-btn:hover {
        transform: scale(1.1);
        background: linear-gradient(135deg, #FFA500, #FF8C00);
        box-shadow: 0 12px 36px rgba(255,140,0,0.6);
    }
    #intro-bubble .restart-btn:hover {
        transform: translateY(-2px) scale(1.05);
        background: linear-gradient(135deg, #FF8E53, #FF6B6B);
        box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    }
    #intro-bubble .restart-btn:hover::before {
        animation: button-shine 0.6s ease-in-out;
    }
    #intro-bubble .start-btn:hover {
        transform: translateY(-3px) scale(1.08);
        background: linear-gradient(135deg, #90EE90, #32CD32);
        box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6);
        animation: none; /* ferma il pulse durante hover */
    }
    #intro-bubble .start-btn:hover::before {
        animation: start-button-shine 0.8s ease-in-out;
    }
    #intro-bubble .continue-btn:hover {
        transform: translateY(-2px) scale(1.05);
        background: linear-gradient(135deg, #44A08D, #4ECDC4);
        box-shadow: 0 8px 25px rgba(78, 205, 196, 0.6);
        animation: none;
    }
    .food-selector:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }
    .super-btn:hover::before {
        left: 100%;
    }
    .super-btn.primary:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 12px 35px rgba(50,205,50,0.4);
        background: linear-gradient(135deg, #90EE90, #32CD32, #228B22);
    }
    .super-btn.secondary:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 10px 30px rgba(78,205,196,0.4);
        background: linear-gradient(135deg, #44A08D, #4ECDC4);
    }
    #intro-bubble .continue-btn:first-of-type:hover {
        background: linear-gradient(135deg, #90EE90, #32CD32) !important;
        box-shadow: 0 12px 35px rgba(50, 205, 50, 0.6) !important;
    }
    button:hover {
      background: linear-gradient(135deg, #90EE90, #32CD32) !important;
      transform: translateY(-2px) scale(1.05);
      box-shadow: 0 12px 35px rgba(50,205,50,0.6) !important;
    }
    .speech-bubble:hover {
            transform: translateY(-2px) scale(1.01); /* Meno drammatico */
        }
    .premium-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
    .chat-close-btn:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1);
    }
    .chat-send-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, #90EE90, #32CD32);
        transform: translateY(-2px);
    }
    .sane-url:hover {
        background: #e8f8ee;
        box-shadow: 0 4px 16px rgba(39,174,96,0.35);
    }
}

/* Settings panel compact overrides */
#settings-panel .settings-section { margin-bottom: 6px !important; }
#settings-panel .toggle-container { padding: 8px 12px !important; }
#settings-panel select { margin-top: 6px !important; }

/* 📱 Piramide alimentare — compatta su mobile per far stare feedback + bottone nello schermo */
@media (max-width: 600px) {
    #semaforo-screen #pir-food-emoji { font-size: 44px !important; margin-bottom: 2px !important; }
    #semaforo-screen #pir-svg-container { max-width: 240px !important; margin: 0 auto 4px !important; }
    #semaforo-screen #semaforo-content > div { padding: 12px 12px !important; }
    #semaforo-screen #semaforo-feedback { min-height: 36px !important; padding: 8px 10px !important; margin-bottom: 6px !important; }
    #semaforo-screen #semaforo-next-btn { padding: 10px !important; }
}
@media (max-width: 600px) and (max-height: 740px) {
    #semaforo-screen #pir-food-emoji { font-size: 36px !important; }
    #semaforo-screen #pir-svg-container { max-width: 200px !important; }
}

/* 🎴 Card scelta-modalità (Piramide + Detective): affiancate su tablet/PC, impilate e larghe su cellulare */
.minigame-card-row { display:flex; gap:12px; width:100%; }
.minigame-card { flex:1; aspect-ratio:1/1; }
@media (max-width: 560px) {
    .minigame-card-row { flex-direction: column; gap: 12px; }
    .minigame-card { aspect-ratio: 3/2; }
}

/* Carousel scrollbar */
#carousel-track::-webkit-scrollbar { display: none; }

/* Etichette screen */
.et-screen-inner { display:none; opacity:0; }
.et-screen-inner.et-active { display:block; animation: etRise 0.38s cubic-bezier(.25,.8,.25,1) both; }
.et-screen-inner.et-exit { animation: etSink 0.22s cubic-bezier(.4,0,1,1) both; }
@keyframes etRise { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
@keyframes etSink { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(-10px)} }
.et-ing-row { display:flex;align-items:center;gap:8px;padding:9px 14px;border-radius:12px;margin-bottom:6px;font-size:0.9rem;font-weight:700;opacity:0;transform:translateX(-12px);transition:all 0.35s cubic-bezier(.22,.68,0,1.1); }
.et-ing-row.et-show { opacity:1;transform:translateX(0); }
.et-ing-row.naturale { background:rgba(46,125,50,0.1);color:#2e7d32; }
.et-ing-row.zucchero { background:rgba(245,127,23,0.12);color:#e65100; }
.et-ing-row.grassi   { background:rgba(251,192,45,0.12);color:#f57f17; }
.et-ing-row.additivo { background:rgba(198,40,40,0.1);color:#c62828; }
.et-dot { width:9px;height:9px;border-radius:50%;flex-shrink:0; }
.et-ing-row.naturale .et-dot { background:#4CAF50; }
.et-ing-row.zucchero .et-dot { background:#F57C00; }
.et-ing-row.grassi   .et-dot { background:#FBC02D; }
.et-ing-row.additivo .et-dot { background:#E53935; }
.et-obj-row { margin-bottom:18px;opacity:0;transition:opacity 0.4s; }
.et-obj-row.et-show { opacity:1; }
.et-claim { display:inline-block;background:rgba(46,125,50,0.1);border:2px solid rgba(46,125,50,0.4);color:#2e7d32;font-weight:800;font-style:normal;font-family:'Fredoka','Nunito',sans-serif;padding:6px 18px;border-radius:50px;font-size:0.95rem;letter-spacing:0.3px;transition:opacity 0.8s,filter 0.8s; }
.et-claim.et-fade { opacity:0.15;filter:blur(2px); }
.et-oi { font-size:1.4rem;display:inline-block;animation:etPop 0.3s cubic-bezier(.22,.68,0,1.5) both; }
@keyframes etPop { from{transform:scale(0) rotate(-20deg);opacity:0} to{transform:scale(1) rotate(0);opacity:1} }
