:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5a623;
    --background-color: #f8f9fa;
    --text-color: #333;
    --ninja-red: #e74c3c;
}

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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--ninja-red);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-container {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score {
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.score.updated {
    animation: bounce 0.5s;
}

.high-score {
    font-size: 1rem;
    color: var(--secondary-color);
    transition: transform 0.3s;
}

.high-score.updated {
    animation: bounce 0.5s;
    color: #f1c40f;
}

.high-score span {
    font-weight: bold;
}

.rank {
    margin-left: 1rem;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.rank.updated {
    animation: fadeIn 0.5s;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.question-container {
    text-align: center;
    font-size: 2rem;
    min-height: 3rem;
}

.answer-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.answer-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.answer-btn:hover {
    transform: scale(1.05);
    background-color: #357abd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.answer-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #666;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .question-container {
        font-size: 1.5rem;
    }

    .answer-btn {
        padding: 0.8rem 1.6rem;
        font-size: 1rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* アニメーションクラス */
.correct {
    animation: bounce 0.5s;
    color: #2ecc71;
}

.incorrect {
    animation: shake 0.5s;
    color: #e74c3c;
}

/* スコア更新時のアニメーション */
.score {
    transition: transform 0.3s;
}

.score.updated {
    animation: bounce 0.5s;
}

/* ランク更新時のアニメーション */
.rank {
    transition: color 0.3s;
}

.rank.updated {
    animation: fadeIn 0.5s;
}

.restart-btn {
    background-color: var(--secondary-color);
    margin-top: 1rem;
}

.restart-btn:hover {
    background-color: #e69500;
}

.choices-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.operator-selection {
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.operator-selection h2 {
    color: var(--ninja-red);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.operator-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.operator-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    min-width: 120px;
}

.operator-btn:hover {
    transform: scale(1.05);
    background-color: #357abd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.operator-btn:active {
    transform: scale(0.95);
}

.high-scores {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.high-scores h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.high-score-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    text-align: left;
    padding: 0 1rem;
}

.high-score-list p {
    margin: 0.5rem 0;
}

.high-score-list .high-score {
    font-weight: bold;
    color: var(--secondary-color);
}

.title-btn {
    background-color: var(--ninja-red);
    margin-left: 1rem;
}

.title-btn:hover {
    background-color: #c0392b;
}

.special-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.special-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
} 