body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
    padding-top: 20px;
}

.hidden {
    display: none;
}

h1 {
    margin-top: 10px;
    margin-bottom: 10px;
}

#image-gallery {
    margin: 10px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
}

#image-gallery h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

#image-thumbnails {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.thumbnail {
    width: 100px;
    height: 100px;
    border: 3px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    background: white;
    padding: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.thumbnail:hover,
.thumbnail:active {
    border-color: #007bff;
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
}

.thumbnail.selected {
    border-color: #28a745;
    border-width: 4px;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#controls {
    margin: 15px 0;
}

#color-palette {
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

.color-box {
    display: inline-block;
    width: 35px;
    height: 35px;
    border: 2px solid #000;
    cursor: pointer;
    margin: 2px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#mode-toggle,
#reset-button,
#undo-button,
#gallery-button {
    display: inline-block;
    vertical-align: middle;
    margin-left: 15px;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
    background-position: center;
    background-repeat: no-repeat;
    width: 44px;
    height: 44px;
}

#mode-toggle {
    background-image: url('icons/paint.svg');
}

#undo-button {
    background-image: url('icons/undo.svg');
}

#reset-button {
    background-image: url('icons/reset.svg');
}

#gallery-button {
    background-image: url('icons/library.svg');
}

#coloring-canvas {
    border: 2px solid #000;
    touch-action: none;
    -webkit-touch-callout: none;
    max-width: 100%;
    max-height: 90vh;
}

/* iPad landscape specific adjustments */
@media screen and (orientation: landscape) and (max-height: 1024px) {
    h1 {
        margin-top: 5px;
        margin-bottom: 5px;
        font-size: 24px;
    }
    
    #image-gallery {
        margin: 5px 0;
        padding: 10px;
    }
    
    #image-gallery h2 {
        margin-bottom: 5px;
        font-size: 16px;
    }
    
    .thumbnail {
        width: 80px;
        height: 80px;
    }
    
    #controls {
        margin: 10px 0;
    }
    
    .color-box {
        width: 30px;
        height: 30px;
    }
    
    #mode-toggle,
    #reset-button,
    #undo-button,
    #gallery-button {
        padding: 0;
        font-size: 12px;
        margin-left: 10px;
        width: 40px;
        height: 40px;
    }
    
    #coloring-canvas {
        max-height: 90vh;
        object-fit: contain;
    }
} 