/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Game Container */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.game-header h1 {
    font-family: 'Fredoka One', cursive;
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-height: 50px;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #FFD93D, #FF6B6B);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6C5CE7, #A29BFE);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
}

/* Main Game Area */
.game-main {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 600px;
}

/* Tool Panel */
.tool-panel {
    background: white;
    border-radius: 20px;
    padding: 25px;
    width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.tool-panel h3 {
    color: #2D3436;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #E0E0E0;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

.mode-btn:hover {
    transform: scale(1.05);
}

/* Tool Sections */
.tool-section {
    margin-bottom: 25px;
}

.tool-section h4 {
    color: #2D3436;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.hidden {
    display: none;
}

/* Brush Options */
.brush-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.brush-btn {
    width: 50px;
    height: 50px;
    border: 3px solid #E0E0E0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-btn.active {
    border-color: #FF6B6B;
    background: #FFF5F5;
    transform: scale(1.1);
}

.brush-btn:hover {
    transform: scale(1.1);
}

/* Color Palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 3px solid #E0E0E0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn.active {
    border-color: #2D3436;
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.color-btn:hover {
    transform: scale(1.2);
}

/* Color Wheel Section */
.color-wheel-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px solid #dee2e6;
}

.color-wheel-section h5 {
    color: #2D3436;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.color-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#colorWheel {
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: crosshair;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#colorWheel:hover {
    transform: scale(1.05);
}

.color-wheel-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.current-color-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #2D3436;
}

.color-preview {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-values {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

/* Image Upload Section */
.image-upload-section {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px dashed #dee2e6;
}

.image-upload-section h5 {
    color: #2D3436;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.upload-container {
    text-align: center;
    margin-bottom: 15px;
}

.upload-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(45deg, #0056b3, #004085);
}

.upload-btn:active {
    transform: translateY(0);
}

.upload-icon {
    font-size: 1.2rem;
}

.upload-text {
    font-size: 0.9rem;
}

.upload-info {
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.8rem;
}

.uploaded-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.uploaded-image-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.uploaded-image-item:hover {
    transform: scale(1.1);
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.uploaded-image-item:active {
    cursor: grabbing;
}

.uploaded-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.uploaded-image-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uploaded-image-item:hover .remove-btn {
    opacity: 1;
}

/* Fun Elements */
.fun-elements {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.element-category {
    margin-bottom: 15px;
}

.element-category h5 {
    color: #2D3436;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.element-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 6px;
    width: 100%;
}

.fun-element {
    width: 60px;
    height: 60px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    background: white;
    padding: 5px;
}

.fun-element:hover {
    transform: scale(1.1);
    border-color: #FF6B6B;
}

.fun-element:active {
    cursor: grabbing;
}

/* Emoji Elements */
.emoji-element {
    width: 50px;
    height: 50px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    cursor: grab;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.emoji-element:hover {
    transform: scale(1.15);
    border-color: #FF6B6B;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
}

.emoji-element:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Special effects for different categories */
.emoji-element[data-emoji*="🐾"],
.emoji-element[data-emoji*="🐱"],
.emoji-element[data-emoji*="🐶"],
.emoji-element[data-emoji*="🐰"],
.emoji-element[data-emoji*="🐼"],
.emoji-element[data-emoji*="🦊"],
.emoji-element[data-emoji*="🐸"],
.emoji-element[data-emoji*="🦄"],
.emoji-element[data-emoji*="🐙"] {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: #ffc107;
}

.emoji-element[data-emoji*="🌺"],
.emoji-element[data-emoji*="🌸"],
.emoji-element[data-emoji*="🌻"],
.emoji-element[data-emoji*="🌴"],
.emoji-element[data-emoji*="🍄"],
.emoji-element[data-emoji*="🌈"],
.emoji-element[data-emoji*="⭐"],
.emoji-element[data-emoji*="🌙"],
.emoji-element[data-emoji*="☀️"] {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
}

.emoji-element[data-emoji*="🍎"],
.emoji-element[data-emoji*="🍕"],
.emoji-element[data-emoji*="🍦"],
.emoji-element[data-emoji*="🍪"],
.emoji-element[data-emoji*="🍭"],
.emoji-element[data-emoji*="🍓"],
.emoji-element[data-emoji*="🍌"],
.emoji-element[data-emoji*="🍇"] {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
}

.emoji-element[data-emoji*="🎮"],
.emoji-element[data-emoji*="🎈"],
.emoji-element[data-emoji*="🎪"],
.emoji-element[data-emoji*="🎨"],
.emoji-element[data-emoji*="🎭"],
.emoji-element[data-emoji*="🎸"],
.emoji-element[data-emoji*="⚽"],
.emoji-element[data-emoji*="🎯"],
.emoji-element[data-emoji*="🎲"] {
    background: linear-gradient(135deg, #cce5ff, #b3d9ff);
    border-color: #007bff;
}

.emoji-element[data-emoji*="💎"],
.emoji-element[data-emoji*="💍"],
.emoji-element[data-emoji*="🔮"],
.emoji-element[data-emoji*="💫"],
.emoji-element[data-emoji*="✨"],
.emoji-element[data-emoji*="🎀"],
.emoji-element[data-emoji*="🦋"],
.emoji-element[data-emoji*="🦜"] {
    background: linear-gradient(135deg, #e2d9f3, #d1c4e9);
    border-color: #6f42c1;
}

.emoji-element[data-emoji*="🚗"],
.emoji-element[data-emoji*="🚁"],
.emoji-element[data-emoji*="🚢"],
.emoji-element[data-emoji*="🚂"],
.emoji-element[data-emoji*="🚲"],
.emoji-element[data-emoji*="🛸"],
.emoji-element[data-emoji*="🚀"],
.emoji-element[data-emoji*="⛵"] {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: #ff9800;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#artCanvas {
    border: 3px solid #E0E0E0;
    border-radius: 15px;
    background: white;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

.canvas-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.canvas-overlay.fade-out {
    opacity: 0;
}

.instruction-text {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.instruction-text p {
    color: #2D3436;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* More Games Button */
.more-games-section {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.more-games-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.more-games-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #FF5252, #FF7676);
}

.more-games-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

.games-icon {
    font-size: 1.3rem;
}

.games-text {
    font-family: 'Nunito', sans-serif;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    color: #2D3436;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-content p {
    color: #636E72;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-main {
        flex-direction: column;
    }
    
    .tool-panel {
        width: 100%;
        position: static;
    }
    
    .tool-panel {
        order: 2;
    }
    
    .canvas-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    .tool-panel {
        padding: 20px;
    }
    
    .color-palette {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .element-grid {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
    }
    
    .emoji-element {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .uploaded-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .uploaded-image-item {
        width: 50px;
        height: 50px;
    }
    
    #artCanvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    .color-palette {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .element-grid {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    }
    
    .emoji-element {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .uploaded-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .uploaded-image-item {
        width: 45px;
        height: 45px;
    }
    
    .more-games-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .brush-btn, .color-btn, .mode-btn {
        min-height: 60px;
        min-width: 60px;
    }
    
    .fun-element {
        width: 70px;
        height: 70px;
    }
    
    .emoji-element {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }
    
    .more-games-btn {
        min-height: 60px;
        padding: 15px 30px;
        font-size: 1.2rem;
    }
}

/* Animation for elements */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.fun-element:hover {
    animation: bounce 0.6s ease;
} 