:root {
    --bg-color: #FCF9F2;
    --primary-orange: #FF6B00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    width: 100%;
    background-color: #101010;
    background-image: url('../img/coloseum.webp');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    /* Keep vertical flow stable and anchor the hero to the top. */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ==========================================================================
   2. LAYOUT STRUTTURALE (HERO & HEADER)
   ========================================================================== */
#canvas-wrapper,
#canvas-desktop {
    display: contents;
}

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    width: 100%;
    text-align: center;
    padding: 2rem 1rem;
}

/* Base dello sfondo (isolato) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Dietro tutto */
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
}

/* Privacy modal legal content blocks */
.privacy-legal-content {
    display: grid;
    gap: 12px;
    line-height: 1.55;
    color: #222;
}

.privacy-section {
    background: #f7f7f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px;
}

.privacy-section-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #1f1f1f;
}

.privacy-section-text {
    margin: 0;
    font-size: 0.95rem;
    color: #303030;
}

.privacy-section-contact {
    font-weight: 600;
    color: #1a1a1a;
}


/* Desktop-specific hero alignment and chef positioning */
@media (min-width: 769px) {
    .hero {
        min-height: 100vh;
        width: 100%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }


    #canvas-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        width: 100%;
        margin: auto;
        box-sizing: border-box;
    }

    #canvas-desktop {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100vw;
        height: 100vh;
        aspect-ratio: auto;
        position: relative;
        background: transparent;
        transform: none;
        transform-origin: center center;
        flex-shrink: 0;
        padding-top: 10px;
        box-sizing: border-box;
        overflow: hidden;
    }

    #chef-container {
        display: block;
        position: fixed;
        left: 0;
        bottom: 0;

        /* Keep the chef proportional while making it visually larger. */
        aspect-ratio: 1402 / 1122;
        height: clamp(560px, 82vh, 920px);
        width: auto;

        /* Keep the chef behind the wheel and controls. */
        z-index: 6;
        pointer-events: none;

        /* Ensure the background covers the container without distortion */
        background-size: contain;
        background-position: left bottom;
        background-repeat: no-repeat;
        transition: background-image 0.5s ease;
    }

    /* Keep chef anchoring stable across JS swap states to prevent visual jumping. */
    #chef-container.swap-1,
    #chef-container.swap-2,
    #chef-container.swap-3,
    #chef-container.swap-idle {
        position: fixed;
        left: 0;
        bottom: 0;

        aspect-ratio: 1402 / 1122;
        width: auto;
        height: clamp(560px, 82vh, 920px);

        background-position: left bottom;
        background-size: contain;
        background-repeat: no-repeat;
    }

    /* Absolute positioning within the desktop composition */
    #canvas-desktop .language-selector {
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 9999;
    }

    #canvas-desktop .global-reset-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 9999;
    }

    /* --- western group --- */
    #chef-container.group-it,
    #chef-container.group-it.swap-idle,
    #chef-container.group-it.swap-3 {
        background-image: url('../img/IT_normal.webp');
    }

    #chef-container.group-it.swap-1 {
        background-image: url('../img/IT_winky2.webp');
    }

    #chef-container.group-it.swap-2 {
        background-image: url('../img/IT_sparkle.webp');
    }

    /* --- eastern group --- */
    #chef-container.group-ja,
    #chef-container.group-ja.swap-idle,
    #chef-container.group-ja.swap-3 {
        background-image: url('../img/JA_nor_.webp');
    }

    #chef-container.group-ja.swap-1 {
        background-image: url('../img/JA_emb_.webp');
    }

    #chef-container.group-ja.swap-2 {
        background-image: url('../img/JA_spa_.webp');
    }

    /* Western Group - Surprise */
    #chef-container.group-it.chef-surprised {
        background-image: url('../img/IT_surprised.webp');
    }

    /* Eastern Group - Surprise */
    #chef-container.group-ja.chef-surprised {
        background-image: url('../img/JA_sur_.webp');
    }
}

.hero h1 {
    position: relative;
    font-weight: 900;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #23037a, #e76f06);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

#app-title {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    z-index: 20;
}

#app-subtitle {
    position: relative;
    z-index: 820;
    font-weight: 500;
    font-size: 1.5rem;
    color: #9d0a0a;
    /* Pure white for maximum readability */
    text-shadow: 0 2px 8px rgba(243, 234, 234, 0.6);
    /* Soft shadow to separate it from the Colosseum */
}

/* ==========================================================================
   3. SELETTORE DI LINGUA (DESKTOP)
   ========================================================================== */
.language-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

#lang-select {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(5px);
}

#lang-select option {
    background: #24243e;
    color: white;
}

.lang-buttons {
    display: none;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.lang-btn {
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.lang-btn.active {
    display: flex;
    background: #FF6B00;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
}

.lang-buttons.expanded .lang-btn {
    display: flex;
}

.lang-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Global text rendering settings for better CJK (Japanese/Chinese) support 
disattivo temporaneamente
.recipe-steps li,
.recipe-frase,
.full-recipe-content {
    word-break: keep-all;
    line-break: strict;
    overflow-wrap: break-word;
    letter-spacing: 0.02em;
}
*/
/* ==========================================================================
   4. wheel elements (COMPONENTS)
   ========================================================================== */
html {
    --wheel-wrapper-width-menu: 70%;
    --wheel-wrapper-width-spin: 70%;
}

html[lang="ja"] {
    --wheel-wrapper-width-menu: 100%;
    --wheel-wrapper-width-spin: 70%;
}

/* --- Widget Core: .ruota-wrapper --- */
.ruota-wrapper {
    /* Geometric properties */
    width: var(--wheel-wrapper-width-spin);
    /* Default width for spin mode */
    aspect-ratio: 1 / 1;
    /* Force a perfect square */
    height: auto !important;
    /* Ensure height follows width */

    /* Positioning and layout */
    margin: 0 auto;
    /* Horizontal centering */
    margin-top: 20px;
    /* Vertical spacing from top */
    position: relative;
    /* Context for internal layers */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Overflow protection and layering */
    max-width: 100%;
    /* Prevent overflow */
    flex: 0 0 auto;
    /* Prevent flex-based resizing feedback */
    z-index: 10;
}

.ruota-wrapper.mode-menu {
    width: var(--wheel-wrapper-width-menu);
}


.ruota-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    isolation: isolate;
}

.ruota-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

#corona-layer {
    border-radius: 50% !important;
    overflow: hidden !important;
}

#corona-layer img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.foto-layer {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.foto-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slice {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    -webkit-clip-path: var(--slice-clip);
    clip-path: var(--slice-clip);
    transition: clip-path 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, filter 0.3s ease;
    transform: translateZ(0);
    will-change: clip-path;
}

.slice img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-clip-path: inherit;
    clip-path: inherit;
}

.ruota-container:not(.has-selection) .slice:hover {
    filter: brightness(1.2);
    z-index: 5;
}


.slice.active {
    -webkit-clip-path: circle(100%) !important;
    clip-path: circle(100%) !important;
    z-index: 10;
    cursor: default;
}

.ruota-container.has-selection .slice:not(.active) {
    opacity: 0;
    pointer-events: none;
}


.ruota-container:not(.has-selection) .slice {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

.slice span {
    position: absolute;
    top: var(--span-top);
    left: var(--span-left);
    transform: translate(-50%, -50%);
    font-weight: 900;
    color: white;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.7rem;
}


.slice.active span {
    top: 12%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    font-size: 1.3rem;
    background: rgba(0, 0, 0, 0.65);
    padding: 8px 20px;
    border-radius: 20px;
}

/* ==========================================================================
   5. CONTROLLI INTERATTIVI (SPIN & RESET GLOBAL)
   ========================================================================== */
#spin-btn {
    position: absolute;
    /* Dimensioni proporzionali alla ruota (es. il 20% del diametro totale) */
    width: 20%;
    height: 20%;
    /* Mantiene il pulsante perfettamente responsivo rispetto alla ruota */
    min-width: 70px;
    min-height: 70px;
    background: radial-gradient(circle, #FF9A44, #FF6B00);
    border: 4px solid white;
    /* Ridotto leggermente per schermi piccoli */
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    color: white;
    font-weight: 900;
    /* Font size fluido basato sulla larghezza del pulsante stesso */
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#spin-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

#spin-btn.ready {
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 107, 0, 0.5);
    }
}

.global-reset-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FF6B00;
    border: 2px solid white;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.global-reset-btn:hover {
    transform: rotate(90deg);
    background: #ff8533;
}

/*.freccia {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #FF6B00;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 110;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
    transition: opacity 0.3s ease;
}

.ruota-wrapper.phase-selected .freccia {
    opacity: 0;
}

/* ==========================================================================
   6. ELEMENTI DI TESTO E AREA RISULTATO (DESKTOP)
   ========================================================================== */
.recipe-title-tap {
    font-weight: 900;
    margin: 5px 0;
    font-size: 2rem;
    text-align: center;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    display: block;
    width: 100%;
}

.spinning-text {
    font-size: 1rem;
    color: #f4efe9;
    font-weight: 400;
    text-align: center;
}

.spinning-text-final {
    font-size: 1.5rem;
    font-weight: 600;
    color: #43eecc;
    /* add a transition for the hover effect */
    transition: all 0.3s ease;
    cursor: pointer;
}

.spinning-text-final:hover {
    color: #ffffff;
    transform: scale(1.05);
    cursor: pointer;
}

#risultato {
    position: relative;
    z-index: 820;
    min-height: 60px;
    display: flex;
    flex-direction: column !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1.4rem;
    margin-top: 40px !important;
}

#mega-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 150px 150px 0 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: transparent;
}


.animation-container {
    position: relative;
    display: inline-block;
    font-size: clamp(2.5rem, 6vw, 5rem);
    /* Dimensione adattiva */
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 0.4em 0.7em;
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Effetto Bordo/Outline */
.animation-container::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    padding: 0.4em 0.7em;
    color: white;
    text-shadow: -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000, 4px 4px 0 #000, 0 0 18px rgba(0, 0, 0, 0.9);
    z-index: -1;
}

/* gradient text */
.animation-container span {
    background: linear-gradient(135deg, #ff0000, #ffcc00, #00ffcc);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

@keyframes pop {
    0% {
        transform: scale(0.2) rotate(-15deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.1) rotate(2deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.0) rotate(-3deg);
        opacity: 1;
    }
}

@media (min-width: 769px) {
    #risultato {
        min-height: 90px;
        justify-content: flex-start;
    }
}

#istruzione {
    position: relative;
    z-index: 820;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: -8px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

/* ==========================================================================
   9. MACRO MEDIA QUERY: CONSOLIDATED MOBILE OPTIMIZATION (Up to 768px)
   ========================================================================== */
@media (max-width: 768px) {

    .splash-title {
        font-size: 1.5rem !important;
    }

    .splash-text {
        font-size: 0.5rem !important;
    }

    /* Il mega contenitore alto livello diventa un blocco standard e fluido */
    .hero {
        display: block;
        width: 100%;
        min-height: 100vh;
        padding: 0;
        box-sizing: border-box;
        position: relative;
    }

    /* SCATOLA 1: Eredita i settaggi originali di .hero per mantenere la ruota intatta */
    #wheel-section-mobile {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        /* Distribuisce lo spazio tra gli elementi in modo uniforme */
        height: 100vh;
        /* Forza questa specifica sezione a occupare solo lo schermo iniziale */
        padding: 10px 15px;
        /* Mantiene il padding ridotto originale */
        box-sizing: border-box;
        width: 100%;
        position: relative;
    }

    /* Lo sfondo si ancora alla hero ma copre l'area visiva iniziale */
    .hero.loaded::before {
        background-image: url('../img/bks_mobile.webp') !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh !important;
        /* Si ferma tassativamente alla fine della prima schermata */
        opacity: 0.8;
        z-index: -1;
        background-attachment: fixed;
    }

    .hero.loaded.swap-1::before {
        background-image: url('../img/bks_mobile.webp') !important;
        background-attachment: fixed;
    }

    .hero.loaded.swap-2::before {
        background-image: url('../img/bks_mobile.webp') !important;
        background-attachment: fixed;
    }

    /* Fixed Header mobile space allocation */
    .app-header {
        position: absolute;
        top: 15px;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0 15px;
        text-align: center;
        z-index: 5;
        height: auto;
    }

    .hero h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    #app-title {
        cursor: pointer !important;
        /* Reset attivo al tap su mobile */
    }

    #app-subtitle {
        font-size: 1rem;
        margin: 0;
        font-weight: 600;
        color: rgba(5, 90, 26, 0.7);
    }

    /* Selettore Lingua Mobile super compatto */
    .language-selector {
        top: 12px;
        left: 1px;
        transform: scale(0.8);
        transform-origin: center;
    }

    #lang-select {
        display: none;
    }

    .lang-buttons {
        display: flex;
        padding: 4px;
        gap: 5px;
        border-radius: 15px;
    }

    .lang-buttons .lang-btn {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
        border-radius: 12px !important;
    }

    /* Tasto Reset Mobile ottimizzato (allineato all'altezza delle lingue) */
    .global-reset-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    /* Bilanciamento proporzioni Ruota */
    /* MOBILE — riga 855 */

    /* MOBILE — riga 855 */

    .ruota-wrapper {
        /* Manteniamo absolute solo se serve a non spostare gli altri elementi */
        position: absolute !important;
        top: 120px !important;
        /* Aumenta questo valore per distanziarla dall'header */
        left: 50% !important;
        transform: translateX(-50%) scale(0.8) !important;

        width: 300px !important;
        height: 300px !important;

        margin: 0 !important;
    }



    .slice span {
        font-size: 0.4rem !important;
        /* Reduce text in small slices */
        padding: 3px 6px !important;
        /* compact label */
    }

    /* Ricalibrazione posizioni per la ruota da 220px */
    .dolci span {
        top: 22% !important;
        right: 12% !important;
    }

    .pasta span {
        bottom: 22% !important;
        right: 12% !important;
    }

    .carni span {
        bottom: 22% !important;
        left: 12% !important;
    }

    .pesce span {
        top: 22% !important;
        left: 12% !important;
    }

    /* slice text when selected */
    .slice.active span {
        font-size: 1.05rem !important;
        /* Più piccolo del desktop ma ben leggibile */
        top: 8% !important;
        padding: 5px 15px !important;
    }

    /* --- SPIN BUTTON TEXT MOBILE --- */
    #spin-btn {
        font-size: 0.65rem !important;
        /* Scaled down from 1.1rem to fit the smaller central circle */
        letter-spacing: 0.5px;
        /* Ensures readability on small screens */
    }

    /* Result Area */
    #risultato {
        position: absolute !important;
        /* Deve essere maior della base della ruota (es. top ruota 120px + altezza 220px = 340px) */
        top: 420px !important;
        /* Centratura orizzontale e larghezza */
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        /* Evita che il testo tocchi i bordi dello schermo */
        text-align: center;
        min-height: 50px;
        margin: 0 !important;
        /* Resetta i vecchi margini */

        /* STILI FONT INTEGRATI */
        font-size: 1rem !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        color: #f1a249;
        /* Il colore arancione/oro del testo finale */
    }

    #istruzione {
        display: none !important;
    }

    /* Tipografia mobile controllata */
    .recipe-title-tap {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        margin: 4px 0 !important;
    }

    .spinning-text {
        font-size: 0.6rem !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
    }

    .spinning-text-final {
        font-size: 0.8rem;
        font-weight: 800;
        color: #f1a249;
    }

    #mega-overlay {
        justify-content: center;
        align-items: center;
        z-index: 1000;
        padding: 0;
        background-image: url('../img/Promo_mob.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .animation-container {
        position: absolute;
        top: 48% !important;
        left: 0;
        width: 100%;
        /* Occupa tutta la larghezza */
        transform: none;
        /* Rimuovi il translateX che sposta il blocco */
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
    }

    .animation-container span {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.1em;
        /* Micro-spazio per allineare meglio i kanji */
    }

    /* ==========================================================================
       ADV BANNER WRAPPER - MOBILE RESPONSIVE SWITCH
       ========================================================================== */
    #bottom-ad-wrapper {
        /* Dimensioni Standard Mobile (Mobile Banner) */
        max-width: 320px;
        height: 50px;
    }

    .full-recipe-content {
        padding: 20px;
    }

    /* Titolo ricetta generale */
    .recipe-card-header h2 {
        font-size: 1rem;
    }

    /* Titoli sezioni (es. Ingredienti, Procedura) */
    .recipe-section h3 {
        font-size: 0.7rem;
    }

    /* Testo dei passaggi della ricetta */
    .recipe-steps li {
        font-size: 0.7rem;
    }

    /* Eventuale frase introduttiva generale */
    .recipe-frase {
        font-size: 0.7rem;
    }

    .mobile-btt-btn {
        position: fixed;
        bottom: 30px;
        right: 25px;
        width: 48px;
        height: 48px;
        background-color: #3e3223;
        border: none;
        border-radius: 50%;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
        z-index: 9999;
        display: none !important;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transform: translateY(15px);
        transition: opacity 0.3s, transform 0.3s;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Draws a pure CSS upward chevron inside the button */
    .mobile-btt-btn::after {
        content: '';
        display: block;
        width: 10px;
        height: 10px;
        border-top: 3px solid #ffffff;
        border-left: 3px solid #ffffff;
        transform: rotate(45deg);
        margin-top: 4px;
    }

    .mobile-btt-btn.visible {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-btt-btn:active {
        transform: scale(0.92);
        background-color: #2c2418;
    }

    /* .recipe-mobile-section and .recipe-ad-placeholder moved to recipe/recipe-mobile.css */

    /* Hide desktop advertisement blocks by default when empty */
    .ad-space-middle,
    .ad-space-bottom {
        display: none;
    }

    /* Display desktop advertisement blocks only when they contain dynamic content */
    .ad-space-middle:not(:empty),
    .ad-space-bottom:not(:empty) {
        display: block;
    }
}

@media (min-width: 769px) {
    #mega-overlay {
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }
}

/* Footer: visible on all layouts */
footer#main-footer {
    display: block !important;
    visibility: visible !important;
    background: transparent !important;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    footer#main-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 100;
    }
}