/* --- Basic Setup --- */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #222;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

/* --- Toolbar --- */
#toolbar {
    flex-shrink: 0;
    background-color: #333;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #555;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

#toolbar button {
    background-color: #555;
    color: #fff;
    border: 2px solid #777;
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}

#toolbar button:hover {
    background-color: #666;
    border-color: #999;
}

#toolbar button.active {
    background-color: #007bff;
    border-color: #0056b3;
    color: #fff;
}

#clear-button {
    background-color: #c82333;
    border-color: #a51c29;
}
#clear-button:hover {
    background-color: #e32d3f;
    border-color: #c82333;
}

/* --- Game Container & Canvas --- */
#game-container {
    flex-grow: 1;
    position: relative; 
    min-height: 0;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
}

/* --- Property Panel --- */
#property-panel {
    position: absolute;
    top: 70px; /* Lowered to avoid toolbar */
    right: 15px;
    width: 240px;
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border: 1px solid #555;
    z-index: 20;
    overflow: hidden;
    transition: width 0.3s ease-in-out, height 0.3s ease-in-out;
}

#panel-header {
    background-color: #333;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
}

#panel-content {
    padding: 15px;
    transition: opacity 0.2s ease-in-out;
}

#property-panel.collapsed {
    width: 100px;
    height: 42px;
}

#property-panel.collapsed #panel-content {
    opacity: 0;
    pointer-events: none;
}

.property {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid #444;
}

.property label {
    font-size: 0.9em;
}

#power-slider {
    width: 120px;
}

/* Custom Switch (Checkbox) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(22px);
}