/* styles.css - 4-5歳児向けさんすうツール スタイルシート */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.game-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.title {
    font-size: clamp(24px, 5vw, 48px);
    color: #FF6B9D;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    font-weight: bold;
}

.subtitle {
    font-size: clamp(16px, 3vw, 24px);
    color: #4169E1;
    margin-bottom: 20px;
}

.game-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
}

.question-section {
    text-align: center;
    margin-bottom: 30px;
}

.question-text {
    font-size: clamp(20px, 4vw, 36px);
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.target-number {
    font-size: clamp(48px, 8vw, 96px);
    color: #FF6B9D;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin: 10px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.animals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    min-height: 300px;
}

.animal {
    width: 100px;
    height: 100px;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

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

.animal.clicked {
    background: #FFE4E1;
    border: 4px solid #FF6B9D;
    transform: scale(0.95);
}

.animal.bounce {
    animation: animalBounce 0.6s ease;
}

@keyframes animalBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
}

.counter-section {
    text-align: center;
    margin: 20px 0;
}

.count-display {
    font-size: clamp(24px, 5vw, 48px);
    color: #4169E1;
    font-weight: bold;
    margin: 10px 0;
}

.buttons-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    font-size: clamp(16px, 3vw, 24px);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 120px;
}

.btn-primary {
    background: #FF6B9D;
    color: white;
}

.btn-secondary {
    background: #87CEEB;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.feedback.success {
    border: 4px solid #32CD32;
}

.feedback.error {
    border: 4px solid #FF6347;
}

.feedback-text {
    font-size: clamp(24px, 5vw, 48px);
    font-weight: bold;
    margin-bottom: 20px;
    white-space: pre-line;
}

.feedback.success .feedback-text {
    color: #32CD32;
}

.feedback.error .feedback-text {
    color: #FF6347;
}

.stars {
    font-size: 48px;
    margin: 10px 0;
}

.progress-bar {
    background: #E0E0E0;
    border-radius: 10px;
    height: 20px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #FF6B9D, #87CEEB);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.level-info {
    text-align: center;
    margin-bottom: 20px;
}

.level-text {
    font-size: clamp(16px, 3vw, 20px);
    color: #666;
    margin-bottom: 10px;
}

.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    background: #FF6B9D;
    animation: confettiFall 3s linear infinite;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* タブレット・モバイル対応 */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-area {
        padding: 20px;
    }
    
    .animals-grid {
        gap: 15px;
        padding: 15px;
    }
    
    .animal {
        width: 80px;
        height: 80px;
        font-size: 45px;
    }
    
    .feedback {
        padding: 30px;
        margin: 20px;
        width: calc(100% - 40px);
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .buttons-section {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .animals-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
    
    .animal {
        width: 70px;
        height: 70px;
        font-size: 40px;
    }
}