/* ============================================================
   Emoji Kitchen Mixer — Styles
   Playful, colorful dark mode with sticker aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #FFEAA7;
    --secondary: #74B9FF;
    --accent: #FF6B6B;
    --bg: #0F0F1A;
    --bg-elevated: #1A1A2E;
    --bg-surface: #252540;
    --bg-card: #1E1E36;
    --bg-hover: #2D2D4A;
    --text-primary: #F0F0F8;
    --text-secondary: #9090B0;
    --text-muted: #606080;
    --border: #30304A;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, .3);
    --transition: 200ms ease;
    --font: 'Inter', -apple-system, sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

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

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover {
    background: var(--bg-hover);
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #FFD700);
    border-color: var(--primary);
    color: #000;
    font-weight: 800;
}

.btn-sm {
    padding: 6px 12px;
    font-size: .8rem;
}

/* --- Mixer Area --- */
.mixer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.emoji-slot {
    width: 100px;
    height: 100px;
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}

.emoji-slot:hover {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.emoji-slot.filled {
    border-style: solid;
    border-color: var(--primary);
}

.mixer-plus {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 800;
}

.mixer-equals {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
}

.result-slot {
    width: 120px;
    height: 120px;
    border: 3px solid var(--accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    box-shadow: 0 0 20px rgba(255, 107, 107, .15);
}

.result-slot canvas {
    border-radius: 8px;
}

/* --- Actions --- */
.mixer-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* --- Emoji Picker --- */
.picker-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
    outline: none;
    margin-bottom: 12px;
}

.picker-search:focus {
    border-color: var(--primary);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 44px);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 4px;
}

.emoji-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    background: transparent;
    transition: all var(--transition);
}

.emoji-btn:hover {
    background: var(--bg-surface);
    transform: scale(1.15);
}

/* --- Gallery --- */
.gallery-section {
    margin-top: 16px;
}

.gallery-title {
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 64px);
    gap: 8px;
}

.gallery-item {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
}

.gallery-item:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* --- Size Selector --- */
.size-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.size-selector label {
    font-size: .8rem;
    color: var(--text-muted);
}

.size-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: .85rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
    .emoji-slot {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .result-slot {
        width: 100px;
        height: 100px;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}