/* --- 1. GLOBAL STYLES (Green Theme) --- */
body { 
    background-color: #121212; 
    color: #e0e0e0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 20px; 
    line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding-bottom: 100px; }

/* --- 2. HEADER & NAV --- */
header { 
    border-bottom: 2px solid #27ae60; 
    padding-bottom: 20px; 
    margin-bottom: 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
h1 { margin: 0; font-size: 1.8rem; color: #fff; }

.back-link {
    text-decoration: none;
    color: #888;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: 0.2s;
    white-space: nowrap;
}
.back-link:hover { color: #fff; border-color: #fff; }

.nav-container { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
button.nav-btn { 
    background: #1e1e1e; border: 1px solid #333; color: #aaa; 
    padding: 10px 16px; cursor: pointer; border-radius: 4px; 
    transition: 0.3s; font-weight: bold; font-size: 0.95rem; 
}
button.nav-btn.active, button.nav-btn:hover { background: #27ae60; color: white; border-color: #27ae60; }

/* --- 3. SECTIONS --- */
.section-box { 
    display: none; 
    background: #1e1e1e; 
    border: 1px solid #333; 
    border-top: 4px solid #27ae60; 
    border-radius: 8px; 
    padding: 30px; 
    margin-bottom: 40px;
    animation: fadeIn 0.4s ease;
}
.section-box.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- 4. VOCABULARY --- */
.vocab-list-single { display: flex; flex-direction: column; gap: 5px; max-width: 800px; margin: 0 auto; }
.vocab-category { color: #2ecc71; margin-top: 25px; margin-bottom: 5px; border-bottom: 1px solid #444; padding-bottom: 5px; text-transform: uppercase; font-size: 1rem; }
.vocab-row { display: flex; align-items: center; padding: 10px 15px; border-bottom: 1px solid #333; font-size: 1rem; background: #222; border-radius: 4px; }
.vocab-row:hover { background: #2a2a2a; border-left: 3px solid #27ae60; }
.vocab-row span:first-child { font-weight: bold; width: 200px; color: #fff; }
.ipa { color: #f39c12; width: 140px; font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', sans-serif; font-size: 0.9rem; }
.bg { color: #aaa; font-style: italic; margin-right: auto; }
.speak-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; margin-left: 10px; filter: grayscale(1); transition: 0.2s; color: #2ecc71; }
.speak-btn:hover { filter: grayscale(0); transform: scale(1.1); }
.context-note { background: #2a2a2a; padding: 15px; border-left: 3px solid #2ecc71; color: #ccc; margin-bottom: 20px; font-size: 0.95rem; }

/* --- 5. GRAMMAR RULES --- */
.rule-box { margin-bottom: 30px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.rule-card { background: #252525; border: 1px solid #444; padding: 15px; border-radius: 8px; }
.rule-card h4 { color: #f39c12; margin-top: 0; border-bottom: 1px solid #555; padding-bottom: 5px; }
.rule-card ul { padding-left: 20px; color: #ccc; font-size: 0.9rem; }
.pro-table { width: 100%; border-collapse: collapse; background: #222; border: 1px solid #333; font-size: 0.95rem; }
.pro-table th { background: #1a1a1a; color: #2ecc71; padding: 12px; text-align: left; border-bottom: 2px solid #333; font-weight: 600; }
.pro-table td { padding: 12px; border-bottom: 1px solid #333; color: #e0e0e0; }
.pro-table tr:hover { background: #2a2a2a; }

/* --- 6. READING --- */
.newspaper-container { border: 2px solid #555; background: #222; padding: 20px; border-radius: 8px; min-height: 450px; position: relative; }
.newspaper-page { display: none; animation: fadeIn 0.5s; }
.newspaper-page.active { display: block; }
.news-layout { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.news-img { flex: 1; min-width: 150px; height: 180px; background: #333; border: 1px solid #444; display:flex; align-items:center; justify-content:center; border-radius: 5px; }
.news-content { flex: 3; min-width: 250px; }
.news-content h3 { color: #f39c12; margin-top: 0; }
.news-controls { display: flex; justify-content: center; align-items: center; margin-top: 20px; }
.reading-quiz { background: #1a1a1a; padding: 15px; border-radius: 5px; border-left: 3px solid #f39c12; }
.q-row { margin-bottom: 10px; font-size: 0.95rem; }
.q-row input { background: #333; border: 1px solid #555; color: white; padding: 4px 8px; border-radius: 4px; margin-left: 10px; width: 60%; }
.fb { font-weight: bold; margin-left: 10px; }

/* --- 7. DRILLS --- */
.quiz-block { border: 1px solid #333; padding: 20px; border-radius: 8px; background: #252525; margin-bottom: 20px;}
.quiz-header { font-weight: bold; color: #f39c12; margin-bottom: 10px; border-bottom: 1px solid #444; padding-bottom: 5px; }
.mini-quiz-item { margin-bottom: 10px; padding: 10px; background: #222; border-radius: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border: 1px solid #333; font-size: 0.95rem; }
.quiz-input { background: #333; border: 1px solid #555; color: #fff; padding: 5px 10px; border-radius: 4px; width: 150px; font-family: 'Segoe UI', sans-serif; }
.check-btn { background: #f39c12; color: black; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.check-btn:hover { background: #d35400; color: white; }
.ex-btn { background: #333; border: 1px solid #555; color: #ccc; padding: 8px 15px; border-radius: 4px; cursor: pointer; transition: 0.2s; font-size: 0.9rem; margin-right:5px; }
.ex-btn:hover { background: #444; }

/* --- LIGHT NOVEL --- */
.level-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.lvl-btn { background: #333; color: #888; border: 1px solid #444; padding: 5px 15px; cursor: pointer; border-radius: 20px; font-size: 0.9rem; transition: 0.3s; }
.lvl-btn.active { background: #f39c12; color: #000; border-color: #f39c12; font-weight: bold; }

.comic-board { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-width: 900px; margin: 0 auto; 
    background: #2c3e50; padding: 20px; border-radius: 8px; border: 4px solid #1a252f; 
}
.comic-panel { background: #fff; border: 3px solid #000; padding: 10px; border-radius: 4px; display: flex; align-items: center; gap: 15px; min-height: 110px; }
.comic-panel.right { justify-content: flex-end; flex-direction: row; }
.comic-img { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #333; object-fit: cover; background: #ddd;}
.speech-bubble { background: #fff; border: 2px solid #000; border-radius: 15px; padding: 10px 15px; color: #000; font-weight: bold; position: relative; flex-grow: 1; text-align: center; min-height: 40px; display: flex; align-items: center; justify-content: center; font-family: 'Comic Sans MS', sans-serif;}
.speech-bubble.empty { border: 2px dashed #bbb; color: #bbb; background: #f4f4f4; }
.speech-bubble.correct { border: 2px solid #2ecc71; background: #d5f5e3; }
.comic-bank { display:flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top:20px; border-top: 1px dashed #555; padding-top: 20px; }
.comic-phrase { background: #f1f1f1; color: #333; padding: 8px 15px; border: 1px solid #999; border-radius: 20px; cursor: grab; display: inline-block; box-shadow: 0 2px 5px rgba(0,0,0,0.5); font-family: 'Comic Sans MS', sans-serif;}

@media (max-width: 600px) {
    .comic-board { grid-template-columns: 1fr; }
    .comic-panel { flex-direction: column; align-items: center; text-align: center;}
    .comic-panel.right { flex-direction: column-reverse; }
    .speech-bubble { text-align: center; justify-content: center; width: 100%;}
}

/* --- GAME: THE RUNWAY JUDGE --- */
.runway-container { 
    display: flex; gap: 30px; justify-content: center; flex-wrap: wrap;
}
.model-stage {
    background: #fff; border: 4px solid #f39c12; width: 300px; height: 350px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 10px; padding: 20px; text-align: center;
}
.model-emoji { font-size: 5rem; margin-bottom: 10px; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.judge-desk {
    flex: 1; min-width: 320px; background: #2c3e50; border: 1px solid #444;
    padding: 20px; border-radius: 10px;
}
.score-board {
    display: flex; justify-content: space-between; font-weight: bold; color: #fff;
    border-bottom: 2px solid #444; padding-bottom: 15px; margin-bottom: 20px; font-size: 1.1rem;
}
.choice-container { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
    background: #34495e; color: #ecf0f1; border: 2px solid #2c3e50; padding: 15px;
    text-align: left; cursor: pointer; transition: 0.2s; border-radius: 5px; font-size: 0.95rem;
}
.choice-btn:hover { background: #f39c12; color: #000; border-color: #e67e22; }
.feedback-text { min-height: 40px; margin-top: 15px; font-weight: bold; }
/* ─── LESSON EXTENSIONS ──────────────────────────────────────────────────── */
.rule-box { margin-bottom: 35px; border-bottom: 1px solid #333; padding-bottom: 28px; }
.rule-box:last-child { border-bottom: none; }
.rule-box h3 { color: #2ecc71; font-size: 1.1rem; margin-bottom: 8px; }
.rule-intro { color: #bbb; margin-bottom: 14px; font-size: 0.95rem; line-height: 1.75; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.rule-card { background: #252525; border: 1px solid #444; padding: 14px; border-radius: 8px; }
.rule-card h4 { color: #f39c12; margin-top: 0; border-bottom: 1px solid #555; padding-bottom: 5px; font-size: 0.9rem; }
.rule-card ul { padding-left: 16px; color: #ccc; font-size: 0.87rem; margin: 0; }
.rule-card ul li { margin-bottom: 5px; }
.grammar-ex-block { background: #1a1a1a; border-radius: 8px; padding: 18px; margin-top: 18px; border: 1px solid #333; }
.easy-ex { border-left: 4px solid #27ae60; }
.hard-ex { border-left: 4px solid #e67e22; }
.ex-instructions { color: #ddd; margin-bottom: 13px; font-size: 0.93rem; background: #252525; padding: 9px 13px; border-radius: 5px; }
.g-item { margin-bottom: 10px; padding: 8px 10px; background: #222; border-radius: 4px; font-size: 0.92rem; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #ddd; border: 1px solid #333; }
.g-input { background: #333; border: 1px solid #555; color: #fff; padding: 5px 10px; border-radius: 4px; width: 180px; font-family: 'Segoe UI', sans-serif; font-size: 0.9rem; }
.g-input.wide { width: 340px; }
.g-fb { font-weight: bold; font-size: 0.88rem; margin-left: 6px; }
.ex-btn-row { display: flex; align-items: center; gap: 14px; margin-top: 13px; padding-top: 10px; border-top: 1px solid #333; }
.score-display { font-weight: bold; font-size: 1rem; color: #f39c12; }
.example-compare { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.wrong-box { background: #2f1a1a; border: 1px solid #e74c3c; border-radius: 6px; padding: 10px 14px; color: #e0a0a0; font-size: 0.9rem; flex: 1; min-width: 180px; }
.correct-box { background: #1a2f1a; border: 1px solid #2ecc71; border-radius: 6px; padding: 10px 14px; color: #a0e0a0; font-size: 0.9rem; flex: 1; min-width: 180px; }
.news-content p { color: #ddd; font-size: 0.95rem; line-height: 1.8; }
.news-content h3 { color: #f39c12; margin-top: 0; }
.news-img { flex: 0 0 80px; height: 100px; background: #333; border: 1px solid #444; display:flex; align-items:center; justify-content:center; border-radius: 5px; font-size: 2.8rem; }
.news-layout { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.reading-quiz { background: #1a1a1a; padding: 16px; border-radius: 5px; border-left: 3px solid #f39c12; margin-top: 8px; }
.reading-quiz h4 { color: #f39c12; margin-top: 0; margin-bottom: 13px; }
.mc-q { margin-bottom: 16px; }
.mc-q p { color: #fff; font-weight: bold; margin-bottom: 7px; font-size: 0.93rem; }
.mc-q label { display: block; padding: 6px 11px; margin-bottom: 3px; background: #252525; border-radius: 4px; cursor: pointer; font-size: 0.88rem; color: #ccc; border: 1px solid #333; transition: 0.2s; }
.mc-q label:hover { background: #2e2e2e; border-color: #555; }
.mc-q input[type="radio"] { margin-right: 7px; accent-color: #27ae60; }
.mc-fb { display: block; font-weight: bold; font-size: 0.88rem; margin-top: 4px; }
.wide-speak { font-size: 0.88rem; background: #252525; border: 1px solid #444; border-radius: 4px; padding: 4px 11px; cursor: pointer; color: #2ecc71; margin-top: 6px; }
.cloze-container { background: #222; border: 1px solid #444; padding: 22px; border-radius: 8px; }
.cloze-text { font-size: 0.97rem; line-height: 2.4; color: #ddd; }
.cloze-text p { margin-bottom: 16px; }
.cloze-select { background: #2a2a2a; border: 1px solid #555; border-bottom: 2px solid #f39c12; color: #fff; padding: 3px 7px; border-radius: 4px 4px 0 0; font-size: 0.93rem; cursor: pointer; margin: 0 3px; }
.cloze-controls { display: flex; align-items: center; gap: 13px; margin-top: 18px; padding-top: 13px; border-top: 1px solid #333; flex-wrap: wrap; }
.cloze-feedback-box { background: #1a2a1a; border: 1px solid #2ecc71; padding: 13px; border-radius: 5px; margin-top: 13px; font-size: 0.88rem; color: #ccc; line-height: 1.8; }
.reset-btn { background: #333 !important; color: #aaa !important; }
.drill-instructions { background: #1e1e1e; padding: 8px 11px; border-radius: 4px; border-left: 3px solid #27ae60; color: #ccc; margin-bottom: 10px; font-size: 0.86rem; }
.drill-fb { font-weight: bold; font-size: 0.86rem; }
.g-select { background: #333; border: 1px solid #555; border-bottom: 2px solid #27ae60; color: #fff; padding: 5px 10px; border-radius: 4px 4px 0 0; font-family: 'Segoe UI', sans-serif; font-size: 0.9rem; cursor: pointer; }
.g-select:focus { outline: none; border-color: #2ecc71; }
.level-badge { display: inline-block; background: #27ae60; color: #fff; font-size: 0.75rem; font-weight: bold; padding: 2px 8px; border-radius: 3px; margin-bottom: 4px; letter-spacing: 0.04em; }
.subtitle { font-size: 0.88rem; color: #888; margin-top: 4px; }
.info-box { background: #1a2a2a; border-left: 4px solid #3498db; padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 12px 0; font-size: 0.9rem; color: #ccc; }
.info-box strong { color: #3498db; }
.pro-table { width: 100%; border-collapse: collapse; background: #222; border: 1px solid #333; font-size: 0.95rem; margin-bottom: 14px; }
.pro-table th { background: #1a1a1a; color: #2ecc71; padding: 12px; text-align: left; border-bottom: 2px solid #333; font-weight: 600; }
.pro-table td { padding: 12px; border-bottom: 1px solid #333; color: #e0e0e0; }
.pro-table tr:hover { background: #2a2a2a; }
/* ─── GRAMMAR LAB STRUCTURE ─────────────────────────────────────────────── */
.rule-part-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.rule-part-num {
    flex-shrink: 0; width: 40px; height: 40px; background: #27ae60;
    color: #fff; font-size: 1.3rem; font-weight: bold; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.rule-part-header h3 { margin: 0 0 2px 0; color: #2ecc71; font-size: 1.05rem; }
.rule-subtitle { margin: 0; color: #888; font-size: 0.87rem; font-style: italic; }

.rule-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 640px) { .rule-split { grid-template-columns: 1fr; } }

.rule-mini-card { border-radius: 8px; padding: 14px 16px; border: 1px solid #444; }
.rule-mini-card ul { padding-left: 16px; margin: 8px 0 0 0; color: #ccc; font-size: 0.88rem; }
.rule-mini-card ul li { margin-bottom: 5px; }
.rule-mini-title { font-weight: bold; font-size: 0.9rem; margin-bottom: 4px; }
.rule-mini-tag { font-weight: normal; font-size: 0.78rem; color: #aaa; margin-left: 6px; font-style: italic; }
.rule-warn { font-size: 0.82rem; color: #aaa; margin-top: 10px; padding-top: 8px; border-top: 1px solid #444; }

.rule-green  { background: #1a2a1a; border-color: #27ae60; }
.rule-green  .rule-mini-title { color: #2ecc71; }
.rule-blue   { background: #1a1f2e; border-color: #3498db; }
.rule-blue   .rule-mini-title { color: #5dade2; }
.rule-orange { background: #2a1e10; border-color: #e67e22; }
.rule-orange .rule-mini-title { color: #f39c12; }
.rule-purple { background: #1e1a2e; border-color: #8e44ad; }
.rule-purple .rule-mini-title { color: #b07ed4; }
.rule-red    { background: #2a1a1a; border-color: #e74c3c; }
.rule-red    .rule-mini-title { color: #e74c3c; }

.rule-compare-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.rule-compare-row .correct-box,
.rule-compare-row .wrong-box { flex: 1; min-width: 180px; font-size: 0.88rem; }

.g-hint { color: #666; font-size: 0.82rem; font-style: italic; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 0.8rem; font-weight: bold; }
.pill-green  { background: #1a3a1a; color: #2ecc71; border: 1px solid #27ae60; }
.pill-blue   { background: #1a1f3a; color: #5dade2; border: 1px solid #3498db; }
.pill-red    { background: #3a1a1a; color: #e74c3c; border: 1px solid #c0392b; }
.pill-yellow { background: #2a2200; color: #f39c12; border: 1px solid #d4a017; }
.pill-purple { background: #1e1a2e; color: #b07ed4; border: 1px solid #8e44ad; }