:root {
  --cream: #f8f1e6;
  --paper: #fffaf2;
  --orange: #f36a17;
  --orange-deep: #dd570e;
  --peach: #f2bea2;
  --brown: #3a2118;
  --brown-soft: #735247;
  --gold: #c59446;
  --brand-orange: #ff5a00;
  --action-orange: #cc4200;
  --canvas-cream: #fff8ef;
  --surface: #fffcf8;
  --platform-peach: #ffd8ba;
  --cocoa: #2b1a13;
  --text-secondary: #715e54;
  --border-warm: #e8d7c7;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--tg-theme-bg-color, var(--cream));
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--tg-theme-bg-color, var(--cream));
  color: var(--tg-theme-text-color, var(--brown));
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

.lesson-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, #fbf0e2 0%, var(--cream) 56%, #f2e2d1 100%);
}

.lesson-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 438px);
  margin: 0 auto;
  padding:
    0
    max(16px, var(--tg-safe-area-inset-right, env(safe-area-inset-right)))
    max(34px, calc(var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom)) + 22px))
    max(16px, var(--tg-safe-area-inset-left, env(safe-area-inset-left)));
}

.ambient {
  position: absolute;
  border: 1px solid rgba(197, 148, 70, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.ambient-one {
  top: 92px;
  right: -176px;
  width: 272px;
  height: 272px;
}

.ambient-two {
  bottom: 360px;
  left: -172px;
  width: 280px;
  height: 280px;
}

.lesson-hero {
  position: relative;
  height: clamp(320px, 87vw, 360px);
  margin: 0 -16px;
  background-image: url('/ugc-hero-tall-v6.png');
  background-position: 50% 100%;
  background-repeat: no-repeat;
  background-size: cover;
}

.lesson-hero::before {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 48px;
  background: linear-gradient(180deg, transparent, var(--cream));
  content: '';
  pointer-events: none;
}

.course-promo {
  position: relative;
  z-index: 2;
  margin: -6px 2px 16px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border-warm);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 216, 186, 0.75), transparent 42%),
    var(--surface);
  box-shadow: 0 8px 28px rgba(77, 42, 24, 0.08);
}

.course-promo::after {
  position: absolute;
  top: -58px;
  right: -46px;
  width: 142px;
  height: 142px;
  border: 1px solid rgba(255, 90, 0, 0.16);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.course-promo-copy {
  position: relative;
  z-index: 1;
}

.course-promo-copy > span,
.course-eyebrow,
.course-section-heading > span,
.course-final-cta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--action-orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.course-promo-copy > span::before,
.course-eyebrow::before,
.course-section-heading > span::before,
.course-final-cta > span::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-orange);
  content: '';
}

.course-promo h2 {
  max-width: 330px;
  margin: 10px 0 8px;
  color: var(--cocoa);
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 25px;
  font-stretch: condensed;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.course-promo p {
  max-width: 325px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.course-promo button {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 0 17px;
  border: 0;
  border-radius: 16px;
  background: var(--action-orange);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(204, 66, 0, 0.2);
}

.course-promo button span {
  font-size: 21px;
  font-weight: 500;
}

.course-promo button:focus-visible,
.course-back:focus-visible,
.course-primary-link:focus-visible,
.course-final-cta button:focus-visible {
  outline: 2px solid var(--cocoa);
  outline-offset: 3px;
}

.course-promo-after-video {
  margin: 18px 2px 2px;
}

.day-tabs-shell {
  position: relative;
  z-index: 2;
  margin: -3px 4px 20px;
  padding: 4px;
  border: 1px solid rgba(197, 148, 70, 0.3);
  border-radius: 17px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: 0 12px 30px rgba(88, 50, 27, 0.09);
  backdrop-filter: blur(8px);
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.day-tab {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--brown-soft);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.08;
  text-transform: uppercase;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.day-tab-stacked {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.day-tab[aria-selected='true'] {
  background: linear-gradient(135deg, var(--orange-deep), var(--orange));
  color: #fffaf2;
  box-shadow: 0 8px 18px rgba(221, 87, 14, 0.22);
}

.day-tab:focus-visible {
  outline: 2px solid var(--brown);
  outline-offset: 2px;
}

.lesson-content {
  animation: lesson-content-in 210ms ease-out;
}

.lesson-intro {
  padding: 0 4px 14px;
  text-align: center;
}

.bonus-eyebrow {
  margin: 0 0 9px;
  color: var(--orange-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.lesson-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 10px;
  color: var(--orange-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.lesson-position::before,
.lesson-position::after {
  width: 27px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 148, 70, 0.75));
  content: '';
}

.lesson-position::after {
  transform: scaleX(-1);
}

.lesson-position span {
  margin: 0 -2px;
  color: var(--gold);
}

.lesson-intro h1 {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  color: var(--brown);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(29px, 8.6vw, 38px);
  font-weight: 700;
  line-height: 1.01;
  letter-spacing: -0.04em;
}

.lesson-title-line {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: center;
  gap: 0.2em;
  text-align: center;
  white-space: nowrap;
}

.lesson-title-line + .lesson-title-line {
  margin-top: 4px;
}

.lesson-title-accent {
  color: var(--orange-deep);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.video-section {
  margin: 0 2px;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(197, 148, 70, 0.32);
  border-radius: 26px;
  background: #2f1d17;
  box-shadow:
    0 18px 42px rgba(88, 50, 27, 0.15),
    0 2px 0 rgba(255, 250, 242, 0.8) inset;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.homework-card {
  margin-top: 20px;
  padding: 21px 19px 9px;
  border: 1px solid rgba(197, 148, 70, 0.3);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 0 14px 34px rgba(88, 50, 27, 0.08);
  backdrop-filter: blur(8px);
}

.homework-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.homework-title-row h2 {
  margin: 0;
  color: var(--brown);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.homework-title-row span {
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
}

.homework-lead {
  margin: 10px 0 0;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 850;
}

.homework-list {
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.homework-list li {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid rgba(58, 33, 24, 0.1);
}

.step-number {
  padding-top: 1px;
  color: var(--orange-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-weight: 700;
}

.homework-list p {
  margin: 0;
  color: #55372d;
  font-size: 13px;
  line-height: 1.47;
}

.homework-note {
  margin: 0;
  padding: 14px 0 13px;
  border-top: 1px solid rgba(58, 33, 24, 0.1);
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.editing-cta {
  position: relative;
  margin-top: 17px;
  padding: 21px 20px 20px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #3a2118 0%, #6a3929 100%);
  color: #fff9f1;
  box-shadow: 0 16px 36px rgba(58, 33, 24, 0.2);
}

.editing-cta::after {
  position: absolute;
  top: -54px;
  right: -48px;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(255, 249, 241, 0.16);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.editing-cta-label {
  display: inline-block;
  margin-bottom: 11px;
  color: #ffaf75;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.editing-cta h2 {
  max-width: 300px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.editing-cta p {
  max-width: 330px;
  margin: 11px 0 16px;
  color: rgba(255, 249, 241, 0.78);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.editing-cta button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange-deep), var(--orange));
  color: #fffaf2;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 9px 20px rgba(16, 7, 3, 0.22);
}

.editing-cta button:focus-visible {
  outline: 2px solid #fffaf2;
  outline-offset: 3px;
}

.game-card {
  position: relative;
  margin-top: 17px;
  padding: 20px 19px 21px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #e85d16 0%, #f58234 100%);
  color: #fff9f1;
  box-shadow: 0 16px 36px rgba(191, 75, 19, 0.2);
}

.game-card::after {
  position: absolute;
  top: -46px;
  right: -42px;
  width: 116px;
  height: 116px;
  border: 1px solid rgba(255, 249, 241, 0.24);
  border-radius: 50%;
  content: '';
}

.game-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 9px 5px;
  border: 1px solid rgba(255, 249, 241, 0.35);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.game-card p {
  max-width: 325px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.game-card blockquote {
  max-width: 340px;
  margin: 9px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.course-page {
  margin: -5px 2px 0;
  color: var(--cocoa);
  font-family: Arial, Helvetica, sans-serif;
  animation: lesson-content-in 210ms ease-out;
}

.course-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.course-back span {
  color: var(--action-orange);
  font-size: 18px;
}

.course-hero {
  position: relative;
  padding: 27px 21px 22px;
  overflow: hidden;
  border: 1px solid var(--border-warm);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 216, 186, 0.9), transparent 37%),
    linear-gradient(145deg, var(--surface), var(--canvas-cream));
  box-shadow: 0 8px 28px rgba(77, 42, 24, 0.08);
}

.course-hero::after {
  position: absolute;
  right: -41px;
  bottom: -71px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 90, 0, 0.18);
  border-radius: 50%;
  content: '';
}

.course-hero h1 {
  position: relative;
  z-index: 1;
  margin: 13px 0 13px;
  color: var(--cocoa);
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: clamp(34px, 10.2vw, 44px);
  font-stretch: condensed;
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.course-hero h1 span {
  display: block;
  margin-top: 5px;
  color: var(--brand-orange);
}

.course-hero > p {
  position: relative;
  z-index: 1;
  max-width: 345px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.course-facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 20px;
}

.course-facts span {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  justify-content: center;
  padding: 9px;
  border: 1px solid rgba(232, 215, 199, 0.9);
  border-radius: 16px;
  background: rgba(255, 252, 248, 0.82);
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}

.course-facts strong {
  color: var(--action-orange);
  font-size: 22px;
  line-height: 1;
}

.course-primary-link {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin-top: 13px;
  border-radius: 16px;
  background: var(--action-orange);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(204, 66, 0, 0.2);
}

.course-section {
  padding-top: 34px;
  scroll-margin-top: 18px;
}

.course-section-heading {
  padding: 0 5px 15px;
}

.course-section-heading h2 {
  margin: 9px 0 6px;
  color: var(--cocoa);
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 31px;
  font-stretch: condensed;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.course-section-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.course-modules {
  display: grid;
  gap: 9px;
}

.course-module {
  overflow: hidden;
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(77, 42, 24, 0.06);
}

.course-module summary {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: flex-start;
  min-height: 78px;
  padding: 16px 14px;
  cursor: pointer;
  list-style: none;
}

.course-module summary::-webkit-details-marker {
  display: none;
}

.course-module-number {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  background: var(--platform-peach);
  color: var(--action-orange);
  font-size: 12px;
  font-weight: 900;
}

.course-module-copy strong,
.course-module-copy small {
  display: block;
}

.course-module-copy strong {
  color: var(--cocoa);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.22;
}

.course-module-copy small {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.42;
}

.course-module-toggle {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--action-orange);
  font-size: 20px;
  line-height: 1;
  transition: transform 150ms ease;
}

.course-module[open] .course-module-toggle {
  transform: rotate(45deg);
}

.course-module ul {
  display: grid;
  gap: 9px;
  margin: 0 15px 17px 63px;
  padding: 15px 0 0;
  border-top: 1px solid var(--border-warm);
  list-style: none;
}

.course-module li {
  position: relative;
  padding-left: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.course-module li::before {
  position: absolute;
  top: 0.52em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-orange);
  content: '';
}

.tariff-list {
  display: grid;
  gap: 13px;
}

.tariff-card {
  padding: 21px 19px 18px;
  border: 1px solid var(--border-warm);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(77, 42, 24, 0.07);
}

.tariff-card-featured {
  border-color: rgba(255, 90, 0, 0.32);
  background: linear-gradient(145deg, #fff3e8, var(--surface));
}

.tariff-card-premium {
  border-color: var(--cocoa);
  background: var(--cocoa);
  color: #fff8ef;
  box-shadow: 0 14px 34px rgba(43, 26, 19, 0.2);
}

.tariff-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tariff-card h3 {
  margin: 0;
  color: var(--cocoa);
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.tariff-card-premium h3 {
  color: #fff8ef;
}

.tariff-card-topline > span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--platform-peach);
  color: var(--action-orange);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tariff-card-premium .tariff-card-topline > span {
  background: rgba(255, 216, 186, 0.14);
  color: #ffd8ba;
}

.tariff-card ul {
  display: grid;
  gap: 8px;
  margin: 17px 0 19px;
  padding: 0;
  list-style: none;
}

.tariff-card li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.tariff-card li::before {
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--brand-orange);
  content: '✓';
  font-weight: 900;
}

.tariff-card-premium li {
  color: rgba(255, 248, 239, 0.82);
}

.tariff-card-premium li::before {
  color: #ffd8ba;
}

.tariff-price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-warm);
}

.tariff-card-premium .tariff-price {
  border-color: rgba(255, 248, 239, 0.16);
}

.tariff-price strong {
  color: var(--action-orange);
  font-size: 24px;
  line-height: 1;
}

.tariff-card-premium .tariff-price strong {
  color: #ffd8ba;
}

.tariff-price span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
}

.tariff-card-premium .tariff-price span {
  color: rgba(255, 248, 239, 0.66);
}

.course-final-cta {
  position: relative;
  margin-top: 28px;
  padding: 25px 21px 21px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff2e5, var(--platform-peach));
  box-shadow: 0 8px 28px rgba(77, 42, 24, 0.09);
}

.course-final-cta::after {
  position: absolute;
  right: -53px;
  bottom: -65px;
  width: 168px;
  height: 168px;
  border: 1px solid rgba(204, 66, 0, 0.2);
  border-radius: 50%;
  content: '';
}

.course-final-cta h2 {
  position: relative;
  z-index: 1;
  margin: 10px 0 7px;
  color: var(--cocoa);
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 29px;
  font-stretch: condensed;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
}

.course-final-cta p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.course-final-cta button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 52px;
  margin-top: 17px;
  border: 0;
  border-radius: 16px;
  background: var(--action-orange);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(204, 66, 0, 0.2);
}

.course-final-cta small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 560px) {
  .lesson-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .lesson-page {
    background: linear-gradient(180deg, #fbf0e2 0%, var(--cream) 56%, #f2e2d1 100%);
  }

  .lesson-hero {
    margin-right: -24px;
    margin-left: -24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .lesson-content {
    animation: none;
  }
}

@keyframes lesson-content-in {
  from {
    transform: translateY(4px);
    opacity: 0.5;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}
