:root {
    --primary-color: #4CAF50;
    --spring-color: #FFB7B2;
    --autumn-color: #E2C097;
    --bg-color: #F9F9F9;
    --text-color: #333;
    --white: #FFF;
    --border-radius: 12px;
    --btn-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    font-family: 'Kosugi Maru', sans-serif; /* やさしい丸ゴシック */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    background: var(--white);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    padding: 20px;
    flex: 1;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

h1, h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* ホーム画面 */
#home-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.btn {
    padding: 15px 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--btn-shadow);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.btn-spring {
    background-color: var(--spring-color);
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.btn-autumn {
    background-color: var(--autumn-color);
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.photo-notice {
    margin-top: 40px;
    font-size: 0.85rem;
    color: #777;
    text-align: left;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
}

/* ゲーム画面ヘッダー */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-back {
    background: none;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
}

#mode-title {
    font-size: 1.2rem;
    margin: 0;
}

#progress {
    font-weight: bold;
    color: var(--primary-color);
}

/* 画像エリア */
.image-container {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.image-placeholder {
    font-size: 2rem;
    color: #aaa;
    font-weight: bold;
}

#plant-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ヒントエリア */
.hint-section {
    margin-bottom: 20px;
}

.btn-hint {
    background-color: #FFF9C4;
    border: 1px solid #FFEB3B;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    display: block;
    margin: 0 auto;
    font-weight: bold;
    color: #f7b731;
}

.hint-content {
    margin-top: 10px;
    padding: 15px;
    background-color: #FFFDE7;
    border-left: 4px solid #FFEB3B;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    animation: slideDown 0.3s ease-out;
}

.hidden {
    display: none !important;
}

/* 選択肢ボタン */
.question-text {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.choices-grid .btn-choice {
    padding: 15px 10px;
    border: 2px solid #ddd;
    background-color: white;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.btn-choice:active {
    background-color: #f0f0f0;
}

.btn-choice.correct {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    animation: correctPulse 0.5s;
}

.btn-choice.wrong {
    background-color: #F44336;
    color: white;
    border-color: #F44336;
    animation: shake 0.4s;
}

/* フィードバックメッセージ */
.feedback {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 150px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 0 15px rgba(255,255,255,1), 0 0 30px rgba(255,255,255,1);
    line-height: 1;
}

.feedback.show {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.correct-mark { color: #F44336; }
.wrong-mark { color: #2196F3; }

.correct-answer-display {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 20;
    animation: fadeIn 0.3s;
    text-align: center;
    width: 80%;
}

/* リザルト画面 */
#result-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.kusudama {
    font-size: 5rem;
    margin: 20px 0;
    animation: bounce 1s infinite alternate;
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-15px); }
}

/* レスポンシブ微調整 */
@media (max-width: 400px) {
    .choices-grid {
        gap: 8px;
    }
    .btn-choice {
        font-size: 1rem;
        padding: 12px 5px;
    }
}

/* Kusudama Overlay */
#kusudama-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.3);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    pointer-events: none;
}
.kusudama-container {
    position: relative;
    width: 150px;
}
.kusudama-ball {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120px; height: 120px;
    background: gold;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.5s;
    border: 2px solid #d4af37;
}
.kusudama-ball.open {
    background: transparent;
    border: none;
}
.kusudama-ball.open::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60px; height: 120px;
    background: gold;
    border-radius: 120px 0 0 120px;
    transform-origin: right center;
    transform: rotate(25deg) translateX(-5px);
    border: 2px solid #d4af37;
}
.kusudama-ball.open::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 120px;
    background: gold;
    border-radius: 0 120px 120px 0;
    transform-origin: left center;
    transform: rotate(-25deg) translateX(5px);
    border: 2px solid #d4af37;
}
.kusudama-banner {
    position: absolute;
    top: 60px; left: 50%;
    transform: translateX(-50%);
    width: 80px;
    background: white;
    border: 1px solid #333;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    padding: 10px 0;
    height: 0;
    overflow: hidden;
    transition: height 1s ease-out 0.2s;
    z-index: 1;
    color: black;
}
.kusudama-banner.open {
    height: 300px;
}
