*, *::before, *::after { 
    box-sizing: border-box; 
}

body { 
    background: #020617; 
    color: #fff; 
    font-family: 'Inter', sans-serif; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    margin: 0; 
    overflow: hidden; 
    user-select: none; 
}

#particles { 
    position: fixed; 
    inset: 0; 
    z-index: 0; 
    pointer-events: none; 
}

.bg-glow { 
    position: fixed; 
    inset: 0; 
    background: radial-gradient(ellipse 80% 60% at 50% 40%, #1e3a8a44 0%, transparent 70%); 
    z-index: 0; 
    pointer-events: none; 
}

.back-home { 
    position: fixed; 
    top: 20px; 
    left: 24px; 
    font-size: 0.85rem; 
    color: #475569; 
    text-decoration: none; 
    z-index: 10; 
}

.back-home:hover { 
    color: #fff; 
}

.container { 
    position: relative; 
    z-index: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 16px 24px; 
    width: 100%; 
}

h1 { 
    font-family: 'Syne', sans-serif; 
    font-size: clamp(1.6rem, 6vw, 2.4rem); 
    font-weight: 900; 
    margin: 0 0 3px; 
    letter-spacing: -1px; 
}

.subtitle { 
    font-size: 0.85rem; 
    color: #64748b; 
    margin-bottom: 12px; 
}

/* Toolbar */
.toolbar { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex-wrap: wrap; 
    justify-content: center; 
    margin-bottom: 12px; 
}

.tool-btn { 
    padding: 7px 14px; 
    background: rgba(15, 23, 42, 0.7); 
    border: 1px solid rgba(51, 65, 85, 0.6); 
    border-radius: 8px; 
    color: #94a3b8; 
    font-size: 0.8rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.15s; 
}

.tool-btn:hover { 
    background: rgba(30, 58, 138, 0.4); 
    color: #fff; 
    border-color: rgba(96, 165, 250, 0.3); 
}

.tool-btn.active { 
    background: rgba(37, 99, 235, 0.3); 
    border-color: #60a5fa; 
    color: #fff; 
}

.color-picker { 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    border: 2px solid rgba(96, 165, 250, 0.4); 
    cursor: pointer; 
    background: none; 
    padding: 0; 
    overflow: hidden; 
}

.size-select { 
    background: rgba(15, 23, 42, 0.7); 
    border: 1px solid rgba(51, 65, 85, 0.6); 
    border-radius: 8px; 
    color: #94a3b8; 
    font-size: 0.8rem; 
    padding: 7px 10px; 
    cursor: pointer; 
    outline: none; 
}

/* Palette */
.palette { 
    display: flex; 
    gap: 5px; 
    flex-wrap: wrap; 
    justify-content: center; 
    margin-bottom: 12px; 
    max-width: 400px; 
}

.swatch { 
    width: 28px; 
    height: 28px; 
    border-radius: 6px; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: transform 0.1s, border-color 0.1s; 
}

.swatch:hover { 
    transform: scale(1.15); 
}

.swatch.selected { 
    border-color: #fff; 
    transform: scale(1.1); 
}

/* Canvas */
canvas#pixelCanvas { 
    display: block; 
    border-radius: 8px; 
    border: 1px solid rgba(51, 65, 85, 0.5); 
    cursor: crosshair; 
    touch-action: none; 
}
