:root {
    --bg-color: #000000;
    --panel-bg: #cccccc;
    --panel-border: #bbbbbb;
    --text-color: #333333;
    --text-muted: #666666;
    --accent-color: #ff9f00;
    --active-green: #c1ffc1;
    --active-red: #ffc1c1;
    --active-white: #ffffff;
    --button-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#pheromone-canvas {
    opacity: 0.5;
    pointer-events: none;
}

/* Panels */
.panel {
    position: absolute;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
}

.panel-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.side-panel {
    top: 20px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
}

.top-right-panel {
    top: 20px;
    right: 20px;
    width: 240px;
}

.panel-content {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h3 {
    font-size: 0.8rem;
    text-transform: none;
    color: var(--text-muted);
    font-weight: 500;
}

/* Options Grid */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Buttons */
.brushes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
}

.brush-btn,
.control-btn,
.mini-btn {
    border: 1px solid #999;
    background: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    box-shadow: var(--button-shadow);
}

.brush-btn:hover,
.control-btn:hover {
    background: #f0f0f0;
}

.brush-btn.active[data-brush="rock"] {
    background: var(--active-white);
    border-color: #666;
}

.brush-btn.active[data-brush="food"] {
    background: var(--active-green);
    border-color: #4CAF50;
}

.brush-btn.active[data-brush="fungus"] {
    background: #fbcfe8;
    border-color: #ec4899;
}

.brush-btn.active[data-brush="erase"] {
    background: var(--active-red);
    border-color: #F44336;
}

.mini-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    background: #fff;
}

/* Time Actions */
.time-actions {
    padding: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    flex: 1;
    font-weight: 600;
}

.control-btn.active {
    background: var(--active-green);
    border-color: #4CAF50;
}

.speed-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.speed-toggle .label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Slider */
.slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-group span {
    font-size: 0.85rem;
    width: 20px;
}

input[type=range] {
    flex: 1;
}

/* Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch.small {
    width: 30px;
    height: 16px;
}

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

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

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

.switch.small .slider.round:before {
    height: 10px;
    width: 10px;
}

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

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

.switch.small input:checked+.slider:before {
    transform: translateX(14px);
}

/* Colony List Item */
.colony-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.3);
    padding: 8px;
    border-radius: 6px;
    margin-top: 8px;
}

.colony-color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.colony-actions {
    display: flex;
    gap: 4px;
    flex: 1;
}

.colony-action-btn {
    font-size: 0.7rem;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.colony-stats-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.colony-stats-toggle span {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}