:root {
    --sky-blue: #87ceeb;
    --cloud-white: #ffffff;
    --text-color: #333;
    --primary-color: #ff9f1c;
    /* オレンジ */
    --secondary-color: #2ec4b6;
    /* ミントグリーン */
    --accent-red: #ff5252;
    --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;
}

/* 空の背景 */
.sky-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #87ceeb 0%, #e0f7fa 100%);
}

/* 風船のアニメーション */
.balloon {
    position: absolute;
    bottom: -150px;
    left: var(--left);
    width: var(--size);
    height: calc(var(--size) * 1.2);
    background-color: var(--color);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    animation: rise var(--duration) infinite linear;
    opacity: 0.7;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 2px;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-60vh) rotate(5deg);
    }

    100% {
        transform: translateY(-120vh) rotate(-5deg);
    }
}

.container {
    width: 90%;
    max-width: 600px;
    z-index: 10;
}

.screen {
    display: none;
    background: var(--glass-bg);
    padding: 30px 20px;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 5px solid #fff;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.header-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 #fff;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

/* ボタン */
.btn {
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    text-decoration: none;
}

.large {
    padding: 15px 40px;
    font-size: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 6px 0 #e68a00;
}

.large:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #e68a00;
}

.main-btn {
    padding: 12px 35px;
    font-size: 1.15rem;
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 5px 0 #25a397;
}

.secondary-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #f0f0f0;
    color: #666;
    border: 2px solid #ddd;
    margin: 10px 0;
}

.back-link {
    display: block;
    margin-top: 25px;
    color: #888;
    text-decoration: none;
    font-size: 1rem;
}

/* クイズ部分 */
.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.badge {
    padding: 8px 15px;
    background: #e1f5fe;
    border-radius: 20px;
    font-weight: bold;
    color: #0288d1;
}

.question-container {
    width: 100%;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 3px dashed var(--secondary-color);
}

.question-text {
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.6;
    word-break: break-all;
}

.choices-grid {
    width: 100%;
    display: grid;
    gap: 15px;
}

.choice-btn {
    padding: 12px 18px;
    font-size: 1.15rem;
    background: white;
    border: 3px solid #eee;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.choice-btn:hover {
    border-color: var(--primary-color);
    background: #fff9db;
}

.choice-btn.correct {
    background-color: #d1fae5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.choice-btn.incorrect {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

/* フィードバック */
.feedback-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.feedback-content {
    width: 85%;
    max-width: 450px;
    background: white;
    padding: 30px;
    border-radius: 30px;
    text-align: center;
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.explanation-box {
    background: #fdf6e3;
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* 結果 */
.result-card {
    width: 100%;
}

.final-score {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 15px 0;
    font-weight: bold;
}

.result-rank {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: #555;
}

ruby {
    font-family: inherit;
}

rt {
    font-size: 0.55em;
    color: #777;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .container {
        width: 95%;
    }

    .screen {
        padding: 25px 15px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .question-text {
        font-size: 1.25rem;
    }

    .choice-btn {
        font-size: 1.1rem;
        padding: 12px;
    }

    .large {
        font-size: 1.5rem;
        padding: 15px 40px;
    }
}