* {
    user-select: none;
    touch-action: none;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: system-ui, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: #2b2b2b;
}

/* --- Floating Action Button (mobile only) --- */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: #ff9800;
    color: #1e1e1e;
    font-size: 24px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.fab:active {
    transform: scale(0.95);
}

/* --- Toolbar container (hidden on mobile by default) --- */
.toolbar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    transition: transform 0.3s ease-in-out;
    transform: translateY(100%);  /* hidden */
}
.toolbar-container.visible {
    transform: translateY(0);     /* visible */
}

/* --- The actual toolbar --- */
#toolbar {
    background: rgba(30,30,35,0.95);
    backdrop-filter: blur(8px);
    border-radius: 20px 20px 0 0;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    max-height: 70vh;
    overflow-y: auto;
}

.tool-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 40px;
}

button {
    background: #3a3a45;
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.1s;
    font-weight: 500;
    touch-action: manipulation;
}

button.active {
    background: #ff9800;
    color: #1e1e1e;
}

label {
    color: #eee;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid #888;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

input[type="range"] {
    width: 100px;
}

select {
    background: #3a3a45;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

/* --- Status panel (top-right) --- */
#infoPanel {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 6px 12px;
    text-align: right;
    z-index: 100;
    pointer-events: none;
    font-family: monospace;
    font-size: 12px;
    color: #eee;
}

#coords {
    margin-bottom: 4px;
}

#statusMsg {
    font-size: 11px;
    opacity: 0.8;
}

/* --- Desktop (width >= 701px) --- */
@media (min-width: 701px) {
    .toolbar-container {
        transform: translateY(0);   /* always visible */
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
    }
    .fab {
        display: none;             /* hide FAB on desktop */
    }
    #toolbar {
        border-radius: 40px;
        padding: 10px 20px;
    }
}

/* Styling voor de HTML5 Dialog */
dialog {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 20px;
    width: 350px;
    background: #ffffff;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

dialog form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

dialog h3 {
    margin: 0;
    color: #333;
}

dialog textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

dialog button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

#dialogConfirm {
    background: #007bff;
    color: white;
}

#dialogCancel {
    background: #eee;
    color: #333;
}

/* --- Mobile adjustments (width <= 700px) --- */
@media (max-width: 700px) {
    .tool-group {
        gap: 8px;
        padding: 4px 10px;
    }
    button {
        padding: 8px 12px;
        font-size: 14px;
    }
    label {
        font-size: 10px;
    }
    input[type="color"] {
        width: 28px;
        height: 28px;
    }
    select {
        font-size: 10px;
        padding: 4px 8px;
    }
    #infoPanel {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }
    #statusMsg {
        font-size: 9px;
    }
}
