body {
    font-family: verdana;
    background: #f6f6f6;
    color: #000;
    margin: 0;
    padding: 0;
    font-size: 16px;
    overscroll-behavior-y: contain;
}

.tab-bar {
    display: flex;
    background: #333;
}

.tab-item {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    flex: 1;
    padding: 13px 0;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    font-size: 16px;
    text-transform: uppercase;
}

    .tab-item.active {
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        outline: none;
        color: #F7CE00;
        border-bottom: 5px solid #F7CE00;
    }

#tools-area {
    background: #d3d3d3;
    padding: 15px;
    display: none;
    border-bottom: 1px solid #bbb;
}

.puntata-label {
    background: #fff;
    border: 1px solid #000;
    padding: 10px 15px;
    font-weight: bold;
    display: inline-block;
    border-radius: 4px;
    margin-bottom: 10px;
    max-width: 250px;
    font-size: 15px
}

.btn-group {
    display: flex;
    gap: 5px;
}

.content-area {
    padding: 15px;
    min-height: 70vh;
    overflow-x: hidden;
}

.tab-content {
    display: none;
    width: 100%;
    gap: 10px;
    align-content: flex-start;
    animation: fadeIn 0.2s ease-out;
}

    .tab-content.active {
        display: flex;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.layout-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

.layout-list {
    flex-direction: column !important;
    align-items: flex-start !important;
}

.force-list {
    flex-direction: column !important;
    align-items: flex-start !important;
}

.tab-content img {
    box-sizing: content-box !important;
    padding: 3px;
}

.fab {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 55px;
    height: 55px;
    background: #ff9800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 1000;
}

.fab-undo {
    position: fixed;
    right: 40px;
    bottom: 120px;
    width: 55px;
    height: 55px;
    background: #adff2f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 1000;
}

/* --- MODALE RIPRISTINATA ORIGINALE --- */
#modalOverlay {
    position: fixed;
    padding-top: 100px;
    inset: 0;
    background: rgba(180,180,180,0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
}

#modalBox {
    background: #fafafa;
    padding: 0px;
    width: 75%;
    max-width: 300px;
    text-align: center;
    border: 1px solid #999
}

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#numIn {
    width: 30%;
    font-size: 40px;
    text-align: center;
    background-color: #fff;
}
/* -------------------------------------- */

.hidden-fab {
    display: none !important;
}

.btn-tool {
    background-color: #888 !important;
    color: #ffffff;
    border: 0;
    cursor: pointer;
    padding: 5px 10px;
    min-width: 60px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

    .btn-tool.active {
        background-color: orange !important;
        color: #ffffff !important;
    }

#top-header {
    background: #000;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px;
    padding-left: 20px;
}

#menu-container {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

#menu-dots {
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#dropdown-menu {
    position: absolute;
    right: 10px;
    top: 35px;
    background-color: white;
    border: 1px solid silver;
    border-radius: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    width: 180px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

    #dropdown-menu.hidden {
        display: none;
    }

    #dropdown-menu a {
        padding: 12px 15px;
        text-decoration: none;
        color: #333;
        font-size: 16px;
    }

        #dropdown-menu a:hover {
            background-color: #f5f5f5;
        }

    #dropdown-menu hr {
        margin: 0;
        border: 0;
        border-top: 1px solid #eee;
    }

#menu-dots:active {
    background-color: rgba(0,0,0,0.1);
    border-radius: 50%;
}

/* 1. ASPETTO 3D NITIDO (Usciti, Gioco, Doppi) */
#cUsciti img, #cGioco img, #cDoppi img {
    border-radius: 50%;
    /* Usiamo ombre molto sottili per non coprire il numero */
    box-shadow:
    /* Ombra esterna per staccarlo dal fondo */
    1px 2px 3px rgba(0, 0, 0, 0.4),
    /* LUCENTEZZA BORDO ALTO SINISTRA: 
                       Poca sfocatura (2px) e posizione decentrata (2px) */
    inset 2px 2px 2px rgba(255, 255, 255, 0.8),
    /* RIFLESSO OPPOSTO SOTTILE:
                       Un filo di luce anche sotto per l'effetto lente */
    inset -1px -1px 1px rgba(255, 255, 255, 0.3),
    /* OMBRA DI CONTORNO INTERNA:
                       Scurisce solo il bordo estremo per dare sfericità */
    inset 0 0 4px rgba(0, 0, 0, 0.4);
    margin: 2px;
    /* Evita che l'immagine sgrani durante l'animazione */
    backface-visibility: hidden;
}

/* 2. LOGICA SPECIFICA PER IL TAB GIOCO (Invisibilità iniziale) */
#cGioco img {
    opacity: 0;
}

/* 3. L'ANIMAZIONE */
.num-anim {
    animation: entraNumero 0.5s ease-out forwards;
}

@keyframes entraNumero {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stile del Toast di notifica */
#toast-notifica {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 1);
    color: #F7CE00; /* Giallo coordinato con il tuo tema */
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    z-index: 3000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #F7CE00;
    pointer-events: none; /* Non blocca i click sotto di esso */
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap; /* Forza il testo su una sola riga */
    min-width: fit-content; /* Si allarga quanto serve al testo */
    display: block;
}

    #toast-notifica.mostra {
        opacity: 1;
    }
