html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #1e1e1e;
    font-family: 'Segoe UI', sans-serif;
    color: white;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.panel {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    font-size: 14px;
}

#stats {
    position: absolute;
    top: 0.1%;
    left: 0.1%;
    width: 160px;
}

#chip-preview {
    position: absolute;
    bottom: 7.5%;
    right: 0.1%;
    width: 180px;
}

#toolbar {
    position: absolute;
    bottom: 0.5%;
    left: 0.1%;
    right: 0.1%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#colorPicker {
    position: relative;
    top: 3px;
    left: 2.5%;
    right: 0.1%;
    width: 70%;
    height: 25px;
}

.gate {
    -webkit-user-drag: none;
}

button {
    background: #222;
    color: white;
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

    button:hover {
        background: #333;
    }

* {
    user-select: none;
}

.connector {
    width: 12px;
    height: 12px;
    background-color: #444;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-5%, -15%);
    z-index: 2;
}

    .connector:hover {
        background-color: #00ff88;
    }

.control-panel {
    position: absolute;
    top: 0.1%;
    right: 0.1%;
    width: 240px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 10;
}

#demo-warning {
    position: absolute;
    top: 0.5%;
    right: 300px;
    width: 230px;
    font-size: 13px;
    line-height: 1.4;
    background-color: rgba(255, 165, 0, 0.1);
    border: 1px solid #ff9900;
    border-radius: 8px;
    padding: 10px;
    color: #fff;
}


#full-version-btn {
    position: absolute;
    top: 5px;
    right: 275px;
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    display: none;
}