:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #67768a;
  --navy: #f7faf9;
  --navy-soft: #eaf3f1;
  --teal: #2c7f88;
  --cyan: #9bdce5;
  --mint: #9dd8c3;
  --gold: #c79a3a;
  --orange: #d9784d;
  --line: rgba(28, 47, 63, 0.12);
  --surface: #ffffff;
  --soft: #f6faf8;
  --shadow: 0 16px 34px rgba(33, 52, 66, 0.09);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8faf7 0%, #eef5f3 48%, #e9f1ef 100%),
    #eef5f3;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  color: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(44, 127, 136, 0.2);
  border-radius: 8px;
  background: rgba(44, 127, 136, 0.08);
  color: var(--teal);
  font-size: 14px;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #385365;
  font-size: 14px;
  font-weight: 850;
}

.nav-links a.language-link {
  border-color: rgba(45, 139, 146, 0.35);
  background: #ffffff;
  color: #247d84;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 24px;
  align-items: stretch;
  min-height: 360px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 249, 0.96)),
    linear-gradient(160deg, rgba(44, 127, 136, 0.08), rgba(199, 154, 58, 0.08));
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 5.1vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 660px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.6;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.primary-action,
.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(44, 127, 136, 0.18);
}

.input-chip,
.quick-points span,
.phase-pill,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.input-chip {
  border: 1px solid rgba(44, 127, 136, 0.16);
  background: rgba(44, 127, 136, 0.06);
  color: #466171;
}

.quick-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.quick-points span {
  background: rgba(44, 127, 136, 0.07);
  color: #3d6170;
}

.river-preview,
.nibbler-preview,
.cave-preview {
  position: relative;
  display: block;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid rgba(44, 127, 136, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.river-preview {
  background:
    linear-gradient(180deg, rgba(232, 248, 250, 0.95) 0 28%, rgba(199, 232, 233, 0.95) 28% 100%);
}

.river-preview.compact,
.nibbler-preview.compact,
.cave-preview.compact {
  min-height: 210px;
}

.preview-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 33%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58), transparent 38%),
    linear-gradient(180deg, #f4fbfc, #dbeff0);
}

.preview-sky::before,
.preview-sky::after {
  content: "";
  position: absolute;
  bottom: -18px;
  width: 190px;
  height: 64px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #a6d4a8, #75b58b);
}

.preview-sky::before {
  left: 5%;
}

.preview-sky::after {
  right: 4%;
  width: 260px;
  background: linear-gradient(180deg, #bddb9c, #86bd91);
}

.preview-river {
  position: absolute;
  inset: 24% 0 0;
  background:
    repeating-linear-gradient(170deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 42px),
    linear-gradient(135deg, #bfe8ed 0%, #8fcfd5 48%, #acd8c3 100%);
}

.river-line {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 44%;
  height: 98px;
  border: 10px solid #69c8d3;
  border-right: 0;
  border-left: 0;
  border-radius: 50%;
  transform: rotate(-6deg);
  filter: drop-shadow(0 0 10px rgba(105, 200, 211, 0.38));
}

.river-line.glow {
  top: 43%;
  border-width: 24px;
  opacity: 0.16;
  filter: blur(3px);
}

.preview-boat {
  position: absolute;
  left: 18%;
  top: 54%;
  width: 108px;
  height: 44px;
  border-radius: 0 0 48px 48px;
  background:
    linear-gradient(90deg, transparent 0 10px, #8f5521 10px 18px, transparent 18px),
    linear-gradient(180deg, #d48c35, #7a3c18);
  box-shadow: 0 10px 0 rgba(0, 67, 99, 0.18);
}

.preview-boat::before {
  content: "";
  position: absolute;
  left: 46px;
  bottom: 40px;
  width: 8px;
  height: 72px;
  background: #8b5626;
}

.preview-boat::after {
  content: "";
  position: absolute;
  left: 54px;
  bottom: 78px;
  width: 54px;
  height: 36px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(31, 128, 255, 0.12);
}

.preview-stone {
  position: absolute;
  width: 58px;
  height: 38px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #b7bec3, #707b83);
  box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12), 0 0 0 6px rgba(217, 120, 77, 0.16);
}

.stone-one {
  left: 58%;
  top: 37%;
}

.stone-two {
  left: 78%;
  top: 57%;
}

.preview-orb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4d877;
  box-shadow: 0 0 12px rgba(244, 216, 119, 0.66);
}

.orb-one {
  left: 46%;
  top: 42%;
}

.orb-two {
  left: 67%;
  top: 31%;
}

.orb-three {
  left: 86%;
  top: 48%;
}

.nibbler-preview {
  background:
    repeating-linear-gradient(170deg, rgba(32, 95, 115, 0.08) 0 2px, transparent 2px 40px),
    linear-gradient(135deg, #effcff 0%, #d8f4ef 52%, #fff3c9 100%);
}

.nibbler-line,
.cave-floor {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 56%;
  height: 72px;
  border: 8px solid #5fcbd8;
  border-right: 0;
  border-left: 0;
  border-radius: 50%;
  transform: rotate(-7deg);
  filter: drop-shadow(0 0 10px rgba(95, 203, 216, 0.35));
}

.nibbler-line.glow {
  top: 55%;
  border-width: 20px;
  opacity: 0.14;
  filter: blur(3px);
}

.nibbler-face {
  position: absolute;
  left: 15%;
  top: 52%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 34%, #16293d 0 4px, transparent 5px),
    conic-gradient(from 318deg, transparent 0 56deg, #ffe083 56deg 360deg);
  box-shadow: 0 10px 0 rgba(46, 82, 95, 0.16), inset -10px -12px 0 rgba(222, 145, 54, 0.22);
}

.note-dot,
.note-block,
.cave-crystal {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 243, 173, 0.96);
  color: #2c7f88;
  font-size: 21px;
  font-weight: 950;
  box-shadow: 0 0 16px rgba(255, 211, 107, 0.55);
}

.note-dot {
  width: 38px;
  height: 38px;
}

.dot-one {
  left: 42%;
  top: 36%;
}

.dot-two {
  left: 62%;
  top: 28%;
}

.dot-three {
  left: 82%;
  top: 46%;
}

.note-block {
  right: 14%;
  bottom: 18%;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe899, #d9784d);
  color: #7c381f;
}

.cave-preview {
  background:
    radial-gradient(circle at 76% 24%, rgba(98, 236, 255, 0.24), transparent 25%),
    linear-gradient(180deg, #173646 0%, #254437 48%, #4e3a28 100%);
}

.cave-roof {
  position: absolute;
  inset: 0 0 auto;
  height: 50%;
  background:
    radial-gradient(circle at 12% 90%, #7b5539 0 18px, transparent 19px),
    radial-gradient(circle at 28% 86%, #5a3a27 0 24px, transparent 25px),
    radial-gradient(circle at 48% 90%, #805638 0 20px, transparent 21px),
    radial-gradient(circle at 68% 84%, #4f3325 0 27px, transparent 28px),
    radial-gradient(circle at 88% 91%, #77513a 0 22px, transparent 23px),
    linear-gradient(180deg, #2b1c18, #6e4630);
  clip-path: polygon(0 0, 100% 0, 100% 54%, 82% 44%, 66% 62%, 48% 39%, 32% 58%, 18% 46%, 0 65%);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.22));
}

.cave-floor {
  top: 72%;
  height: 40px;
  border-color: rgba(255, 211, 107, 0.58);
  transform: rotate(0deg);
}

.cave-gate {
  position: absolute;
  bottom: 19%;
  width: 58px;
  height: 96px;
  border: 5px solid rgba(255, 211, 107, 0.82);
  border-bottom: 0;
  border-radius: 34px 34px 0 0;
  box-shadow: 0 0 16px rgba(255, 211, 107, 0.36);
}

.gate-one {
  left: 42%;
  transform: scale(0.76);
  opacity: 0.72;
}

.gate-two {
  left: 68%;
}

.cave-hero {
  position: absolute;
  left: 24%;
  bottom: 18%;
  width: 58px;
  height: 82px;
  border-radius: 28px 28px 20px 20px;
  background:
    radial-gradient(circle at 62% 28%, #1b2633 0 3px, transparent 4px),
    radial-gradient(circle at 70% 38%, #f09982 0 5px, transparent 6px),
    linear-gradient(180deg, #29a891, #157869);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.18);
}

.cave-crystal {
  width: 32px;
  height: 32px;
  color: #6d4b13;
}

.crystal-one {
  left: 52%;
  top: 43%;
}

.crystal-two {
  left: 78%;
  top: 34%;
}

.preview-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  backdrop-filter: blur(8px);
}

.module-summary {
  display: grid;
  gap: 12px;
}

.module-summary article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 5px;
  align-content: center;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.module-summary span {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(44, 127, 136, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.module-summary strong {
  font-size: 19px;
  line-height: 1.2;
}

.module-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.preview-caption strong {
  font-size: 24px;
}

.preview-caption span {
  color: var(--muted);
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.practice-main,
.guide-panel,
.learning-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.practice-main,
.guide-panel,
.learning-map {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h2,
.guide-panel h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.phase-pill {
  background: rgba(44, 127, 136, 0.08);
  color: var(--teal);
  white-space: nowrap;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.practice-card {
  display: flex;
  flex-direction: column;
  min-height: 238px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.practice-card.is-ready {
  border-color: rgba(44, 127, 136, 0.24);
  background:
    linear-gradient(145deg, #ffffff, #f5faf9),
    linear-gradient(135deg, rgba(44, 127, 136, 0.08), transparent);
}

.practice-card.is-featured,
.practice-card.has-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-height: 430px;
}

.featured-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.practice-card.is-ready:hover,
.practice-card.is-ready:focus-visible,
.river-preview:hover,
.river-preview:focus-visible {
  transform: translateY(-2px);
}

.practice-card.is-disabled {
  opacity: 0.76;
}

.card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: rgba(44, 127, 136, 0.08);
  color: var(--teal);
  font-size: 24px;
  font-weight: 950;
}

.card-kicker {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.practice-card h3 {
  margin-bottom: 10px;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.practice-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.tag-row span {
  background: rgba(44, 127, 136, 0.07);
  color: var(--teal);
}

.card-action {
  width: fit-content;
  min-height: 42px;
  margin-top: auto;
  padding: 0 15px;
  box-shadow: none;
}

.card-action.muted {
  background: rgba(96, 113, 135, 0.12);
  color: var(--muted);
}

.guide-panel {
  position: sticky;
  top: 16px;
  background: #ffffff;
}

.guide-panel h2 {
  margin-bottom: 18px;
}

.guide-panel ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide;
}

.guide-panel li {
  position: relative;
  min-height: 54px;
  padding-left: 44px;
  counter-increment: guide;
}

.guide-panel li::before {
  content: counter(guide);
  position: absolute;
  left: 0;
  top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(199, 154, 58, 0.18);
  color: #8a6721;
  font-weight: 950;
}

.guide-panel li strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.guide-panel li span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.learning-map {
  margin-top: 20px;
}

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

.map-grid article {
  min-height: 152px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.map-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(44, 127, 136, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.map-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 21px;
}

.map-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  body {
    background:
      linear-gradient(180deg, #f8faf7 0%, #eef5f3 100%),
      #eef5f3;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .practice-card.is-featured,
  .practice-card.has-preview {
    grid-template-columns: 1fr;
  }

  .river-preview,
  .nibbler-preview,
  .cave-preview,
  .river-preview.compact,
  .nibbler-preview.compact,
  .cave-preview.compact {
    min-height: 300px;
  }

  .guide-panel {
    position: static;
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero,
  .practice-main,
  .guide-panel,
  .learning-map {
    padding: 16px;
  }

  .hero {
    min-height: 0;
  }

  h1 {
    font-size: clamp(40px, 13vw, 62px);
  }

  .hero-actions,
  .primary-action {
    width: 100%;
  }

  .input-chip {
    width: 100%;
    justify-content: center;
  }

  .river-preview,
  .nibbler-preview,
  .cave-preview,
  .river-preview.compact,
  .nibbler-preview.compact,
  .cave-preview.compact {
    min-height: 240px;
  }

  .preview-caption {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    flex-direction: column;
  }

  .phase-pill {
    white-space: normal;
  }

  .practice-grid,
  .map-grid {
    grid-template-columns: 1fr;
  }
}

.video-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.video-layout .practice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-layout .practice-card.has-preview {
  min-height: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.video-toggle {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(44, 127, 136, 0.2);
  border-radius: 8px;
  background: rgba(44, 127, 136, 0.07);
  color: var(--teal);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.lesson-video {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 344px;
  padding: 12px;
  border: 1px solid rgba(44, 127, 136, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 249, 0.9)),
    rgba(240, 249, 248, 0.92);
  overflow: hidden;
}

.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
}

.video-header strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.video-header span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.video-scene {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  border-radius: 8px;
  background:
    repeating-linear-gradient(170deg, rgba(32, 95, 115, 0.08) 0 2px, transparent 2px 36px),
    linear-gradient(135deg, #effcff 0%, #d8f4ef 52%, #fff3c9 100%);
  box-shadow: inset 0 0 0 1px rgba(44, 127, 136, 0.14);
}

.river-scene {
  background:
    linear-gradient(180deg, rgba(232, 248, 250, 0.96) 0 26%, rgba(184, 230, 234, 0.94) 26% 100%);
}

.cave-scene {
  background:
    radial-gradient(circle at 80% 16%, rgba(110, 237, 255, 0.25), transparent 26%),
    linear-gradient(180deg, #173646 0%, #254437 48%, #4e3a28 100%);
}

.demo-line {
  position: absolute;
  left: -14%;
  right: -14%;
  top: 48%;
  height: 74px;
  border: 7px solid #42c9d7;
  border-right: 0;
  border-left: 0;
  border-radius: 50%;
  transform: rotate(-7deg);
  filter: drop-shadow(0 0 10px rgba(66, 201, 215, 0.42));
}

.river-demo-glow,
.nibbler-demo-glow {
  top: 47%;
  border-width: 20px;
  opacity: 0.14;
  filter: blur(3px);
}

.demo-hand {
  position: absolute;
  left: 10%;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 16px 16px 22px 22px;
  background:
    radial-gradient(circle at 32% 20%, #ffe0a8 0 9px, transparent 10px),
    radial-gradient(circle at 50% 12%, #ffe0a8 0 10px, transparent 11px),
    radial-gradient(circle at 68% 20%, #ffe0a8 0 9px, transparent 10px),
    linear-gradient(180deg, #ffd38f, #f2a86b);
  box-shadow: 0 0 0 5px rgba(66, 201, 215, 0.18);
  z-index: 5;
}

.river-video.is-playing .river-hand,
.nibbler-video.is-playing .nibbler-hand {
  animation: followWave 4.8s ease-in-out infinite;
}

.demo-boat {
  position: absolute;
  left: 20%;
  top: 56%;
  width: 86px;
  height: 36px;
  border-radius: 0 0 42px 42px;
  background:
    linear-gradient(90deg, transparent 0 8px, #8f5521 8px 15px, transparent 15px),
    linear-gradient(180deg, #d48c35, #7a3c18);
  box-shadow: 0 9px 0 rgba(0, 67, 99, 0.16);
  transform-origin: 50% 100%;
}

.demo-boat::before {
  content: "";
  position: absolute;
  left: 38px;
  bottom: 32px;
  width: 6px;
  height: 58px;
  background: #8b5626;
}

.demo-boat::after {
  content: "";
  position: absolute;
  left: 44px;
  bottom: 62px;
  width: 44px;
  height: 30px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #ffffff;
}

.river-video.is-playing .demo-boat {
  animation: boatRide 4.8s ease-in-out infinite;
}

.demo-coin,
.demo-note,
.demo-crystal {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5da73;
  color: #2c7f88;
  font-weight: 950;
  box-shadow: 0 0 16px rgba(245, 218, 115, 0.75);
}

.coin-one {
  left: 46%;
  top: 42%;
}

.coin-two {
  left: 64%;
  top: 36%;
}

.river-video.is-playing .demo-coin,
.nibbler-video.is-playing .demo-note {
  animation: collectPulse 2.4s ease-in-out infinite;
}

.demo-reef {
  position: absolute;
  right: 17%;
  bottom: 38px;
  width: 62px;
  height: 40px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #c6ccd0, #737f87);
  box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12);
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleGlow 2.4s ease-in-out infinite;
}

.demo-nibbler {
  position: absolute;
  left: 18%;
  top: 54%;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 34%, #16293d 0 4px, transparent 5px),
    conic-gradient(from 318deg, transparent 0 58deg, #ffe083 58deg 360deg);
  box-shadow: 0 9px 0 rgba(46, 82, 95, 0.16), inset -8px -10px 0 rgba(222, 145, 54, 0.22);
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerRide 4.8s ease-in-out infinite;
}

.note-one {
  left: 48%;
  top: 38%;
}

.note-two {
  left: 66%;
  top: 28%;
}

.demo-block {
  position: absolute;
  right: 15%;
  bottom: 34px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe899, #d9784d);
  color: #7c381f;
  font-size: 25px;
  font-weight: 950;
}

.demo-feedback {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(16, 32, 51, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(6px);
}

.lesson-video.is-playing .demo-feedback {
  animation: feedbackPop 2.4s ease-in-out infinite;
}

.demo-cave-roof {
  position: absolute;
  inset: 0 0 auto;
  height: 48%;
  background:
    radial-gradient(circle at 12% 86%, #7b5539 0 18px, transparent 19px),
    radial-gradient(circle at 36% 82%, #5a3a27 0 24px, transparent 25px),
    radial-gradient(circle at 60% 88%, #805638 0 20px, transparent 21px),
    radial-gradient(circle at 84% 82%, #4f3325 0 27px, transparent 28px),
    linear-gradient(180deg, #2b1c18, #6e4630);
  clip-path: polygon(0 0, 100% 0, 100% 58%, 80% 46%, 62% 64%, 45% 40%, 26% 58%, 0 66%);
}

.cave-video.is-playing .demo-cave-roof {
  animation: roofBreathe 5.2s ease-in-out infinite;
}

.demo-cave-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(180deg, #6c4b32, #3d2b22);
}

.demo-dynamic-line {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 46px;
  height: 3px;
  background: linear-gradient(90deg, #5fcbd8, #f5da73, #5fcbd8);
  box-shadow: 0 0 14px rgba(95, 203, 216, 0.7);
}

.cave-hand {
  left: auto;
  right: 10%;
  bottom: 48px;
  transform-origin: center;
}

.cave-video.is-playing .cave-hand {
  animation: handOpenClose 5.2s ease-in-out infinite;
}

.demo-cave-kid {
  position: absolute;
  left: 18%;
  bottom: 28px;
  width: 42px;
  height: 62px;
  border-radius: 24px 24px 18px 18px;
  background:
    radial-gradient(circle at 62% 26%, #1b2633 0 3px, transparent 4px),
    radial-gradient(circle at 70% 36%, #f09982 0 5px, transparent 6px),
    linear-gradient(180deg, #29a891, #157869);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.18);
}

.cave-video.is-playing .demo-cave-kid {
  animation: kidSize 5.2s ease-in-out infinite;
}

.demo-gate {
  position: absolute;
  bottom: 28px;
  width: 44px;
  height: 76px;
  border: 4px solid rgba(255, 211, 107, 0.85);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 0 16px rgba(255, 211, 107, 0.5);
}

.gate-small {
  left: 44%;
  transform: scale(0.74);
}

.gate-large {
  left: 64%;
}

.demo-crystal {
  right: 24%;
  top: 34%;
}

.lesson-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.lesson-steps li::marker {
  color: var(--teal);
  font-weight: 950;
}

.lesson-video.is-paused *,
.lesson-video.is-paused *::before,
.lesson-video.is-paused *::after {
  animation-play-state: paused !important;
}

@keyframes followWave {
  0%, 100% {
    transform: translate(0, 30px);
  }
  36% {
    transform: translate(120px, -54px);
  }
  70% {
    transform: translate(230px, 4px);
  }
}

@keyframes boatRide {
  0%, 100% {
    transform: translate(0, 20px) rotate(-3deg);
  }
  36% {
    transform: translate(118px, -54px) rotate(2deg);
  }
  70% {
    transform: translate(214px, -14px) rotate(-1deg);
  }
  82% {
    transform: translate(238px, -58px) rotate(-5deg);
  }
}

@keyframes nibblerRide {
  0%, 100% {
    transform: translate(0, 22px) rotate(0deg);
  }
  36% {
    transform: translate(120px, -46px) rotate(8deg);
  }
  70% {
    transform: translate(218px, -10px) rotate(-8deg);
  }
  82% {
    transform: translate(240px, -58px) rotate(-16deg);
  }
}

@keyframes collectPulse {
  0%, 28%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  42%, 58% {
    opacity: 0.18;
    transform: scale(1.5);
  }
}

@keyframes obstacleGlow {
  0%, 45%, 100% {
    box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12);
  }
  65%, 82% {
    box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12), 0 0 0 9px rgba(255, 211, 107, 0.44), 0 0 22px rgba(255, 211, 107, 0.8);
  }
}

@keyframes feedbackPop {
  0%, 55%, 100% {
    opacity: 0;
    transform: translateY(6px);
  }
  66%, 84% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes roofBreathe {
  0%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 64%, 80% 52%, 62% 68%, 45% 48%, 26% 64%, 0 70%);
  }
  48% {
    clip-path: polygon(0 0, 100% 0, 100% 42%, 80% 34%, 62% 48%, 45% 30%, 26% 46%, 0 54%);
  }
}

@keyframes handOpenClose {
  0%, 100% {
    transform: scale(0.78);
  }
  50% {
    transform: scale(1.26);
  }
}

@keyframes kidSize {
  0%, 100% {
    transform: translateX(0) scale(0.78);
  }
  50% {
    transform: translateX(128px) scale(1.24);
  }
  82% {
    transform: translateX(228px) scale(0.88);
  }
}

@media (max-width: 1180px) {
  .video-layout {
    grid-template-columns: 1fr;
  }

  .video-layout .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .video-layout .practice-grid {
    grid-template-columns: 1fr;
  }

  .lesson-video {
    min-height: 318px;
  }
}

.impact-label {
  position: absolute;
  z-index: 8;
  max-width: 130px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #17384a;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
  box-shadow: 0 8px 16px rgba(28, 47, 63, 0.1);
}

.hand-impact {
  left: 12px;
  bottom: 12px;
}

.role-impact {
  left: 38%;
  bottom: 12px;
}

.success-impact {
  right: 12px;
  bottom: 12px;
}

.teaching-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.teaching-points article {
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(44, 127, 136, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.teaching-points strong,
.teaching-points span {
  display: block;
}

.teaching-points strong {
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.teaching-points span {
  color: #385365;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.48;
}

.lesson-video {
  min-height: 468px;
}

.video-scene {
  min-height: 190px;
}

.cave-scene .role-impact {
  left: 34%;
}

.cave-scene .success-impact {
  right: 10px;
}

@media (max-width: 1180px) {
  .lesson-video {
    min-height: 440px;
  }
}

@media (max-width: 760px) {
  .teaching-points {
    grid-template-columns: 1fr;
  }

  .lesson-video {
    min-height: 0;
  }

  .impact-label {
    max-width: 112px;
    font-size: 10px;
  }
}

/* Storyboard-style lesson video pass */
.lesson-video {
  min-height: 560px;
}

.video-scene {
  min-height: 260px;
}

.scene-title {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 12;
  max-width: calc(100% - 28px);
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(16, 32, 51, 0.86);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(6px);
}

.lesson-video.is-playing .scene-title {
  animation: sceneTitle 12s linear infinite;
}

.lesson-video.is-playing .title-two { animation-delay: 2s; }
.lesson-video.is-playing .title-three { animation-delay: 4s; }
.lesson-video.is-playing .title-four { animation-delay: 6s; }
.lesson-video.is-playing .title-five { animation-delay: 8s; }
.lesson-video.is-playing .title-six { animation-delay: 10s; }

.motion-trace {
  position: absolute;
  left: 12%;
  top: 30%;
  width: 70%;
  height: 42%;
  border-top: 4px dashed rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(66, 201, 215, 0.55));
}

.lesson-video.is-playing .motion-trace {
  animation: tracePulse 12s linear infinite;
}

.motion-arrow,
.press-cue,
.open-cue,
.close-cue,
.dynamic-label,
.mistake-note {
  position: absolute;
  z-index: 11;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #17384a;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(28, 47, 63, 0.1);
  opacity: 0;
}

.arrow-up {
  left: 26%;
  top: 28%;
}

.arrow-down {
  left: 50%;
  top: 64%;
}

.press-cue {
  right: 14%;
  top: 42%;
  background: rgba(255, 226, 125, 0.92);
}

.mistake-note {
  left: 14px;
  bottom: 48px;
  background: rgba(255, 236, 226, 0.95);
  color: #8a3a21;
}

.lesson-video.is-playing .arrow-up {
  animation: cuePop 12s linear infinite 2s;
}

.lesson-video.is-playing .arrow-down {
  animation: cuePop 12s linear infinite 4s;
}

.lesson-video.is-playing .press-cue {
  animation: cuePop 12s linear infinite 6s;
}

.lesson-video.is-playing .mistake-note {
  animation: mistakePop 12s linear infinite 10s;
}

.river-video.is-playing .river-hand,
.nibbler-video.is-playing .nibbler-hand {
  animation: storyboardHand 12s ease-in-out infinite;
}

.river-video.is-playing .demo-boat {
  animation: storyboardBoat 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: storyboardNibbler 12s ease-in-out infinite;
}

.river-video.is-playing .demo-coin,
.nibbler-video.is-playing .demo-note {
  animation: storyboardCollect 12s linear infinite;
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: storyboardObstacle 12s linear infinite;
}

.lesson-video.is-playing .demo-feedback {
  animation: storyboardFeedback 12s linear infinite;
}

.lesson-video.is-playing .impact-label {
  animation: impactCue 12s linear infinite;
}

.role-impact { animation-delay: 2s !important; }
.success-impact { animation-delay: 4s !important; }

.dynamic-label {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  font-family: Georgia, serif;
  background: rgba(255, 243, 173, 0.95);
  color: #1b5964;
}

.label-p {
  left: 13%;
  bottom: 54px;
}

.label-f {
  left: 56%;
  bottom: 54px;
}

.open-cue {
  right: 12px;
  top: 62px;
  background: rgba(255, 226, 125, 0.94);
}

.close-cue {
  right: 12px;
  top: 104px;
  background: rgba(211, 255, 241, 0.94);
}

.cave-video.is-playing .demo-cave-roof {
  animation: storyboardRoof 12s ease-in-out infinite;
}

.cave-video.is-playing .cave-hand {
  animation: storyboardOpenHand 12s ease-in-out infinite;
}

.cave-video.is-playing .demo-cave-kid {
  animation: storyboardKid 12s ease-in-out infinite;
}

.cave-video.is-playing .open-cue {
  animation: cuePop 12s linear infinite 0s;
}

.cave-video.is-playing .close-cue {
  animation: cuePop 12s linear infinite 6s;
}

.cave-video.is-playing .dynamic-label {
  animation: dynamicPulse 12s linear infinite;
}

.cave-video.is-playing .demo-crystal {
  animation: crystalPass 12s linear infinite;
}

@keyframes sceneTitle {
  0%, 15% {
    opacity: 1;
    transform: translateY(0);
  }
  18%, 100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes tracePulse {
  0%, 52% {
    opacity: 0.85;
  }
  58%, 100% {
    opacity: 0.18;
  }
}

@keyframes cuePop {
  0%, 15% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  18%, 100% {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
}

@keyframes mistakePop {
  0%, 17% {
    opacity: 1;
    transform: translateY(0);
  }
  20%, 100% {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes impactCue {
  0%, 17% {
    opacity: 1;
  }
  20%, 100% {
    opacity: 0.25;
  }
}

@keyframes storyboardHand {
  0%, 16% { transform: translate(0, 24px); }
  28%, 34% { transform: translate(96px, -54px); }
  45%, 52% { transform: translate(176px, 24px); }
  58%, 64% { transform: translate(230px, 24px); }
  70%, 76% { transform: translate(230px, 62px) scale(0.9); }
  82%, 100% { transform: translate(0, 24px); }
}

@keyframes storyboardBoat {
  0%, 16% { transform: translate(0, 14px) rotate(-2deg); }
  28%, 34% { transform: translate(96px, -58px) rotate(3deg); }
  45%, 52% { transform: translate(178px, 12px) rotate(-2deg); }
  58%, 64% { transform: translate(222px, 12px) rotate(0deg); }
  70%, 76% { transform: translate(244px, -62px) rotate(-7deg); }
  82%, 100% { transform: translate(0, 14px) rotate(-2deg); }
}

@keyframes storyboardNibbler {
  0%, 16% { transform: translate(0, 18px) rotate(0deg); }
  28%, 34% { transform: translate(94px, -52px) rotate(8deg); }
  45%, 52% { transform: translate(174px, 12px) rotate(-8deg); }
  58%, 64% { transform: translate(222px, 12px) rotate(0deg); }
  70%, 76% { transform: translate(244px, -62px) rotate(-16deg); }
  82%, 100% { transform: translate(0, 18px) rotate(0deg); }
}

@keyframes storyboardCollect {
  0%, 25%, 100% { opacity: 1; transform: scale(1); }
  30%, 50% { opacity: 0.15; transform: scale(1.6); }
}

@keyframes storyboardObstacle {
  0%, 50%, 100% { box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12); }
  56%, 70% { box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12), 0 0 0 10px rgba(255, 211, 107, 0.5), 0 0 24px rgba(255, 211, 107, 0.82); }
}

@keyframes storyboardFeedback {
  0%, 64%, 100% { opacity: 0; transform: translateY(6px); }
  70%, 82% { opacity: 1; transform: translateY(0); }
}

@keyframes storyboardRoof {
  0%, 28% { clip-path: polygon(0 0, 100% 0, 100% 64%, 80% 52%, 62% 68%, 45% 48%, 26% 64%, 0 70%); }
  42%, 52% { clip-path: polygon(0 0, 100% 0, 100% 38%, 80% 30%, 62% 44%, 45% 26%, 26% 42%, 0 50%); }
  72%, 82% { clip-path: polygon(0 0, 100% 0, 100% 66%, 80% 56%, 62% 72%, 45% 52%, 26% 68%, 0 74%); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 64%, 80% 52%, 62% 68%, 45% 48%, 26% 64%, 0 70%); }
}

@keyframes storyboardOpenHand {
  0%, 20% { transform: scale(0.72); }
  42%, 52% { transform: scale(1.28); }
  72%, 82% { transform: scale(0.72); }
  100% { transform: scale(0.72); }
}

@keyframes storyboardKid {
  0%, 20% { transform: translateX(0) scale(0.76); }
  42%, 52% { transform: translateX(128px) scale(1.25); }
  72%, 82% { transform: translateX(228px) scale(0.78); }
  100% { transform: translateX(0) scale(0.76); }
}

@keyframes dynamicPulse {
  0%, 20%, 100% { opacity: 0.9; transform: scale(1); }
  42%, 52% { opacity: 1; transform: scale(1.18); }
  72%, 82% { opacity: 0.9; transform: scale(0.94); }
}

@keyframes crystalPass {
  0%, 42%, 100% { opacity: 1; transform: scale(1); }
  52%, 62% { opacity: 0.25; transform: scale(1.6); }
}

.video-layout .practice-grid {
  grid-template-columns: 1fr;
}

.video-layout .practice-card.has-preview {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(440px, 0.58fr);
  gap: 18px;
  align-items: stretch;
}

.video-layout .featured-copy {
  justify-content: center;
}

.video-layout .lesson-video {
  min-height: 520px;
}

.video-layout .video-scene {
  min-height: 280px;
}

@media (max-width: 980px) {
  .video-layout .practice-card.has-preview {
    grid-template-columns: 1fr;
  }
}

/* Corrected teaching logic: hand moves vertically, character advances automatically. */
.auto-forward {
  position: absolute;
  left: 16px;
  top: 54px;
  z-index: 11;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(211, 255, 241, 0.92);
  color: #145b63;
  font-size: 12px;
  font-weight: 950;
  opacity: 0;
}

.vertical-control {
  position: absolute;
  right: 18px;
  top: 68px;
  bottom: 42px;
  z-index: 4;
  width: 36px;
  border-radius: 999px;
  background: rgba(20, 91, 99, 0.18);
  box-shadow: inset 0 0 0 2px rgba(20, 91, 99, 0.18);
}

.vertical-control::before,
.vertical-control::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #145b63;
  font-size: 16px;
  font-weight: 950;
}

.vertical-control::before {
  content: "↑";
  top: 8px;
}

.vertical-control::after {
  content: "↓";
  bottom: 8px;
}

.river-scene .demo-hand,
.nibbler-scene .demo-hand {
  left: auto;
  right: 14px;
  bottom: 52px;
}

.river-scene .arrow-up,
.nibbler-scene .arrow-up {
  left: auto;
  right: 64px;
  top: 72px;
}

.river-scene .arrow-down,
.nibbler-scene .arrow-down {
  left: auto;
  right: 64px;
  top: 166px;
}

.river-scene .press-cue,
.nibbler-scene .press-cue {
  right: 64px;
  top: 124px;
}

.river-scene .hand-impact,
.nibbler-scene .hand-impact {
  right: 10px;
  left: auto;
  bottom: 8px;
}

.river-scene .role-impact,
.nibbler-scene .role-impact {
  left: 34%;
  bottom: 8px;
}

.river-scene .success-impact,
.nibbler-scene .success-impact {
  right: 128px;
  bottom: 8px;
}

.lesson-video.is-playing .auto-forward {
  animation: autoForwardCue 12s linear infinite;
}

.river-video.is-playing .river-hand,
.nibbler-video.is-playing .nibbler-hand {
  animation: verticalHandOnly 12s ease-in-out infinite;
}

.river-video.is-playing .demo-boat {
  animation: boatAutoForwardOnLine 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerAutoForwardOnLine 12s ease-in-out infinite;
}

@keyframes autoForwardCue {
  0%, 18% { opacity: 1; transform: translateX(0); }
  25%, 100% { opacity: 0; transform: translateX(18px); }
}

@keyframes verticalHandOnly {
  0%, 16% { transform: translateY(40px); }
  28%, 34% { transform: translateY(-62px); }
  45%, 52% { transform: translateY(40px); }
  58%, 64% { transform: translateY(8px); }
  70%, 76% { transform: translateY(70px) scale(0.9); }
  82%, 100% { transform: translateY(40px); }
}

@keyframes boatAutoForwardOnLine {
  0%, 16% { transform: translate(0, 18px) rotate(-2deg); }
  28%, 34% { transform: translate(86px, -58px) rotate(3deg); }
  45%, 52% { transform: translate(172px, 12px) rotate(-2deg); }
  58%, 64% { transform: translate(238px, 12px) rotate(0deg); }
  70%, 76% { transform: translate(268px, -60px) rotate(-7deg); }
  82%, 100% { transform: translate(0, 18px) rotate(-2deg); }
}

@keyframes nibblerAutoForwardOnLine {
  0%, 16% { transform: translate(0, 20px) rotate(0deg); }
  28%, 34% { transform: translate(86px, -54px) rotate(8deg); }
  45%, 52% { transform: translate(172px, 12px) rotate(-8deg); }
  58%, 64% { transform: translate(238px, 12px) rotate(0deg); }
  70%, 76% { transform: translate(268px, -60px) rotate(-16deg); }
  82%, 100% { transform: translate(0, 20px) rotate(0deg); }
}

/* Cave gate correction: crescendo grows into a large gate; diminuendo shrinks into a small gate. */
.cave-scene .gate-large {
  left: 43%;
  width: 58px;
  height: 104px;
  transform: scale(1);
}

.cave-scene .gate-small {
  left: 70%;
  width: 40px;
  height: 68px;
  transform: scale(1);
}

.cave-scene .label-f {
  left: 48%;
}

.cave-scene .label-p {
  left: 74%;
}

@keyframes storyboardKid {
  0%, 20% { transform: translateX(0) scale(0.76); }
  42%, 52% { transform: translateX(118px) scale(1.25); }
  72%, 82% { transform: translateX(230px) scale(0.78); }
  100% { transform: translateX(0) scale(0.76); }
}

/* Second correction: the music line scrolls; the character stays in place and only moves vertically. */
.river-scene,
.nibbler-scene {
  overflow: hidden;
}

.river-scene .demo-line,
.nibbler-scene .demo-line {
  left: -80%;
  right: -80%;
  width: 260%;
  transform-origin: center;
}

.river-video.is-playing .river-demo-line,
.river-video.is-playing .river-demo-glow,
.nibbler-video.is-playing .nibbler-demo-line,
.nibbler-video.is-playing .nibbler-demo-glow {
  animation: flowingMusicLine 12s linear infinite;
}

.playhead-marker {
  position: absolute;
  left: 24%;
  top: 54px;
  bottom: 30px;
  z-index: 10;
  width: 2px;
  border-left: 3px dashed rgba(255, 255, 255, 0.92);
  color: #17384a;
  font-size: 11px;
  font-weight: 950;
  text-indent: 8px;
  white-space: nowrap;
  filter: drop-shadow(0 0 8px rgba(66, 201, 215, 0.5));
}

.river-scene .demo-boat,
.nibbler-scene .demo-nibbler {
  left: 20%;
}

.river-scene .demo-coin,
.nibbler-scene .demo-note,
.river-scene .demo-reef,
.nibbler-scene .demo-block {
  will-change: transform, opacity;
}

.river-scene .coin-one,
.nibbler-scene .note-one {
  left: auto;
  right: -8%;
  top: 34%;
}

.river-scene .coin-two,
.nibbler-scene .note-two {
  left: auto;
  right: -28%;
  top: 60%;
}

.river-scene .demo-reef,
.nibbler-scene .demo-block {
  right: -42%;
}

.river-video.is-playing .demo-boat {
  animation: boatVerticalFollowOnly 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerVerticalFollowOnly 12s ease-in-out infinite;
}

.river-video.is-playing .coin-one,
.nibbler-video.is-playing .note-one {
  animation: collectableFlowsPast 12s linear infinite 2.2s;
}

.river-video.is-playing .coin-two,
.nibbler-video.is-playing .note-two {
  animation: collectableFlowsPast 12s linear infinite 4.2s;
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleFlowsPast 12s linear infinite 6.2s;
}

.river-video.is-playing .demo-coin,
.nibbler-video.is-playing .demo-note {
  opacity: 1;
}

@keyframes flowingMusicLine {
  0% {
    transform: translateX(0) rotate(-7deg);
  }
  100% {
    transform: translateX(-32%) rotate(-7deg);
  }
}

@keyframes boatVerticalFollowOnly {
  0%, 16% { transform: translateY(18px) rotate(-2deg); }
  28%, 34% { transform: translateY(-58px) rotate(3deg); }
  45%, 52% { transform: translateY(12px) rotate(-2deg); }
  58%, 64% { transform: translateY(12px) rotate(0deg); }
  70%, 76% { transform: translateY(-60px) rotate(-7deg); }
  82%, 100% { transform: translateY(18px) rotate(-2deg); }
}

@keyframes nibblerVerticalFollowOnly {
  0%, 16% { transform: translateY(20px) rotate(0deg); }
  28%, 34% { transform: translateY(-54px) rotate(8deg); }
  45%, 52% { transform: translateY(12px) rotate(-8deg); }
  58%, 64% { transform: translateY(12px) rotate(0deg); }
  70%, 76% { transform: translateY(-60px) rotate(-16deg); }
  82%, 100% { transform: translateY(20px) rotate(0deg); }
}

@keyframes collectableFlowsPast {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  34% { opacity: 1; transform: translateX(-190%) scale(1); }
  42% { opacity: 0.18; transform: translateX(-230%) scale(1.6); }
  50%, 100% { opacity: 0; transform: translateX(-245%) scale(1.6); }
}

@keyframes obstacleFlowsPast {
  0% { opacity: 1; transform: translateX(0); }
  22% { opacity: 1; transform: translateX(-120%); }
  30%, 42% {
    opacity: 1;
    transform: translateX(-180%);
    box-shadow: 0 8px 0 rgba(0, 73, 94, 0.12), 0 0 0 10px rgba(255, 211, 107, 0.5), 0 0 24px rgba(255, 211, 107, 0.82);
  }
  56%, 100% { opacity: 0; transform: translateX(-245%); }
}

/* Clarity pass: use one obvious wavy music line and keep obstacles visible. */
.river-demo-glow,
.nibbler-demo-glow {
  display: none;
}

.river-scene .demo-line,
.nibbler-scene .demo-line {
  left: -54%;
  right: auto;
  top: 48%;
  width: 220%;
  height: 118px;
  border: 0;
  border-top: 11px solid #20c9df;
  border-radius: 50%;
  background: none;
  opacity: 1;
  filter:
    drop-shadow(0 0 8px rgba(32, 201, 223, 0.78))
    drop-shadow(0 0 18px rgba(32, 201, 223, 0.45));
}

.river-scene .demo-line::before,
.nibbler-scene .demo-line::before {
  content: "";
  position: absolute;
  inset: -11px 0 auto;
  height: 12px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 4px, transparent 5px) 0 0 / 54px 12px repeat-x;
  opacity: 0.9;
  animation: waveDots 1.4s linear infinite;
}

.river-scene .demo-line::after,
.nibbler-scene .demo-line::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  opacity: 0.5;
  animation: lineShimmer 2.8s linear infinite;
}

.river-video.is-playing .river-demo-line,
.nibbler-video.is-playing .nibbler-demo-line {
  animation: flowingSingleMusicLine 12s linear infinite;
}

.river-scene .demo-boat,
.nibbler-scene .demo-nibbler {
  z-index: 7;
}

.river-scene .demo-coin,
.nibbler-scene .demo-note,
.river-scene .demo-reef,
.nibbler-scene .demo-block {
  z-index: 6;
}

.river-scene .coin-one,
.nibbler-scene .note-one {
  right: -12%;
  top: 36%;
}

.river-scene .coin-two,
.nibbler-scene .note-two {
  right: -34%;
  top: 59%;
}

.river-scene .demo-reef {
  right: -56%;
  bottom: 72px;
  width: 68px;
  height: 44px;
  opacity: 1;
  box-shadow: 0 9px 0 rgba(0, 73, 94, 0.15), 0 0 0 0 rgba(255, 211, 107, 0);
}

.nibbler-scene .demo-block {
  right: -56%;
  bottom: 72px;
  opacity: 1;
  box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 0 rgba(255, 211, 107, 0);
}

.river-video.is-playing .coin-one,
.nibbler-video.is-playing .note-one {
  animation: collectableFlowsClearly 12s linear infinite 1.8s;
}

.river-video.is-playing .coin-two,
.nibbler-video.is-playing .note-two {
  animation: collectableFlowsClearly 12s linear infinite 3.7s;
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleFlowsClearly 12s linear infinite 5.8s;
}

.river-scene .press-cue,
.nibbler-scene .press-cue {
  z-index: 14;
  background: rgba(255, 226, 125, 0.98);
  box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.22);
}

@keyframes flowingSingleMusicLine {
  0% {
    transform: translateX(0) rotate(-7deg);
  }
  100% {
    transform: translateX(-28%) rotate(-7deg);
  }
}

@keyframes waveDots {
  0% {
    background-position-x: 0;
  }
  100% {
    background-position-x: -54px;
  }
}

@keyframes lineShimmer {
  0% {
    transform: translateX(-45%);
  }
  100% {
    transform: translateX(45%);
  }
}

@keyframes collectableFlowsClearly {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  42% {
    opacity: 1;
    transform: translateX(-250%) scale(1);
  }
  50% {
    opacity: 0.18;
    transform: translateX(-300%) scale(1.65);
  }
  58%, 100% {
    opacity: 0;
    transform: translateX(-325%) scale(1.65);
  }
}

@keyframes obstacleFlowsClearly {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  34% {
    opacity: 1;
    transform: translateX(-210%);
  }
  42%, 58% {
    opacity: 1;
    transform: translateX(-265%);
    box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 12px rgba(255, 211, 107, 0.52), 0 0 28px rgba(255, 211, 107, 0.9);
  }
  70%, 100% {
    opacity: 0;
    transform: translateX(-340%);
  }
}

/* Obstacle teaching labels: make the staccato cue visibly identifiable. */
.obstacle-callout,
.obstacle-label {
  position: absolute;
  z-index: 13;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
}

.obstacle-callout {
  right: 86px;
  top: 82px;
  background: rgba(255, 226, 125, 0.98);
  color: #73420e;
  box-shadow: 0 0 0 4px rgba(255, 211, 107, 0.22), 0 10px 18px rgba(28, 47, 63, 0.14);
}

.obstacle-label {
  right: 70px;
  bottom: 116px;
  background: rgba(16, 32, 51, 0.82);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(28, 47, 63, 0.14);
}

.demo-reef::before,
.demo-block::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 3px solid rgba(255, 211, 107, 0.88);
  border-radius: inherit;
  opacity: 0;
  box-shadow: 0 0 20px rgba(255, 211, 107, 0.75);
}

.demo-reef::after {
  content: "礁石";
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #4c5960;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.demo-block::after {
  content: "障碍";
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #7c381f;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

html[lang="en"] .demo-reef::after {
  content: "Reef";
}

html[lang="en"] .demo-block::after {
  content: "Obstacle";
}

.river-video.is-playing .river-obstacle-callout,
.river-video.is-playing .river-obstacle-label,
.nibbler-video.is-playing .nibbler-obstacle-callout,
.nibbler-video.is-playing .nibbler-obstacle-label {
  animation: obstacleTeachingText 12s linear infinite;
}

.river-video.is-playing .demo-reef::before,
.nibbler-video.is-playing .demo-block::before {
  animation: obstacleRing 12s linear infinite;
}

@keyframes obstacleTeachingText {
  0%, 47%, 100% {
    opacity: 0;
    transform: translateY(5px);
  }
  50%, 68% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes obstacleRing {
  0%, 47%, 100% {
    opacity: 0;
    transform: scale(0.92);
  }
  50%, 68% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* Wave-follow correction: one visible wavy music path, character follows the current wave height. */
.wave-track {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 9px rgba(32, 201, 223, 0.74));
}

.wave-track path {
  fill: none;
  stroke: #1fc9df;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 34 18;
  animation: wavePathFlow 1.35s linear infinite;
}

.river-scene .demo-line,
.nibbler-scene .demo-line {
  display: none;
}

.river-video.is-playing .wave-track,
.nibbler-video.is-playing .wave-track {
  animation: waveShapeTravel 12s ease-in-out infinite;
}

.playhead-marker {
  left: 24%;
  top: 42px;
  bottom: 18px;
  border-left-color: rgba(255, 255, 255, 0.96);
  z-index: 12;
}

.river-scene .demo-boat {
  left: 20%;
  top: 52%;
}

.nibbler-scene .demo-nibbler {
  left: 20%;
  top: 52%;
}

.river-video.is-playing .demo-boat {
  animation: boatWaveFollowAtPlayhead 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerWaveFollowAtPlayhead 12s ease-in-out infinite;
}

.river-scene .coin-one,
.nibbler-scene .note-one {
  right: -10%;
  top: 43%;
}

.river-scene .coin-two,
.nibbler-scene .note-two {
  right: -28%;
  top: 61%;
}

.river-scene .demo-reef,
.nibbler-scene .demo-block {
  right: -18%;
  bottom: auto;
  top: 51%;
  opacity: 1;
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleWaveApproach 12s linear infinite;
}

.river-video.is-playing .coin-one,
.nibbler-video.is-playing .note-one {
  animation: itemWaveApproachHigh 12s linear infinite 1.2s;
}

.river-video.is-playing .coin-two,
.nibbler-video.is-playing .note-two {
  animation: itemWaveApproachLow 12s linear infinite 3.1s;
}

.obstacle-sample {
  position: absolute;
  right: 18px;
  top: 46%;
  z-index: 12;
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 46px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #4c5960;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.36), 0 10px 18px rgba(28, 47, 63, 0.12);
}

.river-obstacle-sample::before {
  content: "";
  display: block;
  width: 54px;
  height: 34px;
  margin-bottom: 3px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(180deg, #d0d5d9, #6f7b83);
}

.nibbler-obstacle-sample {
  color: #7c381f;
  font-size: 28px;
  background: linear-gradient(180deg, rgba(255, 246, 199, 0.94), rgba(255, 225, 165, 0.9));
}

.lesson-video.is-playing .obstacle-sample {
  animation: sampleObstaclePulse 12s linear infinite;
}

.obstacle-callout {
  right: 88px;
  top: 76px;
}

.obstacle-label {
  right: 96px;
  bottom: 84px;
}

@keyframes wavePathFlow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -52; }
}

@keyframes waveShapeTravel {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-80px); }
}

@keyframes boatWaveFollowAtPlayhead {
  0%, 12% { transform: translateY(40px) rotate(-2deg); }
  24%, 34% { transform: translateY(-58px) rotate(3deg); }
  45%, 55% { transform: translateY(44px) rotate(-2deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  74%, 82% { transform: translateY(-62px) rotate(-7deg); }
  90%, 100% { transform: translateY(40px) rotate(-2deg); }
}

@keyframes nibblerWaveFollowAtPlayhead {
  0%, 12% { transform: translateY(42px) rotate(0deg); }
  24%, 34% { transform: translateY(-58px) rotate(8deg); }
  45%, 55% { transform: translateY(42px) rotate(-8deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  74%, 82% { transform: translateY(-62px) rotate(-16deg); }
  90%, 100% { transform: translateY(42px) rotate(0deg); }
}

@keyframes itemWaveApproachHigh {
  0% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
  38% { opacity: 1; transform: translateX(-245%) translateY(-74px) scale(1); }
  48% { opacity: 0.18; transform: translateX(-295%) translateY(-74px) scale(1.65); }
  56%, 100% { opacity: 0; transform: translateX(-320%) translateY(-74px) scale(1.65); }
}

@keyframes itemWaveApproachLow {
  0% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
  38% { opacity: 1; transform: translateX(-245%) translateY(54px) scale(1); }
  48% { opacity: 0.18; transform: translateX(-295%) translateY(54px) scale(1.65); }
  56%, 100% { opacity: 0; transform: translateX(-320%) translateY(54px) scale(1.65); }
}

@keyframes obstacleWaveApproach {
  0% { opacity: 1; transform: translateX(0) translateY(0); }
  36% { opacity: 1; transform: translateX(-220%) translateY(-42px); }
  46%, 62% {
    opacity: 1;
    transform: translateX(-275%) translateY(-42px);
    box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 12px rgba(255, 211, 107, 0.52), 0 0 28px rgba(255, 211, 107, 0.9);
  }
  74%, 100% { opacity: 0; transform: translateX(-340%) translateY(-42px); }
}

@keyframes sampleObstaclePulse {
  0%, 42%, 70%, 100% { opacity: 0.92; transform: scale(1); }
  48%, 62% { opacity: 1; transform: scale(1.08); }
}

/* Synchronization pass: the character height now follows the visible wave height. */
.river-video.is-playing .wave-track,
.nibbler-video.is-playing .wave-track {
  animation: waveAtPlayheadHeight 12s ease-in-out infinite;
}

.river-video.is-playing .demo-boat {
  animation: boatMatchedToWave 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerMatchedToWave 12s ease-in-out infinite;
}

@keyframes waveAtPlayheadHeight {
  0%, 12% {
    transform: translateX(0) translateY(40px);
  }
  24%, 34% {
    transform: translateX(-28px) translateY(-58px);
  }
  45%, 55% {
    transform: translateX(-56px) translateY(44px);
  }
  62%, 68% {
    transform: translateX(-72px) translateY(4px);
  }
  74%, 84% {
    transform: translateX(-86px) translateY(-62px);
  }
  92%, 100% {
    transform: translateX(0) translateY(40px);
  }
}

@keyframes boatMatchedToWave {
  0%, 12% { transform: translateY(40px) rotate(-2deg); }
  24%, 34% { transform: translateY(-58px) rotate(3deg); }
  45%, 55% { transform: translateY(44px) rotate(-2deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  74%, 84% { transform: translateY(-62px) rotate(-7deg); }
  92%, 100% { transform: translateY(40px) rotate(-2deg); }
}

@keyframes nibblerMatchedToWave {
  0%, 12% { transform: translateY(40px) rotate(0deg); }
  24%, 34% { transform: translateY(-58px) rotate(8deg); }
  45%, 55% { transform: translateY(44px) rotate(-8deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  74%, 84% { transform: translateY(-62px) rotate(-16deg); }
  92%, 100% { transform: translateY(40px) rotate(0deg); }
}

/* Keep the obstacle visible until after the character has jumped over it. */
.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstaclePassesThenLeaves 12s linear infinite 5.8s;
}

@keyframes obstaclePassesThenLeaves {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  34% {
    opacity: 1;
    transform: translateX(-210%) translateY(-42px);
  }
  42%, 66% {
    opacity: 1;
    transform: translateX(-265%) translateY(-42px);
    box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 12px rgba(255, 211, 107, 0.52), 0 0 28px rgba(255, 211, 107, 0.9);
  }
  76% {
    opacity: 1;
    transform: translateX(-300%) translateY(-42px);
  }
  88%, 100% {
    opacity: 0;
    transform: translateX(-345%) translateY(-42px);
  }
}

/* Obstacle pass correction: obstacle reaches the character's front, then the character jumps over it. */
.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleArrivesInFrontThenBehind 12s linear infinite 5.8s;
}

.river-video.is-playing .demo-boat {
  animation: boatMatchedToWaveAndJumpOver 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerMatchedToWaveAndJumpOver 12s ease-in-out infinite;
}

@keyframes obstacleArrivesInFrontThenBehind {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
  32% {
    opacity: 1;
    transform: translateX(-150%) translateY(-42px) scale(1);
  }
  42%, 56% {
    opacity: 1;
    transform: translateX(-205%) translateY(-42px) scale(1.05);
    box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 12px rgba(255, 211, 107, 0.52), 0 0 28px rgba(255, 211, 107, 0.9);
  }
  70% {
    opacity: 1;
    transform: translateX(-260%) translateY(-42px) scale(1);
  }
  84%, 100% {
    opacity: 0;
    transform: translateX(-330%) translateY(-42px) scale(1);
  }
}

@keyframes boatMatchedToWaveAndJumpOver {
  0%, 12% { transform: translateY(40px) rotate(-2deg); }
  24%, 34% { transform: translateY(-58px) rotate(3deg); }
  45%, 55% { transform: translateY(44px) rotate(-2deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  72%, 80% { transform: translateY(-84px) rotate(-8deg); }
  86% { transform: translateY(-34px) rotate(-3deg); }
  92%, 100% { transform: translateY(40px) rotate(-2deg); }
}

@keyframes nibblerMatchedToWaveAndJumpOver {
  0%, 12% { transform: translateY(40px) rotate(0deg); }
  24%, 34% { transform: translateY(-58px) rotate(8deg); }
  45%, 55% { transform: translateY(44px) rotate(-8deg); }
  62%, 68% { transform: translateY(4px) rotate(0deg); }
  72%, 80% { transform: translateY(-84px) rotate(-18deg); }
  86% { transform: translateY(-34px) rotate(-8deg); }
  92%, 100% { transform: translateY(40px) rotate(0deg); }
}

/* Percent-positioned obstacle pass: the obstacle visibly arrives in front of the character. */
.river-scene .demo-reef,
.nibbler-scene .demo-block {
  right: auto;
  left: 104%;
  top: 56%;
  bottom: auto;
  opacity: 1;
}

.river-video.is-playing .demo-reef,
.nibbler-video.is-playing .demo-block {
  animation: obstacleCrossesCharacterFront 12s linear infinite;
}

.river-video.is-playing .demo-boat {
  animation: boatWaveFollowAndTimedJump 12s ease-in-out infinite;
}

.nibbler-video.is-playing .demo-nibbler {
  animation: nibblerWaveFollowAndTimedJump 12s ease-in-out infinite;
}

.river-video.is-playing .river-obstacle-callout,
.river-video.is-playing .river-obstacle-label,
.nibbler-video.is-playing .nibbler-obstacle-callout,
.nibbler-video.is-playing .nibbler-obstacle-label,
.river-video.is-playing .press-cue,
.nibbler-video.is-playing .press-cue {
  animation: obstacleCueAtFront 12s linear infinite;
}

@keyframes obstacleCrossesCharacterFront {
  0%, 45% {
    left: 104%;
    top: 56%;
    opacity: 0;
    transform: translateY(0) scale(1);
  }
  50% {
    left: 58%;
    top: 50%;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  58%, 66% {
    left: 32%;
    top: 48%;
    opacity: 1;
    transform: translateY(0) scale(1.08);
    box-shadow: 0 9px 0 rgba(0, 73, 94, 0.12), 0 0 0 14px rgba(255, 211, 107, 0.58), 0 0 30px rgba(255, 211, 107, 0.95);
  }
  74% {
    left: 22%;
    top: 58%;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  86% {
    left: 8%;
    top: 60%;
    opacity: 1;
    transform: translateY(0) scale(0.96);
  }
  94%, 100% {
    left: -18%;
    top: 60%;
    opacity: 0;
    transform: translateY(0) scale(0.96);
  }
}

@keyframes boatWaveFollowAndTimedJump {
  0%, 12% { transform: translateY(40px) rotate(-2deg); }
  24%, 34% { transform: translateY(-58px) rotate(3deg); }
  45%, 55% { transform: translateY(44px) rotate(-2deg); }
  60%, 66% { transform: translateY(4px) rotate(0deg); }
  68%, 76% { transform: translateY(-98px) rotate(-8deg); }
  82% { transform: translateY(-34px) rotate(-3deg); }
  92%, 100% { transform: translateY(40px) rotate(-2deg); }
}

@keyframes nibblerWaveFollowAndTimedJump {
  0%, 12% { transform: translateY(40px) rotate(0deg); }
  24%, 34% { transform: translateY(-58px) rotate(8deg); }
  45%, 55% { transform: translateY(44px) rotate(-8deg); }
  60%, 66% { transform: translateY(4px) rotate(0deg); }
  68%, 76% { transform: translateY(-98px) rotate(-18deg); }
  82% { transform: translateY(-34px) rotate(-8deg); }
  92%, 100% { transform: translateY(40px) rotate(0deg); }
}

@keyframes obstacleCueAtFront {
  0%, 52%, 82%, 100% {
    opacity: 0;
    transform: translateY(5px);
  }
  58%, 72% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gesture explainer layer: show how the student's hand drives each game. */
.gesture-demo {
  position: absolute;
  z-index: 14;
  pointer-events: none;
}

.line-gesture {
  right: 18px;
  top: 88px;
  width: 142px;
  height: 190px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 0 0 2px rgba(37, 164, 178, 0.22),
    0 18px 34px rgba(23, 59, 70, 0.12);
}

.gesture-title {
  position: absolute;
  left: 12px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(9, 48, 61, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 1000;
}

.gesture-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 3;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  color: #214257;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.22;
  text-align: center;
}

.caption-line {
  bottom: 42px;
}

.caption-press {
  bottom: 10px;
  opacity: 0;
}

.lesson-video.is-playing .caption-line {
  animation: gestureLineCaption 12s linear infinite;
}

.lesson-video.is-playing .caption-press {
  animation: gesturePressCaption 12s linear infinite;
}

.gesture-track {
  position: absolute;
  right: 30px;
  top: 44px;
  width: 30px;
  height: 100px;
  border-radius: 999px;
  background: rgba(37, 164, 178, 0.2);
  box-shadow: inset 0 0 0 2px rgba(37, 164, 178, 0.18);
}

.gesture-track::before,
.gesture-track::after {
  position: absolute;
  left: 50%;
  color: #2b8794;
  font-size: 22px;
  font-weight: 1000;
  transform: translateX(-50%);
}

.gesture-track::before {
  content: "↑";
  top: 5px;
}

.gesture-track::after {
  content: "↓";
  bottom: 5px;
}

.gesture-press-track {
  position: absolute;
  left: 30px;
  top: 72px;
  width: 42px;
  height: 72px;
  border-left: 4px solid rgba(255, 182, 72, 0.78);
  opacity: 0;
}

.gesture-press-track::after {
  content: "下压";
  position: absolute;
  left: -20px;
  bottom: -22px;
  width: 44px;
  color: #b96d16;
  font-size: 12px;
  font-weight: 1000;
  text-align: center;
}

html[lang="en"] .gesture-press-track::after {
  content: "Press";
}

.lesson-video.is-playing .gesture-press-track {
  animation: gesturePressTrack 12s linear infinite;
}

.gesture-hand-shape {
  position: absolute;
  left: 34px;
  top: 76px;
  width: 48px;
  height: 56px;
  border-radius: 18px 18px 22px 22px;
  background:
    radial-gradient(circle at 68% 20%, rgba(255, 255, 255, 0.58), transparent 14px),
    linear-gradient(180deg, #ffe0a6, #ef9d55);
  box-shadow:
    inset 0 -4px 0 rgba(160, 83, 38, 0.14),
    0 10px 18px rgba(96, 55, 30, 0.18);
}

.gesture-finger {
  position: absolute;
  bottom: 44px;
  width: 10px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe9bd, #f2a864);
  transform-origin: bottom center;
  box-shadow: inset 0 -3px 0 rgba(155, 75, 37, 0.12);
}

.index-finger {
  left: 5px;
  height: 46px;
  transform: rotate(-16deg);
}

.middle-finger {
  left: 17px;
  height: 52px;
}

.ring-finger {
  left: 29px;
  height: 47px;
  transform: rotate(8deg);
}

.little-finger {
  left: 40px;
  height: 36px;
  transform: rotate(18deg);
}

.gesture-thumb {
  position: absolute;
  left: -10px;
  top: 20px;
  width: 28px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1a45e, #ffe1aa);
  transform: rotate(-34deg);
}

.lesson-video.is-playing .line-gesture .gesture-hand-shape {
  animation: lineGestureHand 12s ease-in-out infinite;
}

.lesson-video.is-playing .line-gesture .gesture-finger,
.lesson-video.is-playing .line-gesture .gesture-thumb {
  animation: pressFingerCue 12s ease-in-out infinite;
}

.gesture-link-line {
  position: absolute;
  left: -64px;
  top: 96px;
  width: 78px;
  border-top: 3px dashed rgba(14, 124, 143, 0.42);
}

.gesture-link-line::after {
  content: "手势控制画面";
  position: absolute;
  left: -28px;
  top: -24px;
  width: 94px;
  color: #2b8794;
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
}

html[lang="en"] .gesture-link-line::after {
  content: "Gesture controls screen";
}

.cave-gesture {
  right: 18px;
  top: 48px;
  width: 170px;
  height: 170px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 0 0 2px rgba(37, 164, 178, 0.2),
    0 18px 34px rgba(23, 59, 70, 0.12);
}

.cave-open-caption,
.cave-close-caption {
  bottom: 10px;
}

.cave-close-caption {
  opacity: 0;
}

.lesson-video.is-playing .cave-open-caption {
  animation: caveOpenCaption 12s linear infinite;
}

.lesson-video.is-playing .cave-close-caption {
  animation: caveCloseCaption 12s linear infinite;
}

.cave-hand-open-shape,
.cave-hand-close-shape {
  position: absolute;
  left: 50%;
  top: 78px;
  width: 46px;
  height: 48px;
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(180deg, #ffe0a6, #ef9d55);
  box-shadow: 0 10px 18px rgba(96, 55, 30, 0.16);
  transform: translate(-50%, -50%);
}

.cave-hand-open-shape span,
.cave-hand-close-shape span {
  position: absolute;
  bottom: 38px;
  width: 10px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe9bd, #f2a864);
  transform-origin: bottom center;
}

.cave-hand-open-shape span:nth-child(1) {
  left: 4px;
  transform: rotate(-26deg);
}

.cave-hand-open-shape span:nth-child(2) {
  left: 16px;
  height: 52px;
  transform: rotate(-6deg);
}

.cave-hand-open-shape span:nth-child(3) {
  left: 28px;
  height: 48px;
  transform: rotate(12deg);
}

.cave-hand-open-shape span:nth-child(4) {
  left: 39px;
  height: 38px;
  transform: rotate(28deg);
}

.cave-hand-open-shape i,
.cave-hand-close-shape i {
  position: absolute;
  left: -12px;
  top: 18px;
  width: 30px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f1a45e, #ffe1aa);
  transform: rotate(-38deg);
}

.cave-hand-close-shape {
  opacity: 0;
}

.cave-hand-close-shape span {
  height: 34px;
}

.cave-hand-close-shape span:nth-child(1) {
  left: 6px;
  transform: rotate(-6deg);
}

.cave-hand-close-shape span:nth-child(2) {
  left: 17px;
}

.cave-hand-close-shape span:nth-child(3) {
  left: 28px;
}

.cave-hand-close-shape span:nth-child(4) {
  left: 37px;
  transform: rotate(8deg);
}

.lesson-video.is-playing .cave-hand-open-shape {
  animation: caveOpenHandShow 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-close-shape {
  animation: caveCloseHandShow 12s ease-in-out infinite;
}

.cave-gesture-arrow {
  position: absolute;
  left: 50%;
  top: 40px;
  width: 82px;
  height: 42px;
  border-top: 4px dashed rgba(43, 135, 148, 0.62);
  border-radius: 50%;
  transform: translateX(-50%);
}

.cave-gesture-arrow::before,
.cave-gesture-arrow::after {
  position: absolute;
  top: -18px;
  color: #2b8794;
  font-size: 20px;
  font-weight: 1000;
}

.cave-gesture-arrow::before {
  content: "打开";
  left: -24px;
}

.cave-gesture-arrow::after {
  content: "合拢";
  right: -24px;
}

html[lang="en"] .cave-gesture-arrow::before {
  content: "Open";
}

html[lang="en"] .cave-gesture-arrow::after {
  content: "Close";
}

@keyframes lineGestureHand {
  0%, 12% { transform: translateY(34px) scale(1); }
  24%, 34% { transform: translateY(-30px) scale(1); }
  45%, 55% { transform: translateY(34px) scale(1); }
  60%, 66% { transform: translateY(0) scale(1); }
  68%, 74% { transform: translateY(50px) scale(0.94); }
  78%, 86% { transform: translateY(-6px) scale(1); }
  92%, 100% { transform: translateY(34px) scale(1); }
}

@keyframes pressFingerCue {
  0%, 62%, 82%, 100% { filter: none; }
  68%, 74% { filter: drop-shadow(0 0 8px rgba(255, 178, 58, 0.9)); }
}

@keyframes gestureLineCaption {
  0%, 52%, 84%, 100% { opacity: 1; }
  58%, 78% { opacity: 0; }
}

@keyframes gesturePressCaption {
  0%, 52%, 84%, 100% { opacity: 0; }
  58%, 78% { opacity: 1; }
}

@keyframes gesturePressTrack {
  0%, 52%, 84%, 100% { opacity: 0; transform: translateY(-8px); }
  60%, 76% { opacity: 1; transform: translateY(0); }
}

@keyframes caveOpenHandShow {
  0%, 46% { opacity: 1; transform: translate(-50%, -50%) scale(0.82); }
  24%, 42% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  52%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}

@keyframes caveCloseHandShow {
  0%, 48% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
  56%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(0.86); }
  84%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
}

@keyframes caveOpenCaption {
  0%, 46% { opacity: 1; }
  54%, 100% { opacity: 0; }
}

@keyframes caveCloseCaption {
  0%, 48% { opacity: 0; }
  56%, 78% { opacity: 1; }
  86%, 100% { opacity: 0; }
}

/* Cave gesture correction: one hand gradually opens and closes instead of swapping states. */
.cave-hand-close-shape {
  display: none;
}

.lesson-video.is-playing .cave-hand-open-shape {
  animation: cavePalmGradualMorph 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-open-shape span:nth-child(1) {
  animation: caveFingerOneMorph 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-open-shape span:nth-child(2) {
  animation: caveFingerTwoMorph 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-open-shape span:nth-child(3) {
  animation: caveFingerThreeMorph 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-open-shape span:nth-child(4) {
  animation: caveFingerFourMorph 12s ease-in-out infinite;
}

.lesson-video.is-playing .cave-hand-open-shape i {
  animation: caveThumbMorph 12s ease-in-out infinite;
}

@keyframes cavePalmGradualMorph {
  0%, 12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.84);
  }
  30%, 46% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  64%, 82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.86);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.84);
  }
}

@keyframes caveFingerOneMorph {
  0%, 12% {
    left: 8px;
    height: 34px;
    transform: rotate(-5deg);
  }
  30%, 46% {
    left: 4px;
    height: 46px;
    transform: rotate(-28deg);
  }
  64%, 82%, 100% {
    left: 8px;
    height: 34px;
    transform: rotate(-5deg);
  }
}

@keyframes caveFingerTwoMorph {
  0%, 12% {
    left: 17px;
    height: 36px;
    transform: rotate(0deg);
  }
  30%, 46% {
    left: 16px;
    height: 52px;
    transform: rotate(-7deg);
  }
  64%, 82%, 100% {
    left: 17px;
    height: 36px;
    transform: rotate(0deg);
  }
}

@keyframes caveFingerThreeMorph {
  0%, 12% {
    left: 27px;
    height: 36px;
    transform: rotate(0deg);
  }
  30%, 46% {
    left: 28px;
    height: 48px;
    transform: rotate(13deg);
  }
  64%, 82%, 100% {
    left: 27px;
    height: 36px;
    transform: rotate(0deg);
  }
}

@keyframes caveFingerFourMorph {
  0%, 12% {
    left: 36px;
    height: 32px;
    transform: rotate(6deg);
  }
  30%, 46% {
    left: 39px;
    height: 38px;
    transform: rotate(30deg);
  }
  64%, 82%, 100% {
    left: 36px;
    height: 32px;
    transform: rotate(6deg);
  }
}

@keyframes caveThumbMorph {
  0%, 12% {
    left: -6px;
    top: 22px;
    width: 24px;
    transform: rotate(-18deg);
  }
  30%, 46% {
    left: -14px;
    top: 16px;
    width: 32px;
    transform: rotate(-42deg);
  }
  64%, 82%, 100% {
    left: -6px;
    top: 22px;
    width: 24px;
    transform: rotate(-18deg);
  }
}

/* Rhythm Bridge gameplay clip */
.rhythm-scene {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.86), transparent 18%),
    radial-gradient(circle at 86% 20%, rgba(255, 255, 255, 0.72), transparent 15%),
    linear-gradient(180deg, #8dd9ff 0%, #d9f7ff 42%, #7cc9ed 43%, #2c8bd0 100%);
}

.demo-sky,
.demo-bridge-rail,
.demo-rhythm-board,
.demo-rhythm-kid,
.demo-rhythm-star,
.demo-rhythm-feedback,
.rhythm-forward-arrow,
.rhythm-gesture,
.rhythm-side,
.rhythm-hand-shape,
.rhythm-guide-dot {
  position: absolute;
}

.demo-sky {
  inset: 0;
  background:
    radial-gradient(ellipse at 14% 60%, rgba(94, 174, 107, 0.4), transparent 16%),
    radial-gradient(ellipse at 86% 62%, rgba(45, 132, 173, 0.38), transparent 15%);
  opacity: 0.9;
}

.demo-bridge-rail {
  left: 6%;
  right: 6%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d89c47, #ffe193, #b9792c);
  box-shadow: 0 3px 0 rgba(91, 56, 20, 0.28);
}

.rail-back { top: 38%; }
.rail-front { top: 76%; }

.demo-rhythm-board {
  top: 48%;
  width: 19%;
  height: 24%;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid rgba(128, 86, 29, 0.36);
  color: #4c3318;
  background:
    repeating-linear-gradient(90deg, rgba(80, 52, 20, 0.14) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #fff0b8, #dfa454);
  box-shadow: inset 0 -10px 0 rgba(92, 55, 22, 0.18), 0 10px 18px rgba(55, 83, 111, 0.18);
  font-size: 42px;
  font-weight: 950;
}

.demo-rhythm-board em {
  position: absolute;
  bottom: 9px;
  font-style: normal;
  font-size: 14px;
  font-weight: 950;
}

.rhythm-board-q1 { left: 10%; }
.rhythm-board-q2 { left: 31%; }

.rhythm-board-half {
  left: 52%;
  width: 28%;
  background:
    repeating-linear-gradient(90deg, rgba(41, 91, 51, 0.13) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #dcf8c7, #83cf8a);
}

.rhythm-board-rest {
  right: 6%;
  width: 12%;
  color: #6d5639;
  background:
    repeating-linear-gradient(90deg, rgba(88, 63, 30, 0.09) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #f8ead0, #d0b790);
}

.lesson-video.is-playing .rhythm-board-q1 { animation: rhythmBoardOneLight 12s linear infinite; }
.lesson-video.is-playing .rhythm-board-q2 { animation: rhythmBoardTwoLight 12s linear infinite; }
.lesson-video.is-playing .rhythm-board-half { animation: rhythmBoardHalfLight 12s linear infinite; }
.lesson-video.is-playing .rhythm-board-rest { animation: rhythmBoardRestLight 12s linear infinite; }

.demo-rhythm-glow {
  left: 10%;
  top: 48%;
  width: 19%;
  height: 24%;
  border-radius: 8px;
  border: 4px solid rgba(255, 243, 140, 0.96);
  box-shadow: 0 0 30px rgba(255, 228, 82, 0.86);
  pointer-events: none;
}

.lesson-video.is-playing .demo-rhythm-glow {
  animation: rhythmGlowFollow 12s linear infinite;
}

.demo-rhythm-kid {
  left: 12%;
  top: 39%;
  width: 58px;
  height: 76px;
  border-radius: 30px 30px 18px 18px;
  background: linear-gradient(180deg, #ffe08b 0 34%, #3090df 35% 76%, #174f9d 77% 100%);
  filter: drop-shadow(0 14px 8px rgba(34, 64, 80, 0.28));
}

.demo-rhythm-kid::before {
  content: "";
  position: absolute;
  left: 16px;
  top: -22px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffd08a;
  box-shadow: inset -6px 0 0 rgba(150, 72, 26, 0.18);
}

.demo-rhythm-kid::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 4px;
  width: 34px;
  height: 18px;
  border-radius: 18px 18px 8px 8px;
  background: #8b4b20;
}

.lesson-video.is-playing .demo-rhythm-kid {
  animation: rhythmKidWalk 12s ease-in-out infinite;
}

.rhythm-forward-arrow {
  left: 14%;
  top: 36%;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff8d5;
  background: rgba(17, 76, 105, 0.72);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 14px rgba(69, 216, 255, 0.24);
}

.demo-rhythm-star {
  left: 21%;
  top: 42%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #8a5c0c;
  background: radial-gradient(circle, #fff9c8, #ffd95e);
  box-shadow: 0 0 18px rgba(255, 214, 76, 0.72);
  font-weight: 1000;
}

.lesson-video.is-playing .demo-rhythm-star {
  animation: rhythmStarCollect 12s ease-in-out infinite;
}

.demo-rhythm-feedback {
  left: 39%;
  top: 28%;
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff7cf;
  background: linear-gradient(180deg, rgba(23, 75, 91, 0.94), rgba(13, 54, 70, 0.96));
  box-shadow: 0 0 18px rgba(69, 216, 255, 0.35);
  font-weight: 1000;
  opacity: 0;
}

.lesson-video.is-playing .demo-rhythm-feedback {
  animation: rhythmFeedbackPop 12s ease-in-out infinite;
}

.rhythm-gesture {
  right: 4%;
  top: 12%;
  width: 170px;
  height: 86px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.64);
  background: rgba(16, 68, 87, 0.78);
  box-shadow: 0 10px 22px rgba(25, 68, 94, 0.22);
}

.rhythm-gesture .gesture-title {
  left: 12px;
  top: 9px;
}

.rhythm-quarter-caption,
.rhythm-half-caption {
  left: 12px;
  right: 12px;
  bottom: 9px;
  color: #fff6ca;
  font-size: 11px;
  font-weight: 950;
  opacity: 0;
}

.lesson-video.is-playing .rhythm-quarter-caption {
  animation: rhythmCaptionOne 12s ease-in-out infinite;
}

.lesson-video.is-playing .rhythm-half-caption {
  animation: rhythmCaptionTwo 12s ease-in-out infinite;
}

.rhythm-side {
  top: 36px;
  color: #c7f9ff;
  font-size: 12px;
  font-weight: 1000;
}

.side-left { left: 18px; }
.side-right { right: 18px; }

.rhythm-hand-shape {
  left: 34px;
  top: 31px;
  width: 54px;
  height: 54px;
  transform-origin: 50% 100%;
}

.rhythm-wrist,
.rhythm-palm,
.rhythm-finger,
.rhythm-thumb {
  position: absolute;
  background: linear-gradient(180deg, #ffe7b6, #ffb45d);
  box-shadow: 0 0 0 1px rgba(128, 70, 24, 0.08), 0 3px 8px rgba(70, 38, 15, 0.13);
}

.rhythm-wrist {
  left: 23px;
  top: 40px;
  width: 14px;
  height: 24px;
  border-radius: 10px;
}

.rhythm-palm {
  left: 13px;
  top: 20px;
  width: 34px;
  height: 32px;
  border-radius: 18px 18px 14px 14px;
}

.rhythm-finger {
  bottom: 28px;
  width: 9px;
  height: 31px;
  border-radius: 9px;
  transform-origin: 50% 100%;
}

.finger-one {
  left: 14px;
  transform: rotate(-16deg);
}

.finger-two {
  left: 25px;
  height: 36px;
}

.finger-three {
  left: 36px;
  height: 30px;
  transform: rotate(14deg);
}

.rhythm-thumb {
  left: 2px;
  top: 30px;
  width: 24px;
  height: 10px;
  border-radius: 999px;
  transform: rotate(-33deg);
}

.lesson-video.is-playing .rhythm-hand-shape,
.lesson-video.is-playing .rhythm-guide-dot {
  animation: rhythmHandSwing 12s ease-in-out infinite;
}

.rhythm-guide-dot {
  left: 34px;
  top: 37px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #78ff9a;
  box-shadow: 0 0 0 5px rgba(120, 255, 154, 0.22), 0 0 18px rgba(120, 255, 154, 0.7);
}

.rhythm-scene .hand-impact { left: 6%; bottom: 8%; }
.rhythm-scene .role-impact { left: 36%; bottom: 8%; }
.rhythm-scene .success-impact { right: 5%; bottom: 8%; }

@keyframes rhythmBoardOneLight {
  0%, 12% { filter: brightness(1.32) drop-shadow(0 0 16px rgba(255, 221, 87, 0.8)); transform: translateY(-3px); }
  20%, 100% { filter: brightness(0.92); transform: translateY(0); }
}

@keyframes rhythmBoardTwoLight {
  0%, 18% { filter: brightness(0.92); transform: translateY(0); }
  21%, 34% { filter: brightness(1.32) drop-shadow(0 0 16px rgba(255, 221, 87, 0.8)); transform: translateY(-3px); }
  42%, 100% { filter: brightness(0.92); transform: translateY(0); }
}

@keyframes rhythmBoardHalfLight {
  0%, 58% { filter: brightness(0.92); transform: translateY(0); }
  64%, 78% { filter: brightness(1.32) drop-shadow(0 0 16px rgba(255, 221, 87, 0.8)); transform: translateY(-3px); }
  86%, 100% { filter: brightness(0.92); transform: translateY(0); }
}

@keyframes rhythmBoardRestLight {
  0%, 82% { filter: brightness(0.92); transform: translateY(0); }
  88%, 100% { filter: brightness(1.2) drop-shadow(0 0 14px rgba(255, 255, 255, 0.58)); transform: translateY(-2px); }
}

@keyframes rhythmGlowFollow {
  0%, 12% { opacity: 1; transform: translateX(0) scaleX(1); }
  21%, 28% { opacity: 1; transform: translateX(140px) scaleX(1); }
  64%, 68% { opacity: 1; transform: translateX(326px) scaleX(1.48); }
  88%, 100% { opacity: 0.78; transform: translateX(508px) scaleX(0.78); }
}

@keyframes rhythmKidWalk {
  0%, 10% { transform: translateX(0) translateY(0) rotate(-1deg); }
  21%, 28% { transform: translateX(140px) translateY(-2px) rotate(1deg); }
  64%, 68% { transform: translateX(326px) translateY(-2px) rotate(1deg); }
  100% { transform: translateX(508px) translateY(-2px) rotate(1deg); }
}

@keyframes rhythmHandSwing {
  0%, 10% { transform: translateX(0) rotate(-7deg); }
  21%, 28% { transform: translateX(86px) rotate(7deg); }
  64%, 68% { transform: translateX(0) rotate(-7deg); }
  100% { transform: translateX(0) rotate(-7deg); }
}

@keyframes rhythmStarCollect {
  0%, 18% { opacity: 1; transform: scale(1); }
  24%, 34% { opacity: 1; transform: scale(1.28) rotate(20deg); }
  42%, 100% { opacity: 0; transform: translateY(-28px) scale(0.6); }
}

@keyframes rhythmFeedbackPop {
  0%, 20% { opacity: 0; transform: translateY(8px) scale(0.9); }
  26%, 38% { opacity: 1; transform: translateY(0) scale(1); }
  48%, 100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

@keyframes rhythmCaptionOne {
  0%, 45% { opacity: 1; }
  52%, 100% { opacity: 0; }
}

@keyframes rhythmCaptionTwo {
  0%, 48% { opacity: 0; }
  56%, 86% { opacity: 1; }
  94%, 100% { opacity: 0; }
}

/* Layout refresh: one practice card pairs directly with one gameplay clip. */
.video-layout {
  grid-template-columns: minmax(0, 1fr);
}

.video-layout .practice-main {
  min-width: 0;
}

.video-layout .section-heading {
  align-items: end;
}

.video-layout .section-heading h2 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.98;
}

.video-layout .practice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.video-layout .practice-card.has-preview {
  display: grid;
  grid-template-columns: minmax(230px, 0.42fr) minmax(340px, 0.58fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.video-layout .featured-copy {
  justify-content: center;
}

.video-layout .lesson-video {
  position: relative;
  min-height: clamp(360px, 29vw, 440px);
  cursor: zoom-in;
}

.video-layout .lesson-video::after {
  content: "点击放大";
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  padding: 7px 10px;
  border: 1px solid rgba(31, 184, 201, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #0c7582;
  font-size: 12px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.video-layout .lesson-video:hover::after,
.video-layout .lesson-video:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.video-layout .video-scene {
  min-height: 240px;
}

.video-layout .teaching-points {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-panel {
  max-width: none;
}

.clip-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7, 24, 35, 0.72);
  backdrop-filter: blur(14px);
}

.clip-modal.is-open {
  display: flex;
}

body.clip-modal-open {
  overflow: hidden;
}

.clip-modal-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(244, 252, 253, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  padding: 14px;
}

.clip-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clip-modal-head strong {
  color: #102033;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 1000;
}

.clip-modal-close {
  min-height: 40px;
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #0c7582;
  padding: 0 14px;
  font-weight: 950;
}

.clip-modal-body {
  min-width: 0;
  overflow: auto;
}

.clip-modal-body .lesson-video {
  min-height: min(68vh, 720px);
  cursor: default;
}

.clip-modal-body .lesson-video::after {
  display: none;
}

@media (max-width: 1180px) {
  .video-layout .practice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .video-layout .practice-card.has-preview {
    grid-template-columns: 1fr;
  }

  .video-layout .lesson-video {
    min-height: 360px;
  }

  .video-layout .teaching-points {
    grid-template-columns: 1fr;
  }

  .clip-modal {
    padding: 10px;
  }
}

/* Motion Music v32: match the approved one-game-one-preview layout test. */
body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(31, 184, 201, 0.09) 0%, transparent 32%),
    linear-gradient(240deg, rgba(49, 110, 230, 0.1) 0%, transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #edf4f7 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 32, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 51, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.16));
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid rgba(31, 184, 201, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(223, 247, 250, 0.86));
  color: var(--teal);
  font-size: 22px;
  font-weight: 1000;
  box-shadow: 0 0 26px rgba(31, 184, 201, 0.18);
}

.brand strong {
  display: block;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
  font-weight: 1000;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--slate);
  font-size: 14px;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.button.soft {
  background: rgba(224, 246, 248, 0.9);
  color: var(--teal);
}

.button.ghost {
  border: 1px solid rgba(40, 78, 104, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  backdrop-filter: blur(12px);
}

.panel {
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 70px rgba(22, 52, 78, 0.13);
  backdrop-filter: blur(18px);
}

.intro-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.intro-strip h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 0.98;
  font-weight: 1000;
}

.intro-strip p,
.section-head p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--slate);
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 800;
  line-height: 1.55;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 128px);
  gap: 10px;
}

.flow-strip span {
  min-height: 74px;
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 11px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.flow-strip b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 17px;
}

.paired-section {
  margin-top: 18px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2,
.route-panel h2,
.parent-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  font-weight: 1000;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(224, 246, 248, 0.9);
  color: var(--teal);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.paired-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.goal-browser {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.goal-group {
  min-width: 0;
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 40px rgba(26, 77, 105, 0.06);
  overflow: hidden;
}

.goal-group.is-selected {
  border-color: rgba(31, 184, 201, 0.38);
  box-shadow: inset 0 0 0 1px rgba(31, 184, 201, 0.14), 0 18px 44px rgba(31, 184, 201, 0.12);
}

.goal-group summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "index title"
    "index note";
  gap: 4px 12px;
  align-items: center;
  min-height: 84px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.goal-group summary::-webkit-details-marker {
  display: none;
}

.goal-group summary span {
  grid-area: index;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(224, 246, 248, 0.92);
  color: var(--teal);
  font-size: 16px;
  font-weight: 1000;
}

.goal-group summary strong {
  grid-area: title;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(21px, 1.8vw, 30px);
  line-height: 1.05;
  font-weight: 1000;
}

.goal-group summary small {
  grid-area: note;
  min-width: 0;
  color: var(--slate);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.goal-practice-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.goal-practice {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 66px;
  border: 1px solid rgba(31, 184, 201, 0.2);
  border-radius: 8px;
  background: rgba(241, 251, 252, 0.92);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.goal-practice strong {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 1000;
}

.goal-practice span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.goal-practice.is-active {
  border-color: rgba(31, 184, 201, 0.5);
  background: linear-gradient(135deg, rgba(33, 196, 207, 0.18), rgba(255, 255, 255, 0.9));
}

.goal-practice.is-muted {
  cursor: default;
  opacity: 0.54;
}

.category-stack {
  display: grid;
  gap: 18px;
}

.music-category {
  display: none;
  gap: 12px;
  min-width: 0;
}

.music-category.is-selected {
  display: grid;
}

.music-category[aria-label="节奏与时值"],
.music-category[aria-label="Rhythm and duration"] {
  order: 2;
}

.music-category[aria-label="力度与表达"],
.music-category[aria-label="Dynamics and expression"] {
  order: 3;
}

.category-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 4px 2px 2px;
}

.category-index {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(31, 184, 201, 0.18);
  border-radius: 8px;
  background: rgba(224, 246, 248, 0.76);
  color: var(--teal);
  font-size: 16px;
  font-weight: 1000;
}

.category-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.08;
  font-weight: 1000;
}

.category-head p {
  margin: 4px 0 0;
  color: var(--slate);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.pair-card {
  display: grid;
  grid-template-columns: minmax(238px, 0.4fr) minmax(360px, 0.6fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.pair-card.is-active {
  border-color: rgba(31, 184, 201, 0.34);
  box-shadow: inset 0 0 0 1px rgba(31, 184, 201, 0.12);
}

.pair-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.pair-copy .card-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #eef7f8, #e4f0f2);
  color: var(--teal);
  font-size: 30px;
  font-weight: 1000;
}

.pair-copy .card-kicker {
  margin: 6px 0 0;
  color: var(--slate);
  font-size: 14px;
  font-weight: 950;
}

.pair-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3vw, 54px);
  line-height: 1;
  font-weight: 1000;
}

.pair-copy > p:not(.card-kicker) {
  margin: 0;
  color: var(--slate);
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 800;
  line-height: 1.62;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tag-row span {
  border-radius: 999px;
  background: rgba(224, 238, 241, 0.72);
  color: var(--teal);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 950;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.card-action,
.video-toggle {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 1000;
}

.card-action {
  background: var(--teal);
  color: white;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(24, 137, 150, 0.22);
}

.video-toggle {
  border: 1px solid rgba(31, 184, 201, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: var(--teal);
}

.pair-card .lesson-video.preview-frame {
  position: relative;
  min-width: 0;
  min-height: clamp(330px, 27vw, 430px);
  border-color: rgba(31, 184, 201, 0.22);
  background: rgba(239, 251, 253, 0.62);
  cursor: zoom-in;
  overflow: hidden;
}

.pair-card .video-header {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 12px 14px 8px;
}

.pair-card .video-header strong {
  font-size: 16px;
  color: var(--ink);
}

.pair-card .video-header > span:not(.preview-badge) {
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.preview-badge {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--teal);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 22px rgba(22, 52, 78, 0.1);
}

html[lang="zh-CN"] .pair-copy {
  gap: 8px;
}

html[lang="zh-CN"] .pair-copy > p:not(.card-kicker) {
  line-height: 1.44;
}

html[lang="zh-CN"] .tag-row {
  gap: 6px;
}

html[lang="zh-CN"] .tag-row span {
  padding: 7px 10px;
}

html[lang="zh-CN"] .pair-card .video-header {
  gap: 8px;
}

html[lang="zh-CN"] .pair-card .video-header strong,
html[lang="zh-CN"] .pair-card .video-header > span:not(.preview-badge) {
  white-space: nowrap;
}

.pair-card .video-scene {
  min-height: 270px;
}

.pair-card .teaching-points {
  display: none;
}

.clip-modal-body .teaching-points {
  display: grid;
}

.lower-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-top: 18px;
}

.route-panel,
.parent-panel {
  padding: 18px;
}

.route-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.route-list div {
  min-height: 124px;
  border: 1px solid rgba(40, 78, 104, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 14px;
}

.route-list b {
  display: block;
  color: rgba(12, 117, 130, 0.32);
  font-size: 28px;
  line-height: 1;
}

.route-list strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 1000;
}

.route-list span,
.parent-panel p {
  display: block;
  margin-top: 6px;
  color: var(--slate);
  font-weight: 850;
  line-height: 1.55;
}

.parent-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.parent-panel p {
  margin: 0;
}

@media (max-width: 1240px) {
  .paired-grid {
    grid-template-columns: 1fr;
  }

  .pair-card {
    grid-template-columns: minmax(240px, 0.36fr) minmax(360px, 0.64fr);
  }
}

@media (max-width: 920px) {
  .topbar,
  .section-head,
  .intro-strip {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .flow-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .goal-browser {
    grid-template-columns: 1fr;
  }

  .category-head {
    align-items: start;
  }

  .pair-card,
  .lower-layout {
    grid-template-columns: 1fr;
  }

  .route-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page {
    padding: 14px;
  }

  .nav-actions,
  .flow-strip,
  .route-list {
    grid-template-columns: 1fr;
  }

  .nav-actions {
    display: grid;
  }

  .intro-strip h1 {
    font-size: clamp(36px, 14vw, 56px);
  }

  .pair-card {
    padding: 12px;
  }

  .pair-copy h3 {
    font-size: 36px;
  }

  .pair-card .lesson-video.preview-frame {
    min-height: 350px;
  }
}

/* v136: compact English Motion Music copy and layout. English words are longer
   than Chinese, so the English page uses one wide demo row per game. */
html[lang="en"] .intro-strip {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.56fr);
  padding: 20px 24px;
}

html[lang="en"] .intro-strip h1 {
  max-width: 560px;
  font-size: clamp(46px, 5.2vw, 84px);
}

html[lang="en"] .intro-strip p,
html[lang="en"] .section-head p {
  max-width: 520px;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.42;
}

html[lang="en"] .flow-strip {
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  max-width: 520px;
}

html[lang="en"] .flow-strip span {
  min-height: 58px;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.26;
}

html[lang="en"] .flow-strip b {
  margin-bottom: 2px;
  font-size: 15px;
}

html[lang="en"] .paired-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

html[lang="en"] .category-stack {
  gap: 16px;
}

html[lang="en"] .category-head {
  gap: 10px;
}

html[lang="en"] .category-index {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

html[lang="en"] .category-head h3 {
  font-size: clamp(21px, 2vw, 30px);
}

html[lang="en"] .category-head p {
  max-width: 680px;
  font-size: 13px;
  line-height: 1.35;
}

html[lang="en"] .music-category {
  gap: 10px;
}

html[lang="en"] .pair-card {
  grid-template-columns: minmax(210px, 0.3fr) minmax(560px, 0.7fr);
  gap: 18px;
  padding: 14px;
}

html[lang="en"] .pair-copy {
  gap: 8px;
}

html[lang="en"] .pair-copy .card-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  font-size: 22px;
}

html[lang="en"] .pair-copy .card-kicker {
  font-size: 12px;
}

html[lang="en"] .pair-copy h3 {
  max-width: 260px;
  font-size: clamp(30px, 3vw, 50px);
  line-height: 0.96;
}

html[lang="en"] .pair-copy > p:not(.card-kicker) {
  max-width: 280px;
  font-size: 14px;
  line-height: 1.42;
}

html[lang="en"] .tag-row {
  gap: 6px;
}

html[lang="en"] .tag-row span {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
}

html[lang="en"] .card-action,
html[lang="en"] .video-toggle {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

html[lang="en"] .pair-card .lesson-video.preview-frame {
  min-height: clamp(300px, 23vw, 390px);
}

html[lang="en"] .pair-card .video-header {
  min-height: 38px;
  padding: 9px 12px 6px;
}

html[lang="en"] .pair-card .video-header strong {
  font-size: 14px;
}

html[lang="en"] .pair-card .video-header > span:not(.preview-badge) {
  font-size: 12px;
}

html[lang="en"] .preview-badge {
  padding: 5px 9px;
  font-size: 11px;
}

html[lang="en"] .pair-card .video-scene {
  min-height: 246px;
}

html[lang="en"] .scene-title {
  max-width: min(360px, calc(100% - 28px));
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.18;
}

html[lang="en"] .gesture-title,
html[lang="en"] .demo-feedback,
html[lang="en"] .impact-label {
  font-size: 11px;
}

html[lang="en"] .gesture-caption {
  font-size: 10px;
  line-height: 1.14;
}

html[lang="en"] .line-gesture {
  width: 124px;
  height: 168px;
}

html[lang="en"] .cave-gesture,
html[lang="en"] .rhythm-gesture {
  transform: scale(0.88);
  transform-origin: top right;
}

html[lang="en"] .teaching-points {
  font-size: 13px;
}

html[lang="en"] .lower-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
}

html[lang="en"] .section-head h2,
html[lang="en"] .route-panel h2,
html[lang="en"] .parent-panel h2 {
  font-size: clamp(28px, 3.3vw, 52px);
}

html[lang="en"] .route-list div {
  min-height: 104px;
  padding: 12px;
}

html[lang="en"] .route-list strong {
  font-size: 18px;
}

html[lang="en"] .route-list span,
html[lang="en"] .parent-panel p {
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1240px) {
  html[lang="en"] .pair-card {
    grid-template-columns: minmax(190px, 0.32fr) minmax(420px, 0.68fr);
  }
}

@media (max-width: 920px) {
  html[lang="en"] .intro-strip,
  html[lang="en"] .pair-card,
  html[lang="en"] .lower-layout {
    grid-template-columns: 1fr;
  }

  html[lang="en"] .pair-copy h3,
  html[lang="en"] .pair-copy > p:not(.card-kicker) {
    max-width: none;
  }
}
