* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS 1p', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    transition: all 0.3s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #5a67d8;
    text-align: center;
    margin-bottom: 10px;
    font-size: 3em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transition: font-size 0.3s ease;
}

.subtitle {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 1.1em;
}

h2 {
    color: #e53e3e;
    margin: 30px 0 20px;
    font-size: 1.8em;
    font-weight: 700;
    border-bottom: 3px solid #feb2b2;
    padding-bottom: 10px;
    transition: font-size 0.3s ease;
    line-height: 1.6;
}

h3 {
    color: #38a169;
    margin: 20px 0 15px;
    font-size: 1.4em;
    font-weight: 700;
    transition: font-size 0.3s ease;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: center;
}

.nav-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none; /* この行を追加 */
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.nav-button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ruby-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.ruby-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    line-height: 1.8;
    font-size: 1.1em;
    transition: font-size 0.3s ease;
}

.content p {
    margin-bottom: 20px;
    color: #2d3748;
}

.warning-box {
    background: #fff5f5;
    border: 3px solid #feb2b2;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(254, 178, 178, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(254, 178, 178, 0); }
    100% { box-shadow: 0 0 0 0 rgba(254, 178, 178, 0); }
}

.good-point {
    background: #f0fff4;
    border: 3px solid #9ae6b4;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.example-box {
    background: #e6fffa;
    border: 3px solid #81e6d9;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.icon {
    display: inline-block;
    font-size: 1.4em;
    margin-right: 10px;
    vertical-align: middle;
    line-height: 1;
    transform: translateY(-0.08em);
}

ul, ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    color: #4a5568;
}

ol {
    list-style-type: decimal;
    padding-left: 20px;
}

ol li {
    padding-left: 10px;
}

/* ルビモード用のスタイル（拡大率を調整） */
body.ruby-mode {
    font-size: 1.2em; /* 1.3emから縮小 */
}

body.ruby-mode h1 {
    font-size: 3.2em; /* 3.5emから縮小 */
}
body.ruby-mode .subtitle {
    font-size: 1.15em; /* 1.2emから縮小 */
}

body.ruby-mode h2 {
    font-size: 2.0em; /* 2.2emから縮小 */
    line-height: 1.5;
}

body.ruby-mode h3 {
    font-size: 1.6em; /* 1.7emから縮小 */
    line-height: 1.5;
}

body.ruby-mode .content {
    font-size: 1.3em; /* 1.4emから縮小 */
    line-height: 2.3; /* 2.5から縮小 */
}

/* ルビテキストのマーカー */
.ruby-text {
    display: inline;
    background: transparent;
}

.quiz-section {
    background: #fef3c7;
    border: 3px solid #fbbf24;
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
}

.quiz-button {
    background: #fbbf24;
    color: #78350f;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
}

.quiz-button:hover {
    transform: scale(1.05);
    background: #f59e0b;
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
    color: #718096;
}

.footer-links {
    margin: 15px 0;
}
.footer-links a {
    color: #718096;
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}


/* --- ポップアップ用のスタイル --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-content h2 {
    color: #5a67d8;
    margin-bottom: 20px;
}

.popup-content p {
    color: #2d3748;
    line-height: 1.8;
    margin-bottom: 15px;
}

#close-popup-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

#close-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- ▼▼▼ レスポンシブ対応 (モバイル用) ▼▼▼ --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2.2em;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 1em;
        margin-top: 0;
        line-height: 1.4;
    }

    h2 {
        font-size: 1.6em;
    }
    
    h3 {
        font-size: 1.3em;
    }

    .nav-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .ruby-toggle {
        padding: 10px 18px;
        font-size: 1em;
        top: 10px;
        right: 10px;
    }

    .popup-content {
        padding: 25px 20px;
    }
}