:root {
    --bg-light: #e8f5e9;
    /* 薄い緑 */
    --accent-blue: #0288d1;
    --accent-green: #2e7d32;
    --text-color: #333;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.92);
}

* {
    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(--bg-light);
}

/* 安心感のある背景アニメーション */
.safety-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #e8f5e9 0%, #fff9c4 100%);
    opacity: 0.6;
}

.umbrella {
    position: absolute;
    bottom: -50px;
    left: var(--left);
    font-size: 2.5rem;
    opacity: 0.2;
    animation: drift 15s infinite ease-in-out;
    animation-delay: var(--delay);
}

@keyframes drift {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-110vh) rotate(20deg);
    }

    100% {
        transform: translateY(-110vh) rotate(-20deg);
    }
}

.container {
    width: 90%;
    max-width: 650px;
    z-index: 10;
}

.screen {
    display: none;
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 5px solid #fff;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    color: var(--accent-green);
    margin-bottom: 15px;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.2rem;
    color: #5d4037;
    margin-bottom: 35px;
    line-height: 1.6;
}

/* ボタン */
.btn {
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    text-decoration: none;
}

.large {
    padding: 15px 45px;
    font-size: 1.3rem;
    background-color: var(--accent-green);
    color: white;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.3);
}

.large:active {
    transform: scale(0.98);
}

.main-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background-color: var(--accent-blue);
    color: white;
}

.secondary-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #f5f5f5;
    color: #555;
    border: 2px solid #ddd;
    margin: 10px 0;
}

.back-link {
    display: block;
    margin-top: 30px;
    color: #777;
    text-decoration: none;
    font-size: 1rem;
}

/* クイズ部分 */
.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.badge {
    padding: 8px 18px;
    background: #f1f8e9;
    border-radius: 20px;
    font-weight: bold;
    color: var(--accent-green);
}

.question-container {
    width: 100%;
    background: #f9fbe7;
    padding: 30px;
    border-radius: 25px;
    margin-bottom: 30px;
    border: 3px solid #dcedc8;
}

.question-text {
    font-size: 1.35rem;
    font-weight: bold;
    line-height: 1.55;
    color: #33691e;
    word-break: break-all;
}

.choices-grid {
    width: 100%;
    display: grid;
    gap: 15px;
}

.choice-btn {
    padding: 12px 20px;
    font-size: 1.15rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    color: #444;
}

.choice-btn:hover {
    border-color: var(--accent-blue);
    background: #e1f5fe;
}

.choice-btn.correct {
    background-color: #c8e6c9 !important;
    border-color: #4caf50 !important;
    color: #1b5e20 !important;
}

.choice-btn.incorrect {
    background-color: #ffcdd2 !important;
    border-color: #f44336 !important;
    color: #b71c1c !important;
}

/* フィードバック */
.feedback-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.feedback-content {
    width: 85%;
    max-width: 480px;
    background: white;
    padding: 35px;
    border-radius: 35px;
    text-align: center;
}

.feedback-icon {
    font-size: 5rem;
    margin-bottom: 15px;
}

.explanation-box {
    background: #fdfae5;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: left;
    font-size: 1.15rem;
    line-height: 1.7;
    border-left: 6px solid #f9a825;
}

.hidden {
    display: none !important;
}

/* 結果 */
.result-card {
    width: 100%;
}

.final-score {
    font-size: 3rem;
    color: var(--accent-green);
    margin: 30px 0;
    font-weight: bold;
}

.result-rank {
    font-size: 1.4rem;
    margin-bottom: 40px;
    color: #555;
}

ruby {
    font-family: inherit;
}

rt {
    font-size: 0.55em;
    color: #666;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .screen {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .choice-btn {
        font-size: 1.1rem;
        padding: 15px 20px;
    }

    .large {
        padding: 15px 40px;
        font-size: 1.4rem;
    }
}