/* --- 1. GLOBAL --- */
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 --- */
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; }
.back-link:hover { color: #fff; border-color: #fff; }

/* --- 3. NAV --- */
.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; }

/* --- 4. 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); } }

/* --- 5. TEXT & TABLES --- */
h2 { color: #2ecc71; margin-top: 0; border-bottom: 1px solid #444; padding-bottom: 10px; }
h3 { color: #f39c12; margin-top: 30px; border-left: 3px solid #f39c12; padding-left: 10px; }
.context-note { background: #2a2a2a; padding: 15px; border-left: 3px solid #2ecc71; color: #ccc; margin-bottom: 20px; }
.special-case { background: #202c38; border: 1px solid #34495e; padding: 15px; margin-top: 15px; border-radius: 5px; }
.rule-box { background: #202c38; padding: 10px; border-radius: 5px; border: 1px solid #34495e; margin-bottom: 10px; }
.example-list { list-style: none; padding: 0; margin-top: 10px; }
.example-list li { background: #252525; border-bottom: 1px solid #333; padding: 8px 12px; font-size: 0.95rem; }
.example-list li strong { color: #2ecc71; }

table.vocab-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: #252525; border-radius: 6px; overflow: hidden; }
table.vocab-table th, table.vocab-table td { text-align: left; padding: 12px 15px; border-bottom: 1px solid #333; }
table.vocab-table th { background: #1a1a1a; color: #2ecc71; text-transform: uppercase; font-size: 0.9rem; }
table.vocab-table tr:hover { background: #2c2c2c; }
.tts-btn { background: none; border: 1px solid #555; color: #2ecc71; cursor: pointer; border-radius: 50%; width: 25px; height: 25px; display: inline-flex; align-items: center; justify-content: center; margin-left: 10px; font-size: 0.8rem; }
.tts-btn:hover { background: #2ecc71; color: #000; }

/* --- 6. VISUALS (INVERSION & COLOR) --- */
.inversion-container { display: flex; align-items: center; justify-content: center; gap: 20px; background: #252525; padding: 20px; border-radius: 8px; margin: 20px 0; }
.inv-box { text-align: center; background: #333; padding: 15px; border-radius: 8px; border: 1px solid #555; }
.inv-label { font-size: 0.8rem; color: #aaa; text-transform: uppercase; margin-bottom: 5px; }
.inv-verb { color: #e74c3c; font-weight: bold; font-size: 1.2rem; }
.inv-sub { color: #3498db; font-weight: bold; font-size: 1.2rem; }
.inv-arrow { font-size: 2rem; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; margin-top: 20px; }
.color-card { background: #252525; border: 1px solid #444; border-radius: 8px; padding: 15px; text-align: center; border-top-width: 5px; }
.color-circle { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 10px auto; border: 2px solid #333; }

/* --- 7. EXERCISES --- */
.quiz-block { margin-top: 20px; border: 1px solid #333; padding: 20px; border-radius: 8px; background: #252525; }
.quiz-title { color: #2ecc71; font-weight: bold; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }
.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: 5px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; margin-left: auto; }
.feedback-icon { font-weight: bold; font-size: 1.2rem; margin-left: 10px; }
.correct { color: #2ecc71; }
.wrong { color: #e74c3c; }

/* --- 8. 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;}

/* Character Intro */
.character-showcase { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.char-card { background: #252525; border: 1px solid #444; border-radius: 8px; padding: 12px; text-align: center; width: 140px; transition: transform 0.2s; }
.char-card:hover { transform: translateY(-5px); border-color: #f39c12; }
.char-card img { width: 100%; height: 150px; object-fit: cover; background: #333; border-radius: 4px; margin-bottom: 10px; border: 1px solid #333; }
.char-name { color: #fff; font-weight: bold; font-size: 1.1rem; }
.char-role { color: #888; font-size: 0.85rem; font-style: italic; }

/* --- 9. MINI GAMES --- */
.game-wrapper { display: none; margin-top: 20px; }
.phone-screen { max-width: 400px; margin: 0 auto; background: #000; border: 10px solid #333; border-radius: 20px; height: 600px; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { background: #202c33; padding: 10px; display: flex; align-items: center; gap: 10px; color: white; border-bottom: 1px solid #333; }
.chat-avatar { width: 35px; height: 35px; border-radius: 50%; background: #9b59b6; color:white; display:flex; align-items:center; justify-content:center; font-weight:bold;}
.chat-body { flex-grow: 1; background: #0b141a; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px; border-radius: 8px; font-size: 0.95rem; }
.msg.received { background: #202c33; align-self: flex-start; color: #fff; }
.msg.sent { background: #005c4b; align-self: flex-end; color: #fff; }
.chat-input-area { background: #202c33; padding: 10px; border-top: 1px solid #333; min-height: 150px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.option-btn { background: #2a3942; border: 1px solid #444; color: white; border-radius: 8px; padding: 10px; cursor: pointer; text-align: left; font-size: 0.85rem; height: 100%; transition: 0.2s; }
.option-btn:hover { background: #354550; }

.security-scene { background: #2c3e50; padding: 20px; border-radius: 8px; text-align: center; background-image: url('../images/office_entrance_bg.jpg'); background-size: cover; background-blend-mode: multiply; }
.guard-img { width: 120px; height: 120px; border-radius: 50%; border: 3px solid #f39c12; margin-bottom: 10px; object-fit: cover; background:#555;}
.dialogue-box { background: rgba(0,0,0,0.8); padding: 15px; border-radius: 8px; color: #fff; font-weight: bold; margin-bottom: 20px; min-height: 50px; border: 1px solid #f39c12; }
.sentence-builder { background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; min-height: 60px; display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; border: 2px dashed #555; flex-wrap: wrap; }
.word-bank { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.word-chip { background: #fff; color: #000; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; user-select: none; font-size: 1.1rem; box-shadow: 0 4px 0 #ccc; }

.party-container { text-align: center; padding: 20px; background: #2c3e50; border-radius: 8px; border: 4px solid #f39c12; }
.party-card { background: #fff; color: #333; padding: 15px; border-radius: 8px; margin-bottom: 15px; display: inline-block; width: 220px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.party-img-placeholder { display: block; margin-bottom: 10px; max-width: 100%; max-height: 150px; object-fit: contain; }
.emoji-fallback { font-size: 4rem; }
.party-sentence { font-size: 1.2rem; color: #fff; margin-bottom: 20px; font-weight: bold; }
.gap { border-bottom: 2px solid #f39c12; padding: 0 10px; color: #f39c12; }
.party-options { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.party-btn { background: #f39c12; color: #000; border: none; padding: 10px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.party-btn:hover { background: #d35400; color: white; }