:root {
  --bg: #fbf6ec;
  --surface: #ffffff;
  --ink: #161b1f;
  --muted: #5f6870;
  --line: #e8e0cf;
  --green: #14191d;
  --green-2: #2a3036;
  --red: #d6382a;
  --gold: #f2a93b;
  --hl: #f2a93b;
  --hl-soft: #fdebc8;
  --lena: #b86a00;
  --jonas: #c0392b;
  --s1: #1f6f8b;
  --s2: #7a4fb0;
  --a1: #4caf7d;
  --a2: #3c8fd6;
  --b1: #e5735c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(20,25,29,.08);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121619; --surface: #1b2024; --ink: #f1efe9; --muted: #a9b0b6; --line: #2c3338;
    --green: #173a2d; --green-2: #2a3036;
  --red: #d6382a;
  --gold: #f2a93b; --hl-soft: #3a3412; --lena: #f0b44c; --jonas: #f07a8a;
    --s1: #6cc3e0; --s2: #c3a3f0; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #121619; --surface: #1b2024; --ink: #f1efe9; --muted: #a9b0b6; --line: #2c3338;
  --green: #173a2d; --green-2: #2a3036;
  --red: #d6382a;
  --gold: #f2a93b; --hl-soft: #3a3412; --lena: #f0b44c; --jonas: #f07a8a;
  --s1: #6cc3e0; --s2: #c3a3f0; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar { background: var(--green); color: #fff; position: relative; z-index: 5; }
.flag { position: relative; }
.flag::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 50%, var(--gold) 50% 100%); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .2px; }
.brand svg { flex: none; }
.topbar .spacer { flex: 1; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; border-radius: 10px; width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer; color: #fff; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.back { text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- home ---------- */
.hero { background: var(--green); color: #fff; padding: 28px 0 34px; }
.hero-in { display: flex; align-items: center; gap: 18px; }
.hero-in img { flex: none; border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
@media (max-width: 520px) { .hero-in img { width: 64px; height: 64px; } }
.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 6vw, 40px); line-height: 1.1; }
.hero p { margin: 0; opacity: .85; font-size: 17px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 16px;
  font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding-bottom: 40px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; display: flex; flex-direction: column; border: 1px solid var(--line); transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card .thumb { aspect-ratio: 16/9; background: var(--green-2) center/cover no-repeat; position: relative; }
.card .body { padding: 12px 14px 14px; }
.card h3 { margin: 4px 0 2px; font-size: 18px; line-height: 1.25; }
.card .en { color: var(--muted); font-size: 14px; }
.meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.badge { display: inline-block; font-weight: 800; font-size: 13px; padding: 2px 9px; border-radius: 6px; color: #fff; }
.badge.A1 { background: var(--a1); } .badge.A2 { background: var(--a2); } .badge.B1 { background: var(--b1); }
.soon { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-weight: 800; }

/* ---------- player ---------- */
.stage { position: sticky; top: 0; z-index: 4; background: #000; }
.stage .frame { position: relative; width: 100%; max-width: calc(42vh * 16 / 9); margin: 0 auto; aspect-ratio: 16/9; }
.stage iframe, .stage #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage.compact .frame { max-width: calc(24vh * 16 / 9); }
.toolbar { position: sticky; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; gap: 8px; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.tbtn { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 12px; font-weight: 700;
  font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.tbtn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toolbar .spacer { flex: 1; }

.ep-head { padding: 18px 0 6px; }
.ep-head h1 { margin: 6px 0 0; font-size: clamp(24px, 5vw, 32px); line-height: 1.15; }
.ep-head .en { color: var(--muted); }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.section-title { margin: 28px 0 8px; font-size: 20px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.section-title small { color: var(--muted); font-weight: 600; font-size: 15px; }

.transcript { list-style: none; margin: 0; padding: 0; }
.ln { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; padding: 10px 12px; margin: 0 -12px;
  border-radius: 10px; border-left: 4px solid transparent; scroll-margin-top: 50vh; cursor: default; }
.synced .ln { cursor: pointer; }
.synced .ln:hover { background: rgba(127,127,127,.07); }
.ln.active { background: var(--hl-soft); border-left-color: var(--hl); }
.who { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; padding-top: calc(var(--size) * .2); }
.who.Lena { color: var(--lena); } .who.Jonas { color: var(--jonas); }
.who.S1 { color: var(--s1); } .who.S2 { color: var(--s2); }
.de { font-size: var(--size); }
.en-t { grid-column: 2; color: var(--muted); font-size: calc(var(--size) * .82); display: none; }
.show-en .en-t { display: block; }

.exercises { margin: 36px 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.exercises .txt { flex: 1 1 260px; }
.exercises h2 { margin: 0 0 4px; font-size: 20px; }
.exercises p { margin: 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 800;
  text-decoration: none; border: 0; cursor: pointer; }
.btn.primary { background: var(--gold); color: #161b1f; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
footer { color: var(--muted); font-size: 14px; padding: 24px 0 40px; text-align: center; }

@media (max-width: 520px) {
  .ln { grid-template-columns: 1fr; gap: 2px; }
  .en-t { grid-column: 1; }
  .who { padding-top: 0; }
  .tbtn .lbl { display: none; }
}
:fullscreen body, :-webkit-full-screen body { overflow-y: auto; }
