/* Mlan — a millet field you grow by learning. Earth greens, harvest gold. */

:root {
  --soil: #22301c;
  --soil-deep: #182312;
  --leafy: #7ea34f;
  --leaf-pale: #a9c46a;
  --gold: #d9a441;
  --cream: #f2eddc;
  --cream-dim: #b9c2a4;
  --rust: #b4642d;
  --rose: #c96a50;
  --line: #3a4c30;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--soil-deep), var(--soil) 40%);
  color: var(--cream);
  font-family: "Nunito", system-ui, sans-serif;
}

[lang^="dux"] { font-family: "Andika", sans-serif; }

#top {
  display: flex;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 20px 6px;
}

#top h1 { font-size: 1.8rem; font-weight: 400; color: var(--leaf-pale); font-family: "Andika", sans-serif; }
#top h1 .sub { display: block; font-family: "Nunito", sans-serif; font-size: 0.8rem; font-weight: 700; color: var(--cream-dim); }

#streak {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 9px;
  color: var(--gold);
  font-weight: 800;
  font-size: 1.05rem;
}

#streak svg { width: 19px; height: 19px; }

#field { display: block; width: 100%; height: 110px; margin-top: 4px; }

#field-note { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--cream-dim); margin-bottom: 4px; }

/* ---------- view ---------- */

#view {
  flex: 1;
  padding: 12px 18px 80px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.intro-box { text-align: center; padding: 20px 8px; }
.intro-box p { color: var(--cream-dim); font-weight: 600; line-height: 1.6; margin-bottom: 18px; }

.big-btn {
  border: 0;
  border-radius: 18px;
  background: var(--leafy);
  color: var(--soil-deep);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 16px 30px;
  box-shadow: 0 6px 0 #5c7d3a;
  cursor: pointer;
  transition: transform 0.2s var(--bounce);
}

.big-btn:active { transform: scale(0.94); }
.big-btn.gold { background: var(--gold); box-shadow: 0 6px 0 var(--rust); }
.big-btn:disabled { opacity: 0.45; }

.due-note { margin-top: 12px; font-size: 0.85rem; color: var(--cream-dim); font-weight: 700; }

/* flashcard */
.card {
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(165deg, #2b3d23, #22301c);
  padding: 30px 22px 24px;
  text-align: center;
  animation: pop-in 0.35s var(--bounce) both;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

@keyframes pop-in { from { opacity: 0; transform: scale(0.93) translateY(14px); } }

.card .pos { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--leaf-pale); }

.card .word {
  font-size: 2.7rem;
  line-height: 1.15;
  color: var(--cream);
  margin: 10px 0 4px;
  overflow-wrap: anywhere;
}

.card .answer { margin-top: 12px; animation: pop-in 0.3s ease both; }
.card .answer .fr { font-size: 1.15rem; font-weight: 700; color: var(--gold); }

.card .ex {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  font-size: 0.95rem;
  color: var(--cream-dim);
  line-height: 1.55;
}

.card .ex .dux { color: var(--cream); font-size: 1.05rem; }

.play-row { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }

.spk {
  width: 52px;
  height: 52px;
  border: 1.6px solid var(--gold);
  border-radius: 50%;
  background: rgba(217, 164, 65, 0.1);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s;
}

.spk:active { transform: scale(0.88); }
.spk svg { width: 20px; height: 20px; }
.spk.playing { background: var(--gold); color: var(--soil-deep); animation: throb 0.9s infinite; }

@keyframes throb { 50% { transform: scale(1.1); } }

.reveal-btn { margin-top: 18px; }

.grade-row { display: flex; gap: 10px; margin-top: 20px; }

.grade {
  flex: 1;
  border: 0;
  border-radius: 16px;
  padding: 14px 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}

.grade:active { transform: scale(0.93); }
.grade small { display: block; font-size: 0.68rem; font-weight: 700; opacity: 0.75; }
.grade.again { background: var(--rose); color: #fff; box-shadow: 0 5px 0 #94452f; }
.grade.hard { background: var(--rust); color: #fff; box-shadow: 0 5px 0 #7c3f1c; }
.grade.good { background: var(--leafy); color: var(--soil-deep); box-shadow: 0 5px 0 #5c7d3a; }

.session-note { text-align: center; margin-top: 14px; font-size: 0.8rem; font-weight: 700; color: var(--cream-dim); }

/* done screen */
.done-box { text-align: center; padding: 26px 10px; animation: pop-in 0.4s var(--bounce) both; }
.done-box h2 { color: var(--leaf-pale); font-size: 1.6rem; margin-bottom: 6px; }
.done-box p { color: var(--cream-dim); font-weight: 600; margin-bottom: 16px; line-height: 1.6; }

#foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 9px 18px calc(9px + env(safe-area-inset-bottom));
  background: rgba(24, 35, 18, 0.95);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--cream-dim);
}

#foot a { color: var(--gold); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
