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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    color: #FF6B6B;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.category-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.category-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.animal-selector {
    display: none;
    margin-bottom: 30px;
}

.animal-selector.show {
    display: block;
}

.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    padding: 20px;
}

.animal-card {
    background: white;
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.animal-card:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.animal-card .emoji {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

.animal-card .name {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.coloring-area {
    display: none;
}

.coloring-area.show {
    display: block;
}

.color-palette {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.selected {
    border: 4px solid #333;
    transform: scale(1.3);
}

.canvas-container {
    background: white;
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#coloringSvg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 52%, #2BFF88 90%);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.animation-area {
    display: none;
    text-align: center;
}

.animation-area.show {
    display: block;
}

#animationCanvas {
    width: 100%;
    max-width: 800px;
    height: 500px;
    border: 3px solid #FFD700;
    border-radius: 20px;
    margin-bottom: 30px;
    background: white;
}

#backBtn {
    margin: 0 auto;
}

.svg-part {
    cursor: pointer;
    stroke: #333;
    stroke-width: 2;
    fill: white;
    transition: fill 0.3s;
}

.svg-part:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .category-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .color-option {
        width: 40px;
        height: 40px;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
}