* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #2d1b69 0%, #1a0a2e 50%, #0d0618 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Patrick Hand', cursive;
    overflow: hidden;
    padding: 10px;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#canvas {
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(139, 69, 19, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    cursor: grab;
    touch-action: none;
}

#canvas:active {
    cursor: grabbing;
}

#controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#draw-mode-btn {
    background: linear-gradient(145deg, #d4a574, #b8895a);
    border: 3px solid #8B4513;
    border-radius: 12px;
    padding: 10px 24px;
    font-family: 'Permanent Marker', cursive;
    font-size: 16px;
    color: #4a3728;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#draw-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

#draw-mode-btn.active {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    border-color: #d97706;
    color: #78350f;
}

#draw-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 350px;
}

#draw-tools.hidden {
    display: none;
}

.tool-btn {
    background: #fef9c3;
    border: 2px solid #92400e;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Patrick Hand', cursive;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    transform: scale(1.05);
    background: #fde68a;
}

.tool-btn.active {
    background: #fbbf24;
    border-color: #78350f;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

footer {
    margin-top: 20px;
    color: #a78bfa;
    font-size: 14px;
    text-align: center;
}

footer a {
    color: #c4b5fd;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #e9d5ff;
}

@media (max-width: 500px) {
    #draw-tools {
        max-width: 280px;
    }
    
    .tool-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    #draw-mode-btn {
        padding: 8px 18px;
        font-size: 14px;
    }
}