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

:root {
    --primary: #8B5CF6;
    --background: #1E1B4B;
    --surface: #312E81;
    --text: #F8FAFC;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
}

#game-area {
    padding: 16px;
}

.palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.color-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

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

.color-btn.active {
    border-color: var(--text);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.canvas {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 1px;
    background: #1E1B4B;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.pixel {
    aspect-ratio: 1;
    background: #312E81;
    border-radius: 2px;
    cursor: crosshair;
    transition: background 0.1s;
}

.pixel:hover {
    opacity: 0.8;
}

.tools {
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #EC4899 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}