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

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #121212;
    --accent: #E91E63;
    --accent-dark: #5D1A1A;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #333333;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.export-btn {
    background: var(--border);
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.main-content {
    flex: 1;
}

.canvas-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

#canvas {
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}

.hover-pixel {
    position: absolute;
    pointer-events: none;
    border: 2px solid transparent;
    transition: opacity 0.1s ease;
    opacity: 0;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--border);
    color: var(--text);
}

.mode-btn.active {
    background: var(--accent);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
}

.mode-btn:hover:not(.active) {
    background: #444;
}

.clear-btn, .undo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.clear-btn {
    background: var(--accent-dark);
}

.clear-btn:hover {
    background: #7a2323;
}

.undo-btn {
    background: var(--border);
}

.undo-btn:hover {
    background: #444;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.color-swatch {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 36px;
}

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

.color-swatch.selected {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.6);
    transform: scale(1.1);
}

.footer {
    padding: 20px 0;
    text-align: center;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent);
}

@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .color-palette {
        grid-template-columns: repeat(8, 1fr);
        gap: 6px;
    }
    
    .color-swatch {
        min-width: 28px;
    }
    
    .mode-btn, .clear-btn, .undo-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}