@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bg: #0f0e0c;
  --bg2: #191714;
  --bg3: #221f1b;
  --border: rgba(255,255,255,0.08);
  --maple: #c8451a;
  --maple-light: #e07050;
  --gold: #c9993a;
  --gold-light: #e4b86a;
  --cream: #f0e6d3;
  --cream-dim: #a8987c;
  --text: #ede4d4;
  --text-dim: #7a7060;
  --sage: #7aaa80;
  --sky: #6098b8;
  --correct: #4a8a5a;
  --wrong: #8a3a3a;
  --correct-bg: rgba(74,138,90,0.15);
  --wrong-bg: rgba(138,58,58,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15,14,12,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 56px;
}
.topbar-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem; font-weight: 600;
  color: var(--cream); text-decoration: none;
}
.topbar-logo span { color: var(--maple); }
.topbar-nav { display: flex; align-items: center; gap: 0.2rem; }
.topbar-nav a {
  padding: 0.35rem 0.85rem;
  border-radius: 6px; color: var(--text-dim);
  text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s; border: 1px solid transparent;
}
.topbar-nav a:hover, .topbar-nav a.active {
  color: var(--cream); background: var(--bg3); border-color: var(--border);
}
.topbar-nav a.active { color: var(--gold-light); }

.lang-toggle {
  display: flex; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-left: 1rem;
}
.lang-toggle button {
  padding: 0.32rem 0.7rem; background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600;
  transition: all 0.2s; letter-spacing: 0.05em;
}
.lang-toggle button.active { background: var(--maple); color: white; }

.page-wrap { padding-top: 56px; min-height: 100vh; }
.container { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

.page-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.page-header-label {
  font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--maple); font-weight: 600; margin-bottom: 0.5rem;
}
.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600;
  color: var(--cream); line-height: 1.1;
}
.page-header p { color: var(--text-dim); margin-top: 0.5rem; font-size: 0.93rem; }

.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem;
}
.card-sm { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem; }

.section-label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 0.4rem; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; font-weight: 600; color: var(--cream); margin-bottom: 0.3rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.tab {
  padding: 0.42rem 1rem; border-radius: 6px; font-size: 0.865rem;
  font-weight: 500; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text-dim); transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}
.tab:hover { color: var(--cream); border-color: rgba(255,255,255,0.2); }
.tab.active { background: var(--maple); color: white; border-color: var(--maple); }

.flashcard-scene { perspective: 1200px; height: 200px; cursor: pointer; margin-bottom: 1.2rem; user-select: none; }
.flashcard-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
  border-radius: 12px;
}
.flashcard-inner.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; border-radius: 12px;
  backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem;
}
.flashcard-front {
  background: linear-gradient(135deg, #1e1a16, #2a2219);
  border: 1px solid rgba(200,69,26,0.3);
}
.flashcard-back {
  background: linear-gradient(135deg, #141c14, #1a2a1e);
  border: 1px solid rgba(122,170,128,0.3);
  transform: rotateY(180deg);
}
.flashcard-emoji { font-size: 2.2rem; margin-bottom: 0.4rem; }
.flashcard-word { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; font-weight: 600; color: var(--cream); }
.flashcard-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.3rem; }
.flashcard-translation { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-style: italic; color: var(--sage); text-align: center; margin-bottom: 0.4rem; }
.flashcard-example { font-size: 0.82rem; color: var(--cream); text-align: center; line-height: 1.5; opacity: 0.75; }

.quiz-prompt { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; color: var(--cream); line-height: 1.4; margin-bottom: 1.2rem; }
.quiz-prompt .blank { display: inline-block; min-width: 70px; border-bottom: 2px solid var(--gold); color: var(--gold); font-style: italic; text-align: center; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.option {
  padding: 0.65rem 1rem; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: 'Outfit', sans-serif;
  font-size: 0.92rem; cursor: pointer; transition: all 0.18s; text-align: left;
}
.option:hover:not(:disabled) { border-color: rgba(255,255,255,0.25); background: var(--bg); color: var(--cream); }
.option.correct { background: var(--correct-bg); border-color: var(--correct); color: #7dd88a; }
.option.wrong { background: var(--wrong-bg); border-color: var(--wrong); color: #d88a8a; }
.option:disabled { cursor: default; }

.feedback-box { margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 8px; font-size: 0.88rem; display: none; }
.feedback-box.show { display: block; }
.feedback-box.correct { background: var(--correct-bg); border: 1px solid var(--correct); color: #7dd88a; }
.feedback-box.wrong { background: var(--wrong-bg); border: 1px solid var(--wrong); color: #d88a8a; }
.feedback-box .explication { margin-top: 0.4rem; color: var(--cream-dim); font-size: 0.83rem; line-height: 1.6; white-space: pre-line; }

.score-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.2rem; }
.score-pill { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 0.28rem 0.75rem; font-size: 0.82rem; color: var(--gold); font-weight: 600; }
.progress-line { flex: 1; height: 3px; background: var(--bg3); border-radius: 3px; }
.progress-line-fill { height: 100%; background: linear-gradient(90deg, var(--maple), var(--gold)); border-radius: 3px; transition: width 0.4s; }

.btn { padding: 0.58rem 1.3rem; border-radius: 8px; font-family: 'Outfit', sans-serif; font-weight: 500; font-size: 0.875rem; cursor: pointer; border: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-primary { background: var(--maple); color: white; }
.btn-primary:hover { background: var(--maple-light); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--cream); border-color: rgba(255,255,255,0.2); }
.btn-gold { background: var(--gold); color: var(--bg); font-weight: 600; }
.btn-gold:hover { background: var(--gold-light); }

.poem-stanza { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; font-style: italic; line-height: 1.95; color: var(--cream); margin-bottom: 1.2rem; padding-left: 1rem; border-left: 2px solid rgba(200,69,26,0.4); white-space: pre-line; }
.poem-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.tag { padding: 0.2rem 0.65rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; }
.tag-maple { background: rgba(200,69,26,0.2); color: var(--maple-light); border: 1px solid rgba(200,69,26,0.3); }
.tag-gold { background: rgba(201,153,58,0.15); color: var(--gold-light); border: 1px solid rgba(201,153,58,0.3); }
.tag-sky { background: rgba(96,152,184,0.15); color: var(--sky); border: 1px solid rgba(96,152,184,0.3); }

.info-box { background: rgba(201,153,58,0.08); border: 1px solid rgba(201,153,58,0.25); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; font-size: 0.87rem; color: var(--cream-dim); line-height: 1.75; white-space: pre-line; }
.info-box strong { color: var(--gold-light); }
.warning-box { background: rgba(200,69,26,0.08); border: 1px solid rgba(200,69,26,0.25); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; font-size: 0.87rem; color: var(--cream-dim); line-height: 1.75; white-space: pre-line; }

.completion { text-align: center; padding: 3rem 1rem; }
.completion-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.completion h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; color: var(--cream); margin-bottom: 0.5rem; }
.completion p { color: var(--text-dim); font-size: 0.9rem; }

.reading-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 1rem; color: var(--cream); font-family: 'Outfit', sans-serif; font-size: 0.9rem; margin-top: 0.3rem; transition: border 0.2s; }
.reading-input:focus { outline: none; border-color: var(--gold); }
.reading-q-label { font-size: 0.86rem; color: var(--cream-dim); margin-top: 0.9rem; display: block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.38s ease both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

.nav-mobile { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(15,14,12,0.96); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 0.4rem; z-index: 100; justify-content: space-around; }
.nav-mobile a { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; color: var(--text-dim); text-decoration: none; font-size: 0.68rem; padding: 0.4rem 0.5rem; border-radius: 8px; transition: all 0.2s; }
.nav-mobile a.active { color: var(--gold); }
.nav-mobile a .icon { font-size: 1.25rem; }
@media(max-width: 600px) {
  .nav-mobile { display: flex; }
  .page-wrap { padding-bottom: 70px; }
  .topbar-nav { display: none; }
  .options-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
 