:root {
    --forest-green: #2d6a4f;
    --leaf-green: #74c69d;
    --earth-brown: #6b4724;
    --sky-blue: #d8f3dc;
    --white: #ffffff;
    --text-color: #1b4332;
    --glass-bg: rgba(255, 255, 255, 0.9);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sky-blue);
}

/* 森の背景アニメーション */
.forest-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #d8f3dc 0%, #b7e4c7 100%);
}

.leaf {
    position: absolute;
    top: -50px;
    left: var(--l);
    font-size: 2rem;
    opacity: 0.3;
    animation: fall 12s infinite linear;
    animation-delay: var(--d);
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
    }

    25% {
        transform: translateY(25vh) rotate(90deg) translateX(20px);
    }

    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-20px);
    }

    75% {
        transform: translateY(75vh) rotate(270deg) translateX(20px);
    }

    100% {
        transform: translateY(110vh) rotate(360deg) translateX(0);
    }
}

.container {
    width: 90%;
    max-width: 650px;
    z-index: 10;
}

.screen {
    display: none;
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(27, 67, 50, 0.1);
    text-align: center;
    border: 6px solid #95d5b2;
    animation: slideUp 0.5s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

h1 {
    font-size: 1.7rem;
    color: var(--forest-green);
    margin-bottom: 15px;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.1rem;
    color: #40916c;
    margin-bottom: 35px;
    line-height: 1.6;
}

/* ボタン */
.btn {
    font-family: inherit;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    text-decoration: none;
}

.large {
    padding: 15px 40px;
    font-size: 1.3rem;
    background-color: var(--forest-green);
    color: white;
    box-shadow: 0 5px 15px rgba(45, 106, 79, 0.3);
}

.large:hover {
    transform: translateY(-3px);
    background-color: #1b4332;
}

.main-btn {
    padding: 15px 35px;
    font-size: 1.1rem;
    background-color: var(--earth-brown);
    color: white;
}

.secondary-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    background-color: #f0fff4;
    color: var(--forest-green);
    border: 2px solid var(--forest-green);
    margin: 10px 0;
}

.back-link {
    display: block;
    margin-top: 30px;
    color: var(--forest-green);
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.8;
}

/* クイズ部分 */
.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.badge {
    padding: 8px 15px;
    background: #d8f3dc;
    border-radius: 10px;
    font-weight: bold;
    color: var(--forest-green);
    font-size: 0.9rem;
}

.question-container {
    width: 100%;
    background: #fff;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px dashed var(--leaf-green);
    position: relative;
}

.question-text {
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.5;
    color: var(--forest-green);
    word-break: break-all;
}

.choices-grid {
    width: 100%;
    display: grid;
    gap: 15px;
}

.choice-btn {
    padding: 12px 18px;
    font-size: 1.1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    color: #333;
    text-align: center;
}

.choice-btn:hover {
    border-color: var(--leaf-green);
    background: #f7fffb;
}

.choice-btn.correct {
    background-color: #d8f3dc !important;
    border-color: #40916c !important;
    color: #1b4332 !important;
}

.choice-btn.incorrect {
    background-color: #ffe5e5 !important;
    border-color: #e63946 !important;
    color: #6a040f !important;
}

/* フィードバック */
.feedback-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 67, 50, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.feedback-content {
    width: 85%;
    max-width: 450px;
    background: white;
    padding: 30px;
    border-radius: 25px;
    text-align: center;
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.explanation-box {
    background: #f1f8e9;
    padding: 18px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.6;
    border-bottom: 4px solid var(--leaf-green);
}

.hidden {
    display: none !important;
}

/* 結果 */
.final-score {
    font-size: 2.8rem;
    color: var(--forest-green);
    margin: 25px 0;
    font-weight: bold;
}

.result-rank {
    font-size: 1.3rem;
    margin-bottom: 35px;
    color: var(--earth-brown);
    font-weight: bold;
}

ruby {
    font-family: inherit;
}

rt {
    font-size: 0.55em;
    color: #666;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .screen {
        padding: 30px 20px;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .choice-btn {
        font-size: 1.1rem;
        padding: 15px;
    }

    .large {
        padding: 15px 30px;
        font-size: 1.2rem;
    }
}