/* TEC lesson player – shared styles for every lesson.
   Brand: The English Classroom visual identity (Red Hat Display, TEC palette). */
:root {
  --tec-navy: #142533;
  --tec-blue: #249ACE;
  --tec-blue-dark: #1B7AA5;
  --tec-mint: #42BCAE;
  --tec-mint-tint: #B5E2D6;
  --tec-peach: #F5DBC1;
  --tec-coral: #E56E68;
  --tec-grey: #F5F5F5;
  --tec-white: #FFFFFF;
  --tec-font: 'Red Hat Display', 'Segoe UI', Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font-family: var(--tec-font); color: var(--tec-navy); background: var(--tec-white); -webkit-font-smoothing: antialiased; }
body.tec-idle, body.tec-idle * { cursor: none !important; }

#tec-player { position: fixed; inset: 0; }
.tec-stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  overflow: hidden;
}
.tec-slide { position: absolute; inset: 0; display: none; }
.tec-slide.is-active { display: block; }

/* ---------- Title slide ---------- */
.tec-title { background: var(--tec-white); }
.tec-title__band {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  background: var(--tec-blue); color: var(--tec-white);
  display: flex; align-items: center; padding: 64px 200px;
}
.tec-title__number { font-size: 240px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; min-width: 300px; flex-shrink: 0; }
.tec-title__rule { width: 3px; align-self: stretch; margin: 90px 72px; background: rgba(255,255,255,0.55); flex-shrink: 0; }
.tec-title__title { font-size: 120px; font-weight: 900; line-height: 1.02; margin: 0 0 40px; letter-spacing: -0.01em; }
.tec-title__title--long { font-size: 88px; }
.tec-title__title--xlong { font-size: 66px; }
.tec-title__goals-heading { font-size: 34px; font-weight: 700; letter-spacing: 0.08em; margin: 0 0 12px; }
.tec-title__goals { list-style: none; margin: 0; padding: 0; font-size: 40px; line-height: 1.4; font-weight: 400; }
.tec-title__goals li { padding-left: 40px; position: relative; }
.tec-title__goals li::before { content: ''; position: absolute; left: 4px; top: 0.58em; width: 14px; height: 14px; border-radius: 50%; background: var(--tec-mint-tint); }

/* ---------- Vocabulary grid ---------- */
.tec-grid-slide { background: var(--tec-peach); }
.tec-grid {
  position: absolute; left: 96px; top: 56px; bottom: 56px; width: 1600px;
  display: grid; gap: 24px;
}
.tec-grid-slide--prompt .tec-grid { width: 1080px; }
.tec-tile {
  background: var(--tec-white); border-radius: 20px;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 14px; min-height: 0;
}
.tec-tile__label { font-size: 40px; font-weight: 900; line-height: 1.1; text-align: center; margin-bottom: 8px; }
.tec-grid-slide--prompt .tec-tile__label { font-size: 32px; }
.tec-tile__img { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.tec-tile__img img { max-width: 88%; max-height: 100%; object-fit: contain; display: block; }

.tec-prompt {
  position: absolute; left: 1216px; top: 56px; bottom: 56px; width: 480px;
  background: var(--tec-navy); color: var(--tec-white); border-radius: 28px;
  padding: 72px 56px; display: flex; flex-direction: column; gap: 28px;
}
.tec-prompt__line { font-size: 58px; line-height: 1.15; margin: 0; }
.tec-prompt__line--question { font-weight: 900; }
.tec-prompt__line--answer { font-weight: 500; color: var(--tec-mint-tint); }
.tec-prompt__line--task {
  margin-top: auto; font-size: 40px; font-weight: 700; line-height: 1.25;
  background: var(--tec-peach); color: var(--tec-navy); border-radius: 18px; padding: 28px 30px;
}

/* ---------- Freeform fallback (flagged for review by the converter) ---------- */
.tec-freeform { background: var(--tec-white); }
.tec-freeform__canvas { position: absolute; left: 240px; top: 0; width: 1440px; height: 1080px; }
.tec-freeform__el { position: absolute; }
.tec-freeform__el img { width: 100%; height: 100%; object-fit: contain; }
.tec-freeform__text { font-weight: 500; line-height: 1.2; }

/* ---------- Audio button ---------- */
.tec-audio {
  position: absolute; right: 56px; bottom: 56px; width: 112px; height: 112px;
  border: 0; padding: 0; border-radius: 50%; background: var(--tec-blue); color: var(--tec-white);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5;
  box-shadow: 0 6px 18px rgba(20,37,51,0.25);
}
.tec-audio:hover { background: var(--tec-blue-dark); }
.tec-audio:focus-visible { outline: 6px solid var(--tec-navy); outline-offset: 6px; }
.tec-audio svg.tec-audio__icon { width: 46px; height: 46px; fill: currentColor; }
.tec-audio__ring { position: absolute; inset: -10px; width: 132px; height: 132px; transform: rotate(-90deg); pointer-events: none; }
.tec-audio__ring circle { fill: none; stroke-width: 6; }
.tec-audio__ring .track { stroke: rgba(36,154,206,0.2); }
.tec-audio__ring .bar { stroke: var(--tec-navy); stroke-linecap: round; }
.tec-slide.tec-grid-slide .tec-audio__ring .track { stroke: rgba(20,37,51,0.15); }

/* ---------- Controls (outside the stage, fade when idle) ---------- */
.tec-controls {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(20,37,51,0.88); color: var(--tec-white); border-radius: 999px;
  font-size: 15px; font-weight: 500; z-index: 20; transition: opacity 0.4s ease;
}
body.tec-idle .tec-controls { opacity: 0; pointer-events: none; }
.tec-controls button {
  font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer;
  min-width: 40px; height: 40px; border-radius: 999px; padding: 0 14px;
}
.tec-controls button:hover { background: rgba(255,255,255,0.14); }
.tec-controls button:focus-visible { outline: 3px solid var(--tec-blue); }
.tec-controls button:disabled { opacity: 0.35; cursor: default; background: transparent; }
.tec-controls__count { padding: 0 10px; font-variant-numeric: tabular-nums; }

.tec-hint {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%);
  background: rgba(20,37,51,0.88); color: var(--tec-white); border-radius: 14px;
  padding: 12px 18px; font-size: 15px; display: flex; gap: 18px; z-index: 20; transition: opacity 0.6s ease;
}
.tec-hint.is-hidden { opacity: 0; pointer-events: none; }
.tec-hint kbd {
  font-family: var(--tec-font); font-weight: 700; background: rgba(255,255,255,0.16);
  border-radius: 6px; padding: 2px 8px; margin-right: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .tec-controls, .tec-hint { transition: none; }
}

/* ---------- Grammar reference panel (shared: slides 2, 3, 4) ---------- */
.tec-refpanel {
  display: flex; align-items: center; gap: 36px;
}
.tec-refpanel__col { display: flex; flex-direction: column; gap: 6px; }
.tec-refpanel__col li, .tec-refpanel__col div { font-size: 34px; font-weight: 700; color: var(--tec-navy); list-style: none; }
.tec-refpanel__plus { font-size: 44px; font-weight: 900; color: var(--tec-blue); }

/* ---------- Grammar explanation (slide type) ---------- */
.tec-grammar { background: var(--tec-white); }
.tec-grammar__rules {
  flex: 0 0 620px; background: var(--tec-navy); color: var(--tec-white);
  padding: 80px 64px; display: flex; flex-direction: column; gap: 30px; justify-content: center;
}
.tec-grammar__rules h1 { font-size: 76px; font-weight: 900; margin: 0 0 10px; }
.tec-grammar__rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.tec-grammar__rules li {
  font-size: 32px; font-weight: 500; line-height: 1.35; padding-left: 38px; position: relative;
}
.tec-grammar__rules li::before {
  content: ''; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px;
  border-radius: 50%; background: var(--tec-mint);
}
.tec-grammar__side { flex: 1; padding: 72px 64px; display: flex; flex-direction: column; gap: 48px; justify-content: center; background: var(--tec-grey); }
.tec-grammar__side .tec-refpanel__col li, .tec-grammar__side .tec-refpanel__col div { font-size: 36px; }
.tec-examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.tec-examples li {
  font-size: 32px; font-weight: 500; color: var(--tec-navy); background: var(--tec-white);
  border-left: 6px solid var(--tec-mint); border-radius: 8px; padding: 16px 24px;
}

/* ---------- Practice sentences (slide type; fill-in-blank or answers) ---------- */
.tec-practice { background: var(--tec-white); padding: 96px 72px 56px; flex-direction: column; gap: 36px; }
.tec-practice__top { display: flex; gap: 56px; align-items: flex-start; }
.tec-practice__ref {
  flex: 0 0 auto; background: var(--tec-grey); border-radius: 20px; padding: 28px 36px;
}
.tec-practice__ref .tec-refpanel__col li, .tec-practice__ref .tec-refpanel__col div { font-size: 28px; }
.tec-practice__examples { flex: 1; }
.tec-practice__examples .tec-examples li { font-size: 26px; padding: 12px 20px; }
.tec-practice__label {
  font-size: 22px; font-weight: 700; letter-spacing: 0.04em; color: var(--tec-blue);
  margin: 0 0 6px;
}
.tec-practice__sentences {
  flex: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 22px;
  background: var(--tec-peach); border-radius: 20px; padding: 40px 52px;
}
.tec-practice.is-answers .tec-practice__sentences { background: var(--tec-mint-tint); }
.tec-practice__sentences li { font-size: 34px; font-weight: 700; color: var(--tec-navy); line-height: 1.3; }
.tec-practice.is-answers .tec-practice__sentences li strong { color: var(--tec-blue-dark); }

/* ---------- Sort into categories (slide type) ---------- */
.tec-sort { background: var(--tec-white); padding: 56px 72px; flex-direction: column; gap: 32px; }
.tec-sort__heading { font-size: 40px; font-weight: 900; color: var(--tec-navy); margin: 0; }
.tec-sort__table { flex: 0 0 auto; display: grid; gap: 20px; }
.tec-sort__cat {
  background: var(--tec-blue); color: var(--tec-white); border-radius: 16px;
  padding: 26px 22px; min-height: 130px; display: flex; align-items: center; justify-content: center; text-align: center;
}
.tec-sort__cat span { font-size: 28px; font-weight: 700; line-height: 1.25; }
.tec-sort__bank {
  flex: 1; background: var(--tec-grey); border-radius: 20px; padding: 36px 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.tec-sort__bank ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.tec-sort__bank li { font-size: 30px; font-weight: 600; color: var(--tec-navy); }
.tec-sort.tec-sort--single .tec-sort__bank { align-items: center; }
.tec-sort.tec-sort--single .tec-sort__bank li { font-size: 46px; font-weight: 800; text-align: center; }

/* Fix: give the new templates their flex layout only while active, so
   specificity can't make an inactive slide visible (see .tec-slide base rule). */
.tec-slide.is-active.tec-grammar,
.tec-slide.is-active.tec-practice,
.tec-slide.is-active.tec-sort {
  display: flex;
}

/* ---------- Image prompts (slide type: reference panel + student picture grid) ---------- */
.tec-imgprompt { background: var(--tec-white); padding: 48px 64px; flex-direction: column; gap: 28px; }
.tec-imgprompt__top { display: flex; gap: 48px; align-items: center; }
.tec-imgprompt__ref { flex: 0 0 auto; background: var(--tec-grey); border-radius: 20px; padding: 24px 32px; }
.tec-imgprompt__ref .tec-refpanel__col li, .tec-imgprompt__ref .tec-refpanel__col div { font-size: 26px; }
.tec-imgprompt__example {
  flex: 1; background: var(--tec-mint-tint); border-radius: 16px; padding: 22px 28px;
  font-size: 28px; font-weight: 700; color: var(--tec-navy);
}
.tec-imgprompt__example .tag {
  display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tec-blue-dark); margin-bottom: 6px;
}
.tec-imgprompt__grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 20px; }
.tec-imgprompt__cell {
  position: relative; background: var(--tec-peach); border-radius: 18px;
  display: flex; align-items: center; justify-content: center; padding: 14px; min-height: 0;
}
.tec-imgprompt__cell img { max-width: 82%; max-height: 78%; object-fit: contain; }
.tec-imgprompt__badge {
  position: absolute; top: 10px; left: 10px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--tec-navy); color: var(--tec-white); font-size: 18px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.tec-slide.is-active.tec-imgprompt { display: flex; }

/* ---------- Timeline (present continuous time-line practice) ---------- */
.tec-timeline { background: var(--tec-mint); padding: 56px 72px; flex-direction: column; gap: 36px; color: var(--tec-navy); }
.tec-timeline__top { display: flex; gap: 40px; align-items: center; background: var(--tec-white); border-radius: 24px; padding: 28px 36px; }
.tec-timeline__example { flex: 1; font-size: 32px; font-weight: 700; }
.tec-timeline__example .tag {
  display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tec-blue-dark); margin-bottom: 6px;
}
.tec-timeline__line {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-top: 6px solid var(--tec-navy); padding-top: 18px; margin: 8px 48px 0;
}
.tec-timeline__point { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 120px; }
.tec-timeline__dot { width: 22px; height: 22px; border-radius: 50%; background: var(--tec-navy); margin-top: -32px; }
.tec-timeline__label { font-size: 28px; font-weight: 900; }
.tec-timeline__bank { flex: 1; background: var(--tec-white); border-radius: 24px; padding: 28px 36px; overflow: auto; }
.tec-timeline__bank ul { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 0; padding: 0; list-style: none; }
.tec-timeline__bank li {
  font-size: 30px; font-weight: 700; background: var(--tec-peach); border-radius: 14px; padding: 12px 18px;
}
.tec-slide.is-active.tec-timeline { display: flex; }
