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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #111827;
    color: #fff;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #1f2937;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid #374151;
}

.sidebar-footer a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-footer a:hover {
    color: #fff;
}

.sidebar-content {
    padding: 1.5rem;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Controls */
.control-group {
    margin-top: 1.5rem;
}

.control-group h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #059669;
    color: white;
    margin-top: 1.5rem;
}

.btn-success:hover {
    background: #047857;
}

.btn-filter {
    padding: 0.5rem 0.75rem;
    background: #374151;
    color: #d1d5db;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: #4b5563;
}

.btn-filter.active {
    background: #2563eb;
    color: white;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.button-row {
    display: flex;
    gap: 0.5rem;
}

.button-row .btn-filter {
    flex: 1;
}

.button-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sliders */
.slider-group {
    margin-bottom: 0.75rem;
}

.slider-group label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

input[type="range"] {
    width: 100%;
    height: 0.5rem;
    background: #374151;
    border-radius: 0.25rem;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Color Inputs */
.color-input {
    margin-top: 0.75rem;
}

.color-input label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.color-picker-group {
    display: flex;
    gap: 0.5rem;
}

input[type="color"] {
    width: 2.5rem;
    height: 2rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.hex-input {
    flex: 1;
    padding: 0.5rem;
    background: #374151;
    border: none;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
}

/* Pixelation Controls */
.pixelation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-arrow {
    padding: 0.5rem;
    background: #374151;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
}

.btn-arrow:hover {
    background: #4b5563;
}

.btn-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pixel-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}

.btn-pixel {
    padding: 0.25rem 0.5rem;
    background: #374151;
    color: #d1d5db;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-pixel:hover {
    background: #4b5563;
}

.btn-pixel.active {
    background: #2563eb;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-center;
    padding: 2rem;
    overflow: auto;
}

.placeholder {
    text-align: center;
    color: #6b7280;
}

.placeholder-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.placeholder-text {
    font-size: 0.875rem;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    image-rendering: pixelated;
}

/* Desktop: prevent body scroll, sidebar scrolls internally */
@media (min-width: 1025px) {
    body {
        overflow: hidden;
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        overflow-y: visible;
    }

    .sidebar-footer {
        order: 1;
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .main-content {
        min-height: 400px;
    }
}