/* English Lesson Studio — student theme
   Warm editorial "book" look. One learner, ~50 years old:
   big type, generous spacing, obvious buttons, nothing clever. */

:root {
  --paper: #faf7f2;
  --card: #ffffff;
  --ink: #292524;
  --ink-soft: #57534e;
  --ink-faint: #a8a29e;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #ccfbf1;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --violet: #6d28d9;
  --violet-bg: #f5f3ff;
  --hl-vocab: #fef08a;
  --hl-phrase: #bae6fd;
  --hl-grammar: #ddd6fe;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --line: #e7e5e4;
  --radius: 14px;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.student-shell {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
}

/* ── Header ─────────────────────────────── */
.student-header {
  background: var(--teal);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.student-header .brand { font-family: var(--sans); }
.student-header .brand strong { font-size: 19px; display: block; }
.student-header .brand span { font-size: 13px; color: var(--teal-soft); }
.student-header nav a {
  font-family: var(--sans);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  margin-left: 6px;
}
.student-header nav a:hover { background: rgba(255, 255, 255, .24); }

.student-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ── Home cards ─────────────────────────── */
.page-head h1 { font-size: 30px; margin: 18px 0 6px; }
.page-head p { color: var(--ink-soft); margin: 0 0 18px; }

.lesson-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(41, 37, 36, .06);
  transition: box-shadow .2s, transform .2s;
}
.lesson-card:hover { box-shadow: 0 6px 18px rgba(41, 37, 36, .12); transform: translateY(-2px); }
.lesson-card img {
  width: 190px; height: 110px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--line);
}
.lesson-card .info h2 { margin: 2px 0 6px; font-size: 21px; line-height: 1.35; }
.lesson-card .info .vi { color: var(--ink-soft); font-size: 15px; margin: 0 0 8px; }
.lesson-card .info .meta { font-family: var(--sans); font-size: 13px; color: var(--ink-faint); }
.badge {
  font-family: var(--sans); font-size: 12px;
  background: var(--teal-soft); color: var(--teal-dark);
  border-radius: 20px; padding: 2px 10px; margin-right: 6px;
}

/* ── Lesson page ────────────────────────── */
.lesson-title h1 { font-size: 28px; margin: 14px 0 4px; line-height: 1.3; }
.lesson-title .vi { color: var(--ink-soft); font-size: 17px; margin: 0 0 8px; }
.lesson-title .meta { font-family: var(--sans); font-size: 14px; color: var(--ink-faint); margin-bottom: 10px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}

/* Section headings with number badge (mirrors booklet) */
.sec {
  display: flex; align-items: center; gap: 10px;
  margin: 30px 0 10px;
}
.sec .num {
  font-family: var(--sans);
  background: var(--teal); color: #fff;
  min-width: 30px; height: 30px; border-radius: 50%;
  text-align: center; line-height: 30px;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.sec h2 { font-family: var(--sans); font-size: 21px; margin: 0; color: var(--teal-dark); }
.sec .sub { font-family: var(--sans); font-size: 14px; color: var(--ink-faint); }

/* Info boxes */
.box {
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 10px;
  background: var(--card);
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 16.5px;
}
.box.humor { border-left-color: var(--amber); background: var(--amber-bg); }
.box.grammar { border-left-color: var(--violet); background: var(--violet-bg); }
.box .box-title { font-family: var(--sans); font-weight: 700; font-size: 15px; margin: 0 0 4px; color: var(--teal-dark); }
.box.humor .box-title { color: var(--amber); }
.box.grammar .box-title { color: var(--violet); }
.box p { margin: 6px 0; }

/* Keyword chips */
.chips { margin: 10px 0; }
.chip {
  display: inline-block;
  font-family: var(--sans); font-size: 15px;
  border: 1.5px solid var(--teal);
  border-radius: 22px;
  color: var(--teal-dark);
  background: var(--card);
  padding: 5px 14px; margin: 3px 4px 3px 0;
}
.chip .vi { color: var(--ink-faint); }

/* ── Video player ───────────────────────── */
.player-wrap { position: sticky; top: 0; z-index: 50; background: var(--paper); padding: 8px 0; }
.player-card {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(41, 37, 36, .18);
}
.player-card video { width: 100%; display: block; max-height: 420px; background: #000; }
.caption-bar {
  min-height: 58px;
  background: #1c1917;
  color: #fff;
  padding: 8px 16px;
  text-align: center;
  font-size: 18px;
  line-height: 1.5;
}
.caption-bar .vi-line { color: #d6d3d1; font-size: 15px; }
.caption-bar mark {
  color: #1c1917;
  font-weight: 750;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.player-controls {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 4px;
  font-family: var(--sans);
  justify-content: center;
}
.pbtn {
  font-family: var(--sans);
  font-size: 15px;
  border: 1.5px solid var(--teal);
  background: var(--card);
  color: var(--teal-dark);
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  min-height: 44px;
  transition: background .15s;
}
.pbtn:hover { background: var(--teal-soft); }
.pbtn.active { background: var(--teal); color: #fff; }

/* ── Questions / exercises ──────────────── */
.q { margin: 16px 0 22px; }
.q .qt { font-weight: 700; margin: 0 0 8px; font-size: 17.5px; }
.q .opts { display: flex; flex-direction: column; gap: 8px; }
.opt-btn {
  font-family: var(--serif);
  font-size: 17px;
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 46px;
  transition: border-color .15s, background .15s;
}
.opt-btn:hover { border-color: var(--teal); }
.opt-btn .letter { font-family: var(--sans); font-weight: 700; color: var(--teal); margin-right: 8px; }
.opt-btn.correct { border-color: var(--green); background: var(--green-bg); }
.opt-btn.wrong { border-color: var(--red); background: var(--red-bg); }
.opt-btn:disabled { cursor: default; opacity: .85; }
.why {
  display: none;
  font-size: 15.5px;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
}
.why.show { display: block; }
.why .tag { font-family: var(--sans); font-weight: 700; }
.why .tag.ok { color: var(--green); }
.why .tag.no { color: var(--red); }

/* match exercise */
.match-cols { display: flex; gap: 14px; flex-wrap: wrap; }
.match-col { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.match-item {
  font-size: 16.5px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 44px;
  text-align: left;
  font-family: var(--serif);
}
.match-item.sel { border-color: var(--amber); background: var(--amber-bg); }
.match-item.done { border-color: var(--green); background: var(--green-bg); color: var(--green); cursor: default; }
.match-item.shake { border-color: var(--red); background: var(--red-bg); }

/* ── Transcript ─────────────────────────── */
.tr-row {
  display: flex; gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f4;
}
.tr-row:hover { background: var(--teal-soft); }
.tr-row.playing { background: #fef9c3; }
.tr-row .t {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-faint);
  min-width: 44px; padding-top: 5px; flex-shrink: 0;
}
.tr-row .en { flex: 1.15; font-size: 17px; }
.tr-row .vi { flex: 1; font-size: 15px; color: var(--ink-soft); }
body.hide-vi .tr-row .vi { visibility: hidden; }
mark.hl-vocab { background: var(--hl-vocab); padding: 0 3px; border-radius: 4px; }
mark.hl-phrase { background: var(--hl-phrase); padding: 0 3px; border-radius: 4px; }
mark.hl-grammar { background: var(--hl-grammar); padding: 0 3px; border-radius: 4px; }
.legend { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 6px 0 10px; }
.legend mark { padding: 1px 8px; border-radius: 4px; }

/* ── Vocab cards ────────────────────────── */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.vcard {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s;
  min-height: 86px;
}
.vcard:hover { border-color: var(--teal); }
.vcard .w { font-weight: 700; font-size: 19px; }
.vcard .ipa { font-family: var(--sans); color: var(--ink-faint); font-size: 14px; margin-left: 6px; }
.vcard .hint { font-family: var(--sans); font-size: 13px; color: var(--teal); margin-top: 6px; }
.vcard .meaning { display: none; margin-top: 8px; font-size: 16px; }
.vcard .meaning .vi { font-weight: 700; color: var(--teal-dark); }
.vcard .meaning .def { color: var(--ink-soft); font-size: 14.5px; }
.vcard .meaning .ex { font-style: italic; color: var(--ink-soft); font-size: 15px; margin-top: 4px; }
.vcard.open .meaning { display: block; }
.vcard.open .hint { display: none; }

/* phrases table-ish list */
.phrase-item {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.phrase-item .p { font-weight: 700; font-size: 18px; background: var(--hl-phrase); border-radius: 6px; padding: 1px 8px; }
.phrase-item .kind { font-family: var(--sans); font-size: 12.5px; color: var(--ink-faint); }
.phrase-item .m { font-size: 16px; }
.phrase-item .ex { width: 100%; font-style: italic; color: var(--ink-soft); font-size: 15.5px; }

/* ── Listen again checklist ─────────────── */
.checklist { list-style: none; padding: 0; margin: 8px 0; }
.checklist li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  font-size: 17px;
  border-radius: 8px;
  cursor: pointer;
}
.checklist li:hover { background: var(--teal-soft); }
.checklist li .cb {
  width: 22px; height: 22px;
  border: 2px solid var(--teal);
  border-radius: 6px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
}
.checklist li.done .cb { background: var(--teal); }
.checklist li.done { color: var(--ink-faint); }

/* ── Score + smiley rating ──────────────── */
.score-box {
  font-family: var(--sans);
  text-align: center;
  font-size: 17px;
  padding: 14px;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  margin: 14px 0;
}
.rate-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.rate-btn {
  font-size: 30px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  width: 58px; height: 58px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.rate-btn:hover { transform: scale(1.1); border-color: var(--teal); }
.rate-btn.sel { border-color: var(--teal); background: var(--teal-soft); }
.rate-title { font-family: var(--sans); text-align: center; font-size: 16.5px; font-weight: 700; margin: 12px 0 2px; }
.rate-thanks { text-align: center; font-family: var(--sans); color: var(--green); font-size: 16px; }

/* big action buttons */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.big-btn {
  font-family: var(--sans);
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex; align-items: center; gap: 8px;
}
.big-btn:hover { background: var(--teal-dark); }
.big-btn.ghost { background: var(--card); color: var(--teal-dark); border: 1.5px solid var(--teal); }
.big-btn.ghost:hover { background: var(--teal-soft); }

@media (max-width: 640px) {
  body.student-shell { font-size: 17px; }
  .lesson-card { flex-direction: column; }
  .lesson-card img { width: 100%; height: 150px; }
  .tr-row { flex-wrap: wrap; }
  .tr-row .vi { flex-basis: 100%; padding-left: 56px; }
  .player-card video { max-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
