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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #E6E6FA, #F0E6FF);
    min-height: 100vh;
    color: #4A4A4A;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 2.5rem;
    color: #7B68EE;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 1px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

.main-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.toolbar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 280px;
    height: fit-content;
}

.tool-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(123, 104, 238, 0.1);
}

.tool-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tool-section h3 {
    color: #7B68EE;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.tool-group {
    margin-bottom: 15px;
}

.tool-group label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #E6E6FA, #7B68EE);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7B68EE;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #7B68EE;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#brushSizeValue {
    font-size: 0.8rem;
    color: #7B68EE;
    font-weight: 500;
    margin-left: 10px;
}

.color-palette {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #7B68EE;
    box-shadow: 0 0 0 2px rgba(123, 104, 238, 0.3);
}

.rock-types, .rock-sizes {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.rock-btn, .size-btn {
    padding: 8px 12px;
    border: 2px solid #E6E6FA;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    color: #666;
    font-weight: 500;
}

.rock-btn:hover, .size-btn:hover {
    border-color: #7B68EE;
    color: #7B68EE;
    transform: translateY(-1px);
}

.rock-btn.active, .size-btn.active {
    background: #7B68EE;
    border-color: #7B68EE;
    color: white;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #E6E6FA, #D8BFD8);
    color: #666;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.primary {
    background: linear-gradient(135deg, #7B68EE, #9370DB);
    color: white;
}

.action-btn.danger {
    background: linear-gradient(135deg, #FFB6C1, #FF69B4);
    color: white;
}

.canvas-container {
    flex: 1;
    min-width: 400px;
}

#canvas {
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: #F5E6D3;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.mode-indicator {
    text-align: center;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.mode-indicator span {
    font-weight: 600;
    color: #7B68EE;
    font-size: 1rem;
}

.mode-indicator small {
    display: block;
    color: #888;
    margin-top: 5px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .toolbar {
        order: 2;
        min-width: unset;
    }
    
    .canvas-container {
        order: 1;
        min-width: unset;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .tool-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .rock-types, .rock-sizes {
        flex-wrap: wrap;
    }
    
    #canvas {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 15px;
    }
    
    .toolbar {
        padding: 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .color-palette {
        justify-content: center;
    }
    
    .action-buttons {
        gap: 8px;
    }
    
    .action-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}