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

body {
    font-family: 'Nunito', sans-serif;
    background: #fdf2f8; /* Soft pinkish background */
    color: #1e293b;
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3 { font-family: 'Quicksand', sans-serif; font-weight: 700; }

/* Game Header */
.game-header {
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.mini-mascot { height: 40px; width: 40px; border-radius: 50%; object-fit: contain; background: #fff1f2; border: 2px solid #fecdd3; }
.game-info h1 { font-size: 1.2rem; color: #e11d48; line-height: 1.2; text-transform: uppercase; }
.game-info span { font-size: 0.8rem; color: #64748b; font-weight: 600; }

.header-right { display: flex; gap: 10px; }

/* Main Layout */
main {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
    background: #fffcfd;
}

#canvas-wrapper {
    flex: 1;
    position: relative;
    background: white;
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

canvas {
    position: absolute;
    max-width: 95%;
    max-height: 95%;
    touch-action: none;
}

#paint-canvas { z-index: 1; }
#outline-canvas { z-index: 2; pointer-events: none; opacity: 0.8; }
#instruction-arrows { z-index: 3; pointer-events: none; position: absolute; width: 100%; height: 100%; top: 0; left: 0; }

/* Controls Sidebar */
.controls {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

.glass-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.control-group { display: flex; flex-direction: column; gap: 8px; }
.control-group label { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 0.85rem; color: #64748b; }

/* Palette */
.palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: #e11d48; transform: scale(1.15); }

.rainbow-swatch {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
}

/* Patterns */
.patterns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pattern-btn {
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}
.pattern-btn:hover { background: #f1f5f9; }
.pattern-btn.active { background: #e11d48; color: white; border-color: #e11d48; }

/* Brush Settings */
.brush-settings { display: flex; align-items: center; gap: 10px; }
input[type=range] { flex: 1; cursor: pointer; accent-color: #e11d48; }

/* Actions */
.actions { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; margin-top: auto; }

/* Buttons */
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: #f1f5f9;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}
.icon-btn:hover { transform: translateY(-2px); background: #e2e8f0; }

.primary-btn {
    background: #e11d48;
    color: white;
    border: none;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 0 #9f1239;
    transition: all 0.1s;
    font-size: 0.9rem;
    text-transform: uppercase;
}
.primary-btn:active { transform: translateY(4px); box-shadow: none; }

.secondary-btn {
    background: #f1f5f9;
    color: #475569;
    border: none;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.overlay.active { opacity: 1; pointer-events: auto; }

.glass-card-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 90%;
    width: 480px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.gallery-item {
    background: white;
    border-radius: 16px;
    padding: 15px;
    cursor: pointer;
    border: 3px solid #f1f5f9;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gallery-item:hover { transform: scale(1.03); border-color: #fecdd3; }
.gallery-item.active { border-color: #e11d48; background: #fff1f2; }

.gallery-item img { width: 100px; height: 100px; object-fit: contain; }
.gallery-item span { font-weight: 700; font-size: 0.9rem; color: #475569; }

.gallery-item.coming-soon { background: #f8fafc; border-style: dashed; cursor: default; }
.gallery-item.coming-soon .placeholder { font-size: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    main { flex-direction: column; height: auto; }
    .controls { width: 100%; height: auto; overflow-y: visible; border-left: none; border-top: 1px solid rgba(0,0,0,0.05); }
    #canvas-wrapper { height: 60vh; width: 100%; }
    .gallery-grid { grid-template-columns: 1fr; }
}
