body {
    margin: 0;
    padding: 0;
    background-color: #dcb37b;
    background-image: url('https://www.transparenttextures.com/patterns/cork-board.png'); 
    font-family: sans-serif;
}

#board {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#addBtn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    padding: 15px 25px;
    font-size: 18px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 99999 !important;
    
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: transform;
}

@media (max-width: 768px) {
    #addBtn {
        bottom: max(25px, env(safe-area-inset-bottom) + 25px) !important;
        right: 20px !important;
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Stile Polaroid */
.polaroid {
    position: absolute;
    background: #fff;
    padding: 15px 15px 40px 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    border-radius: 2px;
    width: 250px;
    transition: transform 0.2s;
}

.polaroid:hover {
    z-index: 500;
    transform: scale(1.05) !important;
}

.polaroid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #000;
    pointer-events: none;
}

.polaroid p {
    text-align: center;
    margin: 15px 0 0 0;
    font-size: 24px;
    color: #333;
}

/* Modale */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100000; }
.modal-content { background: white; margin: 10% auto; padding: 20px; width: 300px; border-radius: 10px; display: flex; flex-direction: column; gap: 15px; }
.close { align-self: flex-end; cursor: pointer; font-size: 24px; }
input, select, button { padding: 10px; font-size: 16px; }

/* Pulsante Elimina */
.delete-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.polaroid.editable .delete-btn {
    display: block;
}

.polaroid.editable {
    cursor: grab;
    /* BLOCCO PULL-TO-REFRESH SU DISPOSITIVI TOUCH */
    touch-action: none;
}

.polaroid.editable:active {
    cursor: grabbing;
}
