* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* UNICO PUNTO DI CONTROLLO SFONDO */
#canvas-svg {
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: crosshair;
    background-color: lightcyan; /*#040814*/
}

/* Pannello di Controllo */
#control-panel {
    position: absolute;
    top: 20px;
    right: 0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.1, 0.9, 0.2, 1);
    background: rgba(8, 14, 28, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-right: none;
    border-radius: 12px 0 0 12px;
    padding: 20px;
    width: 310px;
    color: #ffd700;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

#control-panel.open {
    transform: translateX(0);
}

/* Linguetta sul bordo */
#panel-toggle {
    position: absolute;
    left: -42px;
    top: 20px;
    width: 42px;
    height: 50px;
    background: rgba(8, 14, 28, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: -4px 2px 10px rgba(0,0,0,0.5);
    transition: background 0.2s, color 0.2s;
}

#panel-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #fff;
}

#control-panel h3 {
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.25);
    padding-bottom: 8px;
    color: #ffee55;
    text-align: center;
}

.control-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 12px;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
}

.control-group input[type="range"] {
    accent-color: #ffd700;
    cursor: pointer;
}

/* Gruppo Pulsanti Fluttuanti e Trascinabili */
#floating-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
}

.action-btn {
    padding: 10px 20px;
    background: rgba(10, 20, 40, 0.75);
    border: 1.5px solid #ffd700;
    border-radius: 30px;
    color: #ffd700;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.action-btn:hover {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    background: rgba(20, 35, 65, 0.85);
}

#freeze-btn.frozen {
    background: rgba(180, 40, 40, 0.8);
    border-color: #ff6b6b;
    color: #ffffff;
}

#reset-btn {
    border-color: #ffee55;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #00ff88;
    box-shadow: 0 0 8px #00ff88;
}

#freeze-btn.frozen .status-dot {
    background-color: #ff3333;
    box-shadow: 0 0 8px #ff3333;
}