@charset "UTF-8";

:root {
    --primary-color: #4CAF50;
    /* 緑 */
    --secondary-color: #2196F3;
    /* 青 */
    --accent-color: #FF9800;
    /* オレンジ */
    --bg-color: #E0F7FA;
    /* 薄い水色 */
    --text-color: #333;
    --white: #ffffff;
    --font-main: "Zen Maru Gothic", sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23b2ebf2" fill-opacity="0.4"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.screen {
    display: none;
    /* デフォルトは非表示 */
    background-color: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 5px solid var(--secondary-color);
}

.screen.active {
    display: block;
    /* アクティブな画面だけ表示 */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    text-shadow: 2px 2px 0 #fff;
    margin-bottom: 2rem;
}

h2 {
    color: var(--primary-color);
}

p {
    font-size: 1.2rem;
    line-height: 1.8;
}

/* ボタン共通 */
.btn {
    font-family: var(--font-main);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    font-weight: bold;
    outline: none;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: none !important;
}

.large {
    font-size: 2rem;
    padding: 1rem 3rem;
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 6px 0 #E65100;
}

.next {
    font-size: 1.5rem;
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 5px 0 #0D47A1;
    margin-top: 1rem;
}

.retry {
    font-size: 1.5rem;
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 0 #1B5E20;
    margin-top: 2rem;
}

/* クイズ画面 */
.quiz-header {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #666;
}

.question-box {
    margin-bottom: 2rem;
}

#question-text {
    font-size: 1.8rem;
    color: #333;
}

.choices-container {
    display: grid;
    gap: 1rem;
}

.choice-btn {
    font-family: var(--font-main);
    font-size: 1.4rem;
    padding: 1rem;
    background-color: #fff;
    border: 3px solid var(--secondary-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.choice-btn:hover {
    background-color: #E3F2FD;
}

/* 正解・不正解時のスタイル */
.correct {
    background-color: #C8E6C9 !important;
    border-color: #4CAF50 !important;
    color: #1B5E20 !important;
}

.incorrect {
    background-color: #FFCDD2 !important;
    border-color: #F44336 !important;
    color: #B71C1C !important;
}

/* 解説エリア */
.feedback-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #FFF3E0;
    border-radius: 15px;
    border: 2px dashed var(--accent-color);
    text-align: left;
}

.feedback-area.hidden {
    display: none;
}

#feedback-title {
    text-align: center;
    font-size: 2rem;
    margin: 0 0 1rem 0;
}

.correct-msg {
    color: var(--primary-color);
}

.incorrect-msg {
    color: #F44336;
}

.explanation-box {
    background-color: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 10px;
}

/* 結果画面 */
.final-score {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 2rem 0;
}

/* フッター */
footer {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* レスポンシブ */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    #question-text {
        font-size: 1.4rem;
    }

    .choice-btn {
        font-size: 1.2rem;
    }

    .container {
        padding: 1rem;
        margin: 1rem auto;
    }
}

/* ルビの調整 */
ruby {
    font-family: var(--font-main);
}

rt {
    font-size: 0.6em;
    color: #555;
}