:root {
  /* Warm cream + playful accents */
  --bg: #FFF6E6;
  --bg-2: #FFE9D2;
  --surface: #FFFFFF;
  --ink: #2A2244;
  --ink-soft: #5B5478;
  --muted: #8B85A3;
  --line: #E9DFC8;

  --purple: #7C5CFF;
  --purple-deep: #5B3DE0;
  --pink: #FF6FB5;
  --blue: #4DA8FF;
  --green: #45C26B;
  --green-deep: #2DA052;
  --yellow: #FFD23F;
  --red: #FF5A5A;
  --red-deep: #E03A3A;

  --shadow-card: 0 18px 28px -16px rgba(43, 33, 80, 0.22), 0 4px 10px -4px rgba(43, 33, 80, 0.10);
  --shadow-pop: 0 26px 44px -18px rgba(124, 92, 255, 0.45);

  --radius-card: 22px;
  --radius-lg: 30px;

  --font-display: 'Fredoka', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --mosolykulcs-pink: #E91E63;
  --demo-banner-height: 44px;
  --solo-edge-nav-size: 44px;
  --solo-edge-nav-icon: 22px;
  --solo-edge-nav-bg: rgba(255, 255, 255, 0.94);
  --solo-edge-nav-color: var(--purple-deep);
  --solo-edge-nav-border: rgba(124, 92, 255, 0.22);
  --solo-edge-nav-shadow: 0 8px 20px -12px rgba(43, 33, 80, 0.32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient blobs */
.bg-blobs {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55;
}
.blob--a { width: 520px; height: 520px; left: -160px; top: -120px; background: #FFD79B; }
.blob--b { width: 480px; height: 480px; right: -140px; top: 30%; background: #BFD9FF; }
.blob--c { width: 460px; height: 460px; left: 30%; bottom: -180px; background: #FFC9E2; }

/* Demo mode banner (solo practice only) */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: var(--demo-banner-height);
  padding: 8px clamp(12px, 3vw, 24px);
  background: linear-gradient(135deg, var(--mosolykulcs-pink) 0%, #C2185B 100%);
  color: #fff;
  box-shadow: 0 4px 14px -6px rgba(194, 24, 91, .45);
}
.demo-banner[hidden] { display: none !important; }
.demo-banner-text {
  margin: 0;
  font-size: clamp(13px, 1.35vw, 15px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.demo-banner-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .2px;
}
.demo-banner-cta {
  flex: 0 0 auto;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--mosolykulcs-pink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(42, 34, 68, .35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.demo-banner-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(42, 34, 68, .4);
}
.demo-banner-cta:active { transform: translateY(0); }

body.solo-mode .demo-banner {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
  color: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px -6px rgba(91, 61, 224, 0.45);
  min-height: 0;
  padding: 6px 12px;
  gap: 0;
  z-index: 58;
}
body.solo-mode .demo-banner .solo-task-nav--top,
body.solo-mode .demo-banner-cta {
  display: none !important;
}
body.solo-mode .demo-banner-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
body.solo-mode .demo-banner-text strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.solo-task-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.solo-task-nav-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--mosolykulcs-pink);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px -8px rgba(42, 34, 68, .35);
  transition: transform 160ms ease, opacity 160ms ease;
}
.solo-task-nav-btn:hover:not(:disabled) { transform: translateY(-1px); }
.solo-task-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.solo-task-nav-indicator {
  min-width: 3.5rem;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .2px;
}
.solo-task-nav--bottom {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 56;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px clamp(12px, 3vw, 24px) calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 246, 230, 0.96);
  border-top: 1px solid rgba(233, 223, 200, 0.86);
  box-shadow: 0 -4px 18px -8px rgba(43, 33, 80, .22);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}
body.solo-mode .solo-task-section.solo-task-active .solo-task-nav--bottom,
body.solo-mode .orbit.solo-task-section.solo-task-active .solo-task-nav--bottom {
  display: inline-flex;
}
.orbit.solo-task-section > .solo-task-nav--bottom,
.orbit-2b.solo-task-section > .solo-task-nav--bottom {
  grid-column: 1 / -1;
  justify-self: center;
}

/* Solo mobil: D2 – élszél gombok + alul pontok (feladat oldalon) */
.solo-task-nav--edge {
  display: none;
}
@media (max-width: 640px) {
  body.solo-mode.solo-mobile-edge-nav-active:not(.classroom-locked) {
    padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav--edge {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 57;
    pointer-events: none;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-section .solo-task-nav--bottom,
  body.solo-mode.solo-mobile-edge-nav-active .orbit.solo-task-section > .solo-task-nav--bottom,
  body.solo-mode.solo-mobile-edge-nav-active .orbit-2b.solo-task-section > .solo-task-nav--bottom {
    display: none !important;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-indicator,
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-float-pill {
    display: none !important;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge {
    pointer-events: auto;
    position: fixed;
    top: 50%;
    width: var(--solo-edge-nav-size);
    height: var(--solo-edge-nav-size);
    min-width: var(--solo-edge-nav-size);
    min-height: var(--solo-edge-nav-size);
    padding: 0;
    border: 1.5px solid var(--solo-edge-nav-border);
    border-radius: 999px;
    background: var(--solo-edge-nav-bg);
    color: var(--solo-edge-nav-color);
    font-size: var(--solo-edge-nav-icon);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--solo-edge-nav-shadow);
    transform: translateY(-50%);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    backdrop-filter: blur(10px) saturate(1.15);
    transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge:hover:not(:disabled) {
    border-color: rgba(124, 92, 255, 0.42);
    box-shadow: 0 10px 24px -12px rgba(124, 92, 255, 0.28);
    transform: translateY(calc(-50% - 1px));
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge.solo-task-nav-btn--prev {
    left: max(2px, env(safe-area-inset-left, 0px));
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge.solo-task-nav-btn--next {
    right: max(2px, env(safe-area-inset-right, 0px));
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-dots {
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.28);
    transition: width 0.18s ease, height 0.18s ease, background 0.18s ease;
  }
  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-dot.is-active {
    width: 12px;
    height: 12px;
    background: var(--purple);
  }
}

/* Landing iframe embed: keep edge nav off cards, compact header readable */
@media (max-width: 640px) {
  html.solo-landing-embed body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge {
    top: auto;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    transform: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 20px;
  }
  html.solo-landing-embed body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav-btn--edge:hover:not(:disabled) {
    transform: none;
  }
  html.solo-landing-embed body.solo-mode .orbit.solo-task-section.solo-task-active .cards,
  html.solo-landing-embed body.solo-mode .orbit-2b.solo-task-section.solo-task-active .cards {
    padding-top: 6px;
  }
  html.solo-landing-embed body.solo-mode .rabbit-task.solo-task-active .rabbit-progress {
    min-height: clamp(120px, 34vw, 160px);
    max-height: 160px;
  }
}
@media (max-width: 640px) {
  .demo-banner .solo-task-nav--top { display: none; }
}

/* Solo: megerősítés befejezetlen nyuszi-feladatnál */
.solo-leave-confirm {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 16px calc(52px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.solo-leave-confirm:not([hidden]) {
  pointer-events: auto;
}
.solo-leave-confirm[hidden] {
  display: none !important;
}
.solo-leave-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(42, 34, 68, 0.08) 0%,
    rgba(42, 34, 68, 0.22) 55%,
    rgba(42, 34, 68, 0.28) 100%
  );
}
.solo-leave-confirm__card {
  position: relative;
  z-index: 1;
  width: min(100%, 340px);
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid var(--line);
  box-shadow: 0 18px 36px -16px rgba(43, 33, 80, 0.32);
  animation: soloLeavePop 0.22s cubic-bezier(0.2, 0.7, 0.3, 1.15) both;
}
.solo-leave-confirm__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.solo-leave-confirm__text {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.4;
}
.solo-leave-confirm__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.solo-leave-confirm__btn {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.solo-leave-confirm__btn:active {
  transform: translateY(1px);
}
.solo-leave-confirm__btn--no {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}
.solo-leave-confirm__btn--no:hover {
  background: rgba(124, 92, 255, 0.06);
  color: var(--ink);
}
.solo-leave-confirm__btn--yes {
  border: 0;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(124, 92, 255, 0.45);
}
.solo-leave-confirm__btn--yes:hover {
  box-shadow: 0 12px 26px -10px rgba(124, 92, 255, 0.52);
}
@keyframes soloLeavePop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.solo-compact-header {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 4px;
}
.solo-compact-header .solo-task-nav-btn {
  flex: 0 0 auto;
}
.solo-compact-header-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  max-width: 100%;
}
body.solo-mode:not(.classroom-locked) .solo-compact-header {
  display: none !important;
}

body.solo-mode .solo-task-section { display: none !important; }
body.solo-mode .solo-task-section.solo-task-active { display: block !important; }
body.solo-mode .orbit.solo-task-section.solo-task-active { display: grid !important; }
body.classroom-paged-mode .solo-task-section { display: none !important; }
body.classroom-paged-mode .solo-task-section.solo-task-active { display: block !important; }
body.classroom-paged-mode .orbit.solo-task-section.solo-task-active { display: grid !important; }
body.classroom-paged-mode .solo-task-section.solo-task-active .solo-task-nav--bottom {
  display: inline-flex;
}


/* Topbar — fixed so it's always visible at the top of the viewport,
   even if a child container creates an unexpected stacking/scroll context. */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 8px clamp(14px, 3vw, 28px);
  background: rgba(255, 246, 230, 0.92);
  border-bottom: 1px solid rgba(233, 223, 200, 0.72);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 6px 18px -16px rgba(43, 33, 80, .28);
  overflow: visible;
}
/* Solo/demo mode: opaque chrome — no scroll bleed-through in iframe preview */
body.solo-mode .topbar {
  top: var(--demo-banner-height);
  z-index: 55;
  background: #FFF6E6;
  border-bottom-color: #E9DFC8;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 2px 12px rgba(42, 34, 68, .12);
  isolation: isolate;
}
body.solo-mode .task-banner {
  background: #fff;
  border-color: #E9DFC8;
}
body.solo-mode .score-pill {
  box-shadow: 0 10px 22px -12px rgba(124, 92, 255, .45);
}
/* Reserve space at the top of the document so the fixed topbar
   doesn't cover the first row of stage content. The landing view
   hides .topbar entirely, so no offset is needed there. */
body:not(.classroom-locked) { padding-top: 60px; }
body.solo-mode:not(.classroom-locked) {
  padding-top: calc(var(--demo-banner-height) + 60px);
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 640px) {
  body:not(.classroom-locked) { padding-top: 54px; }
  body.solo-mode:not(.classroom-locked) {
    padding-top: var(--demo-banner-height, 28px);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  body.solo-mode.solo-mobile-nav-visible:not(.classroom-locked) {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  body.solo-mode:not(.classroom-locked):not(.classroom-paged-mode) .classroom-panel {
    display: none !important;
  }
  body.solo-mode:not(.classroom-locked):not(.classroom-paged-mode) .topbar {
    display: none !important;
  }
  body.classroom-paged-mode:not(.classroom-locked) .topbar {
    display: flex !important;
  }
  body.solo-mode .solo-task-nav--bottom {
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      visibility 0.22s ease;
  }
  body.solo-mode .solo-task-nav--bottom:not(.is-scroll-revealed) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
  }
  body.solo-mode:not(.classroom-locked) .stage {
    padding: 10px 8px 12px;
  }
  body.solo-mode .tongue-task,
  body.solo-mode .rabbit-task {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 20px;
  }
  body.solo-mode .tongue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body.solo-mode .tongue-card {
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 6px;
    border-radius: 16px;
    gap: 4px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "visual visual"
      "copy confirm";
    align-content: stretch;
  }
  body.solo-mode .tongue-play {
    grid-area: visual;
    min-height: 0;
    height: 100%;
    align-self: stretch;
  }
  body.solo-mode .tongue-visual {
    min-height: 0;
    height: 100%;
    aspect-ratio: 1 / 1;
  }
  body.solo-mode .mouth-scene.photo-motion-demo {
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
  }
  body.solo-mode .mouth-scene:not(.photo-motion-demo) {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
  }
  body.solo-mode .photo-motion-frame,
  body.solo-mode .photo-motion-video,
  body.solo-mode .photo-motion-poster {
    max-height: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  body.solo-mode .tongue-copy {
    grid-area: copy;
    align-self: end;
    min-width: 0;
  }
  body.solo-mode .tongue-confirm {
    grid-area: confirm;
    align-self: end;
    justify-self: end;
    width: 36px;
    height: 36px;
    margin-top: 0;
  }
  body.solo-mode .tongue-task-line {
    display: none;
  }
  body.solo-mode .tongue-title {
    font-size: 10px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body.solo-mode .tongue-task.solo-task-active .solo-demo-end-notice--bottom {
    margin-top: 14px;
    margin-bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  }
  body.solo-mode .orbit,
  body.solo-mode .orbit-2b {
    gap: 8px;
  }
  body.solo-mode .orbit .card,
  body.solo-mode .orbit-2b .card {
    min-height: 92px;
    padding: 6px 5px 8px;
    border-radius: 14px;
  }
  body.solo-mode .card .illu img {
    max-height: 48px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }
  body.solo-mode .card .label {
    font-size: 12px;
  }
  body.solo-mode .prompt-card {
    padding: 12px 10px;
    border-radius: 16px;
  }
  body.solo-mode .prompt-text {
    font-size: 13px;
  }
  body.solo-mode .rabbit-progress {
    min-height: 200px;
  }
  body.solo-mode .rabbit-runner {
    width: 72px;
  }
  /* Solo nyuszi (1. feladat): sticky játéktér + felfelé tömörülő szólista */
  body.solo-mode .rabbit-task .section-heading {
    display: none;
  }
  body.solo-mode .rabbit-task.solo-task-active .rabbit-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  body.solo-mode .rabbit-task.solo-task-active .rabbit-progress {
    position: sticky;
    top: var(--demo-banner-height, 28px);
    z-index: 12;
    min-height: clamp(140px, 38vw, 180px);
    max-height: 180px;
    flex-shrink: 0;
    border-radius: 20px;
  }
  body.solo-mode .rabbit-task .word-panel {
    padding: 10px;
    gap: 10px;
    border-radius: 20px;
  }
  body.solo-mode .rabbit-task .rabbit-score {
    padding: 8px 10px;
    font-size: 13px;
  }
  body.solo-mode .rabbit-task .word-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-template-columns: unset;
  }
  body.solo-mode .rabbit-task .word-chip {
    min-height: 48px;
    padding: 10px 12px 10px 10px;
    font-size: 15px;
    transition:
      opacity .2s ease,
      transform .2s ease,
      max-height .25s ease,
      padding .25s ease,
      margin .25s ease,
      border-width .25s ease;
  }
  body.solo-mode .rabbit-task .word-chip.is-current {
    border-color: #7ECF97;
    box-shadow: 0 12px 22px -14px rgba(43, 33, 80, .34);
  }
  body.solo-mode .rabbit-task .word-chip:not(.is-current) {
    opacity: 0.78;
    pointer-events: none;
  }
  body.solo-mode .rabbit-task .word-chip.is-removing {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    max-height: 0;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-width: 0;
    overflow: hidden;
    pointer-events: none;
  }
  /* Solo choice (2–3. feladat): sticky motor prompt + görgethető kártyarács */
  body.solo-mode .r-choice-heading {
    display: none !important;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active {
    display: block !important;
    gap: 0;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card {
    position: sticky;
    top: var(--demo-banner-height, 28px);
    z-index: 14;
    flex-shrink: 0;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 8px 12px;
    margin: 0 0 8px;
    grid-column: unset !important;
    grid-row: unset !important;
    overflow: visible;
    background: linear-gradient(160deg, #FFFFFF 0%, #FFF1F8 100%);
    box-shadow: 0 8px 20px -10px rgba(43, 33, 80, .28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card.solo-motor-is-fixed,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card.solo-motor-is-fixed {
    position: fixed;
    top: var(--demo-banner-height, 28px);
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    margin: 0;
  }
  body.solo-mode .solo-choice-motor-placeholder {
    display: block;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card::after,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card::after {
    display: none;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card .prompt-motor,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card .prompt-motor {
    width: 54px;
    margin: 0;
    flex-shrink: 0;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card .prompt-title,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card .prompt-title {
    font-size: 15px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .prompt-card .reset-btn,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .prompt-card .reset-btn {
    display: none;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .cards,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.solo-mode .orbit.solo-task-section.solo-task-active .card,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active .card {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .demo-banner { gap: 8px; padding: 8px 12px; }
}
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
.brand-logo { display: inline-flex; }
.brand-logo svg { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.brand-text span { font-size: 11.5px; color: var(--ink-soft); }

.task-banner {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-width: min(480px, 42vw);
  max-width: 100%;
  flex: 1 1 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(233, 223, 200, 0.86);
  box-shadow: 0 10px 22px -18px rgba(43, 33, 80, 0.32);
  transition: background .25s ease, border-color .25s ease;
}
.task-motor {
  width: 30px; height: 30px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #FFF7DC;
}
.task-motor svg { width: 26px; height: 26px; }
.task-banner span:last-child { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.task-banner strong {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.35vw, 15.5px);
  letter-spacing: .1px;
}
.task-banner small { color: var(--ink-soft); font-weight: 800; font-size: 11px; margin-top: 1px; }

.score-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  color: #fff; font-weight: 700; font-size: 13.5px;
  box-shadow: var(--shadow-pop);
}
.score-pill[hidden] { display: none; }
.score-pill .score-icon svg { width: 18px; height: 18px; }
.score-icon { display: inline-flex; }
.score-text strong { font-variant-numeric: tabular-nums; }

/* Stage layout */
.stage {
  position: relative; z-index: 1;
  padding: 24px clamp(12px, 3vw, 32px) 32px;
  max-width: 1280px; margin: 0 auto;
}

/* Tongue exercise task */
.solo-demo-end-notice {
  display: none;
}
body.solo-mode .tongue-task.solo-task-active .solo-demo-end-notice {
  display: grid;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 241, 248, 0.96) 100%);
  border: 1.5px solid rgba(124, 92, 255, 0.22);
  box-shadow: 0 10px 24px -16px rgba(43, 33, 80, 0.28);
  text-align: center;
}
body.solo-mode .tongue-task.solo-task-active .solo-demo-end-notice--bottom {
  margin-top: 16px;
}
body.solo-mode .solo-demo-end-notice__kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
}
body.solo-mode .solo-demo-end-notice__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.4vw, 18px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
body.solo-mode .solo-demo-end-notice__text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.4;
}
body.solo-mode .solo-demo-end-notice__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mosolykulcs-pink) 0%, #C2185B 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 22px -12px rgba(233, 30, 99, 0.45);
}
body.solo-mode .solo-demo-end-notice__cta:hover {
  transform: translateY(-1px);
}
.tongue-task {
  padding: clamp(18px, 3vw, 30px);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 210, 63, .22), transparent 28%),
    radial-gradient(circle at 92% 15%, rgba(77, 168, 255, .18), transparent 24%),
    rgba(255, 255, 255, .66);
  border: 1.5px solid rgba(233, 223, 200, .9);
  border-radius: 34px;
  box-shadow: 0 26px 40px -26px rgba(43, 33, 80, .24);
  margin-bottom: clamp(30px, 5vw, 58px);
}
.tongue-heading {
  margin-bottom: 18px;
  align-items: center;
}
.tongue-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
}
.tongue-card {
  position: relative;
  min-height: 278px;
  padding: 12px;
  border: 1.5px solid #E8DFC8;
  border-radius: 24px;
  background:
    radial-gradient(circle at 26% 12%, rgba(255, 255, 255, .98), transparent 36%),
    linear-gradient(160deg, #FFFFFF 0%, #FFF4E6 100%);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  cursor: default;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .18s cubic-bezier(.16, 1, .3, 1),
    box-shadow .18s cubic-bezier(.16, 1, .3, 1),
    border-color .18s cubic-bezier(.16, 1, .3, 1),
    background .18s cubic-bezier(.16, 1, .3, 1);
}
.tongue-card:has(.tongue-play:hover),
.tongue-card:has(.tongue-confirm:hover),
.tongue-card.is-playing {
  transform: translateY(-3px);
  border-color: #F2B77C;
  box-shadow: 0 22px 30px -16px rgba(43, 33, 80, .28);
}
.tongue-play {
  width: 100%;
  display: grid;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tongue-play:focus-visible,
.tongue-confirm:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}
.tongue-visual {
  min-height: 186px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, .9), transparent 36%),
    linear-gradient(160deg, #FFFDF8, #F6EAD8);
  border: 1px solid #E9DDC6;
  overflow: hidden;
  transition: filter .24s ease, opacity .24s ease;
}
.tongue-play:hover .tongue-visual,
.tongue-play:focus-visible .tongue-visual,
.tongue-card.is-playing .tongue-visual {
  border-color: #F2B77C;
  box-shadow: inset 0 0 0 2px rgba(255, 210, 63, .22);
}
.mouth-scene {
  width: min(100%, 150px);
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(42, 34, 68, .14));
}
.mouth-scene.cheek-demo {
  width: min(100%, 168px);
}
.mouth-scene.photo-motion-demo {
  position: relative;
  display: block;
  width: min(100%, 190px);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: #F8E9C9;
}
.tongue-copy {
  display: grid;
  gap: 5px;
}
.tongue-title {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--ink);
}
.tongue-instruction,
.tongue-task-line {
  font-size: 12.5px;
  line-height: 1.28;
  font-weight: 700;
  color: var(--ink-soft);
}
.tongue-task-line strong {
  color: var(--purple-deep);
  font-weight: 900;
}
.tongue-confirm {
  align-self: center;
  width: 44px;
  height: 44px;
  margin-top: auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #BFEBCB;
  background:
    radial-gradient(circle at 34% 18%, rgba(255,255,255,.95), transparent 36%),
    linear-gradient(160deg, #FFFFFF 0%, #EEF8F0 100%);
  color: var(--green-deep);
  cursor: pointer;
  box-shadow: 0 10px 18px -14px rgba(45, 160, 82, .5);
  transition:
    transform .16s cubic-bezier(.16, 1, .3, 1),
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}
.tongue-confirm:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--green);
  box-shadow: 0 14px 22px -14px rgba(45, 160, 82, .58);
}
.tongue-card.is-playing .tongue-confirm {
  opacity: .5;
  pointer-events: none;
}
.tongue-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  transform: scale(0);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1.2);
  box-shadow: 0 8px 14px -5px rgba(45, 160, 82, .55);
}
.tongue-card.is-done {
  border-color: #BFEBCB;
  background: linear-gradient(160deg, #EEF8F0 0%, #E3F3E8 100%);
}
.tongue-card.is-done .tongue-visual {
  filter: grayscale(1);
  opacity: .54;
}
.tongue-card.is-done .tongue-title,
.tongue-card.is-done .tongue-instruction,
.tongue-card.is-done .tongue-task-line,
.tongue-card.is-done .tongue-task-line strong {
  color: var(--muted);
}
.tongue-card.is-done .tongue-check {
  transform: scale(1);
}
.tongue-card.is-done .tongue-confirm {
  background: linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%);
  border-color: var(--green-deep);
  color: #fff;
  box-shadow: 0 12px 20px -12px rgba(45, 160, 82, .65);
}

.mouth-scene .anim {
  transform-box: fill-box;
  transform-origin: center;
}
.mouth-scene .cheek { transform-box: fill-box; transform-origin: center; }
.mouth-scene .motion-extra { opacity: .92; }
.cheek-demo-frame {
  opacity: 0;
}
.cheek-demo-frame.frame-1 {
  opacity: 1;
}
.photo-motion-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1);
  will-change: opacity, transform;
  pointer-events: none;
  user-select: none;
}
.photo-motion-video {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
}
.photo-motion-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
.tongue-card.is-playing .photo-motion-poster {
  opacity: 0;
}
.tongue-card.is-playing .photo-motion-video {
  opacity: 1;
  visibility: visible;
  z-index: 3;
}
.photo-motion-frame.frame-1 {
  opacity: 1;
}
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .cheek-demo-frame,
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .photo-motion-frame,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .photo-motion-frame {
  animation-duration: 4.4s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-1,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-1 { animation-name: cheekFrameOne; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-2,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-2 { animation-name: cheekFrameTwo; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-3,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-3 { animation-name: cheekFrameThree; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-4,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-4 { animation-name: cheekFrameFour; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-5,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-5 { animation-name: cheekFrameFive; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-6,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-6 { animation-name: cheekFrameSix; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .frame-7,
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .frame-7 { animation-name: cheekFrameSeven; }
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .cheek-left,
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .cheek-right {
  animation: cheeksPulse 1.15s ease-in-out infinite;
}
.tongue-card[data-motion="cheeks"]:is(:hover, :focus-visible, .is-playing) .mouth-hole {
  animation: cheeksMouth 1.15s ease-in-out infinite;
}
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .kiss-lips {
  animation: kissToOpen 1.15s ease-in-out infinite;
}
.tongue-card[data-motion="kiss-open"]:is(:hover, :focus-visible, .is-playing) .mouth-hole {
  animation: openMouthTall 1.15s ease-in-out infinite;
}
.tongue-card[data-motion="lip-circle"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueCircle 1.8s linear infinite;
}
.tongue-card[data-motion="middle-left-right"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueSideMiddle 1.15s ease-in-out infinite;
}
.tongue-card[data-motion="cover-lips"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueCoverLips 1.25s ease-in-out infinite;
}
.tongue-card[data-motion="point-up-down"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tonguePointUpDown 1.05s ease-in-out infinite;
}
.tongue-card[data-motion="hold-stick"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueHoldStick 1.2s ease-in-out infinite;
}
.tongue-card[data-motion="hold-stick"]:is(:hover, :focus-visible, .is-playing) .stick {
  animation: stickTinyPulse 1.2s ease-in-out infinite;
}
.tongue-card[data-motion="vertical-stick"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueAroundVerticalStick 1.25s ease-in-out infinite;
}
.tongue-card[data-motion="horizontal-stick"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueAroundHorizontalStick 1.25s ease-in-out infinite;
}
.tongue-card[data-motion="inside-up-down"]:is(:hover, :focus-visible, .is-playing) .tongue {
  animation: tongueInsideUpDown 1.05s ease-in-out infinite;
}

@keyframes cheeksPulse {
  0%, 100% { transform: scale(.82); opacity: .42; }
  42% { transform: scale(1.2); opacity: .86; }
  72% { transform: scale(.66); opacity: .28; }
}
@keyframes cheeksMouth {
  0%, 100% { transform: scale(.72, .9); }
  44% { transform: scale(.48, .76); }
  72% { transform: scale(1.08, .68); }
}
@keyframes cheekFrameOne {
  0%, 8% { opacity: 1; transform: scale(1); }
  14%, 92% { opacity: 0; transform: scale(1.006); }
  98%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes cheekFrameTwo {
  0%, 8%, 28%, 100% { opacity: 0; transform: scale(1.004); }
  14%, 22% { opacity: 1; transform: scale(1.006); }
}
@keyframes cheekFrameThree {
  0%, 22%, 42%, 100% { opacity: 0; transform: scale(1.006); }
  28%, 36% { opacity: 1; transform: scale(1.01); }
}
@keyframes cheekFrameFour {
  0%, 36%, 56%, 100% { opacity: 0; transform: scale(1.006); }
  42%, 50% { opacity: 1; transform: scale(1.012); }
}
@keyframes cheekFrameFive {
  0%, 50%, 70%, 100% { opacity: 0; transform: scale(1.006); }
  56%, 64% { opacity: 1; transform: scale(1.008); }
}
@keyframes cheekFrameSix {
  0%, 64%, 84%, 100% { opacity: 0; transform: scale(1.004); }
  70%, 78% { opacity: 1; transform: scale(1.006); }
}
@keyframes cheekFrameSeven {
  0%, 78%, 98%, 100% { opacity: 0; transform: scale(1.002); }
  84%, 92% { opacity: 1; transform: scale(1.004); }
}
@keyframes kissToOpen {
  0%, 100% { transform: scale(.62, .72); }
  48% { transform: scale(1.22, 1.62); }
}
@keyframes openMouthTall {
  0%, 100% { transform: scale(.55, .6); opacity: .82; }
  48% { transform: scale(1.08, 1.55); opacity: 1; }
}
@keyframes tongueCircle {
  0% { transform: translate(0, -20px) rotate(-8deg); }
  25% { transform: translate(24px, 0) rotate(16deg); }
  50% { transform: translate(0, 21px) rotate(4deg); }
  75% { transform: translate(-24px, 0) rotate(-16deg); }
  100% { transform: translate(0, -20px) rotate(-8deg); }
}
@keyframes tongueSideMiddle {
  0%, 100% { transform: translateX(-24px); }
  50% { transform: translateX(24px); }
}
@keyframes tongueCoverLips {
  0%, 100% { transform: translateY(-18px) scaleX(1.12); }
  50% { transform: translateY(20px) scaleX(1.12); }
}
@keyframes tonguePointUpDown {
  0%, 100% { transform: translateY(-23px) scale(.78, 1.18); }
  50% { transform: translateY(23px) scale(.78, 1.18); }
}
@keyframes tongueHoldStick {
  0%, 18% { transform: translateY(12px) scale(.86); }
  38%, 100% { transform: translateY(-25px) scale(.8, 1.12); }
}
@keyframes stickTinyPulse {
  0%, 100% { transform: translateY(0); }
  42% { transform: translateY(-1px); }
}
@keyframes tongueAroundVerticalStick {
  0%, 100% { transform: translate(-27px, 0) rotate(-6deg); }
  50% { transform: translate(27px, 0) rotate(6deg); }
}
@keyframes tongueAroundHorizontalStick {
  0%, 100% { transform: translateY(-20px); }
  50% { transform: translateY(22px); }
}
@keyframes tongueInsideUpDown {
  0%, 100% { transform: translateY(8px) scale(.86, .78); }
  18%, 28% { transform: translateY(-6px) scale(.84, .76); }
  44% { transform: translateY(8px) scale(.86, .78); }
  62%, 72% { transform: translateY(12px) scale(.84, .76); }
  88% { transform: translateY(8px) scale(.86, .78); }
}

.r-choice-heading {
  margin: 0 0 18px;
}

.orbit {
  position: relative;
  display: grid;
  /* Desktop: prompt centered, cards in a 4-col grid wrapping around */
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  align-items: stretch;
}

/* Prompt card occupies center 2x2 on desktop */
.prompt-card {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFF1F8 100%);
  border: 1.5px solid #F2E5F5;
  border-radius: var(--radius-lg);
  padding: clamp(18px, 2.2vw, 26px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; box-shadow: var(--shadow-pop);
  position: relative; overflow: hidden;
}
.prompt-card::after {
  content: ""; position: absolute; inset: auto -40% -60% auto;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,210,63,0.35), transparent 70%);
}
.prompt-motor {
  width: clamp(136px, 17vw, 190px); aspect-ratio: 4/3;
  filter: drop-shadow(0 14px 18px rgba(124,92,255,0.22));
  animation: bob 3.4s ease-in-out infinite;
}
.prompt-motor-img { aspect-ratio: 1/1; }
.prompt-motor-img img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 18px;
}
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-6px) rotate(2deg)} }

.prompt-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 6px 0 0; line-height: 1.15;
}
.prompt-title span {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.prompt-text {
  margin: 2px 0 4px; color: var(--ink-soft); font-size: 15px; line-height: 1.5;
  max-width: 30ch;
}
.prompt-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #FFF4DA; color: #8A5A12; font-weight: 700; font-size: 12.5px;
  border: 1px solid #F2DFAF;
}

.reset-btn {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: #fff; color: var(--purple-deep);
  border: 1.5px solid #E4D9FF; font-family: var(--font-body); font-weight: 800;
  font-size: 14px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.reset-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -8px rgba(124,92,255,0.45); background: #FAF7FF; }
.reset-btn:active { transform: translateY(0); }
.reset-btn--solid { background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; border-color: transparent; }
.tongue-reset {
  margin-left: auto;
  align-self: start;
  white-space: nowrap;
}

/* Cards container = full grid; each card placed individually around the prompt */
.cards { display: contents; }

.card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 12px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 132px;
}
.card:hover { transform: translateY(-3px) rotate(-0.5deg); box-shadow: 0 22px 30px -16px rgba(43,33,80,0.28); }
.card:active:not(.is-locked) { transform: translateY(-1px) scale(0.98); }
.card:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.card .illu {
  width: clamp(72px, 8vw, 104px); aspect-ratio: 1/1; display: grid; place-items: center;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,.95), rgba(255,255,255,.32) 28%, transparent 46%),
    linear-gradient(155deg, #FFFDF8 0%, #F4EFE4 100%);
  border-radius: 20px; border: 1px solid #E9DDC6;
  box-shadow:
    inset 0 2px 12px rgba(255, 255, 255, .88),
    inset 0 -10px 18px rgba(42, 34, 68, .06),
    0 10px 18px -14px rgba(42, 34, 68, .38);
}
.card .illu svg {
  width: 88%; height: 88%; display: block;
  filter: drop-shadow(0 8px 8px rgba(42,34,68,.18)) saturate(.96) contrast(1.03);
}
.card .illu img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 6px 8px rgba(42,34,68,.14));
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 14px;
}
.card .illu { overflow: hidden; }
.card .label {
  font-weight: 800; font-size: 15px; color: var(--ink);
  letter-spacing: 0.1px;
}
.card .check {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff;
  transform: scale(0); transition: transform .2s ease;
  box-shadow: 0 6px 12px -4px rgba(45,160,82,0.55);
}
.card.is-correct .check { transform: scale(1); }
.card.is-correct {
  background: linear-gradient(160deg, #E9FBEE, #D6F5E1);
  border-color: #9FE3B5;
}
.card.is-correct .illu { background: linear-gradient(160deg,#FFFFFF,#EEFBF2); border-color:#BBE9C8; }
.card.is-correct .label { color: var(--green-deep); }

.card.is-locked { cursor: default; }
.card.is-locked:hover { transform: none; }

.card.is-wrong {
  animation: shake .42s cubic-bezier(.36,.07,.19,.97);
  background: linear-gradient(160deg, #FFEAEA, #FFD7D7);
  border-color: #FFB3B3;
}
@keyframes shake {
  10%,90% { transform: translateX(-2px) }
  20%,80% { transform: translateX(4px) }
  30%,50%,70% { transform: translateX(-7px) }
  40%,60% { transform: translateX(7px) }
}

/* --- 2b feladat: ugyanaz az orbit layout mint a 2-esnél, csak PNG képek --- */
.r-choice-2b-heading {
  margin-top: clamp(16px, 2.4vw, 28px);
}
/* A 2-es és 2b orbit egységes, tömör layout-tal */
.orbit, .orbit-2b {
  margin-top: 4px;
  gap: clamp(6px, 0.7vw, 12px);
}
.orbit .card, .orbit-2b .card {
  padding: 6px 8px 8px;
  gap: 3px;
  min-height: 0;
}
.orbit .card .illu, .orbit-2b .card .illu {
  width: clamp(64px, 6.4vw, 88px);
  border-radius: 14px;
  overflow: hidden;
}
.orbit .card .label, .orbit-2b .card .label {
  font-size: 13.5px;
}
/* A 2-es és 2b középső prompt-card-ot egységesen tömörebbé tesszük */
.prompt-card, .prompt-card-2b {
  padding: clamp(12px, 1.6vw, 18px);
  gap: 6px;
}
.prompt-card .prompt-motor, .prompt-card-2b .prompt-motor {
  width: clamp(96px, 11vw, 140px);
}
.prompt-card .prompt-title, .prompt-card-2b .prompt-title { font-size: clamp(18px, 1.9vw, 22px); margin-top: 2px; }
.prompt-card .prompt-text, .prompt-card-2b .prompt-text  { font-size: 13.5px; margin: 0; }

/* Rabbit word automation task */
.rabbit-task {
  margin-top: clamp(38px, 6vw, 72px);
  padding: clamp(18px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.52);
  border: 1.5px solid rgba(233, 223, 200, 0.86);
  border-radius: 34px;
  box-shadow: 0 26px 40px -26px rgba(43, 33, 80, 0.24);
}
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.section-kicker {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #E8FBEE;
  border: 1px solid #BFEBCB;
  color: var(--green-deep);
  font-weight: 900;
  font-size: 13px;
}
.section-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  margin: 0;
}
.section-heading p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.45;
}

/* === KIS LAPTOP OPTIMALIZÁCIÓ (max-height 700px): egy feladat egy képernyőn === */
/* Célja: hangfelismerő feladatok (L1, T1, K1, G1, D1, GY1, TY1, NY1, J1, S1) beleférjenek */
/* egy tipikus 1366x650 laptop viewportba scroll nélkül. */
@media (max-height: 720px) and (min-width: 900px) {
  main.stage {
    padding-top: 8px !important;
    padding-bottom: 12px !important;
  }
  .section-heading.r-choice-heading {
    margin-bottom: 6px;
    gap: 10px;
  }
  .section-heading.r-choice-heading h2 {
    font-size: clamp(18px, 2.2vw, 24px);
  }
  .section-heading.r-choice-heading p {
    margin-top: 2px;
    font-size: 13.5px;
  }
  .section-heading.r-choice-heading .section-kicker {
    padding: 5px 10px;
    font-size: 12px;
  }
  /* Prompt-card kompaktabb (középső hívóképes kártya) */
  .orbit .prompt-card,
  .orbit-2b .prompt-card,
  .orbit .prompt-card-2b,
  .orbit-2b .prompt-card-2b {
    padding: 10px 14px;
    gap: 4px;
  }
  .orbit .prompt-card .prompt-motor,
  .orbit-2b .prompt-card .prompt-motor {
    width: clamp(84px, 8.5vw, 112px);
  }
  .orbit .prompt-card .prompt-title,
  .orbit-2b .prompt-card .prompt-title {
    font-size: clamp(16px, 1.6vw, 20px);
    margin: 2px 0 0;
  }
  .orbit .prompt-card .reset-btn,
  .orbit-2b .prompt-card .reset-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    margin-top: 2px;
  }
  /* Tárgykártyák kompaktabbak */
  .orbit .card,
  .orbit-2b .card {
    min-height: 104px;
    padding: 10px 8px 8px;
    gap: 6px;
  }
  .orbit .card .illu,
  .orbit-2b .card .illu {
    width: clamp(56px, 5.6vw, 74px);
  }
  .orbit .card .label,
  .orbit-2b .card .label {
    font-size: 13px;
  }
}

.rabbit-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: clamp(16px, 2.2vw, 26px);
  align-items: stretch;
}
.rabbit-progress {
  --rabbit-x: 8%;
  --rabbit-y: 73%;
  position: relative;
  min-height: clamp(280px, 34vw, 430px);
  overflow: hidden;
  border-radius: 30px;
  border: 1.5px solid #E8DFC8;
  box-shadow:
    inset 0 1px 18px rgba(255, 255, 255, .86),
    0 18px 26px -22px rgba(43, 33, 80, .22);
  background: #FBFAF1;
}
.garden-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.rabbit-runner {
  position: absolute;
  left: var(--rabbit-x);
  top: var(--rabbit-y);
  width: clamp(112px, 13vw, 166px);
  transform: translate(-54%, -78%);
  transition: left .72s cubic-bezier(.22,.85,.28,1), top .72s cubic-bezier(.22,.85,.28,1);
  z-index: 2;
  filter: drop-shadow(0 10px 10px rgba(42, 34, 68, .18));
}
.rabbit-runner.is-hopping {
  animation: rabbitHop .72s cubic-bezier(.22,1,.36,1);
}
@keyframes rabbitHop {
  0% { margin-top: 0; rotate: 0deg; scale: 1; }
  18% { margin-top: -18px; rotate: -2deg; scale: 1.02; }
  48% { margin-top: -56px; rotate: -5deg; scale: 1.04; }
  78% { margin-top: -16px; rotate: 2deg; scale: 1.01; }
  100% { margin-top: 0; rotate: 0deg; scale: 1; }
}
.carrot-row {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.carrot {
  position: absolute;
  width: clamp(34px, 4vw, 54px);
  transform: translate(-50%, -50%) rotate(var(--tilt, -8deg));
  transition: opacity .28s ease, scale .28s ease, filter .28s ease;
  filter: drop-shadow(0 8px 7px rgba(92, 58, 26, .16));
}
.carrot.is-eaten {
  opacity: 0;
  scale: .58;
  filter: blur(2px);
}
.word-panel {
  background: rgba(255, 255, 255, .76);
  border: 1.5px solid #E8DFC8;
  border-radius: 28px;
  padding: clamp(14px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.rabbit-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 18px;
  padding: 10px 12px;
  background: #FFF7DC;
  border: 1px solid #F2DFAF;
  color: #805313;
  font-weight: 900;
}
.word-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.word-chip {
  position: relative;
  border: 1.5px solid #E5D8BF;
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 18%, rgba(255,255,255,.95), transparent 34%),
    linear-gradient(160deg, #FFFFFF 0%, #FFF6E6 100%);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  padding: 9px 12px 9px 9px;
  min-height: 44px;
  box-shadow: 0 10px 18px -16px rgba(43, 33, 80, .28);
  transition: transform .14s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.word-chip:hover { transform: translateY(-2px); border-color: #BFEBCB; }
.word-chip:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.word-chip::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 12px;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease;
}
.word-chip.is-done {
  color: var(--muted);
  background: linear-gradient(160deg, #EEF8F0 0%, #E3F3E8 100%);
  border-color: #BFEBCB;
}
.word-chip.is-done::after { transform: scaleX(1); }
.word-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.95), transparent 36%),
    linear-gradient(150deg, #FFFFFF, #F4EFE4);
  border: 1px solid #E9DDC6;
  box-shadow: inset 0 -7px 12px rgba(42, 34, 68, .05), 0 5px 10px -8px rgba(42, 34, 68, .34);
}
.word-icon svg {
  width: 88%;
  height: 88%;
  display: block;
  filter: drop-shadow(0 3px 3px rgba(42,34,68,.16));
}
.word-text { line-height: 1; }
.rabbit-reset { justify-content: center; width: 100%; }

/* Confetti canvas */
#confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
}

/* App-wide password gate (client-side deterrence) */
.app-password-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(42, 34, 68, 0.52);
  animation: fadeIn .2s ease both;
}
.app-password-gate[hidden] { display: none; }
.app-password-gate-card {
  position: relative;
  background: #fff;
  border-radius: 28px;
  padding: 28px 28px 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 30px 60px -20px rgba(43, 33, 80, 0.4);
  animation: pop .3s cubic-bezier(.2, .7, .3, 1.2) both;
}
.app-password-gate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(124, 92, 255, .08);
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.app-password-gate-close:hover {
  background: rgba(124, 92, 255, .16);
  color: var(--ink);
}
.app-password-gate-card h2 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 24px;
}
.app-password-gate-card p {
  color: var(--ink-soft);
  margin: 0 0 16px;
  font-size: 15px;
}
.app-password-gate-form {
  display: grid;
  gap: 10px;
  text-align: left;
}
.app-password-gate-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.app-password-gate-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(124, 92, 255, .22);
  font: inherit;
  font-size: 16px;
  background: #fff;
}
.app-password-gate-input:focus {
  outline: 2px solid rgba(124, 92, 255, .35);
  outline-offset: 1px;
}
.app-password-gate-error {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #c0392b;
  min-height: 1.2em;
}
.app-password-gate-submit {
  margin-top: 4px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C5CFF, #4DA8FF);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.app-password-gate-submit:hover { filter: brightness(1.05); }
.app-password-gate-cancel {
  margin-top: 2px;
  padding: 10px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.app-password-gate-cancel:hover {
  color: var(--ink);
  background: rgba(124, 92, 255, .08);
}
body.app-password-locked { overflow: hidden; }

/* Celebration overlay */
.celebrate {
  position: fixed; inset: 0; z-index: 6;
  background: rgba(42, 34, 68, 0.45);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .2s ease both;
}
.celebrate[hidden] { display: none; }
.celebrate-card {
  position: relative;
  background: #fff; border-radius: 28px; padding: 28px 28px 24px;
  text-align: center; max-width: 380px; width: 100%;
  box-shadow: 0 30px 60px -20px rgba(43,33,80,0.4);
  animation: pop .3s cubic-bezier(.2,.7,.3,1.2) both;
}
.celebrate-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.08);
  color: var(--ink-soft);
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.celebrate-close:hover {
  background: rgba(124, 92, 255, 0.16);
  color: var(--ink);
}
.celebrate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.celebrate-actions .reset-btn {
  width: 100%;
  min-height: 44px;
  margin: 0;
  font-size: 13px;
  padding: 10px 12px;
}
.celebrate-next-btn {
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
}
.celebrate-next-btn[hidden] {
  display: none;
}
body.solo-mode .celebrate {
  z-index: 70;
}
@media (max-width: 640px) {
  .celebrate-actions {
    grid-template-columns: 1fr;
  }
  .celebrate-actions .reset-btn {
    font-size: 14px;
  }
}
.celebrate-emoji { font-size: 54px; line-height: 1; }
.celebrate-card h2 { font-family: var(--font-display); margin: 8px 0 4px; font-size: 26px; }
.celebrate-card p { color: var(--ink-soft); margin: 0 0 16px; }

@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes pop { from{opacity:0; transform:scale(.85)} to{opacity:1; transform:scale(1)} }

/* ---- Responsive ---- */

/* Tablet: prompt at top, cards in 3 cols. Cancel inline grid placements. */
@media (max-width: 980px) {
  .tongue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orbit { grid-template-columns: repeat(3, 1fr); }
  .prompt-card { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .card { grid-column: auto !important; grid-row: auto !important; }
  .topbar { align-items: stretch; flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .score-pill { order: 2; margin-left: auto; }
  .task-banner { order: 3; flex: 1 0 100%; min-width: 0; border-radius: 22px; }
  .rabbit-board { grid-template-columns: 1fr; }
  .rabbit-progress { min-height: 340px; }
}

/* Phones: 2 cols, prompt compact */
@media (max-width: 620px) {
  .tongue-task { padding: 14px; border-radius: 26px; }
  .tongue-grid { grid-template-columns: 1fr; }
  body.solo-mode .tongue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tongue-card { min-height: 0; }
  .tongue-visual { min-height: 116px; }
  body.solo-mode .tongue-visual { min-height: 0; }
  body.solo-mode .orbit.solo-task-section.solo-task-active,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active {
    display: block !important;
  }
  .orbit { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .score-pill { font-size: 14px; padding: 8px 14px; }
  .brand-text span { display: none; }
  .brand-text strong { font-size: 17px; }
  .task-banner { padding: 8px 10px; gap: 8px; align-items: center; }
  .task-banner strong { font-size: 14px; }
  .task-banner small { display: none; }
  .task-motor { width: 32px; height: 32px; }
  .card { min-height: 118px; padding: 10px 8px 10px; }
  .card .label { font-size: 14px; }
  .prompt-card { padding: 18px 16px; }
  .prompt-text { font-size: 14px; }
  .section-heading { flex-direction: column; gap: 10px; }
  .rabbit-task { padding: 14px; border-radius: 26px; }
  .rabbit-progress { min-height: 290px; }
  .rabbit-runner { width: 98px; }
  .word-list { grid-template-columns: 1fr; }
  .word-chip { font-size: 16px; padding: 12px; }
}



/* Multiplayer óra mód */
[hidden] { display: none !important; }
body.classroom-locked .topbar,
body.classroom-locked .stage {
  display: none;
}
body.classroom-locked .classroom-panel {
  min-height: 100vh;
  display: grid;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: clamp(18px, 4vh, 48px);
  padding-bottom: clamp(18px, 4vh, 48px);
}
body.classroom-locked .classroom-shell {
  box-shadow: 0 34px 90px rgba(42, 34, 68, .22);
}
body.student-scroll-locked {
  overscroll-behavior: none;
}
body.student-scroll-locked::after {
  content: "A tanár vezérli a feladatot";
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(42, 34, 68, .9);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(42, 34, 68, .22);
  pointer-events: none;
}

.classroom-panel {
  position: relative;
  top: auto;
  z-index: 3;
  max-width: 1280px;
  margin: 18px auto 14px;
  padding: 0 clamp(12px, 3vw, 32px);
  pointer-events: none;
}
.classroom-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  border: 1.5px solid rgba(233, 223, 200, .92);
  border-radius: 28px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 22px 38px -24px rgba(42, 34, 68, .34);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  overflow: visible;
  pointer-events: auto;
}
/* When in the landing/locked state, treat the shell as a polished app
   card — softer corners, layered shadows, slightly more square,
   centered on screen with a generous surrounding panel. */
body.classroom-locked .classroom-shell {
  width: min(720px, 100%);
  max-width: min(720px, 94vw);
  border-radius: 38px;
  border-color: rgba(228, 217, 255, .92);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 210, 63, .18), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(77, 168, 255, .14), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #FBF7EE 100%);
  box-shadow:
    0 36px 70px -34px rgba(42, 34, 68, .38),
    0 12px 26px -18px rgba(124, 92, 255, .22),
    inset 0 1px 0 rgba(255, 255, 255, .92);
}
body.classroom-locked .classroom-body {
  padding: clamp(18px, 2.8vw, 28px);
  gap: 16px;
  border-top: 1px solid rgba(233, 223, 200, .55);
}
body.classroom-locked .classroom-panel:not(.has-selected-role) .classroom-toggle {
  display: none;
}
body.classroom-locked .classroom-panel:not(.has-selected-role) .classroom-body {
  border-top: none;
  padding-top: clamp(10px, 2vw, 18px);
}
.classroom-toggle {
  width: 100%;
  min-height: 70px;
  border: 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 210, 63, .26), transparent 36%),
    linear-gradient(135deg, #fff 0%, #fff7e7 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}
.classroom-toggle strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.05;
}
.classroom-toggle small {
  display: block;
  color: var(--ink-soft);
  font-weight: 800;
  margin-top: 2px;
}
.classroom-toggle:focus-visible,
.classroom-role-btn:focus-visible,
.classroom-primary:focus-visible,
.classroom-solo-btn:focus-visible,
.classroom-actions button:focus-visible,
.classroom-input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}
.classroom-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(69, 194, 107, .16);
  flex: 0 0 auto;
}
.classroom-body {
  display: grid;
  gap: 13px;
  padding: 16px;
  border-top: 1px solid rgba(233, 223, 200, .72);
  overflow: auto;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.classroom-back-btn {
  justify-self: start;
  margin: 0 0 2px;
  padding: 8px 14px;
  border: 1.5px solid rgba(124, 92, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--purple-deep);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.classroom-back-btn:hover {
  transform: translateY(-1px);
  background: rgba(124, 92, 255, .08);
  border-color: rgba(124, 92, 255, .34);
  box-shadow: 0 8px 16px -12px rgba(124, 92, 255, .35);
}
.classroom-back-btn:focus-visible {
  outline: 3px solid rgba(124, 92, 255, .35);
  outline-offset: 2px;
}
.classroom-panel.is-collapsed .classroom-body {
  display: none;
}
.landing-copyright {
  margin: 0;
  padding: 8px 12px 12px;
  text-align: center;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .03em;
  color: rgba(58, 45, 114, .48);
  user-select: none;
}
body:not(.classroom-locked) .landing-copyright {
  display: none;
}
body:not(.classroom-locked) .classroom-panel.is-collapsed {
  margin: 10px auto 6px;
}
body:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-shell {
  border-radius: 20px;
  box-shadow: 0 14px 28px -22px rgba(42, 34, 68, .28);
}
body:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-toggle {
  min-height: 56px;
  padding: 12px 16px;
}
.landing-intro {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.28;
}
.classroom-solo-entry {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 2px;
}
.classroom-panel.has-selected-role .landing-intro,
.classroom-panel.has-selected-role .classroom-solo-entry {
  display: none;
}
.classroom-solo-divider {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.classroom-solo-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 18px;
  border: 1.5px solid rgba(69, 194, 107, .45);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(240, 252, 244, .88));
  color: var(--green-deep);
  font-family: var(--font-display);
  font-size: clamp(16px, 2.2vw, 18px);
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 12px 22px -18px rgba(45, 160, 82, .28),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.classroom-solo-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(69, 194, 107, .62);
  background: linear-gradient(135deg, rgba(69, 194, 107, .10), rgba(45, 160, 82, .08));
  box-shadow: 0 14px 20px -14px rgba(45, 160, 82, .32);
}
.classroom-solo-btn:active {
  transform: translateY(0);
}
.classroom-solo-help {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.35;
  max-width: 34ch;
}
.classroom-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .classroom-chooser { grid-template-columns: 1fr; }
}
.classroom-role-btn,
.classroom-primary,
.classroom-actions button {
  min-height: 44px;
  border-radius: 16px;
  border: 1.5px solid #E4D9FF;
  background: #fff;
  color: var(--purple-deep);
  font-family: var(--font-body);
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.classroom-role-btn:hover,
.classroom-primary:hover,
.classroom-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px -14px rgba(42, 34, 68, .34);
}
.classroom-role-btn.is-selected,
.classroom-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-color: transparent;
  color: #fff;
}

/* --- Role choice buttons (teacher / student) with icons --- */
.classroom-role-btn--teacher,
.classroom-role-btn--student {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  min-height: 92px;
  text-align: left;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 250, 239, .86));
  box-shadow:
    0 16px 30px -24px rgba(42, 34, 68, .32),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}
.classroom-role-btn:active {
  transform: translateY(0);
}
.classroom-role-btn--teacher { border-color: rgba(124, 92, 255, .35); }
.classroom-role-btn--teacher:hover {
  background: linear-gradient(135deg, rgba(124, 92, 255, .08), rgba(77, 168, 255, .08));
  border-color: rgba(124, 92, 255, .55);
}
.classroom-role-btn--student { border-color: rgba(255, 122, 89, .35); }
.classroom-role-btn--student:hover {
  background: linear-gradient(135deg, rgba(255, 179, 71, .12), rgba(255, 122, 89, .10));
  border-color: rgba(255, 122, 89, .55);
}
.classroom-role-btn .role-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(245, 247, 255, .8);
  box-shadow: inset 0 0 0 1px rgba(228, 217, 255, .8);
}
.classroom-role-btn--student .role-icon {
  background: rgba(255, 245, 230, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 150, .65);
}
.classroom-role-btn .role-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}
.classroom-role-btn .role-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.classroom-role-btn .role-text strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--ink);
}
.classroom-role-btn .role-text small {
  display: block;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 12px;
  margin-top: 2px;
  white-space: normal;
}
.classroom-role-btn.is-selected .role-text strong,
.classroom-role-btn.is-selected .role-text small {
  color: #fff;
}
.classroom-role-btn.is-selected .role-icon {
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.classroom-setup {
  display: grid;
  gap: 10px;
}
.classroom-task-picker {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(245, 247, 255, .86);
  border: 1px solid rgba(228, 217, 255, .8);
}
.classroom-picker-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}
.classroom-task-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid rgba(233, 223, 200, .86);
  font-weight: 900;
  cursor: pointer;
}
.classroom-task-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

/* --- Teacher consonant category picker (room setup) --- */
.classroom-task-picker .teacher-consonant-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 2px 4px;
  margin: 0 -2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, .35) transparent;
}
.classroom-task-picker .teacher-consonant-block {
  flex: 0 0 auto;
}
.classroom-task-picker .teacher-consonant-grid::-webkit-scrollbar {
  width: 6px;
}
.classroom-task-picker .teacher-consonant-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(124, 92, 255, .28);
}
.teacher-consonant-block {
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  border: 1.5px solid rgba(233, 223, 200, .72);
  box-shadow: 0 10px 20px -18px rgba(42, 34, 68, .18);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.teacher-consonant-block.is-ready:hover {
  border-color: rgba(124, 92, 255, .28);
}
.teacher-consonant-block.is-featured {
  border-color: rgba(124, 92, 255, .42);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 240, 255, .94));
  box-shadow:
    0 14px 24px -18px rgba(124, 92, 255, .28),
    inset 0 1px 0 rgba(255, 255, 255, .95);
}
.teacher-consonant-block.is-empty {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(233, 223, 200, .45);
  box-shadow: none;
}
.teacher-consonant-block.is-open {
  border-color: rgba(124, 92, 255, .38);
  box-shadow: 0 14px 26px -18px rgba(124, 92, 255, .22);
}
.teacher-consonant-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px 10px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease;
}
.teacher-consonant-block.is-empty .teacher-consonant-header {
  min-height: 44px;
  opacity: .78;
}
.teacher-consonant-header:hover {
  background: rgba(124, 92, 255, .04);
}
.teacher-consonant-block.is-featured .teacher-consonant-header {
  min-height: 56px;
}
.teacher-consonant-letter-img {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(245, 240, 255, .95), rgba(228, 217, 255, .72));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .14);
}
.teacher-consonant-block.is-featured .teacher-consonant-letter-img {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(124, 92, 255, .16), rgba(77, 168, 255, .12));
  box-shadow: inset 0 0 0 1.5px rgba(124, 92, 255, .22);
}
.teacher-consonant-block.is-empty .teacher-consonant-letter-img {
  background: rgba(245, 247, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(228, 217, 255, .55);
}
.teacher-consonant-letter-img--long {
  width: auto;
  min-width: 42px;
  padding: 0 8px;
}
.teacher-consonant-letter-glyph {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--purple-deep);
}
.teacher-consonant-block.is-featured .teacher-consonant-letter-glyph {
  font-size: 22px;
}
.teacher-consonant-block.is-empty .teacher-consonant-letter-glyph {
  color: var(--muted);
}
.teacher-consonant-heading {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.teacher-consonant-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.6vw, 17px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.teacher-consonant-block.is-empty .teacher-consonant-title {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}
.teacher-consonant-count {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--purple-deep);
}
.teacher-consonant-count.is-empty {
  color: var(--muted);
  font-weight: 700;
}
.teacher-consonant-chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .18s ease, border-color .18s ease;
}
.teacher-consonant-block.is-open .teacher-consonant-chevron {
  transform: rotate(45deg);
  border-color: var(--purple);
  margin-top: 4px;
}
.teacher-consonant-body {
  padding: 0 10px 12px;
}
.teacher-consonant-task-list {
  display: grid;
  gap: 7px;
  padding: 4px 0 2px;
}
.classroom-task-picker .teacher-consonant-task-option {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(228, 217, 255, .85);
  font-weight: 800;
  line-height: 1.3;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.classroom-task-picker .teacher-consonant-task-option:hover {
  border-color: rgba(124, 92, 255, .35);
  background: #fff;
  box-shadow: 0 8px 16px -14px rgba(124, 92, 255, .28);
}
.classroom-task-picker .teacher-consonant-task-option:has(input:checked) {
  border-color: rgba(124, 92, 255, .48);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 240, 255, .92));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .12);
}
.classroom-task-picker .teacher-consonant-task-option input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}
.teacher-consonant-task-label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
}
.classroom-task-picker .teacher-consonant-task-option:has(input:checked) .teacher-consonant-task-label {
  color: var(--ink);
}
.teacher-consonant-empty {
  margin: 0;
  padding: 8px 4px 2px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--muted);
  font-style: italic;
}
.classroom-task-picker .classroom-picker-title {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}
.classroom-task-picker {
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(245, 247, 255, .88));
  border-color: rgba(228, 217, 255, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

/* Live in-session consonant grid — minimal, unchanged layout */
.teacher-consonant-grid--live {
  display: grid;
  gap: 8px;
}
.teacher-consonant-grid--live .teacher-consonant-header {
  min-height: 44px;
  padding: 8px 10px;
}
.teacher-consonant-grid--live .teacher-consonant-letter-img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.teacher-consonant-grid--live .teacher-consonant-body {
  display: grid;
  gap: 6px;
  padding: 0 8px 10px;
}
.teacher-consonant-focus-btn {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid #E4D9FF;
  background: #fff;
  color: var(--purple-deep);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

@media (max-width: 520px) {
  .classroom-task-picker .teacher-consonant-grid {
    max-height: min(48vh, 360px);
  }
  .teacher-consonant-header {
    gap: 10px;
    padding-right: 10px;
  }
  .teacher-consonant-letter-img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .teacher-consonant-block.is-featured .teacher-consonant-letter-img {
    width: 42px;
    height: 42px;
  }
  .classroom-task-picker .teacher-consonant-task-option {
    min-height: 44px;
    padding: 11px 12px;
  }
  .teacher-consonant-task-label {
    font-size: 12.5px;
  }
}

.classroom-help,
.classroom-error {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
  line-height: 1.35;
}
.classroom-error {
  color: var(--red-deep);
  background: #FFEAEA;
  border: 1px solid #FFB3B3;
  padding: 9px 11px;
  border-radius: 14px;
}
.classroom-label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-weight: 900;
  font-size: 13px;
}
.classroom-label span {
  color: var(--muted);
  font-weight: 800;
}
.classroom-input {
  min-height: 44px;
  border-radius: 15px;
  border: 1.5px solid #E8DFC8;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
}
.classroom-live {
  display: grid;
  gap: 11px;
}
.classroom-room-card {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 18px;
  background: #FFF7DC;
  border: 1px solid #F2DFAF;
}
.classroom-kicker {
  color: #805313;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.classroom-code {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: .11em;
  color: var(--ink);
}
.classroom-room-card small {
  color: var(--ink-soft);
  font-weight: 800;
}
.classroom-actions {
  display: grid;
  gap: 8px;
}
.classroom-actions button {
  color: var(--green-deep);
  border-color: #BFEBCB;
  background: linear-gradient(160deg, #FFFFFF 0%, #EEF8F0 100%);
}
.classroom-sync-toggle {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(233, 223, 200, .9);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 900;
  cursor: pointer;
}
.classroom-sync-toggle input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  accent-color: var(--purple);
}
.classroom-floating-controls {
  position: fixed;
  top: max(88px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 80;
  display: grid;
  gap: 6px;
  width: min(174px, calc(100vw - 20px));
  padding: 7px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(233, 223, 200, .88);
  box-shadow: 0 16px 38px -20px rgba(42, 34, 68, .42);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  pointer-events: auto;
}
.classroom-floating-title {
  display: block;
  padding: 0 4px 1px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.classroom-floating-controls .classroom-sync-toggle {
  min-height: 30px;
  background: rgba(245, 247, 255, .86);
}
.classroom-screen-state {
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(232, 251, 238, .8);
  color: var(--green-deep);
  border: 1px solid #BFEBCB;
  font-size: 13px;
  font-weight: 900;
}
.classroom-events {
  display: grid;
  gap: 6px;
  max-height: 148px;
  overflow: auto;
}
.classroom-event {
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(245, 247, 255, .86);
  color: var(--ink-soft);
  border: 1px solid rgba(228, 217, 255, .72);
  font-size: 13px;
  font-weight: 800;
}
.classroom-focus-ring {
  animation: classroomFocus 1.5s ease both;
}
@keyframes classroomFocus {
  0%, 100% { box-shadow: none; }
  18%, 72% { box-shadow: 0 0 0 7px rgba(124, 92, 255, .18), 0 0 0 13px rgba(77, 168, 255, .10); }
}
.classroom-remote-cursor-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100001;
}
body.classroom-cursor-sync-off .classroom-remote-cursor-layer {
  display: none !important;
}
.teacher-cursor,
.classroom-remote-cursor {
  position: fixed;
  left: 50vw;
  top: 50vh;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transform: translate(10px, 10px);
  transition: opacity .14s ease;
  filter: drop-shadow(0 10px 18px rgba(42, 34, 68, .34));
}
.teacher-cursor.is-visible,
.classroom-remote-cursor.is-visible {
  opacity: 1;
}
.teacher-cursor-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple);
  border: 4px solid #fff;
  box-shadow:
    0 0 0 2px rgba(124, 92, 255, .45),
    0 10px 22px -8px rgba(42, 34, 68, .5);
}
.teacher-cursor.is-student .teacher-cursor-dot,
.classroom-remote-cursor.is-student .teacher-cursor-dot {
  background: #ff6b2c;
  box-shadow:
    0 0 0 2px rgba(255, 107, 44, .55),
    0 0 18px rgba(255, 107, 44, .55),
    0 10px 22px -8px rgba(42, 34, 68, .5);
  animation: studentCursorGlow 1.4s ease-in-out infinite;
}
.teacher-cursor-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(42, 34, 68, .92);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
}
.teacher-cursor.is-student .teacher-cursor-label,
.classroom-remote-cursor.is-student .teacher-cursor-label {
  background: rgba(204, 74, 12, .95);
}
.teacher-cursor-pulse,
.classroom-remote-cursor-pulse {
  position: fixed;
  width: 28px;
  height: 28px;
  z-index: 1;
  border-radius: 50%;
  border: 4px solid var(--purple);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.55);
}
.teacher-cursor-pulse.is-student,
.classroom-remote-cursor-pulse.is-student {
  border-color: #ff6b2c;
  background: rgba(255, 107, 44, .18);
}
.teacher-cursor-pulse.is-active,
.classroom-remote-cursor-pulse.is-active {
  animation: cursorPulse .85s ease-out both;
}
@keyframes studentCursorGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes cursorPulse {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.55); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.8); }
}
@media (max-width: 980px) {
  .classroom-panel { top: auto; }
  .classroom-shell { margin-left: 0; width: 100%; }
  .classroom-floating-controls {
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(166px, calc(100vw - 16px));
  }
}
@media (max-width: 620px) {
  .classroom-panel { position: relative; top: auto; margin-top: 10px; }
  .classroom-shell { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===== Logopédiapp logo: landing screen + sticky topbar ===== */

/* sr-only helper used by mini topbar logo */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* --- Landing logo block sits inside the classroom-shell, above the role chooser --- */
.landing-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(300px, 42vw, 420px);
  padding: clamp(22px, 3.6vw, 36px) 16px clamp(14px, 2.2vw, 22px);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 210, 63, .18), transparent 26%),
    radial-gradient(circle at 86% 78%, rgba(77, 168, 255, .16), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(124, 92, 255, .08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #FBF7EE 100%);
  border-bottom: 1px solid rgba(233, 223, 200, .55);
}
.classroom-panel.has-selected-role .landing-logo,
body:not(.classroom-locked) .landing-logo {
  display: none;
}
.landing-logo-stage {
  position: relative;
  width: clamp(330px, 54vw, 470px);
  aspect-ratio: 1 / 1;
  isolation: isolate;
}
.landing-logo-stage::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 248, 232, .76));
  box-shadow:
    0 28px 58px -34px rgba(42, 34, 68, .42),
    inset 0 1px 0 rgba(255, 255, 255, .96);
  z-index: -2;
}
.landing-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  animation: landing-logo-rise 720ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes landing-logo-rise {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Separate overlay loading bar placed where the embedded bar used to be
   (cleared in the PNG). Matches the bar's slot in stack_a source logo:
   x ≈ 21.1% .. 79.3%, y ≈ 66.4% .. 69.1% (height ≈ 2.7%).
   The logo image itself is static. */
.landing-logo-progress {
  position: absolute;
  left: 21.1%;
  right: 20.7%;
  top: 66.4%;
  height: 2.7%;
  border-radius: 999px;
  overflow: hidden;
  z-index: 2;
}
.landing-logo-progress-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #E9E4FC;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .18);
}
.landing-logo-progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg,
    #6B45F0 0%,
    #7C5CFF 30%,
    #8FB8FF 60%,
    #9BE6C8 88%,
    #B4F0D6 100%);
  box-shadow: 0 0 10px rgba(124, 92, 255, .35);
  animation: landing-logo-fill 2200ms cubic-bezier(.22,.61,.36,1) 280ms forwards;
}
.landing-logo-progress::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: skewX(-18deg);
  animation: landing-logo-shimmer 2200ms cubic-bezier(.22,.61,.36,1) 280ms 1;
  pointer-events: none;
  z-index: 3;
}
@keyframes landing-logo-fill {
  0%   { width: 0%; }
  60%  { width: 70%; }
  100% { width: 100%; }
}
@keyframes landing-logo-shimmer {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Smaller mobile sizing */
@media (max-width: 640px) {
  body.classroom-locked .classroom-shell { border-radius: 30px; }
  .landing-logo {
    min-height: clamp(300px, 76vw, 390px);
    padding: 20px 12px 14px;
  }
  .landing-logo-stage { width: clamp(260px, 76vw, 340px); }
  .classroom-role-btn--teacher,
  .classroom-role-btn--student { min-height: 82px; }
  .classroom-role-btn .role-icon { width: 50px; height: 50px; }
}

/* Reduced motion: hold the bar at 100% rather than animating */
@media (prefers-reduced-motion: reduce) {
  .landing-logo-img { animation: none; }
  .landing-logo-progress-fill { animation: none; width: 100%; }
  .landing-logo-progress::after { display: none; }
}

/* --- Sticky topbar mini logo (after the user enters tasks) ---
   Now uses the horizontal one-line lockup PNG, so the height is
   tuned tighter and width is allowed to expand naturally. */
.brand--mini-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 8px;
  border-radius: 14px;
  transition: transform 180ms ease, background-color 180ms ease;
  flex: 0 0 auto;
}
.brand--mini-logo:hover { background: rgba(124, 92, 255, .08); transform: translateY(-1px); }
.brand-mini-logo {
  display: block;
  height: 34px;
  width: auto;
  max-height: 38px;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 640px) {
  .brand-mini-logo { height: 28px; }
}
@media (max-width: 420px) {
  .brand-mini-logo { height: 24px; }
}

/* ============================================================
   4. feladat: R hang helye a szóban (4×3 rács kártyák karikákkal)
   ============================================================ */
.task-4 {
  background: #fff;
  border-radius: 32px;
  padding: 16px clamp(14px, 1.8vw, 20px) 18px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 18px;
}
.task-4 .section-heading h2 { font-size: clamp(18px, 2vw, 22px); }
/* Motor prompt-card a 4. feladat tetején — kompakt */
.prompt-card-4 {
  grid-column: auto !important;
  grid-row: auto !important;
  max-width: 380px;
  margin: 10px auto 6px;
  padding: 8px 16px 10px;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  text-align: left;
}
.prompt-card-4 .prompt-motor {
  width: clamp(56px, 7vw, 72px);
  aspect-ratio: 1/1;
  margin: 0;
  flex-shrink: 0;
}
.prompt-card-4 .prompt-title {
  font-size: clamp(15px, 1.6vw, 18px);
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .prompt-card-4 { max-width: 100%; padding: 8px 12px; gap: 10px; }
  .prompt-card-4 .prompt-motor { width: 54px; }
  .prompt-card-4 .prompt-title { font-size: 15px; }
}
.cards-4-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(8px, 1vw, 12px);
  margin-top: 10px;
}
.card-4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF6FF 100%);
  border: 2px solid #EAE2FF;
  border-radius: 14px;
  padding: 6px 6px 8px;
  box-shadow: 0 14px 22px -16px rgba(43, 33, 80, 0.18);
}
.card-4-illu {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.card-4-illu img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.card-4-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.2px;
}
.card-4-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
}
.r-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #2B2150;
  background: #fff;
  padding: 0;
  cursor: pointer;
  transition: background-color .18s ease, transform .15s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.r-dot:hover { transform: scale(1.08); }
.r-dot:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.r-dot.is-correct {
  background: #45C26B;
  border-color: #2EA152;
  box-shadow: 0 6px 14px -6px rgba(69, 194, 107, 0.55);
}
.r-dot.is-wrong {
  animation: dotShake .42s ease;
  background: #FF6B6B;
  border-color: #D24A4A;
}
@keyframes dotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* ---- Responsive ---- */

/* Tablet: prompt at top, cards in 3 cols. Cancel inline grid placements. */
@media (max-width: 980px) {
  .tongue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orbit { grid-template-columns: repeat(3, 1fr); }
  .prompt-card { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .card { grid-column: auto !important; grid-row: auto !important; }
  .topbar { align-items: stretch; flex-wrap: wrap; }
  .brand { flex: 1 1 auto; }
  .task-banner { order: 3; flex: 1 0 100%; min-width: 0; border-radius: 22px; }
  .rabbit-board { grid-template-columns: 1fr; }
  .rabbit-progress { min-height: 340px; }
  .cards-4-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Phones: 2 cols, prompt compact */
@media (max-width: 620px) {
  .tongue-task { padding: 14px; border-radius: 26px; }
  .tongue-grid { grid-template-columns: 1fr; }
  body.solo-mode .tongue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tongue-card { min-height: 0; }
  .tongue-visual { min-height: 116px; }
  body.solo-mode .tongue-visual { min-height: 0; }
  body.solo-mode .orbit.solo-task-section.solo-task-active,
  body.solo-mode .orbit-2b.solo-task-section.solo-task-active {
    display: block !important;
  }
  .orbit { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .score-pill { font-size: 14px; padding: 8px 14px; }
  .brand-text span { display: none; }
  .brand-text strong { font-size: 17px; }
  .task-banner { padding: 8px 10px; gap: 8px; align-items: center; }
  .task-banner strong { font-size: 14px; }
  .task-banner small { display: none; }
  .task-motor { width: 32px; height: 32px; }
  .card { min-height: 118px; padding: 10px 8px 10px; }
  .card .label { font-size: 14px; }
  .prompt-card { padding: 18px 16px; }
  .prompt-text { font-size: 14px; }
  .section-heading { flex-direction: column; gap: 10px; }
  .rabbit-task { padding: 14px; border-radius: 26px; }
  .rabbit-progress { min-height: 290px; }
  .rabbit-runner { width: 98px; }
  .word-list { grid-template-columns: 1fr; }
  .word-chip { font-size: 16px; padding: 12px; }
  .task-4 { padding: 12px; border-radius: 24px; }
  .cards-4-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card-4-label { font-size: 11px; }
  .card-4 { padding: 6px 6px 6px; border-radius: 12px; }
  .card-4-illu { border-radius: 8px; }
  .r-dot { width: 24px; height: 24px; border-width: 2px; }
}

/* ============================================================
   4.b feladat: vonatos R-hang játék (drag & drop)
   ============================================================ */
.task-4b {
  background: #fff;
  border-radius: 32px;
  padding: 22px clamp(16px, 2.2vw, 26px) 26px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 18px;
}
.prompt-card-4b { margin: 6px auto 4px; max-width: 380px; padding: 8px 16px; }
.prompt-card-4b .prompt-motor { width: clamp(56px, 7vw, 72px); }
.prompt-card-4b .prompt-title { font-size: clamp(15px, 1.6vw, 18px); }

/* 4.b szakasz kompaktabb section-heading és padding */
.task-4b { padding: 16px 18px 18px; }
.task-4b .section-heading { margin-bottom: 6px; gap: 12px; }
.task-4b .section-heading h2 { font-size: clamp(18px, 1.9vw, 22px); margin: 0; }
.task-4b .section-heading p { font-size: 13px; line-height: 1.4; margin: 4px 0 0; }

/* Kép kompaktabb arány */
.card-4b-illu { aspect-ratio: 5 / 4; }

/* Vonat — mozdony + 3 vagon vizuális sorban */
.train-4b {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: clamp(4px, 0.9vw, 10px);
  align-items: end;
  padding: 10px clamp(4px, 1vw, 12px) 4px;
  margin-top: 6px;
  background: linear-gradient(180deg, #F7F4FF 0%, #ECE6FF 100%);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}
.train-4b::after {
  /* sín */
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: 14px;
  height: 6px;
  background: repeating-linear-gradient(90deg, #6B4DFF 0 14px, transparent 14px 24px),
              linear-gradient(180deg, #B7A8FF, #8E7BFF);
  border-radius: 3px;
  opacity: 0.55;
}
.train-piece {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 4px;
}
.train-svg {
  width: 100%;
  height: auto;
  max-height: 120px;
  display: block;
  filter: drop-shadow(0 6px 8px rgba(43,33,80,0.18));
  pointer-events: none;
}
.train-piece-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: #4B3A8E;
  margin-top: 4px;
  text-align: center;
  letter-spacing: 0.2px;
  pointer-events: none;
}
.wagon-drop {
  position: absolute;
  left: 8%; right: 8%;
  top: 18%;
  bottom: 22%;
  z-index: 2;
  border-radius: 14px;
  background: transparent;
  border: 2px dashed transparent;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  align-content: flex-start;
  pointer-events: auto;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.wagon-drop.is-over {
  background: rgba(124, 92, 255, 0.18);
  border-color: #7C5CFF;
  border-style: solid;
  transform: scale(1.02);
}
.wagon-drop.is-correct-flash {
  background: rgba(69, 194, 107, 0.30);
  border-color: #2BA84A;
  border-style: solid;
  animation: pop 0.42s ease;
}
.wagon-drop.is-wrong-flash {
  background: rgba(255, 110, 110, 0.30);
  border-color: #E54B4B;
  border-style: solid;
  animation: shake 0.42s cubic-bezier(.36,.07,.19,.97);
}
.wagon-mini {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(43,33,80,0.18);
  animation: pop 0.4s ease;
}
.wagon-mini img {
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}

/* Tárló: 12 kép 6x2 rácsban (kompaktabb, hogy minden elférjen) */
.cards-4b-tray {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(6px, 0.7vw, 10px);
  margin-top: 8px;
}
.card-4b {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF6FF 100%);
  border: 1px solid rgba(124, 92, 255, 0.16);
  border-radius: 14px;
  padding: 6px 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 8px 16px -12px rgba(43,33,80,0.32);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 200ms ease;
}
.card-4b:hover { transform: translateY(-2px); box-shadow: 0 18px 28px -16px rgba(43,33,80,0.40); }
.card-4b:focus-visible {
  outline: 3px solid #7C5CFF;
  outline-offset: 3px;
}
.card-4b.is-dragging {
  opacity: 0.25;
  cursor: grabbing;
}
.card-4b.is-done {
  opacity: 0.32;
  filter: grayscale(0.4);
  pointer-events: none;
  cursor: default;
}
.card-4b.shake { animation: shake 0.42s cubic-bezier(.36,.07,.19,.97); }
.card-4b-illu {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.card-4b-illu img {
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}
.card-4b-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink);
  margin-top: 0;
  line-height: 1.2;
}

/* Drag-ghost: a tárlóból elemelt elem követi a pointert */
.drag-ghost {
  position: fixed !important;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.95;
  transform: rotate(-3deg) scale(1.04);
  box-shadow: 0 24px 40px -16px rgba(43,33,80,0.50);
  transition: none !important;
  will-change: transform;
  top: 0;
  left: 0;
}

.drag-ghost.junk-drag-ghost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  contain: layout style paint;
  transition: none !important;
  filter: none;
}

.drag-ghost.junk-drag-ghost img {
  width: 88%;
  height: auto;
  max-height: 72%;
  object-fit: contain;
  pointer-events: none;
}

.drag-ghost.junk-drag-ghost .junk-label {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
  pointer-events: none;
}
.drag-ghost .card-4b-illu { background: #fff; }

@media (max-width: 980px) {
  .train-4b { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .train-svg { max-height: 100px; }
  .cards-4b-tray { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 620px) {
  .task-4b { padding: 14px; border-radius: 26px; }
  .train-4b {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 10px 16px;
  }
  .train-4b::after { display: none; }
  .train-piece { padding-bottom: 0; }
  .train-svg { max-height: 100px; }
  .wagon-drop { top: 22%; bottom: 26%; left: 12%; right: 12%; min-height: 50px; }
  .cards-4b-tray { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card-4b-label { font-size: 12px; }
  .wagon-mini { width: 24px; height: 24px; }
  .train-piece-label { font-size: 12px; }
}

/* ============================================================
 * 5. feladat — R és L hangok megkülönböztetése (vonalkötős)
 * ============================================================ */
.task-5 {
  background: #fff;
  border-radius: 32px;
  padding: 16px clamp(14px, 1.8vw, 20px) 22px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 18px;
}
.task-5 .section-heading h2 { font-size: clamp(18px, 2vw, 22px); }
.task-5 .section-heading p { font-size: 13px; line-height: 1.45; margin: 4px 0 0; }

.task-5-board {
  position: relative;
  margin-top: 12px;
  display: grid;
  grid-template-rows: auto auto auto;
  row-gap: clamp(14px, 2vw, 24px);
  padding: 4px;
  /* a vonal-SVG fölé kerül, bár pointer-events: none */
  isolation: isolate;
}
.task-5-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5; /* a képek előtt */
  overflow: visible;
}
.task-5-lines path,
.task-5-lines line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.task-5-lines .line--r,
.task-5-lines .line--l { stroke: #2ECC71; stroke-width: 5; }
.task-5-lines .line--wrong { stroke: #E74C3C; stroke-width: 5; opacity: 0.85; animation: flash-wrong 0.5s ease-out forwards; }
@keyframes flash-wrong {
  0%   { opacity: 0.9; }
  60%  { opacity: 0.9; }
  100% { opacity: 0; }
}
.task-5-lines .line--active { stroke-dasharray: 6 6; animation: dash-move 0.8s linear infinite; }
@keyframes dash-move { to { stroke-dashoffset: -24; } }

/* Sorok: 6 oszlopos rács, kompakt kártyák */
.cards-5-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(8px, 1vw, 12px);
}

/* Hívóképek középen */
.prompts-5 {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  padding: 4px 0;
}
.prompt-5 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 18px;
  padding: 10px 14px 8px;
  user-select: none;
  touch-action: none;
  cursor: grab;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.prompt-5:active,
.prompt-5.is-dragging { cursor: grabbing; transform: scale(1.03); }
.prompt-5.is-over { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.35); }
.prompt-5--r { border: 3px solid #E74C3C; box-shadow: 0 12px 24px -16px rgba(231, 76, 60, 0.45); }
.prompt-5--l { border: 3px solid #2E86DE; box-shadow: 0 12px 24px -16px rgba(46, 134, 222, 0.45); }
.prompt-5-illu {
  width: clamp(96px, 11vw, 130px);
  aspect-ratio: 1/1;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.prompt-5-illu img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.prompt-5-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1;
  letter-spacing: 0.5px;
}
.prompt-5--r .prompt-5-label { color: #E74C3C; }
.prompt-5--l .prompt-5-label { color: #2E86DE; }

/* Kis kártyák — hasonló a 4.feladat kompakt méretéhez, de magasabb (kép ne vágjék le) */
.card-5 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF6FF 100%);
  border: 2px solid #EAE2FF;
  border-radius: 14px;
  padding: 8px 6px 10px;
  box-shadow: 0 14px 22px -16px rgba(43, 33, 80, 0.18);
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.card-5.is-dragging { cursor: grabbing; transform: scale(1.02); }
.card-5.is-over { transform: scale(1.04); box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.28); }
.card-5:hover { transform: translateY(-2px); }
.card-5.is-matched-r,
.card-5.is-matched-l { border-color: #2ECC71; box-shadow: 0 18px 28px -16px rgba(46, 204, 113, 0.40); cursor: default; }
.card-5.is-correct-pop { animation: correct-pop 0.5s ease-out; }
@keyframes correct-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.10); box-shadow: 0 0 0 8px rgba(70, 200, 120, 0.18); }
  100% { transform: scale(1); }
}
.card-5.shake { animation: shake 0.42s cubic-bezier(.36,.07,.19,.97); }
.card-5.is-wrong-flash { border-color: #E74C3C; }
.card-5-illu {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 4px;
}
.card-5-illu img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.card-5-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.2px;
}

/* Responsive */
@media (max-width: 980px) {
  .cards-5-row { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 720px) {
  .cards-5-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .prompts-5 { gap: 24px; }
  .prompt-5-illu { width: 88px; }
  .prompt-5-label { font-size: 22px; }
  .task-5 { padding: 14px; border-radius: 26px; }
  .card-5-label { font-size: 12px; }
  .card-5 { padding: 8px 6px 10px; border-radius: 12px; }
  .card-5-illu { border-radius: 8px; padding: 3px; }
}

/* ============================================================
 * 5.b feladat — R és L házak (drag-and-drop)
 * ============================================================ */
.task-5b {
  background: #fff;
  border-radius: 28px;
  padding: 10px clamp(12px, 1.4vw, 18px) 14px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 14px;
}
.task-5b .section-heading { margin-bottom: 4px; }
.task-5b .section-heading h2 { font-size: clamp(16px, 1.7vw, 20px); margin: 0; }
.task-5b .section-heading p { font-size: 12px; line-height: 1.35; margin: 2px 0 0; }

.houses-5b {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.6vw, 20px);
  margin: 6px auto 8px;
  max-width: 760px;
  padding: 6px clamp(6px, 0.8vw, 12px) 8px;
  background: linear-gradient(180deg, #F7F4FF 0%, #ECE6FF 100%);
  border-radius: 18px;
}
.haz-5b {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 4px 4px;
}
.haz-5b-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(43,33,80,0.16));
  pointer-events: none;
}
.haz-5b-figure {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(36px, 4vw, 48px);
  pointer-events: none;
  z-index: 3;
}
.haz-5b-figure img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(43,33,80,0.35));
}
.haz-5b-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: #4B3A8E;
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.haz-5b--r .haz-5b-label { color: #B33232; }
.haz-5b--l .haz-5b-label { color: #1E4A8A; }

.haz-5b-drop {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 2px dashed rgba(124, 92, 255, 0.25);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  align-content: flex-start;
  justify-content: center;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.haz-5b--r .haz-5b-drop { border-color: rgba(230, 69, 69, 0.35); }
.haz-5b--l .haz-5b-drop { border-color: rgba(74, 143, 230, 0.35); }
.haz-5b-drop.is-over {
  background: rgba(124, 92, 255, 0.18);
  border-color: #7C5CFF;
  border-style: solid;
  transform: scale(1.02);
}
.haz-5b-drop.is-correct-flash {
  background: rgba(69, 194, 107, 0.30);
  border-color: #2BA84A;
  border-style: solid;
  animation: pop 0.42s ease;
}
.haz-5b-drop.is-wrong-flash {
  background: rgba(255, 110, 110, 0.30);
  border-color: #E54B4B;
  border-style: solid;
  animation: shake 0.42s cubic-bezier(.36,.07,.19,.97);
}
.haz-mini {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(43,33,80,0.18);
  animation: pop 0.4s ease;
}
.haz-mini img {
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}

/* Tárló: 16 kép (8x2 desktop) */
.cards-5b-tray {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: clamp(5px, 0.6vw, 8px);
  margin: 4px auto 0;
  max-width: 1100px;
}
.card-5b {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAF6FF 100%);
  border: 1px solid rgba(124, 92, 255, 0.16);
  border-radius: 12px;
  padding: 4px 4px 3px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: 0 8px 16px -12px rgba(43,33,80,0.32);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 200ms ease;
}
.card-5b:hover { transform: translateY(-2px); box-shadow: 0 18px 28px -16px rgba(43,33,80,0.40); }
.card-5b:focus-visible {
  outline: 3px solid #7C5CFF;
  outline-offset: 3px;
}
.card-5b.is-dragging {
  opacity: 0.25;
  cursor: grabbing;
}
.card-5b.is-done {
  opacity: 0.32;
  filter: grayscale(0.4);
  pointer-events: none;
  cursor: default;
}
.card-5b.shake { animation: shake 0.42s cubic-bezier(.36,.07,.19,.97); }
.card-5b-illu {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.card-5b-illu img {
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}
.card-5b-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  color: var(--ink);
  margin-top: 0;
  line-height: 1.15;
  text-align: center;
}
.drag-ghost .card-5b-illu { background: #fff; }

@media (max-width: 980px) {
  .cards-5b-tray { grid-template-columns: repeat(6, 1fr); }
  .haz-5b-figure { width: 42px; }
}
@media (max-width: 620px) {
  .task-5b { padding: 6px 8px 8px; border-radius: 20px; margin-top: 8px; }
  .task-5b .section-heading h2 { font-size: 13px; }
  .task-5b .section-heading p { font-size: 10px; line-height: 1.2; }
  .houses-5b { padding: 4px 5px 5px; gap: 5px; margin: 3px auto 4px; border-radius: 12px; }
  .haz-5b { padding: 1px 2px 3px; }
  .haz-5b-svg { max-width: 110px; }
  .haz-5b-figure { width: 24px; top: 16%; }
  .haz-5b-label { font-size: 10px; margin-top: 1px; }
  .haz-5b-drop { min-height: 38px; padding: 3px; margin-top: 2px; border-radius: 9px; }
  .haz-mini { width: 20px; height: 20px; border-radius: 5px; }
  .cards-5b-tray { grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 3px; }
  .card-5b { padding: 2px 2px 1px; border-radius: 9px; }
  .card-5b-illu { border-radius: 7px; }
  .card-5b-label { font-size: 9px; line-height: 1.05; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
 * 6. feladat — R és J hangok megkülönböztetése (drag tokens)
 * ============================================================ */
.task-6 {
  background: #fff;
  border-radius: 28px;
  padding: 10px clamp(12px, 1.4vw, 18px) 14px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 14px;
}
.task-6 .section-heading { margin-bottom: 4px; }
.task-6 .section-heading h2 { font-size: clamp(16px, 1.7vw, 20px); margin: 0; }
.task-6 .section-heading p { font-size: 12px; line-height: 1.35; margin: 2px 0 0; }

/* 4x3 szókártyák (drop targets) — kompakt, hogy 1 képernyőn elférjen */
.cards-6-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(6px, 0.7vw, 9px);
  margin: 6px auto 8px;
  max-width: 720px;
  padding: 7px;
  background: linear-gradient(180deg, #F7F4FF 0%, #ECE6FF 100%);
  border-radius: 16px;
}
.card-6 {
  position: relative;
  background: #fff;
  border: 1.5px solid rgba(124, 92, 255, 0.18);
  border-radius: 12px;
  padding: 4px 4px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  box-shadow: 0 6px 12px -10px rgba(43,33,80,0.30);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.card-6.is-over {
  background: rgba(124, 92, 255, 0.16);
  border-color: #7C5CFF;
  border-style: solid;
  transform: scale(1.03);
}
.card-6.is-correct-flash {
  background: rgba(69, 194, 107, 0.28);
  border-color: #2BA84A;
  animation: pop 0.42s ease;
}
.card-6.is-wrong-flash {
  background: rgba(255, 110, 110, 0.28);
  border-color: #E54B4B;
  animation: shake 0.42s cubic-bezier(.36,.07,.19,.97);
}
.card-6.is-solved {
  background: rgba(220, 245, 230, 0.50);
  border-color: rgba(43, 168, 74, 0.40);
}
.card-6-illu {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 130px;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.card-6-illu img {
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none;
}
.card-6-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink);
  line-height: 1.1;
  text-align: center;
  margin-top: 1px;
}
/* Megoldás jel (kis hívókép a szókártyán bal alsó sarokban) */
.card-6-marker {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  border: 1.5px solid rgba(43, 168, 74, 0.40);
  box-shadow: 0 2px 4px rgba(43,33,80,0.18);
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  animation: pop 0.4s ease;
  z-index: 2;
}
.card-6-marker img {
  width: 100%; height: 100%; object-fit: contain;
}

/* Hívókép tárló (12 dragable: 6 motor + 6 jajgató) */
.tokens-6-tray {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(4px, 0.5vw, 7px);
  margin: 4px auto 0;
  max-width: 640px;
  padding: 5px;
  background: linear-gradient(180deg, #FFF8EC 0%, #FFEFD5 100%);
  border-radius: 14px;
}
.token-6 {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid rgba(124, 92, 255, 0.18);
  box-shadow: 0 6px 12px -8px rgba(43,33,80,0.30);
  cursor: grab;
  touch-action: none;
  user-select: none;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 200ms ease;
}
.token-6:hover { transform: translateY(-2px); box-shadow: 0 12px 20px -10px rgba(43,33,80,0.40); }
.token-6:focus-visible {
  outline: 3px solid #7C5CFF;
  outline-offset: 3px;
}
.token-6.is-dragging {
  opacity: 0.25;
  cursor: grabbing;
}
.token-6.is-done {
  opacity: 0.20;
  filter: grayscale(0.6);
  pointer-events: none;
  cursor: default;
}
.token-6.shake { animation: shake 0.42s cubic-bezier(.36,.07,.19,.97); }
.token-6--r { background: linear-gradient(180deg, #FFFFFF 0%, #FFEFEF 100%); }
.token-6--j { background: linear-gradient(180deg, #FFFFFF 0%, #FFF7E2 100%); }
.token-6 img {
  width: 78%; height: 78%; object-fit: contain;
  pointer-events: none;
}
.drag-ghost.token-6 { background: #fff; }

@media (max-width: 980px) {
  .cards-6-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; max-width: 100%; }
  .tokens-6-tray { grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 100%; }
  .card-6-illu { max-height: 110px; }
  .card-6-label { font-size: 11px; }
}
@media (max-width: 620px) {
  .task-6 { padding: 6px 8px 8px; border-radius: 20px; margin-top: 8px; }
  .task-6 .section-heading h2 { font-size: 13px; }
  .task-6 .section-heading p { font-size: 10px; line-height: 1.2; }
  .cards-6-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 6px; margin: 5px auto 6px; border-radius: 14px; }
  .card-6 { padding: 3px 3px 2px; border-radius: 10px; }
  .card-6-label { font-size: 9.5px; line-height: 1.1; }
  .card-6-marker { width: 20px; height: 20px; left: 3px; bottom: 3px; border-radius: 6px; }
  .tokens-6-tray { grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 4px; border-radius: 12px; }
  .token-6 { border-radius: 9px; }
}

/* ============================================================
 * 7. feladat — Hívóképek (R, J, L) kattintásra felvillan
 * ============================================================ */
.task-7 {
  background: #fff;
  border-radius: 28px;
  padding: 14px clamp(14px, 1.6vw, 22px) 18px;
  box-shadow: 0 30px 60px -28px rgba(43, 33, 80, 0.22);
  border: 1px solid rgba(124, 92, 255, 0.10);
  margin-top: 14px;
}
.task-7 .section-heading { margin-bottom: 10px; }
.task-7 .section-heading h2 { font-size: clamp(16px, 1.7vw, 20px); margin: 0; }
.task-7 .section-heading p { font-size: 12.5px; line-height: 1.35; margin: 2px 0 0; }

.prompts-7 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
  margin: 4px auto 2px;
  max-width: 720px;
  padding: 10px;
  background: linear-gradient(180deg, #FBF8FF 0%, #F1ECFF 100%);
  border-radius: 18px;
  /* alap képméret — a 3-oszlopos (7.c) változathoz: kb. a viewport-magasság 38%-a */
  --prompt-img-size: min(38vh, 200px);
}
.prompts-7--one {
  grid-template-columns: minmax(220px, 360px);
  max-width: 380px;
  justify-content: center;
  /* 1 gomb — nagyobb kép, a viewport-magasság ~50%-a */
  --prompt-img-size: min(50vh, 320px);
}
.prompts-7--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 560px;
  /* 2 gomb — közepes méret, a viewport-magasság ~42%-a */
  --prompt-img-size: min(42vh, 240px);
}
.prompt-7 {
  position: relative;
  background: #fff;
  border: 2.5px solid rgba(124, 92, 255, 0.18);
  border-radius: 16px;
  padding: 8px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 10px 22px -14px rgba(43, 33, 80, 0.32);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.prompt-7:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -14px rgba(43, 33, 80, 0.40);
}
.prompt-7:focus-visible {
  outline: 3px solid #7C5CFF;
  outline-offset: 3px;
}
.prompt-7:active { transform: translateY(-1px) scale(0.98); }
.prompt-7 img {
  width: 100%;
  max-width: 100%;
  height: var(--prompt-img-size, 140px);
  object-fit: contain;
  pointer-events: none;
}
.prompt-7-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1;
}
/* Hang-specifikus háttér/szín */
.prompt-7--r { background: linear-gradient(180deg, #FFFFFF 0%, #FFEFEF 100%); }
.prompt-7--r .prompt-7-label { color: #E54B4B; }
.prompt-7--j { background: linear-gradient(180deg, #FFFFFF 0%, #FFF7E2 100%); }
.prompt-7--j .prompt-7-label { color: #D69500; }
.prompt-7--l { background: linear-gradient(180deg, #FFFFFF 0%, #E8F1FF 100%); }
.prompt-7--l .prompt-7-label { color: #2563D9; }
/* S hang 7. típusú feladatok (S/SZ/ZS) */
.prompt-7--s  { background: linear-gradient(180deg, #FFFFFF 0%, #FFEFEF 100%); }
.prompt-7--s  .prompt-7-label { color: #E54B4B; }
.prompt-7--sz { background: linear-gradient(180deg, #FFFFFF 0%, #E7F7EA 100%); }
.prompt-7--sz .prompt-7-label { color: #2E9B4E; }
.prompt-7--zs { background: linear-gradient(180deg, #FFFFFF 0%, #E8F1FF 100%); }
.prompt-7--zs .prompt-7-label { color: #2563D9; }
.prompt-7--cs { background: linear-gradient(180deg, #FFFFFF 0%, #FFF1E0 100%); }
.prompt-7--cs .prompt-7-label { color: #E8933F; }
.prompt-7--c  { background: linear-gradient(180deg, #FFFFFF 0%, #F0E7FA 100%); }
.prompt-7--c  .prompt-7-label { color: #7C4DB8; }
.prompt-7--z  { background: linear-gradient(180deg, #FFFFFF 0%, #FFF8E6 100%); }
.prompt-7--z  .prompt-7-label { color: #C99200; }

/* Villogás animáció kattintásra - 2 fehér pulzus */
@keyframes flash-7 {
  0%,  50%, 100% { transform: scale(1);    box-shadow: 0 10px 22px -14px rgba(43,33,80,0.32), 0 0 0 0 rgba(255,255,255,0); background-color: #FFFFFF; }
  15%, 65%       { transform: scale(1.08); box-shadow: 0 18px 32px -10px rgba(43,33,80,0.40), 0 0 0 14px rgba(255,255,255,1); background-color: #FFFFFF; }
}
.prompt-7.is-flash {
  animation: flash-7 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.prompt-7--r.is-flash { border-color: #E54B4B; }
.prompt-7--j.is-flash { border-color: #D69500; }
.prompt-7--l.is-flash { border-color: #2563D9; }
.prompt-7--s.is-flash  { border-color: #E54B4B; }
.prompt-7--sz.is-flash { border-color: #2E9B4E; }
.prompt-7--zs.is-flash { border-color: #2563D9; }
.prompt-7--cs.is-flash { border-color: #E8933F; }
.prompt-7--c.is-flash  { border-color: #7C4DB8; }
.prompt-7--z.is-flash  { border-color: #C99200; }

@media (max-width: 980px) {
  .prompts-7 { gap: 8px; padding: 8px; max-width: 100%; }
  .prompt-7 { border-radius: 14px; padding: 6px 4px 6px; }
}
@media (max-width: 620px) {
  .task-7 { padding: 10px 10px 12px; border-radius: 20px; margin-top: 10px; }
  .task-7 .section-heading h2 { font-size: 14px; }
  .task-7 .section-heading p { font-size: 11px; line-height: 1.25; }
  .prompts-7 { gap: 6px; padding: 6px; border-radius: 14px; --prompt-img-size: min(28vh, 140px); }
  .prompts-7--one { --prompt-img-size: min(42vh, 280px); max-width: 280px; }
  .prompts-7--two { --prompt-img-size: min(34vh, 200px); }
  .prompt-7 { border-radius: 12px; padding: 5px 3px 5px; gap: 2px; border-width: 2px; }
  .prompt-7-label { font-size: 18px; }
}


/* === ÚJ FELADATOK 8-21 ADDITIVE MERGE START === */
/* ============================================================
   8. feladat — R hang rögzítése (út + 8 állomás + garázs)
   ============================================================ */

.task-8 {
  background: #FFFFFF;
  border-radius: 28px;
  padding: 22px 22px 28px;
  border: 1px solid rgba(43, 33, 80, 0.08);
  box-shadow: 0 22px 56px -28px rgba(43, 33, 80, 0.22);
  margin-top: 18px;
}

.road-game {
  background: linear-gradient(180deg, #F4FBF6 0%, #E8F4EC 100%);
  border-radius: 22px;
  padding: 48px 28px 36px;
  border: 1px solid rgba(43, 33, 80, 0.06);
  overflow: hidden;
}

.road-track {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 220px;
}

/* Autópálya — aszfalt + fehér szegélyek + sárga szaggatott felezővonal */

.road-line {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 50%;
  height: 56px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #4A4E55 0%, #2F3238 50%, #4A4E55 100%);
  border-radius: 10px;
  box-shadow:
    inset 0 8px 12px -8px rgba(0,0,0,0.55),
    inset 0 -8px 12px -8px rgba(0,0,0,0.55),
    0 10px 22px -14px rgba(43,33,80,0.45);
  overflow: hidden;
}

/* Fehér szegélyvonalak fent és lent */

.road-line::before,
.road-line::after {
  content: "";
  position: absolute;
  left: 1.5%;
  right: 1.5%;
  height: 3px;
  background: #FFFFFF;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.road-line::before { top: 10%; }

.road-line::after  { bottom: 10%; }

/* Sárga szaggatott felezővonal — külön elem, hogy középen feküdjön */

.road-center-line {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    90deg,
    #F5C518 0,
    #F5C518 38px,
    transparent 38px,
    transparent 70px
  );
  z-index: 1;
  pointer-events: none;
  border-radius: 2px;
}

/* Állomás gombok — egyenletesen elosztva. 
   A label a pálya FELETT, a pötty pontosan a PÁLYA KÖZEPÉN. */

.road-stop {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  font-family: inherit;
  z-index: 2;
  width: 56px;
  height: 90px; /* magas klikk-zóna, hogy a label is benne legyen */
}

.road-stop[data-stop-index="0"] { left: 5%;  }

.road-stop[data-stop-index="1"] { left: 16%; }

.road-stop[data-stop-index="2"] { left: 27%; }

.road-stop[data-stop-index="3"] { left: 38%; }

.road-stop[data-stop-index="4"] { left: 49%; }

.road-stop[data-stop-index="5"] { left: 60%; }

.road-stop[data-stop-index="6"] { left: 71%; }

.road-stop[data-stop-index="7"] { left: 82%; }

.road-stop[data-stop-index="8"] { left: 94%; }

.road-stop-label {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 22px); /* a dot FELETT lebeg, nem takarja az utat */
  top: auto;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 800;
  color: #E54B4B;
  background: #FFFFFF;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 14px -8px rgba(43,33,80,0.35);
  border: 2px solid #FFE0E0;
  line-height: 1.1;
  white-space: nowrap;
  display: block;
}

.road-stop-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFFFFF 0%, #E54B4B 60%, #B7333A 100%);
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 10px -3px rgba(43,33,80,0.55);
  transition: transform 160ms ease;
  display: block;
  z-index: 2;
}

.road-stop:hover .road-stop-dot,
.road-stop:focus-visible .road-stop-dot {
  transform: translate(-50%, -50%) scale(1.18);
}

.road-stop:focus-visible {
  outline: 3px solid #2563D9;
  outline-offset: 6px;
  border-radius: 12px;
}

/* Megálló látogatott állapot */

.road-stop.is-visited .road-stop-dot {
  background: radial-gradient(circle at 30% 30%, #FFFFFF 0%, #59C16E 60%, #2F8F45 100%);
}

.road-stop.is-visited .road-stop-label {
  border-color: #C8EBD2;
  color: #2F8F45;
}

.road-stop--garage .road-stop-dot { display: none; }

.road-stop--garage .road-stop-label { display: none; }

.road-stop--garage .road-garage-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(43,33,80,0.32));
  transition: transform 200ms ease;
  background: transparent;
  border: none;
  box-shadow: none;
}

.road-stop--garage:hover .road-garage-img,
.road-stop--garage:focus-visible .road-garage-img {
  transform: translate(-50%, -50%) scale(1.06);
}

/* Motor — abszolút pozícióban, animált mozgással. Kezdetben az út elején, az első állomás (rá) előtt, hogy ne takarja. */

.road-motor {
  position: absolute;
  top: 50%;
  left: 3%;
  width: 96px;
  height: auto;
  /* Motorkép balra néz, de jobbra halad — horizontális tükrözés */
  transform: translate(-50%, -55%) scaleX(-1);
  transition: left 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: drop-shadow(0 8px 12px rgba(43,33,80,0.45));
  pointer-events: none;
  z-index: 3;
}

.road-motor.is-finished {
  animation: road-finish-pulse 0.8s ease-in-out 2;
}

/* Tablet */

@media (max-width: 980px) {
  .road-game { padding: 40px 18px 28px; }
  .road-track { height: 200px; }
  .road-stop { width: 48px; height: 80px; }
  .road-stop-label { font-size: 18px; padding: 3px 9px; top: 0; }
  .road-stop-dot { width: 20px; height: 20px; border-width: 2px; }
  .road-motor { width: 82px; }
  .road-stop--garage { width: 160px; height: 160px; }
  .road-stop--garage .road-garage-img { width: 140px; }
  .road-line { height: 44px; }
}

/* Mobil */

@media (max-width: 620px) {
  .task-8 { padding: 12px 12px 16px; border-radius: 20px; margin-top: 10px; }
  .task-8 .section-heading h2 { font-size: 15px; }
  .task-8 .section-heading p { font-size: 12px; line-height: 1.3; }
  .road-game { padding: 26px 6px 20px; border-radius: 16px; }
  .road-track { height: 170px; }
  .road-stop { width: 32px; height: 56px; }
  .road-stop-label { font-size: 11px; padding: 1px 5px; border-width: 1.5px; border-radius: 8px; top: 0; }
  .road-stop-dot { width: 12px; height: 12px; border-width: 1.5px; }
  .road-motor { width: 44px; }
  .road-motor { left: 2%; }
  .road-stop--garage { width: 60px; height: 60px; }
  .road-stop--garage .road-garage-img { width: 64px; }
  /* Mobilon átrendezett állomás-pozíciók — több hely a széleken */
  .road-stop[data-stop-index="0"] { left: 6%;  }
  .road-stop[data-stop-index="1"] { left: 16%; }
  .road-stop[data-stop-index="2"] { left: 26%; }
  .road-stop[data-stop-index="3"] { left: 36%; }
  .road-stop[data-stop-index="4"] { left: 46%; }
  .road-stop[data-stop-index="5"] { left: 56%; }
  .road-stop[data-stop-index="6"] { left: 66%; }
  .road-stop[data-stop-index="7"] { left: 76%; }
  .road-stop[data-stop-index="8"] { left: 92%; }
  .road-line {
    height: 34px;
    border-radius: 6px;
  }
  .road-line::before { top: 12%; height: 2px; }
  .road-line::after  { bottom: 12%; height: 2px; }
  .road-center-line {
    height: 4px;
    background: repeating-linear-gradient(
      90deg,
      #F5C518 0,
      #F5C518 18px,
      transparent 18px,
      transparent 34px
    );
  }
}

.balloon {
  position: absolute;
  bottom: -120px;
  width: 56px;
  height: 72px;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.0) 35%),
              radial-gradient(circle at 50% 60%, var(--balloon-c2, #E54B4B) 0%, var(--balloon-c1, #B7333A) 100%);
  box-shadow:
    inset -6px -10px 18px rgba(0,0,0,0.18),
    0 6px 14px -6px rgba(43,33,80,0.35);
  will-change: transform, opacity;
  animation:
    balloon-rise var(--balloon-dur, 4.5s) cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
    balloon-sway var(--balloon-sway-dur, 2.4s) ease-in-out infinite alternate;
  animation-delay: var(--balloon-delay, 0s), var(--balloon-delay, 0s);
  opacity: 0;
}

/* Lufi csomó (alul) */

.balloon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 8px;
  height: 8px;
  background: var(--balloon-c1, #B7333A);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}

/* Madzag */

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 64px;
  background: linear-gradient(180deg, rgba(43,33,80,0.5), rgba(43,33,80,0.15));
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Mobilon kisebb lufik */

@media (max-width: 620px) {
  .balloon { width: 40px; height: 52px; }
  .balloon::after { height: 48px; }
}

/* SVG-pálya — kitölti a track-et */

.road-wave-svg,
.road-zigzag-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Vastag aszfaltszínű alapút */

.road-wave-path,
.road-zigzag-path {
  fill: none;
  stroke: #2A2F3A;
  stroke-width: 44;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* enyhe vetődő árnyék hatás */
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
}

/* Sárga szaggatott vonal az út közepén */

.road-wave-dash,
.road-zigzag-dash {
  fill: none;
  stroke: #F5C518;
  stroke-width: 4;
  stroke-dasharray: 14 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Wave / zigzag track-en NE jelenjenek meg az egyenes road-line / road-center-line */

.road-track--wave .road-line,
.road-track--wave .road-center-line,
.road-track--zigzag .road-line,
.road-track--zigzag .road-center-line {
  display: none;
}

/* 8a / 8b — Desktop: garázs a jobb szélen (úrkezdet ide jobbra), motor balról indul a 0. szótag előtt (mint a 8-asnál) */
.road-track--wave .road-stop--garage[data-stop-index="9"],
.road-track--zigzag .road-stop--garage[data-stop-index="9"] { left: 94%; }

/* Tablet — wave/zigzag */

@media (max-width: 980px) {
  .road-track--wave,
  .road-track--zigzag { height: 220px; }
  .road-wave-path,
  .road-zigzag-path { stroke-width: 38; }
  .road-track--wave .road-motor--wave,
  .road-track--zigzag .road-motor--zigzag { width: 82px; }
}

/* Mobil — wave/zigzag: kissebb motor, alacsonyabb track */

@media (max-width: 620px) {
  .road-track--wave,
  .road-track--zigzag { height: 180px; }
  .road-wave-path,
  .road-zigzag-path { stroke-width: 32; }
  .road-wave-dash,
  .road-zigzag-dash { stroke-width: 3; stroke-dasharray: 9 7; }
  .road-track--wave .road-motor--wave,
  .road-track--zigzag .road-motor--zigzag { width: 44px; }
  /* Mobilon az állomások X-pozícióját kicsit szétfeszítjük */
  .road-track--wave .road-stop--wave[data-stop-index="0"] { left: 3%;  }
  .road-track--wave .road-stop--wave[data-stop-index="8"] { left: 78%; }
  .road-track--wave .road-stop--garage[data-stop-index="9"] { left: 94%; }
  .road-track--zigzag .road-stop--zigzag[data-stop-index="0"] { left: 3%; }
  .road-track--zigzag .road-stop--zigzag[data-stop-index="8"] { left: 78%; }
  .road-track--zigzag .road-stop--garage[data-stop-index="9"] { left: 94%; }
}

/* =====================================================================
   9. feladat — R hang automatizálása szó elején (24 kép, 3D flip)
   ===================================================================== */

.task-9 {
  padding: 12px 0 28px;
}

.task-9 .word-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
}

.task-9 .word-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.95;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
}

.task-9 .word-card:hover {
  transform: translateY(-2px);
}

.task-9 .word-card:focus-visible {
  outline: 3px solid #ffb84a;
  outline-offset: 4px;
  border-radius: 18px;
}

.task-9 .word-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-9 .word-card.flipped .word-card-inner {
  transform: rotateY(180deg);
}

.task-9 .word-card-front,
.task-9 .word-card-back {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.task-9 .word-card-front {
  background: #fffdf7;
  border: 2px solid #f0e6d4;
  padding: 6px 6px 4px;
  gap: 2px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.task-9 .word-card:hover .word-card-front {
  border-color: #ffb84a;
  box-shadow: 0 4px 12px rgba(255, 184, 74, 0.18);
}

.task-9 .word-card-front img {
  width: 100%;
  height: 74%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.task-9 .word-card-front .word-label {
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: #3b2a14;
  text-align: center;
  line-height: 1.1;
  margin: 0;
}

.task-9 .word-card-back {
  background: linear-gradient(135deg, #5bc97a 0%, #38a85a 100%);
  transform: rotateY(180deg);
  gap: 10px;
}

.task-9 .word-card-back .check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  color: #2f8f45;
}

.task-9 .word-card-back .back-label {
  font-family: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

@media (max-width: 720px) {
  .task-9 .word-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 8px;
  }
  .task-9 .word-card-front .word-label {
    font-size: 0.92rem;
  }
  .task-9 .word-card-back .check {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }
  .task-9 .word-card-back .back-label {
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .task-9 .word-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .task-9 .word-card-front .word-label {
    font-size: 0.82rem;
  }
}

/* ============================
   10. feladat — R hang szókapcsolatban (kuka + kacatok, drag&drop)
   ============================ */

.task-10 {
  padding: 18px 20px 32px;
  max-width: 1180px;
  margin: 0 auto;
}

.task-10-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.task-10-head .kicker {
  background: linear-gradient(135deg, #ffb86b, #ff8a3d);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 14px rgba(255,138,61,0.35);
  white-space: nowrap;
  margin-top: 4px;
}

.task-10-head h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: #2b2240;
}

.task-10-head .subtitle {
  margin: 0;
  color: #5b5078;
  font-size: 0.98rem;
}

.task-10-head .subtitle i {
  font-style: italic;
  color: #c44d2e;
  font-weight: 600;
}

.task-10-stage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: stretch;
  /* "udvar" háttér — régi kacatok a földön hangulat */
  background:
    radial-gradient(ellipse at 30% 70%, rgba(180,140,90,0.10), transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(120,80,40,0.07), transparent 55%),
    linear-gradient(180deg, #f3ead8 0%, #e8dcc1 100%);
  border-radius: 22px;
  padding: 22px;
  min-height: 480px;
  box-shadow: inset 0 2px 12px rgba(120, 80, 40, 0.10);
  position: relative;
  overflow: hidden;
}

.task-10-stage.is-trash-celebrating {
  overflow: visible;
}

/* Kuka (drop zone) */

.trash-bin-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.trash-bin-wrap.is-happy {
  z-index: 40;
  animation: trashBinWrapHappy 0.62s ease-in-out 4;
  transform-origin: center bottom;
}

.trash-bin {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: transparent;
  border: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.trash-bin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.trash-bin.is-over {
  border: 3px dashed #ff8a3d;
  box-shadow: 0 0 0 6px rgba(255, 138, 61, 0.20), 0 10px 24px rgba(255, 138, 61, 0.30);
  transform: scale(1.04);
}

.trash-bin.is-correct-flash {
  animation: trashFlash 520ms ease;
}

.trash-bin.is-happy {
  animation: trashBinHappy 0.62s ease-in-out 4;
  border: 3px solid #45c26b;
  box-shadow:
    0 0 0 8px rgba(69, 194, 107, 0.28),
    0 16px 36px rgba(69, 194, 107, 0.38);
  transition: none;
}

.trash-bin-wrap.is-happy .trash-bin {
  border: 3px solid #45c26b;
  box-shadow:
    0 0 0 8px rgba(69, 194, 107, 0.28),
    0 16px 36px rgba(69, 194, 107, 0.38);
}

.trash-bin.is-happy img,
.trash-bin-wrap.is-happy .trash-bin img {
  animation: trashBinHappyImg 0.62s ease-in-out 4;
}

.trash-bin.is-happy .trash-count,
.trash-bin-wrap.is-happy .trash-count {
  animation: trashCountHappy 0.62s ease-in-out 4;
  background: linear-gradient(135deg, #45c26b, #7ee081);
  box-shadow: 0 6px 16px rgba(69, 194, 107, 0.45);
}

@keyframes trashFlash {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 138, 61, 0);
  }
  40% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.35);
  }
  70% { transform: scale(1.03); }
}

@keyframes trashBinWrapHappy {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  18% { transform: translateY(-22px) rotate(-8deg) scale(1.08); }
  36% { transform: translateY(0) rotate(8deg) scale(1.05); }
  54% { transform: translateY(-16px) rotate(-6deg) scale(1.07); }
  72% { transform: translateY(0) rotate(6deg) scale(1.04); }
  86% { transform: translateY(-8px) rotate(-3deg) scale(1.03); }
}

@keyframes trashBinHappy {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-4deg); }
  50% { transform: scale(1.06) rotate(4deg); }
  75% { transform: scale(1.08) rotate(-2deg); }
}

@keyframes trashBinHappyImg {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-14deg) scale(1.08); }
  75% { transform: rotate(14deg) scale(1.08); }
}

@keyframes trashCountHappy {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.12); }
}

.trash-count {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff8a3d, #ffb86b);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(255,138,61,0.40);
  letter-spacing: 0.5px;
}

/* Kacatok "udvara" - szabad pozíciók */

.junk-yard {
  position: relative;
  min-height: 460px;
}

.junk-item {
  position: absolute;
  width: 110px;
  height: 110px;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, filter 180ms ease;
  filter: drop-shadow(2px 4px 4px rgba(80, 50, 20, 0.25));
}

.junk-item img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.junk-item img {
  width: 100%;
  height: 88px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.junk-label {
  font-size: 0.78rem;
  color: #4a3820;
  font-weight: 700;
  background: rgba(255, 250, 235, 0.85);
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: -2px;
  pointer-events: none;
  white-space: nowrap;
}

.junk-item:hover {
  transform: scale(1.08) rotate(0deg) !important;
  filter: drop-shadow(3px 6px 6px rgba(80, 50, 20, 0.4));
  z-index: 10;
}

.junk-item.is-dragging {
  opacity: 0.35;
  transition: none;
}

.junk-item.is-removed {
  display: none;
}

/* Random forgatások a kacatokhoz (nth-child) */

.junk-item:nth-child(1)  { top:  20px; left:  10px; transform: rotate(-12deg); }

.junk-item:nth-child(2)  { top:  10px; left: 180px; transform: rotate(  8deg); }

.junk-item:nth-child(3)  { top:  40px; left: 340px; transform: rotate( -5deg); }

.junk-item:nth-child(4)  { top:  10px; left: 480px; transform: rotate( 15deg); }

.junk-item:nth-child(5)  { top: 150px; left:  90px; transform: rotate(  6deg); }

.junk-item:nth-child(6)  { top: 130px; left: 260px; transform: rotate(-18deg); }

.junk-item:nth-child(7)  { top: 160px; left: 420px; transform: rotate( 10deg); }

.junk-item:nth-child(8)  { top: 280px; left:  20px; transform: rotate( 14deg); }

.junk-item:nth-child(9)  { top: 270px; left: 180px; transform: rotate( -8deg); }

.junk-item:nth-child(10) { top: 290px; left: 340px; transform: rotate( 11deg); }

.junk-item:nth-child(11) { top: 270px; left: 490px; transform: rotate( -4deg); }

.junk-item:nth-child(12) { top: 130px; left: 560px; transform: rotate( 18deg); }

@media (max-width: 900px) {
  .task-10 {
    padding: 4px 8px 6px;
  }
  .task-10-head {
    gap: 2px;
    margin-bottom: 2px;
  }
  .task-10-head .kicker {
    font-size: 0.58rem;
    padding: 1px 6px;
  }
  .task-10-head h2 {
    font-size: 0.82rem;
    line-height: 1.1;
  }
  .task-10-head .subtitle {
    display: none;
  }
  .task-10-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 4px;
    padding: 6px;
    min-height: 0;
  }
  .trash-bin-wrap {
    margin-bottom: 2px;
  }
  .trash-bin {
    max-width: 95px;
    aspect-ratio: 1/1;
  }
  .trash-count {
    font-size: 0.68rem;
    padding: 2px 7px;
    bottom: -8px;
  }
  /* Kacatok: 6 oszlop × 2 sor széles, kis cellák */
  .junk-yard {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    min-height: 0;
    max-height: 180px;
    position: relative;
  }
  .junk-item {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    padding: 2px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .junk-item img {
    width: auto;
    max-width: 88%;
    height: 60%;
    object-fit: contain;
  }
  .junk-label {
    font-size: 0.52rem;
    padding: 0 2px;
    margin-top: 0;
    line-height: 1;
  }
  /* Random forgások grid layoutban is */
  .junk-item:nth-child(1)  { top: auto; left: auto; transform: rotate(-8deg); }
  .junk-item:nth-child(2)  { top: auto; left: auto; transform: rotate(  6deg); }
  .junk-item:nth-child(3)  { top: auto; left: auto; transform: rotate( -4deg); }
  .junk-item:nth-child(4)  { top: auto; left: auto; transform: rotate( 10deg); }
  .junk-item:nth-child(5)  { top: auto; left: auto; transform: rotate(  5deg); }
  .junk-item:nth-child(6)  { top: auto; left: auto; transform: rotate( -9deg); }
  .junk-item:nth-child(7)  { top: auto; left: auto; transform: rotate(  8deg); }
  .junk-item:nth-child(8)  { top: auto; left: auto; transform: rotate( -6deg); }
  .junk-item:nth-child(9)  { top: auto; left: auto; transform: rotate(  9deg); }
  .junk-item:nth-child(10) { top: auto; left: auto; transform: rotate( -3deg); }
  .junk-item:nth-child(11) { top: auto; left: auto; transform: rotate(  7deg); }
  .junk-item:nth-child(12) { top: auto; left: auto; transform: rotate( -5deg); }
}

/* ===========================================
   10/a feladat — R hang szókapcsolatokban
   =========================================== */

.task-10a {
  background: linear-gradient(180deg, #fff7ed 0%, #fef3c7 100%);
  border-radius: 20px;
  padding: 14px 20px 18px;
  margin-top: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.task-10a-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.task-10a-head .kicker {
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-10a-head .head-text { flex: 1; min-width: 0; }

.task-10a-head h2 {
  margin: 0 0 2px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400e;
  line-height: 1.2;
}

.task-10a-head .subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #78350f;
  line-height: 1.25;
}

.phrase-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto;
}

.phrase-card {
  position: relative;
  background: #fff;
  border: 2px solid #fed7aa;
  border-radius: 14px;
  padding: 6px 5px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1.1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.6s ease;
  /* overflow: visible — hogy a por szétrepülhessen a kártyán túl is */
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  font-family: inherit;
}

@media (hover: hover) {
  .phrase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(245,158,11,0.18);
    border-color: #fb923c;
  }
}

@media (hover: hover) {
  .phrase-card:active { transform: translateY(-1px); }
}

.phrase-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

.phrase-card img {
  width: 88%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.phrase-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #78350f;
  text-align: center;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 1px;
}

/* Porladás animáció — a card-inner fokozatosan eltűnik (blur + scale + fade) */

.phrase-card.is-crumbling { pointer-events: none; }

.phrase-card.is-crumbling .phrase-card-inner {
  opacity: 0;
  transform: none;
  filter: blur(8px);
}

.dust-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
  animation: dust-fly var(--p-dur, 800ms) ease-out forwards;
  background: var(--p-color, #d97706);
}

@keyframes dust-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--p-dx, 0), var(--p-dy, 0)) scale(0.2);
  }
}

/* Befejezett állapot — a kép teljesen eltűnik, csak halvány üres hely marad */

.phrase-card.is-done {
  background: rgba(255, 247, 237, 0.5);
  border-color: #fed7aa;
  border-style: dashed;
  cursor: default;
  opacity: 0.4;
}

.phrase-card.is-done .phrase-card-inner { display: none; }

.phrase-card.is-done:hover {
  transform: none;
  box-shadow: none;
  border-color: #fed7aa;
}

.task-10a-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.phrase-count {
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Mobil layout — 4 oszlop x 3 sor, 1 képernyobe befér */

@media (max-width: 900px) {
  .task-10a {
    padding: 8px 10px 10px;
    border-radius: 14px;
    margin-top: 8px;
  }
  .task-10a-head {
    gap: 6px;
    margin-bottom: 6px;
  }
  .task-10a-head .kicker {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .task-10a-head h2 {
    font-size: 0.78rem;
    line-height: 1.1;
    margin: 0;
  }
  .task-10a-head .subtitle {
    font-size: 0.62rem;
    line-height: 1.1;
  }
  .phrase-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .phrase-card {
    padding: 2px 2px;
    aspect-ratio: 1/1.15;
    border-width: 1.5px;
    border-radius: 10px;
  }
  .phrase-card img {
    width: 90%;
    height: 70%;
  }
  .phrase-label {
    font-size: 0.52rem;
    line-height: 1.0;
    padding: 0 1px;
  }
  .task-10a-foot {
    margin-top: 6px;
    gap: 8px;
  }
  .phrase-count { font-size: 0.7rem; padding: 3px 9px; }
  .task-10a-foot .btn,
  .task-10a-foot button { font-size: 0.7rem; padding: 4px 10px; }
}

/* === 11. feladat — R hang automatizálása mondatokban (gyerek ↔ étel összekötés) === */

.task-11 {
  margin: 22px auto 32px;
  max-width: 1080px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #fff7ed 0%, #fffaf2 100%);
  border: 1.5px solid #fde68a;
  border-radius: 22px;
  box-shadow: 0 4px 18px rgba(180, 83, 9, 0.08);
  scroll-margin-top: 320px;
}

.task-11-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  text-align: center;
}

.task-11-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.task-11-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.35);
}

.task-11-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #78350f;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.task-11-instr {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #92400e;
  font-weight: 600;
}

.match-board {
  position: relative;
  padding: 8px 4px 6px;
}

.match-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.match-svg .match-line {
  stroke: #f59e0b;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  opacity: 0.92;
  filter: drop-shadow(0 1px 2px rgba(180, 83, 9, 0.35));
}

@keyframes line-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes dash-march {
  to { stroke-dashoffset: -28; }
}

.kids-row,
.foods-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 4px 0;
}

.kids-row { margin-bottom: 14px; }

.foods-row { margin-top: 14px; }

.kid-card,
.food-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px 4px;
  background: transparent;
  border: 2px solid #fde68a;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  font-family: inherit;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.kid-card {
  background: #fff;
}

.food-card {
  background: transparent;
}

.kid-card img,
.food-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #78350f;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kid-card:hover,
.food-card:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 5px 14px rgba(245, 158, 11, 0.22);
}

.kid-card.is-dragging {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25), 0 4px 12px rgba(234, 88, 12, 0.28);
  transform: scale(1.04);
  cursor: grabbing;
}

.food-card.is-target {
  border-color: #ea580c;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.35), 0 6px 16px rgba(234, 88, 12, 0.32);
  transform: translateY(-2px) scale(1.06);
}

.kid-card.is-matched {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.18);
}

.food-card.is-matched {
  border-color: #16a34a;
  background: rgba(240, 253, 244, 0.55);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.18);
}

.kid-card.is-matched:hover,
.food-card.is-matched:hover {
  transform: translateY(-1px);
}

/* Mobilon a gyerek-kártyán is látsék kicsi grab kurzor */

.kid-card { cursor: grab; }

/* Élő dröggött vonal */

.match-svg .drag-line {
  stroke: #ea580c;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(234, 88, 12, 0.45));
  pointer-events: none;
}

.match-svg .drag-line.is-dashed {
  stroke-dasharray: 8 6;
  animation: dash-march 600ms linear infinite;
}

.task-11-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px dashed #fcd34d;
}

.match-sentence {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 700;
  color: #78350f;
  min-height: 1.2em;
  text-align: left;
}

.match-sentence:empty::before {
  content: "Még nincs összekötés.";
  color: #b45309;
  font-weight: 500;
  font-style: italic;
}

.task-11-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.match-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: #78350f;
  background: #fde68a;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid #f59e0b;
}

/* Mobil: kompakt 5+4 elrendezés sorokban */

@media (max-width: 720px) {
  .task-11 {
    margin: 12px 8px 20px;
    padding: 10px 10px 12px;
    border-radius: 18px;
  }
  .task-11-head h2 { font-size: 0.92rem; }
  .task-11-badge { width: 24px; height: 24px; font-size: 0.78rem; }
  .task-11-instr { font-size: 0.7rem; }
  .kids-row,
  .foods-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  /* 9 elem 5 oszlopban: 5+4 sor. A 9. elem központosul */
  .kids-row .kid-card:nth-child(9),
  .foods-row .food-card:nth-child(9) {
    /* hagyjuk természetes pozícióban (új sor első cellája) */
  }
  .kids-row { margin-bottom: 8px; }
  .foods-row { margin-top: 8px; }
  .kid-card,
  .food-card {
    padding: 3px 2px 2px;
    border-radius: 10px;
    border-width: 1.5px;
  }
  .chip-label { font-size: 0.6rem; }
  .task-11-foot {
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    margin-top: 8px;
  }
  .match-sentence { font-size: 0.78rem; text-align: center; }
  .task-11-actions { justify-content: space-between; }
  .match-count { font-size: 0.72rem; padding: 3px 9px; }
  .task-11-foot .reset-btn { font-size: 0.7rem; padding: 4px 10px; }
  .match-svg .match-line { stroke-width: 3; }
}

/* ============================================================
   Task 11a — Ki csinálja? (drag & drop cselekvés-képek 2 gyerekhez)
   ============================================================ */

.task-11a {
  background: #fff;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  margin: 18px 0;
}

.task-11a .kids-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 14px;
}

.task-11a .kid-target {
  position: relative;
  background: linear-gradient(180deg, #fef9f0 0%, #fff5e6 100%);
  border: 3px dashed #fbbf24;
  border-radius: 18px;
  padding: 10px 8px 8px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  min-height: 180px;
}

.task-11a .kid-target.is-over {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  border-style: solid;
  transform: scale(1.02);
}

.task-11a .kid-target.is-wrong {
  animation: shake11a 0.4s ease;
  border-color: #ef4444;
}

.task-11a .kid-target > img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
  user-select: none;
  -webkit-user-drag: none;
}

.task-11a .kid-target-label {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #b45309;
  margin-bottom: 6px;
}

.task-11a .kid-target-dropped {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
}

.task-11a .kid-target-dropped .dropped-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 2px solid #10b981;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  animation: popIn11a 0.3s ease;
}

.task-11a .kid-target-dropped .dropped-thumb img {
  width: 100%; height: 100%; object-fit: contain;
}

.task-11a .actions-pool {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 16px;
  min-height: 120px;
}

.task-11a .action-card {
  position: relative;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.task-11a .action-card:hover {
  transform: translateY(-2px);
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.task-11a .action-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.task-11a .action-card.is-placed {
  display: none;
}

.task-11a .action-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.task-11a .action-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  line-height: 1.1;
}

.action-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  opacity: 0.95;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.22));
}

.action-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes shake11a {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.task-11a-foot {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.task-11a-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobil */

@media (max-width: 640px) {
  .task-11a { padding: 12px 10px; }
  .task-11a .kids-targets { gap: 8px; }
  .task-11a .kid-target { padding: 8px 4px 6px; min-height: 150px; }
  .task-11a .kid-target > img { width: 64px; height: 64px; }
  .task-11a .kid-target-label { font-size: 0.92rem; }
  .task-11a .kid-target-dropped .dropped-thumb { width: 34px; height: 34px; }
  .task-11a .actions-pool {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding: 5px;
  }
  .task-11a .action-card { padding: 3px; border-radius: 9px; }
  .task-11a .action-label { font-size: 0.6rem; }
  .action-ghost { width: 72px; height: 72px; }
}

/* ===== Task 12 — T hang gyöngyfűzés ===== */

.task-12 {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF6E6 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 3vw, 32px);
  margin: clamp(24px, 4vw, 44px) clamp(14px, 3vw, 28px);
}

.task-12 .section-heading { margin-bottom: 14px; }

.task-12-tips {
  display: flex; flex-direction: row; align-items: center; gap: 16px;
  margin: 6px 0 18px;
  padding: 12px 16px;
  background: rgba(255, 210, 63, 0.18);
  border: 1px dashed rgba(255, 154, 64, 0.5);
  border-radius: 16px;
  color: var(--ink);
}

.task-12-tips-img {
  width: 200px; max-width: 30%; height: auto;
  flex-shrink: 0;
  background: transparent;
  filter: drop-shadow(0 6px 10px rgba(43, 33, 80, 0.18));
}

.task-12-tips-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }

.task-12-tips-text p { margin: 0; font-size: 0.95rem; line-height: 1.45; }

/* Bead pool */

.task-12 .beads-pool {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  border: 1px solid rgba(233, 223, 200, 0.7);
  min-height: 180px;
  margin-bottom: 22px;
}

.task-12 .bead {
  --bead-bg: var(--purple);
  display: inline-flex; align-items: center; justify-content: center;
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 45%), var(--bead-bg);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 600;
  cursor: grab;
  box-shadow: 0 6px 14px -6px rgba(43, 33, 80, 0.45), inset 0 -6px 10px -4px rgba(0,0,0,0.18);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Bead colors by index (CSS only via :nth-of-type) */

.task-12 .bead:nth-of-type(6n+1) { --bead-bg: #FF6B6B; }

.task-12 .bead:nth-of-type(6n+2) { --bead-bg: #FFA94D; }

.task-12 .bead:nth-of-type(6n+3) { --bead-bg: #FFD23F; color: #3A2E0A; text-shadow: 0 1px 1px rgba(255,255,255,0.4); }

.task-12 .bead:nth-of-type(6n+4) { --bead-bg: #51CF66; }

.task-12 .bead:nth-of-type(6n+5) { --bead-bg: #4DABF7; }

.task-12 .bead:nth-of-type(6n)   { --bead-bg: #B197FC; }

.task-12 .bead:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 20px -8px rgba(43, 33, 80, 0.5), inset 0 -6px 10px -4px rgba(0,0,0,0.18); }

.task-12 .bead:active { cursor: grabbing; }

.task-12 .bead.is-dragging { opacity: 0.35; transform: scale(0.92); }

.task-12 .bead.is-placed { display: none; }

.bead-ghost {
  position: fixed;
  z-index: 100002;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 18px -8px rgba(43, 33, 80, 0.5), inset 0 -6px 10px -4px rgba(0,0,0,0.18);
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* String / cérna (kanyargós) */

.task-12 .string-wrap {
  position: relative;
  width: 100%;
  min-height: 180px;
  padding: 24px 0;
  margin-bottom: 18px;
}

.task-12 .string-svg {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  width: 100%; height: 140px;
  pointer-events: none;
}

.task-12 .string-track {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* A gyöngyöket a JS abszolút pozícionálja a path mentén */

.task-12 .threaded-bead {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
}

.task-12 .string-wrap.is-over {
  background: rgba(255, 210, 63, 0.18);
  border-radius: 20px;
  outline: 3px dashed rgba(255, 154, 64, 0.6);
  outline-offset: -8px;
}

.task-12 .threaded-bead {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 14px -6px rgba(43, 33, 80, 0.45), inset 0 -5px 8px -3px rgba(0,0,0,0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  animation: beadDrop12 0.35s ease-out;
}

.task-12-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.task-12-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

.task-12 .match-count { color: var(--ink); font-weight: 600; font-size: 1rem; }

.task-12 .reset-btn {
  background: var(--purple); color: #fff; border: none;
  padding: 10px 18px; border-radius: 14px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, background 0.15s ease;
}

.task-12 .reset-btn:hover { background: var(--purple-deep); transform: translateY(-1px); }

.task-12 .reset-btn:active { transform: translateY(0); }

/* Mobil */

@media (max-width: 700px) {
  .task-12 { margin: 18px 10px; padding: 16px; }
  .task-12-tips { flex-direction: column; align-items: stretch; }
  .task-12-tips-img { width: 100%; max-width: 220px; align-self: center; }
  .task-12 .beads-pool { gap: 8px; padding: 12px; }
  .task-12 .bead { width: 58px; height: 58px; font-size: 1.05rem; border-width: 2px; }
  .bead-ghost { width: 58px; height: 58px; font-size: 1.05rem; }
  .task-12 .string-wrap { min-height: 140px; padding: 18px 0; }
  .task-12 .string-svg { height: 110px; }
  .task-12 .string-track { padding: 0 24px; gap: 2px; min-height: 110px; }
  .task-12 .threaded-bead { width: 38px; height: 38px; font-size: 0.78rem; border-width: 2px; }
  .task-12-tips-text p { font-size: 0.85rem; }
}

/* ============ 13. feladat — L hangzó olvasókönyv ============ */

.task-13 {
  background: linear-gradient(180deg, #fff7ec 0%, #fff1e0 100%);
  border-radius: 32px;
  padding: clamp(20px, 3vw, 36px);
  margin-top: clamp(28px, 4vw, 48px);
  position: relative;
  overflow: visible;
}

.task-13-tips {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(180deg, #fff5e1, #ffe8c8);
  border: 2px dashed rgba(255, 154, 64, 0.45);
  border-radius: 24px;
  padding: 16px 22px;
  margin: 16px 0 24px;
}

.task-13-tips-img {
  width: 160px; height: auto; flex-shrink: 0;
  filter: drop-shadow(0 8px 14px rgba(180, 90, 30, 0.18));
}

.task-13-tips-mouth {
  width: 160px; height: auto; flex-shrink: 0;
  filter: drop-shadow(0 8px 14px rgba(180, 90, 30, 0.18));
}

.task-13-tips-text { flex: 1; }

.task-13-tips-text p { margin: 0 0 6px; color: #4a3320; line-height: 1.45; }

.task-13-tips-text p:last-child { margin-bottom: 0; }

.task-13-board {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 460px) 1fr;
  gap: clamp(14px, 2vw, 28px);
  align-items: center;
  margin: 18px 0 12px;
}

.syllable-pool {
  display: flex; flex-direction: column; gap: 12px;
  padding: 8px;
}

.syllable-row {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #fff7ea, #ffeacd);
  padding: 6px 10px 6px 14px;
  border-radius: 16px;
  box-shadow: 0 4px 10px -3px rgba(180, 90, 30, 0.18);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.syllable-row.is-dragging { cursor: grabbing; transform: scale(1.02); }

.syllable-row.is-placed { opacity: 0.45; cursor: default; }

.syllable-row.is-placed .note-card { display: none; }

.syllable-pool--left .syllable-row { flex-direction: row; }

.syllable-pool--right .syllable-row { flex-direction: row; }

.syllable-text {
  color: #b03d18;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: max-content;
}

.syllable-row { width: max-content; max-width: 100%; }

.note-card {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(180deg, #6f8bff, #3a5cd9);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: inherit;
  user-select: none;
  touch-action: none;
  pointer-events: none;
  box-shadow: 0 6px 12px -3px rgba(60, 70, 180, 0.5), inset 0 -3px 6px -2px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.syllable-row:not(.is-placed):hover { transform: translateY(-1px); }

.syllable-row:not(.is-placed):hover .note-card { transform: scale(1.06); }

.book-drop {
  position: relative;
  width: 100%;
  aspect-ratio: 460 / 360;
  filter: drop-shadow(0 18px 30px -10px rgba(140, 60, 20, 0.4));
}

.book-svg { display: block; width: 100%; height: 100%; }

.book-pages {
  position: absolute; inset: 0;
  pointer-events: none;
}

.book-page {
  position: absolute;
  top: 14%;
  width: 38%;
  height: 72%;
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  padding: 6px;
  box-sizing: border-box;
}

.book-page--left { left: 8%; }

.book-page--right { right: 8%; }

.book-drop.is-over {
  filter: drop-shadow(0 18px 30px -10px rgba(140, 60, 20, 0.4)) drop-shadow(0 0 0 3px rgba(255, 154, 64, 0.45));
}

.book-drop.is-over .book-page--left,
.book-drop.is-over .book-page--right { 
  background: rgba(255, 210, 63, 0.22);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(255, 154, 64, 0.5);
}

.note-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(180deg, #6f8bff, #3a5cd9);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 10px 20px -6px rgba(60, 70, 180, 0.55);
}

.placed-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #6f8bff, #3a5cd9);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 8px -2px rgba(60, 70, 180, 0.45);
}

.task-13-celebration {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.task-13-celebration.is-visible {
  opacity: 1;
}

.task-13-celebration-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 10px);
  animation: task13CelebrationDance 1.1s ease-in-out infinite;
}

.task-13-celebration-girl {
  width: clamp(120px, 42%, 180px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 18px rgba(180, 90, 30, 0.35));
}

.task-13-music-note {
  font-size: 1.65rem;
  font-weight: 700;
  color: #3a5cd9;
  text-shadow: 0 2px 4px rgba(60, 70, 180, 0.28);
  animation: task13NoteFloat 1.35s ease-in-out infinite;
  line-height: 1;
}

.task-13-music-note--1 { animation-delay: 0s; }
.task-13-music-note--2 { animation-delay: 0.18s; }
.task-13-music-note--3 { animation-delay: 0.36s; }
.task-13-music-note--4 { animation-delay: 0.54s; }
.task-13-music-note--5 { animation-delay: 0.72s; }

@keyframes task13CelebrationDance {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-8px) scale(1.03) rotate(-2deg); }
  50% { transform: translateY(-4px) scale(1.05); }
  75% { transform: translateY(-10px) scale(1.02) rotate(2deg); }
}

@keyframes task13NoteFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.82; }
  50% { transform: translateY(-12px) scale(1.14); opacity: 1; }
}

.task-13-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}

.task-13-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .task-13-tips { flex-direction: column; text-align: center; gap: 10px; padding: 14px; }
  .task-13-tips-img { width: 110px; }
  .task-13-tips-mouth { width: 110px; }
  .task-13-tips-text p { font-size: 0.92rem; }
  .task-13-board {
    grid-template-columns: 1fr;
    gap: 16px;
    grid-template-areas: "book" "left" "right";
  }
  .book-drop { grid-area: book; max-width: 360px; margin: 0 auto; }
  .syllable-pool--left { grid-area: left; align-items: stretch; }
  .syllable-pool--right { grid-area: right; align-items: stretch; }
  .syllable-pool { flex-direction: column; gap: 8px; }
  .syllable-row { padding: 5px 8px 5px 12px; }
  .syllable-text { font-size: 0.9rem; }
  .note-card { width: 36px; height: 36px; font-size: 1.3rem; }
  .placed-note { width: 24px; height: 24px; font-size: 0.9rem; margin: 2px; }
  .task-13-celebration-girl { width: clamp(100px, 48%, 150px); }
  .task-13-music-note { font-size: 1.25rem; }
}

/* ============================================================
   14. feladat — Zöngétlen ajakperdítés (PR)
   ============================================================ */

.task-14 {
  background: linear-gradient(180deg, #fff4e6 0%, #ffe7ce 100%);
  border-radius: 24px;
  padding: 28px 28px 24px;
  margin-top: 28px;
  box-shadow: 0 8px 24px -12px rgba(180, 90, 30, 0.22);
}

.task-14-tips {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed #f0a574;
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.task-14-tips-badge {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8b3a, #e0651a);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -2px rgba(200, 90, 20, 0.45), inset 0 -3px 6px -2px rgba(0,0,0,0.18);
}

.task-14-tips-text { flex: 1; }

.task-14-tips-text p {
  margin: 0 0 6px;
  color: #4a3320;
  line-height: 1.45;
  font-size: 0.98rem;
}

.task-14-tips-text p:last-child { margin-bottom: 0; }

.task-14-tips-text strong { color: #c14820; }

.task-14-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: end;
}

.prr-animal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 18px;
  padding: 8px 4px 4px;
  cursor: pointer;
  transition: transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}

.prr-animal:hover { transform: translateY(-3px); }

.prr-animal:active { transform: scale(0.97); }

.prr-animal-stage {
  position: relative;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
}

.prr-animal-img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
}

.prr-animal-img--well {
  position: relative;
  z-index: 1;
  transition: opacity 0.35s ease;
}

.prr-animal-img--sick {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.prr-animal.is-sick { pointer-events: none; }

.prr-animal.is-sick .prr-animal-img--well { opacity: 0; }

.prr-animal.is-sick .prr-animal-img--sick {
  opacity: 1;
  animation: prrSniffSneeze 0.85s ease-in-out infinite;
}

.prr-animal.is-sick .prr-label { color: #c14820; animation: prrLabelSniff 0.85s ease-in-out infinite; }

.prr-animal.is-sick .prr-puff {
  display: block;
  position: absolute;
  top: 18%;
  right: 8%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95), rgba(200,220,255,0.55) 55%, rgba(180,200,240,0));
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  animation: prrPuffFloat 0.85s ease-in-out infinite;
}

.prr-animal.is-sick .prr-puff::before,
.prr-animal.is-sick .prr-puff::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(200,220,255,0.45) 60%, transparent);
}

.prr-animal.is-sick .prr-puff::before {
  width: 18px;
  height: 18px;
  top: -14px;
  left: -10px;
  animation: prrPuffFloat 0.85s ease-in-out 0.15s infinite;
}

.prr-animal.is-sick .prr-puff::after {
  width: 14px;
  height: 14px;
  top: -22px;
  left: 6px;
  animation: prrPuffFloat 0.85s ease-in-out 0.3s infinite;
}

@keyframes prrSniffSneeze {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(-3px) rotate(-2deg) scale(1.02); }
  55% { transform: translateY(2px) rotate(1deg) scale(0.99); }
  72% { transform: translateY(-4px) rotate(-1.5deg) scale(1.01); }
}

@keyframes prrLabelSniff {
  0%, 100% { opacity: 1; transform: scale(1); }
  55% { opacity: 0.72; transform: scale(0.96); }
}

@keyframes prrPuffFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  35% { opacity: 0.85; transform: translate(4px, -8px) scale(1); }
  100% { opacity: 0; transform: translate(10px, -22px) scale(1.15); }
}

.prr-animal.is-gone { pointer-events: none; }

.prr-animal.is-gone img { animation: prrRunAway 1.1s ease-in forwards; }

.prr-animal.is-gone .prr-label { animation: prrLabelFade 1.1s ease-in forwards; }

.prr-label {
  font-family: var(--font-display);
  font-weight: 800;
  color: #e0651a;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.prr-puff { display: none; }

.task-14-foot {
  margin-top: 20px;
  text-align: center;
}

.task-14-hint {
  margin: 0;
  color: #6a4a30;
  font-style: italic;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .task-14 { padding: 18px 14px 16px; }
  .task-14-tips { flex-direction: row; gap: 12px; padding: 12px; align-items: flex-start; }
  .task-14-tips-badge { width: 52px; height: 52px; font-size: 1.15rem; }
  .task-14-tips-text p { font-size: 0.9rem; }
  .task-14-board { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .prr-animal { padding: 10px 8px 8px; }
  .prr-animal-stage { max-width: 130px; }
  .prr-animal img { max-width: 130px; }
  .prr-label { font-size: 1.15rem; }
  .task-14-hint { font-size: 0.88rem; }
}

/* ===================== TASK 14b — Szaladj haza ===================== */

.task-14b {
  background: linear-gradient(180deg, #fff5e8 0%, #ffe6d2 100%);
  border-radius: 28px;
  padding: 28px 32px 32px;
  margin-top: 28px;
}

.task-14b .task-head { margin-bottom: 14px; }

.task-14b-tips {
  background: #fffdf7;
  border: 2px dashed #f59e6b;
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.task-14b-tips-badge {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  background: #f47a3a;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.task-14b-tips-text p { margin: 0; line-height: 1.45; color: #4a2e1c; }

.task-14b-tips-text strong { color: #c64a10; }

.task-14b-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prr-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 130px;
  padding: 4px 8px;
}

.prr-runner {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  flex: 0 0 auto;
  transform: translateX(0);
  transition: filter 0.2s;
}

.prr-home { position: relative; z-index: 2; }

.prr-runner img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
  pointer-events: none;
}

.prr-runner:hover { filter: brightness(1.05); }

.prr-runner:active { transform: scale(0.96) translateX(0); }

.prr-runner.is-running {
  pointer-events: none;
  animation:
    prrRunHome 4s linear forwards,
    prrBounce 0.4s linear infinite;
}

.prr-runner.is-running img {
  animation: prrBounceImg 0.4s ease-in-out infinite;
}

.prr-runner.is-home {
  transform: translateX(var(--run-distance)) translateY(0) scale(0.4);
  opacity: 1;
  pointer-events: none;
}

.prr-home {
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prr-home.is-reached {
  animation: prrHomePulse 0.55s ease;
}

@keyframes prrHomePulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

.prr-home img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.task-14b-foot {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

@media (max-width: 720px) {
  .task-14b { padding: 20px 16px 24px; border-radius: 22px; }
  .task-14b-tips { gap: 12px; padding: 12px 14px; }
  .task-14b-tips-badge { flex: 0 0 50px; width: 50px; height: 50px; font-size: 1rem; }
  .task-14b-tips-text p { font-size: 0.92rem; }
  .prr-row { min-height: 100px; padding: 2px 4px; }
  .prr-runner img { width: 90px; height: 90px; }
  .prr-home { width: 110px; height: 110px; }
}

/* ============================================================
   TASK 14/c — Zöngétlen ajakperdítés gyakorlása szótagokban
   ============================================================ */

.task-14c {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 28px;
  padding: 28px 24px 32px;
  margin: 28px auto;
  max-width: 1100px;
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
}

.task-14c-tips {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed rgba(231, 122, 41, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 12px 0 22px;
}

.task-14c-tips-badge {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand-orange, #e77a29);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-14c-tips-text p {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.4;
  color: #4a3a2a;
}

.task-14c-tips-text p:last-child { margin-bottom: 0; }

.task-14c-tips-text strong { color: var(--brand-orange, #e77a29); }

.task-14c-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.prc-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  align-items: end;
}

.prc-horse {
  appearance: none;
  background: transparent;
  border: none;
  padding: 4px 2px 6px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.prc-horse:hover { background: rgba(231, 122, 41, 0.08); }

.prc-horse:focus-visible { outline: 3px solid var(--brand-orange, #e77a29); outline-offset: 2px; }

.prc-horse-img {
  display: block;
  width: 96px;
  height: 96px;
  background-image: url('./assets/task-14/lovacska-allo.webp');
  background-size: contain;
  background-position: bottom center;
  background-repeat: no-repeat;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background-image 0s;
  transform-origin: bottom center;
  pointer-events: none;
  box-sizing: border-box;
}

.prc-horse { width: 100%; min-width: 0; box-sizing: border-box; }

.prc-horse.is-rearing .prc-horse-img {
  background-image: url('./assets/task-14/lovacska-agaskodo.webp');
  animation: prcRear 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prc-syllable {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-orange, #e77a29);
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
}

.task-14c-foot {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

/* Egy kiügyetett ló — halvány jelzés, hogy már kattintottak rá */

.prc-horse.is-done .prc-horse-img { opacity: 0.55; filter: saturate(0.7); }

.prc-horse.is-done .prc-syllable { opacity: 0.55; }

.prc-horse.is-done.is-rearing .prc-horse-img,
.prc-horse.is-done.is-rearing .prc-syllable { opacity: 1; filter: none; }

/* Egész sor eltűnése, amikor mind a 9 ló kész */

.prc-row {
  transition: opacity 0.6s ease, transform 0.6s ease, max-height 0.7s ease 0.1s, margin 0.6s ease;
  overflow: hidden;
  max-height: 200px;
}

.prc-row.is-row-gone {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  max-height: 0;
  margin: 0;
  pointer-events: none;
}

@media (max-width: 980px) {
  .prc-horse-img { width: 78px; height: 78px; }
  .prc-syllable { font-size: 1rem; }
}

@media (max-width: 720px) {
  .task-14c { padding: 18px 8px 22px; border-radius: 22px; }
  .task-14c-tips { gap: 10px; padding: 10px 12px; }
  .task-14c-tips-badge { flex: 0 0 46px; width: 46px; height: 46px; font-size: 0.95rem; }
  .task-14c-tips-text p { font-size: 0.88rem; }
  .prc-row { gap: 2px; }
  .prc-horse { padding: 2px 0 4px; }
  .prc-horse-img { width: 100%; max-width: 40px; aspect-ratio: 1 / 1; height: auto; }
  .prc-syllable { font-size: 0.7rem; letter-spacing: 0; }
}

@media (max-width: 480px) {
  .task-14c { padding: 14px 6px 20px; }
  .prc-row { gap: 1px; }
  .prc-horse-img { max-width: 34px; }
  .prc-syllable { font-size: 0.62rem; }
}

@media (max-width: 380px) {
  .prc-horse-img { max-width: 30px; }
  .prc-syllable { font-size: 0.58rem; }
}

/* ============================================================
   TASK 14/d — Zöngés ajakperdítés gyakorlása szótagokban (BR)
   ============================================================ */

.task-14d {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 28px;
  padding: 28px 24px 32px;
  margin: 28px auto;
  max-width: 1100px;
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
}

.task-14d-tips {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed rgba(231, 122, 41, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 12px 0 22px;
}

.task-14d-tips-badge {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand-orange, #e77a29);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-14d-tips-text p {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.4;
  color: #4a3a2a;
}

.task-14d-tips-text p:last-child { margin-bottom: 0; }

.task-14d-tips-text strong { color: var(--brand-orange, #e77a29); }

.task-14d-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.prd-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  align-items: end;
  transition: opacity 0.6s ease, transform 0.6s ease, max-height 0.7s ease 0.1s, margin 0.6s ease;
  overflow: visible;
  max-height: 220px;
}

.prd-row.is-row-gone { overflow: hidden; }

/* Az aktuálisan elhajtó járgány kerüljön a többi fölé */

.prd-vehicle.is-revving { z-index: 5; position: relative; }

.prd-row.is-row-gone {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  max-height: 0;
  margin: 0;
  pointer-events: none;
}

.prd-vehicle {
  appearance: none;
  background: transparent;
  border: none;
  padding: 4px 2px 6px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.18s ease, transform 0.18s ease;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.prd-vehicle:hover { background: rgba(231, 122, 41, 0.08); }

.prd-vehicle:focus-visible { outline: 3px solid var(--brand-orange, #e77a29); outline-offset: 2px; }

.prd-vehicle-img {
  display: block;
  width: 96px;
  height: 96px;
  background-size: contain;
  background-position: bottom center;
  background-repeat: no-repeat;
  transform-origin: bottom center;
  pointer-events: none;
  box-sizing: border-box;
  position: relative;
}

/* Kipufogó füst */

.prd-vehicle-img::before,
.prd-vehicle-img::after {
  content: '';
  position: absolute;
  bottom: 14%;
  left: 6%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95) 0%, rgba(200,200,200,0.8) 45%, rgba(150,150,150,0.0) 75%);
  opacity: 0;
  pointer-events: none;
  filter: blur(1px);
}

.prd-vehicle-img::after {
  width: 24px;
  height: 24px;
  bottom: 22%;
  left: 2%;
}

.prd-row[data-vehicle="motor"] .prd-vehicle-img { background-image: url('./assets/task-14/motor.webp'); }

.prd-row[data-vehicle="auto"]  .prd-vehicle-img { background-image: url('./assets/task-14/auto.webp'); }

.prd-row[data-vehicle="busz"]  .prd-vehicle-img { background-image: url('./assets/task-14/busz.webp'); }

/* Kattintás: kis rázkódás, majd elhajtás + eltűnés */

.prd-vehicle.is-revving .prd-vehicle-img {
  animation: prdDrive 1.4s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

.prd-vehicle.is-revving .prd-vehicle-img::before {
  animation: prdSmoke1 1.4s ease-out forwards;
}

.prd-vehicle.is-revving .prd-vehicle-img::after {
  animation: prdSmoke2 1.4s ease-out 0.15s forwards;
}

.prd-syllable {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-orange, #e77a29);
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
}

/* Elhajtott járgány: kép eltűnik, szótag halványul */

.prd-vehicle.is-done .prd-vehicle-img { opacity: 0; }

.prd-vehicle.is-done .prd-syllable { opacity: 0.45; }

.task-14d-foot {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

@media (max-width: 980px) {
  .prd-vehicle-img { width: 78px; height: 78px; }
  .prd-syllable { font-size: 1rem; }
}

@media (max-width: 720px) {
  .task-14d { padding: 18px 8px 22px; border-radius: 22px; }
  .task-14d-tips { gap: 10px; padding: 10px 12px; }
  .task-14d-tips-badge { flex: 0 0 46px; width: 46px; height: 46px; font-size: 0.95rem; }
  .task-14d-tips-text p { font-size: 0.88rem; }
  .prd-row { gap: 2px; }
  .prd-vehicle { padding: 2px 0 4px; }
  .prd-vehicle-img { width: 100%; max-width: 40px; height: 40px; }
  .prd-syllable { font-size: 0.7rem; letter-spacing: 0; }
}

@media (max-width: 480px) {
  .task-14d { padding: 14px 6px 20px; }
  .prd-row { gap: 1px; }
  .prd-vehicle-img { max-width: 34px; height: 34px; }
  .prd-syllable { font-size: 0.62rem; }
}

@media (max-width: 380px) {
  .prd-vehicle-img { max-width: 30px; height: 30px; }
  .prd-syllable { font-size: 0.58rem; }
}

/* ===== 15/a. FELADAT — Zöngés ajakperdítés (Brumi morog, járgányok elhajtanak) ===== */

.task-15a {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 28px;
  padding: 28px 24px 32px;
  margin: 28px auto;
  max-width: 1100px;
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
}

.task-15a-tips {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed rgba(231, 122, 41, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 12px 0 18px;
}

.task-15a-tips-badge {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand-orange, #e77a29);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-15a-tips-text p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #4a3a2a;
}

.task-15a-tips-text strong { color: var(--brand-orange, #e77a29); }

/* Brumi mackó a tips-dobozban a BR-pajzs mellett */

.task-15a-brumi-img {
  flex: 0 0 110px;
  width: 110px;
  height: auto;
  display: block;
  animation: p15aBrumiBob 2.6s ease-in-out infinite;
  transform-origin: center bottom;
}

/* Lead szöveg saját sora */

.task-15a-lead-row {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  padding: 12px 18px;
  margin: 0 0 18px;
}

.task-15a-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #4a3a2a;
}

/* Vehicles row */

.task-15a-board { margin-top: 6px; }

.task-15a-vehicles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  overflow: visible;
}

.p15a-vehicle {
  appearance: none;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 10px 6px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.p15a-vehicle:hover:not(.is-driving):not(.is-gone) {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.p15a-vehicle:focus-visible {
  outline: 3px solid var(--brand-orange, #e77a29);
  outline-offset: 2px;
  border-color: var(--brand-orange, #e77a29);
}

.p15a-veh-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: end;
  overflow: visible;
}

.p15a-veh-img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
  animation: p15aIdle 3.2s ease-in-out infinite;
  transform-origin: bottom center;
  position: relative;
  z-index: 2;
}

.p15a-vehicle:nth-child(2) .p15a-veh-img { animation-delay: 0.4s; }

.p15a-vehicle:nth-child(3) .p15a-veh-img { animation-delay: 0.8s; }

.p15a-vehicle:nth-child(4) .p15a-veh-img { animation-delay: 1.2s; }

.p15a-veh-label {
  font-family: var(--font-display, 'Fredoka', system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: #d96a3a;
  letter-spacing: 0.02em;
  transition: opacity 0.4s ease;
}

/* Kipufogófüst */

.p15a-smoke {
  position: absolute;
  bottom: 18%;
  left: 18%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95) 0%, rgba(200,200,200,0.8) 45%, rgba(150,150,150,0.0) 75%);
  opacity: 0;
  pointer-events: none;
  filter: blur(1px);
  z-index: 1;
}

.p15a-smoke-2 {
  width: 28px;
  height: 28px;
  bottom: 26%;
  left: 12%;
}

/* Kattintás: elindul, elhajt jobbra, eltűnik */

.p15a-vehicle.is-driving .p15a-veh-img {
  animation: p15aDrive 1.4s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

.p15a-vehicle.is-driving .p15a-smoke-1 {
  animation: p15aSmoke1 1.4s ease-out forwards;
}

.p15a-vehicle.is-driving .p15a-smoke-2 {
  animation: p15aSmoke2 1.4s ease-out 0.15s forwards;
}

.p15a-vehicle.is-driving .p15a-veh-label {
  opacity: 0.45;
}

.p15a-vehicle.is-driving { z-index: 5; }

.p15a-vehicle.is-gone .p15a-veh-img { opacity: 0; }

.p15a-vehicle.is-gone .p15a-veh-label { opacity: 0.45; }

.p15a-vehicle.is-gone { cursor: default; }

.task-15a-foot {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

@media (max-width: 980px) {
  .task-15a-brumi-img { flex: 0 0 90px; width: 90px; }
  .p15a-veh-img { max-width: 130px; }
}

@media (max-width: 720px) {
  .task-15a { padding: 18px 10px 22px; border-radius: 22px; }
  .task-15a-tips { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .task-15a-tips-badge { flex: 0 0 46px; width: 46px; height: 46px; font-size: 0.95rem; }
  .task-15a-brumi-img { flex: 0 0 70px; width: 70px; }
  .task-15a-tips-text { flex: 1 1 100%; }
  .task-15a-tips-text p { font-size: 0.88rem; }
  .task-15a-lead-row { padding: 10px 12px; }
  .task-15a-lead { font-size: 0.9rem; }
  .task-15a-vehicles { gap: 6px; }
  .p15a-vehicle { padding: 6px 4px 8px; }
  .p15a-veh-img { max-width: 78px; }
  .p15a-veh-label { font-size: 0.85rem; }
  .p15a-smoke { width: 14px; height: 14px; }
  .p15a-smoke-2 { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  .task-15a { padding: 14px 6px 20px; }
  .task-15a-brumi-img { flex: 0 0 60px; width: 60px; }
  .p15a-veh-img { max-width: 64px; }
  .p15a-veh-label { font-size: 0.78rem; }
}

/* ============================================================
   15/c és 15/d feladat — BR szavak képekkel, tükörtörés animáció
   ============================================================ */

.task-15c, .task-15d {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 18px 28px;
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
  margin: 0 auto 32px;
  max-width: 1080px;
}

.task-15c-tips, .task-15d-tips {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 2px solid rgba(231, 122, 41, 0.18);
}

.task-15c-tips-badge, .task-15d-tips-badge {
  flex: 0 0 auto;
  background: var(--brand-orange, #e77a29);
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: 14px;
  padding: 8px 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-15c-tips-text, .task-15d-tips-text {
  color: #4a3a2a;
  font-size: 1.02rem;
  line-height: 1.45;
}

.task-15c-tips-text p, .task-15d-tips-text p { margin: 0; }

.task-15c-tips-text strong, .task-15d-tips-text strong { color: #d96a3a; }

/* ===== Shatter-grid (4×3) ===== */

.shatter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 8px 4px;
}

.shatter-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ec 100%);
  border: 3px solid rgba(231, 122, 41, 0.18);
  border-radius: 18px;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  color: #4a3a2a;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.10);
  overflow: visible;
}

.shatter-card:hover:not(.shattered) {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--brand-orange, #e77a29);
  box-shadow: 0 8px 22px rgba(231, 122, 41, 0.25);
}

.shatter-card:active:not(.shattered) {
  transform: translateY(-1px) scale(1.01);
}

.shatter-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.shatter-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.shatter-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d96a3a;
  text-align: center;
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* ===== Shatter animáció (tükör darabokra törik) =====
   A kép helyén 6 háromszög-szilánk jelenik meg ugyanazzal a képpel,
   mindegyik clip-path-szel egy darabot mutat. Forgás + esés + halványulás. */

.shatter-card.shattering .shatter-img {
  animation: shatterImgFade 0.25s ease forwards;
}

.shatter-card.shattering .shatter-shard {
  opacity: 1;
  animation: shardFall 1.2s cubic-bezier(0.4, 0.05, 0.6, 1) forwards;
}

.shatter-card.shattering .shatter-flash {
  animation: shardFlash 0.35s ease-out forwards;
}

.shatter-card.shattering .shatter-cracks {
  animation: cracksFade 0.6s ease-out forwards;
}

/* Card "shattered" állapot — eltűnik */

.shatter-card.shattered {
  pointer-events: none;
}

.shatter-card.shattered .shatter-img-wrap {
  opacity: 0;
}

.shatter-card.shattered .shatter-word {
  opacity: 0.35;
  text-decoration: line-through;
  text-decoration-color: rgba(217, 106, 58, 0.4);
}

.task-15c-foot, .task-15d-foot {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* ===== Mobile (≤ 640px) ===== */

@media (max-width: 640px) {
  .task-15c, .task-15d { padding: 16px 10px 22px; }
  .shatter-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .shatter-card { padding: 8px 6px 10px; border-radius: 14px; border-width: 2px; }
  .shatter-word { font-size: 0.85rem; }
  .task-15c-tips, .task-15d-tips { padding: 10px 12px; gap: 10px; }
  .task-15c-tips-badge, .task-15d-tips-badge { font-size: 1.1rem; padding: 6px 10px; border-radius: 10px; }
  .task-15c-tips-text, .task-15d-tips-text { font-size: 0.92rem; }
  /* mobilon kisebb pálya — szilánkok közelebb essenek */
  .shatter-shard[data-shard="0"] { --tx: -90px; --ty: 130px; --rot: -40deg; }
  .shatter-shard[data-shard="1"] { --tx: 50px; --ty: 130px; --rot: 30deg; }
  .shatter-shard[data-shard="2"] { --tx: 110px; --ty: 150px; --rot: 50deg; }
  .shatter-shard[data-shard="3"] { --tx: 100px; --ty: 170px; --rot: 80deg; }
  .shatter-shard[data-shard="4"] { --tx: -20px; --ty: 190px; --rot: -70deg; }
  .shatter-shard[data-shard="5"] { --tx: -120px; --ty: 160px; --rot: -100deg; }
}

/* nagyon kicsi (≤ 380px) */

@media (max-width: 380px) {
  .shatter-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .shatter-word { font-size: 0.9rem; }
}

/* ===== 14/d-pr és 14/e-pr feladat — PR ajakperdítés szavakkal, becsukódó animáció ===== */

.task-14d-pr, .task-14e-pr {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 18px 28px;
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
  margin: 0 auto 32px;
  max-width: 1080px;
}

.task-14d-pr-tips, .task-14e-pr-tips {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 2px solid rgba(231, 122, 41, 0.18);
}

.task-14d-pr-tips-badge, .task-14e-pr-tips-badge {
  flex: 0 0 auto;
  background: var(--brand-orange, #e77a29);
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: 14px;
  padding: 8px 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-14d-pr-tips-text, .task-14e-pr-tips-text {
  color: #4a3a2a;
  font-size: 1.02rem;
  line-height: 1.45;
}

.task-14d-pr-tips-text p, .task-14e-pr-tips-text p { margin: 0; }

.task-14d-pr-tips-text strong, .task-14e-pr-tips-text strong { color: #d96a3a; }

/* ===== Fold-grid (4×3) ===== */

.fold-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 8px 4px;
  perspective: 1200px;
}

.fold-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ec 100%);
  border: 3px solid rgba(231, 122, 41, 0.18);
  border-radius: 18px;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  color: #4a3a2a;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.10);
  overflow: visible;
  transform-style: preserve-3d;
}

.fold-card:hover:not(.closed):not(.closing) {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--brand-orange, #e77a29);
  box-shadow: 0 8px 22px rgba(231, 122, 41, 0.25);
}

.fold-card:active:not(.closed):not(.closing) {
  transform: translateY(-1px) scale(1.01);
}

.fold-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.fold-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  backface-visibility: hidden;
  transition: filter 0.4s ease;
}

.fold-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4a3a2a;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: opacity 0.4s ease;
}

/* Könyv becsukódik effekt — vízszintes 3D forgás, középről záródik */

.fold-card.closing .fold-img {
  animation: foldClose 0.85s cubic-bezier(0.5, 0, 0.65, 1) forwards;
}

.fold-card.closing .fold-word {
  opacity: 0.4;
}

.fold-card.closing::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 36px;
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(180deg, rgba(231, 122, 41, 0.0) 0%, rgba(231, 122, 41, 0.45) 30%, rgba(231, 122, 41, 0.45) 70%, rgba(231, 122, 41, 0.0) 100%);
  border-radius: 2px;
  opacity: 0;
  animation: foldSpine 0.85s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}

/* Becsukódott állapot — kép eltűnik, szó halvány, kártya enyhén lebillen */

.fold-card.closed {
  transform: rotateX(2deg) scale(0.96);
  border-color: rgba(231, 122, 41, 0.10);
  box-shadow: 0 2px 6px rgba(231, 122, 41, 0.06);
  cursor: default;
}

.fold-card.closed .fold-img-wrap {
  opacity: 0;
  pointer-events: none;
}

.fold-card.closed .fold-word {
  opacity: 0.42;
  font-style: italic;
}

.task-14d-pr-foot, .task-14e-pr-foot {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ===== Responsive ===== */

@media (max-width: 720px) {
  .task-14d-pr, .task-14e-pr { padding: 16px 10px 22px; }
  .fold-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .fold-card { padding: 8px 6px 10px; border-radius: 14px; border-width: 2px; }
  .fold-word { font-size: 0.96rem; }
  .task-14d-pr-tips, .task-14e-pr-tips { padding: 10px 12px; gap: 10px; }
  .task-14d-pr-tips-badge, .task-14e-pr-tips-badge { font-size: 1.1rem; padding: 6px 10px; border-radius: 10px; }
  .task-14d-pr-tips-text, .task-14e-pr-tips-text { font-size: 0.92rem; }
}

@media (max-width: 380px) {
  .fold-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fold-word { font-size: 0.9rem; }
}

/* ===== 16. feladat — PR-BR szólánc dobókockával (TÁRSASJÁTÉK stílus) ===== */

.task-16 {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: clamp(10px, 2vw, 22px) clamp(10px, 2.5vw, 18px) clamp(14px, 2.2vw, 28px);
  box-shadow: 0 8px 32px rgba(231, 122, 41, 0.10);
  margin: 0 auto 32px;
  max-width: 1080px;
  position: relative;
  --task-16-board-max-h: min(52vh, 420px);
}

.task-16-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.task-16-tips {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  padding: 14px 18px;
  border: 3px dashed rgba(184, 106, 42, 0.45);
  box-shadow: 0 4px 12px rgba(184, 106, 42, 0.12);
}

.task-16-tips-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.task-16-badge {
  background: var(--brand-orange, #e77a29);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 10px rgba(231, 122, 41, 0.32);
}

.task-16-tips-text {
  color: #4a3a2a;
  font-size: 0.98rem;
  line-height: 1.45;
}

.task-16-tips-text p { margin: 0 0 6px; }

.task-16-tips-text p:last-child { margin-bottom: 0; }

.task-16-tips-text strong { color: #d96a3a; }

/* ===== Instrukció blokkok (hangsorok + tábla előtt) ===== */

.task-16-instruction {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #f3c89a;
  border-radius: 14px;
  margin: 12px 0;
}

.task-16-instr-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.task-16-instr-text {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1rem;
  color: #4a3a2a;
  line-height: 1.45;
  flex: 1;
}

.task-16-instr-text strong { color: #d96a3a; }

.task-16-instr-board {
  justify-content: space-between;
  gap: 18px;
}

.task-16-instr-board .task-16-dice-wrap {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 640px) {
  .task-16-instruction { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .task-16-instr-badges { justify-content: center; }
  .task-16-instr-board .task-16-dice-wrap { margin-left: 0; align-self: center; }
  .task-16-instr-text { font-size: 0.95rem; text-align: center; }
}

/* ===== PR-BR szótagpárok (hangsorok) ===== */

.task-16-syllables {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fff8f0 0%, #ffeacc 100%);
  border: 2px dashed #f0b070;
  border-radius: 16px;
  align-items: center;
}

.task-16-syll-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
}

.task-16-syll {
  /* Baloo 2: kerek, gyerekbarát, kiváló magyar di-/trigraph (ő, ű, á, é, í, ó, ú) támogatással */
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  color: #e77a29;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

@media (max-width: 560px) {
  .task-16-syllables { padding: 12px 14px; gap: 6px; }
  .task-16-syll-row { gap: 8px 18px; }
  .task-16-syll { font-size: 1.15rem; }
}

/* ===== Dobókocka ===== */

.task-16-dice-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  align-self: start;
}

.task-16-dice {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  border: 3px solid #d96a3a;
  background: linear-gradient(160deg, #ffffff 0%, #fff2e0 100%);
  /* alapszimbólum, amíg nem dobtunk */
}

.task-16-dice:not([data-value])::before {
  content: "?";
  font-size: 2.4rem;
  font-weight: 800;
  color: #d96a3a;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.task-16-dice {
  box-shadow:
    0 6px 16px rgba(231, 122, 41, 0.28),
    inset 0 -4px 8px rgba(217, 106, 58, 0.08);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-16-dice:hover:not(.is-rolling) {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 10px 22px rgba(231, 122, 41, 0.38),
    inset 0 -4px 8px rgba(217, 106, 58, 0.08);
}

.task-16-dice:active {
  transform: translateY(0) scale(0.98);
}

.task-16-dice.is-rolling {
  animation: diceShake 0.7s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
  pointer-events: none;
}

.dice-face {
  position: relative;
  width: 70px;
  height: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
}

.dice-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4a3a2a;
  box-shadow: inset -2px -2px 3px rgba(0,0,0,0.18);
  opacity: 0;
  justify-self: center;
  align-self: center;
}

/* Dot positions — 3×3 grid:
   1: center (5)
   2: 1, 9
   3: 1, 5, 9
   4: 1, 3, 7, 9
   5: 1, 3, 5, 7, 9
   6: 1, 3, 4, 6, 7, 9
*/

.dice-dot.dot-1 { grid-area: 1 / 1; }

.dice-dot.dot-2 { grid-area: 1 / 3; }

.dice-dot.dot-3 { grid-area: 2 / 1; }

.dice-dot.dot-4 { grid-area: 2 / 2; }

.dice-dot.dot-5 { grid-area: 2 / 3; }

.dice-dot.dot-6 { grid-area: 3 / 1; }

.dice-dot.dot-7 { grid-area: 3 / 3; }

.dice-dot.dot-8 { grid-area: 1 / 2; }

.dice-dot.dot-9 { grid-area: 3 / 2; }

.task-16-dice[data-value="1"] .dot-4 { opacity: 1; }

.task-16-dice[data-value="2"] .dot-1,
.task-16-dice[data-value="2"] .dot-7 { opacity: 1; }

.task-16-dice[data-value="3"] .dot-1,
.task-16-dice[data-value="3"] .dot-4,
.task-16-dice[data-value="3"] .dot-7 { opacity: 1; }

.task-16-dice[data-value="4"] .dot-1,
.task-16-dice[data-value="4"] .dot-2,
.task-16-dice[data-value="4"] .dot-6,
.task-16-dice[data-value="4"] .dot-7 { opacity: 1; }

.task-16-dice[data-value="5"] .dot-1,
.task-16-dice[data-value="5"] .dot-2,
.task-16-dice[data-value="5"] .dot-4,
.task-16-dice[data-value="5"] .dot-6,
.task-16-dice[data-value="5"] .dot-7 { opacity: 1; }

.task-16-dice[data-value="6"] .dot-1,
.task-16-dice[data-value="6"] .dot-2,
.task-16-dice[data-value="6"] .dot-3,
.task-16-dice[data-value="6"] .dot-5,
.task-16-dice[data-value="6"] .dot-6,
.task-16-dice[data-value="6"] .dot-7 { opacity: 1; }

.task-16-dice-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #d96a3a;
  text-align: center;
  white-space: nowrap;
}

/* ===== Társasjáték TÁBLA: zöld pázsit + fa-keret + rárajzolt útvonal ===== */

.task-16-board {
  position: relative;
  background: #b9e07c; /* fallback pázsit — az SVG fedi */
  border: 8px solid transparent;
  border-radius: 26px;
  padding: clamp(12px, 2vw, 30px) clamp(8px, 1.5vw, 22px) clamp(10px, 1.8vw, 26px);
  /* Fa-keret hatás: kettős box-shadow */
  background-image:
    linear-gradient(180deg, #b9e07c 0%, #b9e07c 100%);
  background-clip: padding-box;
  box-shadow:
    0 0 0 6px #8b4a18,           /* fa-keret külseje */
    0 0 0 8px #a25a22,           /* keret átmenet */
    0 0 0 12px #c98a4a,          /* világosabb él */
    0 14px 30px rgba(90, 47, 15, 0.40),
    inset 0 0 0 2px rgba(255,255,255,0.4);
  overflow: hidden;
  min-height: 0;
  max-height: var(--task-16-board-max-h);
}

/* Fa-keret fehér szegecsek a sarkokban */

.task-16-board::before,
.task-16-board::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7d0 0%, #d4a04a 70%, #8b4a18 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.4);
  z-index: 5;
}

.task-16-board::before { top: 8px; left: 8px; }

.task-16-board::after  { top: 8px; right: 8px; }

/* Tábla hátterek SVG — abszolút, a teljes board */

.task-16-board-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Mezők rácsa az SVG táblára — a mezők "állnak" az útvonalon */

.chain-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: clamp(14px, 2.2vw, 36px) clamp(8px, 1.2vw, 18px);
  padding: 4px 2px 8px;
  position: relative;
  z-index: 2;
  height: 100%;
  align-content: center;
}

/* Pozíció elrendezés a kanyargós úthoz:
   Felső sor: 1 → 2 → 3 → 4 → 5 → 6 → 7
   Alsó sor (jobbról balra): 8 → 9 → 10 → 11 → 12 → 13 → 14
   Tehát fizikailag a 8. mezőt a felső sor jobb szélével azonos oszlopba, a 14. mezőt a bal szélre rakjuk. */

.chain-cell.pos-1  { grid-column: 1; grid-row: 1; }

.chain-cell.pos-2  { grid-column: 2; grid-row: 1; }

.chain-cell.pos-3  { grid-column: 3; grid-row: 1; }

.chain-cell.pos-4  { grid-column: 4; grid-row: 1; }

.chain-cell.pos-5  { grid-column: 5; grid-row: 1; }

.chain-cell.pos-6  { grid-column: 6; grid-row: 1; }

.chain-cell.pos-7  { grid-column: 7; grid-row: 1; }

.chain-cell.pos-8  { grid-column: 7; grid-row: 2; }

.chain-cell.pos-9  { grid-column: 6; grid-row: 2; }

.chain-cell.pos-10 { grid-column: 5; grid-row: 2; }

.chain-cell.pos-11 { grid-column: 4; grid-row: 2; }

.chain-cell.pos-12 { grid-column: 3; grid-row: 2; }

.chain-cell.pos-13 { grid-column: 2; grid-row: 2; }

.chain-cell.pos-14 { grid-column: 1; grid-row: 2; }

.chain-cell {
  position: relative;
  /* Társasjáték-mező: KER OVÁLIS alakú fejér korong — a sárga útvonal alatta */
  background: linear-gradient(180deg, #ffffff 0%, #fff7ec 100%);
  border: 3px solid #5a2f0f;
  border-radius: 50%;             /* OVÁLIS — a flex-tartalmat úgy alakítjuk hogy beleilljen */
  aspect-ratio: 1 / 1.15;         /* enyhén magasabb mint széles: ovális */
  padding: 22px 10px 16px;        /* Felül több hely a számkörnek + alul a feliratnak */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow:
    inset 0 -3px 0 rgba(90, 47, 15, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    0 5px 12px rgba(90, 47, 15, 0.28);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
  z-index: 3;
  /* overflow visible: a szám-kör és bábu kilóghasson */
}

/* Számozott lépés-kör minden cella tetején (társasjáték mező-szám) */

.chain-cell::before {
  content: attr(data-pos);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffd277 0%, #e8a23c 100%);
  color: #5a2f0f;
  font-weight: 900;
  font-size: 0.92rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b86a2a;
  box-shadow: 0 2px 4px rgba(184, 106, 42, 0.35);
  z-index: 3;
}

/* SVG-n lévő útvonal már köti a mezőket, így pötty-jeleket nem használunk */

.chain-cell.is-current {
  border-color: #e77a29;
  box-shadow:
    0 0 0 5px rgba(231, 122, 41, 0.22),
    inset 0 -3px 0 rgba(231, 122, 41, 0.32),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 8px 20px rgba(231, 122, 41, 0.32);
  transform: translateY(-3px);
  background: linear-gradient(180deg, #fff0d5 0%, #ffdca0 100%);
  z-index: 4;
}

.chain-cell.is-current::before {
  background: linear-gradient(180deg, #ff9540 0%, #e77a29 100%);
  color: #fff;
}

/* START mező (1) — zöld, mint társasjáték startja */

.chain-cell.pos-1 {
  background: linear-gradient(180deg, #d8f5c8 0%, #a5e07a 100%);
  border-color: #4d8a2e;
  box-shadow:
    inset 0 -3px 0 rgba(77, 138, 46, 0.30),
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 4px 10px rgba(77, 138, 46, 0.20);
}

.chain-cell.pos-1::before {
  background: linear-gradient(180deg, #7bc94a 0%, #4d8a2e 100%);
  color: #fff;
  border-color: #2f5e1a;
}

/* CÉL mező (14) — piros gyűrű + dupla szegély verseny-cél érzettel */

.chain-cell.is-goal {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ec 100%);
  border: 5px solid #b14a13;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px #e77a29,
    0 0 0 9px #fff,
    0 0 0 11px #b14a13,
    inset 0 -3px 0 rgba(177, 74, 19, 0.30),
    0 8px 18px rgba(177, 74, 19, 0.40);
}

.chain-cell.is-goal .chain-img-wrap {
  box-shadow: 0 0 0 2px rgba(231, 122, 41, 0.30);
}

.chain-cell.is-goal::before {
  background: linear-gradient(180deg, #ff5a3a 0%, #b14a13 100%);
  color: #fff;
  border-color: #6d2a08;
}

/* CÉL mező (kör) — kockás minta átlapolva, bélyeg-szerű hatású */

.chain-img-wrap {
  width: 78%;                /* szűkítés, hogy a kép a kerek peremen belül maradjon */
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* A kép maga is körre vágódik (a fejér alap ovalis, a kép felfekszik) */
  border-radius: 50%;
  overflow: hidden;
}

.chain-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.chain-label {
  font-size: clamp(0.62rem, 1.1vw, 0.78rem);
  font-weight: 700;
  color: #4a3a2a;
  text-align: center;
  line-height: 1.05;
  padding: 0 2px;
  max-width: 100%;
  word-break: break-word;
  hyphens: auto;
}

/* Bábu — társasjáték-figura: lila bábu emoji + talapzat */

.chain-pawn {
  position: absolute;
  top: -22px;
  right: -14px;
  font-size: 2.4rem;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,0.3));
  z-index: 6;
  animation: pawnBounce 1.4s ease-in-out infinite;
  transition: top 0.35s ease, right 0.35s ease;
  line-height: 1;
}

/* Talapzat a bábu alatt — ovális árnyék/hely-jel */

.chain-pawn::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 5px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

/* Start / End felirat-szalag a mezők alatt */

.chain-arrow {
  position: absolute;
  font-weight: 900;
  pointer-events: none;
  z-index: 5;
}

.chain-arrow-start {
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #7bc94a 0%, #4d8a2e 100%);
  color: #fff;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  border: 2px solid #2f5e1a;
  box-shadow: 0 3px 6px rgba(77, 138, 46, 0.4);
  white-space: nowrap;
}

.chain-arrow-start::before {
  content: "START";
}

.chain-arrow-start { font-size: 0; }

.chain-arrow-start::before { font-size: 0.78rem; }

.chain-arrow-end {
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ff5a3a 0%, #b14a13 100%);
  color: #fff;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0;
  letter-spacing: 0.08em;
  border: 2px solid #6d2a08;
  box-shadow: 0 3px 6px rgba(177, 74, 19, 0.4);
  white-space: nowrap;
}

.chain-arrow-end::before {
  content: "CÉL \1F3C1";
  font-size: 0.78rem;
}

/* Következő lépés mezője — kattintható, pulzáló zöld glow */

.chain-cell.is-next-step {
  cursor: pointer;
  animation: nextStepPulse 1.2s ease-in-out infinite;
}

.chain-cell.is-next-step::after {
  content: "👆";
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  animation: tapHint 1s ease-in-out infinite;
  z-index: 7;
  pointer-events: none;
}

/* Pulse animáció amikor új mezőre érkezik */

.chain-cell.just-arrived {
  animation: cellPulse 0.6s ease-out;
}

/* Cél elérve állapot */

.task-16.is-finished .chain-cell.pos-14 {
  background: linear-gradient(180deg, #fff8e0 0%, #ffe39a 100%);
  border-color: #e77a29;
  animation: goalGlow 1.2s ease-in-out infinite;
}

.task-16-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.task-16-status {
  font-size: 1rem;
  font-weight: 700;
  color: #4a3a2a;
  background: rgba(255, 255, 255, 0.65);
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid rgba(231, 122, 41, 0.15);
  flex: 1;
  min-width: 200px;
}

.task-16-status.is-goal {
  background: linear-gradient(180deg, #fff3e3 0%, #ffe39a 100%);
  border-color: #e77a29;
  color: #b14a13;
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  .chain-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
  /* 4 oszlop kanyargós: felső sor 1-4, jobbra; következő sor 5-8 jobbról balra; aztán 9-12; végül 13-14 jobbról balra */
  .chain-cell.pos-1  { grid-column: 1; grid-row: 1; }
  .chain-cell.pos-2  { grid-column: 2; grid-row: 1; }
  .chain-cell.pos-3  { grid-column: 3; grid-row: 1; }
  .chain-cell.pos-4  { grid-column: 4; grid-row: 1; }
  .chain-cell.pos-5  { grid-column: 4; grid-row: 2; }
  .chain-cell.pos-6  { grid-column: 3; grid-row: 2; }
  .chain-cell.pos-7  { grid-column: 2; grid-row: 2; }
  .chain-cell.pos-8  { grid-column: 1; grid-row: 2; }
  .chain-cell.pos-9  { grid-column: 1; grid-row: 3; }
  .chain-cell.pos-10 { grid-column: 2; grid-row: 3; }
  .chain-cell.pos-11 { grid-column: 3; grid-row: 3; }
  .chain-cell.pos-12 { grid-column: 4; grid-row: 3; }
  .chain-cell.pos-13 { grid-column: 4; grid-row: 4; }
  .chain-cell.pos-14 { grid-column: 3; grid-row: 4; }
}

/* Tablet — SVG útvonalat eltávolítjuk (mert külön elrendezés) és sima hátteret használunk */

@media (max-width: 900px) {
  .task-16-board-svg { display: none; }
  .task-16-board {
    background:
      radial-gradient(circle at 20% 20%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
      radial-gradient(circle at 60% 60%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
      linear-gradient(180deg, #b9e07c 0%, #a3d36b 100%);
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .task-16 { padding: 16px 10px 22px; }
  .task-16-top { grid-template-columns: 1fr; gap: 12px; }
  .task-16-dice-wrap { flex-direction: row; gap: 12px; justify-content: center; }
  .task-16-tips { padding: 10px 12px; gap: 10px; }
  .task-16-tips-text { font-size: 0.88rem; }
  .task-16-badge { width: 38px; height: 38px; font-size: 0.92rem; }
  .task-16-dice { width: 78px; height: 78px; }
  .dice-face { width: 56px; height: 56px; }
  .dice-dot { width: 10px; height: 10px; }
  .task-16-board { padding: 18px 10px 14px; }
  .chain-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 22px 14px;
  }
  .chain-cell { padding: 20px 6px 12px; border-width: 2px; }
  .chain-cell::before {
    width: 22px; height: 22px; font-size: 0.78rem; top: -10px;
  }
  .chain-img-wrap { width: 72%; }
  .chain-label { font-size: 0.72rem; }
  .chain-pawn { font-size: 1.9rem; top: -18px; right: -10px; }
  .chain-arrow-start::before,
  .chain-arrow-end::before { font-size: 0.7rem; }
  /* 3 oszlop kanyargós:
     sor1: 1-2-3 →
     sor2: 6-5-4 ←
     sor3: 7-8-9 →
     sor4: 12-11-10 ←
     sor5: 13-14 →
  */
  .chain-cell.pos-1  { grid-column: 1; grid-row: 1; }
  .chain-cell.pos-2  { grid-column: 2; grid-row: 1; }
  .chain-cell.pos-3  { grid-column: 3; grid-row: 1; }
  .chain-cell.pos-4  { grid-column: 3; grid-row: 2; }
  .chain-cell.pos-5  { grid-column: 2; grid-row: 2; }
  .chain-cell.pos-6  { grid-column: 1; grid-row: 2; }
  .chain-cell.pos-7  { grid-column: 1; grid-row: 3; }
  .chain-cell.pos-8  { grid-column: 2; grid-row: 3; }
  .chain-cell.pos-9  { grid-column: 3; grid-row: 3; }
  .chain-cell.pos-10 { grid-column: 3; grid-row: 4; }
  .chain-cell.pos-11 { grid-column: 2; grid-row: 4; }
  .chain-cell.pos-12 { grid-column: 1; grid-row: 4; }
  .chain-cell.pos-13 { grid-column: 1; grid-row: 5; }
  .chain-cell.pos-14 { grid-column: 2; grid-row: 5; }
}

/* ===== 16. feladat — viewport-fit (solo + classroom paged) ===== */

body.solo-mode .task-16.solo-task-active,
body.classroom-paged-mode .task-16.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
}

body.solo-mode .task-16.solo-task-active .task-16-syllables,
body.classroom-paged-mode .task-16.solo-task-active .task-16-syllables {
  padding: 8px 12px;
  gap: 4px;
}

body.solo-mode .task-16.solo-task-active .task-16-syll,
body.classroom-paged-mode .task-16.solo-task-active .task-16-syll {
  font-size: clamp(0.82rem, 2.2vw, 1rem);
}

body.solo-mode .task-16.solo-task-active .task-16-instruction,
body.classroom-paged-mode .task-16.solo-task-active .task-16-instruction {
  padding: 8px 10px;
  margin-bottom: 6px;
}

body.solo-mode .task-16.solo-task-active .task-16-instr-text,
body.classroom-paged-mode .task-16.solo-task-active .task-16-instr-text {
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  line-height: 1.35;
}

body.solo-mode .task-16.solo-task-active .task-16-board,
body.classroom-paged-mode .task-16.solo-task-active .task-16-board {
  flex: 1 1 auto;
  min-height: 0;
  --task-16-board-max-h: none;
  max-height: none;
  display: flex;
  flex-direction: column;
}

body.solo-mode .task-16.solo-task-active .chain-grid,
body.classroom-paged-mode .task-16.solo-task-active .chain-grid {
  flex: 1 1 auto;
  min-height: 0;
  gap: clamp(8px, 1.5vh, 18px) clamp(6px, 1vw, 12px);
}

body.solo-mode .task-16.solo-task-active .chain-cell,
body.classroom-paged-mode .task-16.solo-task-active .chain-cell {
  padding: clamp(12px, 2vh, 18px) 4px 10px;
}

body.solo-mode .task-16.solo-task-active .chain-img-wrap,
body.classroom-paged-mode .task-16.solo-task-active .chain-img-wrap {
  width: 72%;
}

body.solo-mode .task-16.solo-task-active .task-16-dice,
body.classroom-paged-mode .task-16.solo-task-active .task-16-dice {
  width: clamp(56px, 10vw, 72px);
  height: clamp(56px, 10vw, 72px);
}

body.solo-mode .task-16.solo-task-active .task-16-foot,
body.classroom-paged-mode .task-16.solo-task-active .task-16-foot {
  margin-top: 8px;
  flex-shrink: 0;
}

body.solo-mode .task-16.solo-task-active .task-16-status,
body.classroom-paged-mode .task-16.solo-task-active .task-16-status {
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  padding: 6px 10px;
}

/* ===================================================================
   16/b feladat — Ajakperdítés gyakorlása szövegben
   =================================================================== */

.task-16a {
  margin-top: 32px;
}

.task-16a-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.task-16b,
.task-16c {
  margin-top: 32px;
}

.task-16bc-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.task-16bc-page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.task-16bc-nav-btn {
  border: none;
  background: #e77a29;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.task-16bc-nav-btn:hover:not(:disabled) { transform: translateY(-1px); }

.task-16bc-nav-btn:disabled { opacity: 0.35; cursor: default; }

.task-16bc-page-indicator {
  font-weight: 800;
  font-size: 14px;
  min-width: 72px;
  text-align: center;
  color: #b14a13;
}

.task-16bc-pages {
  flex: 1 1 auto;
  min-height: 0;
}

.task-16bc-page[hidden] { display: none !important; }

.task-16bc-foot {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

body.solo-mode .task-16b.solo-task-active .task-16bc-shell,
body.solo-mode .task-16c.solo-task-active .task-16bc-shell,
body.classroom-paged-mode .task-16b.solo-task-active .task-16bc-shell,
body.classroom-paged-mode .task-16c.solo-task-active .task-16bc-shell {
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(72px, 14dvh, 120px));
}

body.solo-mode .task-16b.solo-task-active .task-16bc-page:not([hidden]),
body.solo-mode .task-16c.solo-task-active .task-16bc-page:not([hidden]),
body.classroom-paged-mode .task-16b.solo-task-active .task-16bc-page:not([hidden]),
body.classroom-paged-mode .task-16c.solo-task-active .task-16bc-page:not([hidden]) {
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(120px, 20dvh, 180px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.solo-mode .task-16b.solo-task-active .task-16bc-puzzle,
body.solo-mode .task-16c.solo-task-active .task-16bc-puzzle,
body.classroom-paged-mode .task-16b.solo-task-active .task-16bc-puzzle,
body.classroom-paged-mode .task-16c.solo-task-active .task-16bc-puzzle {
  margin-top: 0;
}

/* Tipp blokk (PR/BR badge + utasítás) */

.task-16b-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #f3c89a;
  border-radius: 14px;
  margin: 12px 0 16px;
}

.task-16b-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.task-16b-tip-text {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1rem;
  color: #4a3a2a;
  line-height: 1.45;
  flex: 1;
}

.task-16b-tip-text strong { color: #d96a3a; }

/* Hangutánzó mini-példák */

.task-16b-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  justify-content: center;
}

.task-16b-example {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #fff8f0 0%, #ffeacc 100%);
  border: 2px dashed #f0b070;
  border-radius: 14px;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1rem;
  color: #4a3a2a;
}

.task-16b-example-sound {
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  background: #e77a29;
  padding: 4px 12px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

/* Mese-doboz */

.task-16b-story {
  background: linear-gradient(180deg, #fffdf7 0%, #fff5e6 100%);
  border: 2px solid #f3c89a;
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 12px rgba(168, 110, 60, 0.08);
}

.task-16b-story-title {
  margin: 0 0 14px;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #b14a13;
  border-bottom: 2px dashed #f3c89a;
  padding-bottom: 8px;
}

.task-16b-story-body {
  font-family: "Nunito", "Georgia", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3a2a1a;
}

.task-16b-story-body p {
  margin: 0 0 10px;
}

.task-16b-dialog {
  margin-left: 14px;
  font-style: italic;
  color: #5a3a1a;
}

.task-16b-closing {
  font-weight: 700;
  color: #d96a3a;
  margin-top: 12px !important;
}

.task-16b-story-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px dashed #f3c89a;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #b14a13;
  text-align: center;
}

/* ===== PR/BR szótag-kiemelés (a mintában piros | jelölés modernizált változata) ===== */

mark.pr-br {
  /* Reset böngésző mark stílus */
  background: transparent;
  color: inherit;
  /* A szótag félkövér, narancssárga */
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-weight: 800;
  color: #e77a29;
  /* Függőleges piros/narancs sáv a szótag bal oldalán (mint a mintában |) */
  border-left: 3px solid #e77a29;
  padding-left: 2px;
  margin-left: 1px;
  /* Enyhe halvány háttér a kiemelt szótag mögött */
  background: linear-gradient(180deg, rgba(255, 220, 180, 0.4) 0%, rgba(255, 200, 140, 0.5) 100%);
  border-radius: 0 3px 3px 0;
}

/* A mese címében nincs háttér, csak a függőleges sáv és színes szöveg */

.task-16b-story-title mark.pr-br {
  background: transparent;
  color: #b14a13;
}

/* Mobil ===================================================== */

@media (max-width: 640px) {
  .task-16b-tip {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .task-16b-badges { justify-content: center; }
  .task-16b-tip-text { font-size: 0.95rem; text-align: center; }

  .task-16b-examples { flex-direction: column; }
  .task-16b-example { justify-content: center; flex-wrap: wrap; }

  .task-16b-story { padding: 16px 14px; }
  .task-16b-story-title { font-size: 1.25rem; }
  .task-16b-story-body { font-size: 1rem; line-height: 1.65; }
  .task-16b-dialog { margin-left: 8px; }
}

/* ===================================================================
   16/b puzzle feladat — drag & drop képkirakó
   =================================================================== */

.task-16b-puzzle {
  margin-top: 24px;
  padding: 18px 20px;
  background: #fff;
  border: 2px dashed #f0b070;
  border-radius: 18px;
}

.puzzle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: 1.2rem;
  color: #b14a13;
  font-weight: 700;
}

.puzzle-icon {
  font-size: 1.6rem;
}

.puzzle-title {
  flex: 1;
}

/* A puzzle-tábla: 3×3 üres rács, ahova a darabokat húzni kell */

.puzzle-board {
  --puzzle-size: 360px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  width: var(--puzzle-size);
  height: var(--puzzle-size);
  margin: 0 auto 18px;
  background: linear-gradient(180deg, #fffdf7 0%, #fff5e6 100%);
  border: 3px solid #e77a29;
  border-radius: 14px;
  padding: 6px;
  box-shadow: inset 0 2px 8px rgba(168, 110, 60, 0.1);
}

/* Tray: a kevert puzzle darabok gyűjtője alul */

.puzzle-tray {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fff8f0 0%, #ffeacc 100%);
  border: 2px solid #f3c89a;
  border-radius: 14px;
  margin-bottom: 14px;
  min-height: 76px;
}

.puzzle-tray .puzzle-piece {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  border: 2px solid #f3c89a;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
}

.puzzle-piece.is-dragging {
  cursor: grabbing;
  opacity: 0.85;
  z-index: 1000;
}

.puzzle-piece.is-placed {
  cursor: default;
  border-color: transparent;
}

.puzzle-slot {
  position: relative;
  background: rgba(255, 245, 230, 0.5);
  border: 2px dashed rgba(231, 122, 41, 0.25);
  border-radius: 6px;
  overflow: hidden;
}

.puzzle-slot.is-over {
  border-color: #e77a29;
  background: rgba(231, 122, 41, 0.12);
}

.puzzle-slot.is-filled .puzzle-piece {
  width: 100%;
  height: 100%;
}

.puzzle-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.puzzle-status {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1rem;
  color: #4a3a2a;
  flex: 1;
  min-width: 200px;
}

.puzzle-status.is-success {
  color: #4d8a2e;
  font-weight: 700;
}

/* Sikersignal: a tábla körül zöld glow + pulzál */

.task-16b-puzzle.is-complete .puzzle-board,
.task-16bc-puzzle.is-complete .puzzle-board,
.task-18d-puzzle-board.is-complete .puzzle-board {
  border-color: #4d8a2e;
  box-shadow: 0 0 0 4px rgba(123, 201, 74, 0.35),
              inset 0 2px 8px rgba(168, 110, 60, 0.1);
  animation: puzzleSuccess 0.8s ease;
}

/* Mobil ===================================================== */

@media (max-width: 640px) {
  .task-16b-puzzle { padding: 14px 12px; }
  .puzzle-board { --puzzle-size: 280px; }
  .puzzle-tray { 
    grid-template-columns: repeat(5, 1fr); 
    grid-auto-rows: 1fr;
    gap: 6px;
  }
  .puzzle-header { font-size: 1.05rem; }
  .puzzle-icon { font-size: 1.35rem; }
}

/* ============================================================ */

.task-17a, .task-17b {
  position: relative;
  background: linear-gradient(180deg, #fffdf7 0%, #fff5e6 100%);
  border: 2px dashed #f0b070;
  border-radius: 22px;
  padding: 28px 32px;
  margin: 28px auto;
  max-width: 1100px;
  box-shadow: 0 6px 20px rgba(231, 122, 41, 0.08);
}

.task-17a-head, .task-17b-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.task-17a-badge, .task-17b-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e77a29 0%, #d96a3a 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.35);
}

.task-17a-titles, .task-17b-titles {
  flex: 1;
}

.task-17a-title, .task-17b-title {
  font-family: 'Fredoka', sans-serif;
  color: #4a3a2a;
  font-size: 1.5rem;
  margin: 0 0 6px;
  line-height: 1.25;
}

.task-17a-title .tr-mark,
.task-17b-title .tr-mark {
  background: #fff2e0;
  color: #d96a3a;
  padding: 0 8px;
  border-radius: 6px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
}

.task-17a-subtitle, .task-17b-subtitle {
  font-family: 'Nunito', sans-serif;
  color: #6a5240;
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

/* 17/a grid + instruction */

.task-17a-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.task-17a-instruction {
  background: #fffdf7;
  border-radius: 16px;
  padding: 20px 22px;
  border: 1px solid #f3c89a;
}

.task-17a-instruction p {
  font-family: 'Nunito', sans-serif;
  color: #4a3a2a;
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

.task-17a-instruction p:last-of-type {
  margin-bottom: 0;
}

.task-17a-instruction strong {
  color: #b14a13;
  font-weight: 800;
}

.task-17a-sound {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  background: linear-gradient(135deg, #fff2e0 0%, #ffe6c4 100%);
  border-radius: 12px;
  border: 2px dashed #e77a29;
  justify-content: center;
}

.task-17a-sound-piece {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #d96a3a;
  padding: 4px 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(231, 122, 41, 0.15);
}

.task-17a-sound-strong {
  font-size: 1.7rem;
  font-weight: 800;
  color: #b14a13;
  background: #fff8eb;
}

/* Lépések listája */

.task-17a-steps-title {
  font-family: 'Fredoka', sans-serif;
  color: #b14a13;
  font-size: 1.15rem;
  margin: 0 0 14px;
  font-weight: 600;
}

.task-17a-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-17a-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff8eb 0%, #fff2e0 100%);
  border-left: 4px solid #e77a29;
  border-radius: 10px;
}

.task-17a-steps .step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e77a29 0%, #d96a3a 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(231, 122, 41, 0.3);
}

.task-17a-steps .step-text {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  color: #4a3a2a;
  font-size: 1rem;
  line-height: 1.5;
  padding-top: 4px;
}

.task-17a-steps strong {
  color: #b14a13;
  font-weight: 800;
}

/* Hanyatt fekvős kártya */

.task-17a-hanyatt-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #fff8eb 0%, #ffeacc 100%);
  border-radius: 16px;
  border: 2px solid #f0b070;
}

.task-17a-hanyatt-image-wrap {
  flex-shrink: 0;
  width: 180px;
  background: white;
  border-radius: 14px;
  padding: 8px;
  border: 1px solid #f3c89a;
  box-shadow: 0 3px 10px rgba(231, 122, 41, 0.15);
}

.task-17a-hanyatt-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.task-17a-hanyatt-text {
  flex: 1;
}

.task-17a-hanyatt-text p {
  font-family: 'Nunito', sans-serif;
  color: #4a3a2a;
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
}

.task-17a-hanyatt-text strong {
  color: #b14a13;
  font-weight: 800;
}

.task-17a-hanyatt-text em {
  color: #d96a3a;
  font-style: italic;
  font-weight: 700;
  background: #fff2e0;
  padding: 0 6px;
  border-radius: 4px;
}

/* ============================================================ */

.task-17b-sound-row {
  text-align: center;
  margin: 14px 0;
}

.task-17b-sound {
  display: inline-block;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: #d96a3a;
  padding: 8px 22px;
  background: #fff2e0;
  border-radius: 12px;
  border: 2px dashed #e77a29;
}

.task-17b-instr-card {
  background: #fffdf7;
  border-radius: 14px;
  padding: 16px 20px;
  border: 1px solid #f3c89a;
  margin: 14px 0;
  text-align: center;
}

.task-17b-instr-card p {
  font-family: 'Nunito', sans-serif;
  color: #4a3a2a;
  font-size: 1.05rem;
  margin: 6px 0;
  line-height: 1.5;
}

.task-17b-instr-card strong {
  color: #b14a13;
}

.task-17b-sound-strong {
  display: inline-block;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #b14a13;
  background: linear-gradient(135deg, #fff2e0 0%, #ffe6c4 100%);
  padding: 6px 18px;
  border-radius: 10px;
  margin: 6px 0;
}

/* Bohóc kép és labdák overlay */

.task-17b-clown-wrap {
  position: relative;
  max-width: 520px;
  margin: 20px auto;
  background: linear-gradient(135deg, #fff8eb 0%, #fff2e0 100%);
  border-radius: 20px;
  padding: 18px;
  border: 2px dashed #f0b070;
  text-align: center;
}

.task-17b-clown-img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.task-17b-balls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.task-17b-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #d96a3a;
  background: white;
  color: #d96a3a;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.3s ease, color 0.3s ease;
  box-shadow: 0 3px 8px rgba(231, 122, 41, 0.2);
}

.task-17b-ball:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 14px rgba(231, 122, 41, 0.3);
}

.task-17b-ball:active {
  transform: scale(0.95);
}

.task-17b-ball.is-colored {
  background: var(--ball-color, #e74c3c);
  color: white;
  border-color: var(--ball-color, #e74c3c);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.task-17b-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  color: #d96a3a;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 28px;
  border-radius: 16px;
  border: 3px solid #e77a29;
  box-shadow: 0 8px 24px rgba(231, 122, 41, 0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.3s ease;
  z-index: 5;
  white-space: nowrap;
}

.task-17b-flash.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: task17bFlashPulse 0.6s ease-in-out;
}

.task-17b-counter-row,
.task-17b-trumpet-counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px 18px;
  background: #fffdf7;
  border-radius: 12px;
  border: 1px solid #f3c89a;
}

.task-17b-counter-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: #4a3a2a;
  font-size: 1rem;
}

.task-17b-counter {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: #b14a13;
  background: #fff2e0;
  padding: 4px 14px;
  border-radius: 8px;
  min-width: 80px;
  text-align: center;
}

/* Trombiták */

.task-17b-trumpets {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
  background: linear-gradient(135deg, #fff8eb 0%, #fff2e0 100%);
  border-radius: 18px;
  border: 2px dashed #f0b070;
}

.task-17b-trumpet {
  width: 96px;
  height: 96px;
  background: white;
  border: 3px solid #f0b070;
  border-radius: 14px;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.3s ease;
  box-shadow: 0 3px 8px rgba(231, 122, 41, 0.15);
  position: relative;
  overflow: hidden;
}

.task-17b-trumpet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(85%) opacity(0.55);
  transition: filter 0.4s ease;
}

.task-17b-trumpet:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 14px rgba(231, 122, 41, 0.28);
}

.task-17b-trumpet:active {
  transform: scale(0.95);
}

.task-17b-trumpet.is-colored {
  border-color: #e77a29;
  background: linear-gradient(135deg, #fff8eb 0%, #ffe6c4 100%);
  box-shadow: 0 6px 18px rgba(231, 122, 41, 0.35);
}

.task-17b-trumpet.is-colored img {
  filter: grayscale(0%) opacity(1);
}

/* Mobil */

@media (max-width: 768px) {
  .task-17a, .task-17b {
    padding: 20px 18px;
    margin: 20px 12px;
  }
  .task-17a-head, .task-17b-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .task-17a-badge, .task-17b-badge {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }
  .task-17a-title, .task-17b-title {
    font-size: 1.2rem;
  }
  .task-17a-subtitle, .task-17b-subtitle {
    font-size: 0.95rem;
  }
  .task-17a-instruction {
    padding: 14px 16px;
  }
  .task-17a-instruction p {
    font-size: 0.98rem;
  }
  .task-17a-sound-piece {
    font-size: 1.1rem;
    padding: 3px 9px;
  }
  .task-17a-sound-strong {
    font-size: 1.3rem;
  }
  .task-17b-sound {
    font-size: 1.3rem;
    padding: 6px 14px;
  }
  .task-17b-sound-strong {
    font-size: 1.2rem;
  }
  .task-17b-ball {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  .task-17b-flash {
    font-size: 1.8rem;
    padding: 10px 20px;
  }
  .task-17b-trumpet {
    width: 70px;
    height: 70px;
  }
  .task-17b-counter {
    font-size: 1.1rem;
  }
  .task-17a-steps-title {
    font-size: 1.05rem;
  }
  .task-17a-steps li {
    padding: 8px 10px;
    gap: 10px;
  }
  .task-17a-steps .step-num {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }
  .task-17a-steps .step-text {
    font-size: 0.95rem;
  }
  .task-17a-hanyatt-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .task-17a-hanyatt-image-wrap {
    width: 60%;
    margin: 0 auto;
  }
  .task-17a-hanyatt-text p {
    font-size: 0.98rem;
    text-align: center;
  }
}

/* Globális kompakt padding mindkettőnek */

.task-17a, .task-17b {
  padding: 16px 24px !important;
  margin: 16px auto !important;
  max-width: 1200px !important;
}

.task-17a-head, .task-17b-head {
  margin-bottom: 10px !important;
  gap: 14px !important;
}

.task-17a-badge, .task-17b-badge {
  width: 52px !important;
  height: 52px !important;
  font-size: 1.3rem !important;
}

.task-17a-title, .task-17b-title {
  font-size: 1.25rem !important;
  margin-bottom: 4px !important;
}

.task-17a-subtitle, .task-17b-subtitle {
  font-size: 0.92rem !important;
  line-height: 1.4;
}

/* 17/a — kompakt lépések */

.task-17a-steps-title {
  font-size: 0.95rem !important;
  margin: 0 0 8px !important;
}

.task-17a-steps {
  gap: 5px !important;
  margin-bottom: 8px !important;
}

.task-17a-steps li {
  padding: 5px 10px !important;
  gap: 9px !important;
}

.task-17a-steps .step-num {
  width: 24px !important;
  height: 24px !important;
  font-size: 0.85rem !important;
}

.task-17a-steps .step-text {
  font-size: 0.88rem !important;
  line-height: 1.35 !important;
  padding-top: 1px !important;
}

.task-17a-instruction {
  padding: 12px 14px !important;
}

.task-17a-sound {
  padding: 8px !important;
  margin: 8px 0 !important;
  gap: 7px !important;
}

.task-17a-sound-piece {
  font-size: 1.05rem !important;
  padding: 3px 9px !important;
}

.task-17a-sound-strong {
  font-size: 1.25rem !important;
}

/* 17/a hanyatt-fekvős kompakt */

.task-17a-hanyatt-card {
  padding: 10px 14px !important;
  gap: 14px !important;
}

.task-17a-hanyatt-image-wrap {
  width: 110px !important;
  padding: 5px !important;
}

.task-17a-hanyatt-text p {
  font-size: 0.92rem !important;
  line-height: 1.4 !important;
}

/* ===== 17/b — Kétoszlopos layout ===== */

.task-17b-sound-inline {
  margin-top: 6px;
}

.task-17b-sound-inline .task-17b-sound {
  font-size: 1.05rem;
  padding: 3px 12px;
}

.task-17b-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.task-17b-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-17b-instr-card--compact {
  padding: 8px 12px !important;
  margin: 0 !important;
}

.task-17b-instr-card--compact p {
  font-size: 0.9rem !important;
  margin: 2px 0 !important;
}

.task-17b-instr-card--compact .task-17b-sound-strong {
  font-size: 0.95rem !important;
  padding: 2px 10px !important;
  margin-left: 4px;
}

.task-17b-instr-sub {
  font-size: 0.82rem !important;
  color: #6a5240 !important;
  font-style: italic;
}

/* 17/b kompakt bohóc */

.task-17b-clown-wrap {
  margin: 0 !important;
  padding: 8px !important;
  max-width: 100% !important;
}

.task-17b-clown-img {
  max-height: 240px !important;
  width: auto !important;
  margin: 0 auto !important;
}

.task-17b-balls {
  margin-top: 0 !important;
  gap: 8px !important;
}

.task-17b-ball {
  width: 42px !important;
  height: 42px !important;
  font-size: 1.05rem !important;
  border-width: 2px !important;
}

.task-17b-flash {
  font-size: 1.6rem !important;
  padding: 8px 18px !important;
}

.task-17b-counter-row,
.task-17b-trumpet-counter-row {
  padding: 6px 12px !important;
  margin: 0 !important;
  gap: 10px !important;
}

.task-17b-counter {
  font-size: 1rem !important;
  padding: 2px 10px !important;
  min-width: 56px !important;
}

.task-17b-counter-label {
  font-size: 0.88rem !important;
}

/* 17/b kompakt trombiták */

.task-17b-trumpets {
  margin: 0 !important;
  padding: 10px !important;
  gap: 8px !important;
}

.task-17b .task-17b-trumpet {
  width: 60px !important;
  height: 60px !important;
  padding: 4px !important;
  border-width: 2px !important;
  border-radius: 10px !important;
}

/* Mobil — egy oszlopra váltunk */

@media (max-width: 768px) {
  .task-17b-cols {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .task-17b-clown-img {
    max-height: 280px !important;
  }
  .task-17b .task-17b-trumpet {
    width: 56px !important;
    height: 56px !important;
  }
  .task-17b-ball {
    width: 44px !important;
    height: 44px !important;
  }
}

/* ============================================
   Task 17/c, 17/d, 17/e — TR szótag-gyakorlás
   Stílus: 17/b mintát követi (közös .task-17b-trumpet)
   ============================================ */

.task-17-syll {
  position: relative;
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border: 2px solid #f3c89a;
  border-radius: 20px;
  padding: 20px 28px !important;
  margin: 18px auto !important;
  max-width: 1200px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

.task-17-syll .task-17b-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.task-17-syll-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
  align-items: start;
}

.task-17-syll-instr {
  background: linear-gradient(135deg, #fffdf7 0%, #fff5e6 100%);
  border: 2px dashed #f0b070;
  border-radius: 16px;
  padding: 16px 18px;
}

.task-17-syll-instr > p {
  margin: 0 0 8px 0;
  color: #4a3a2a;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

.task-17-syll-instr > p strong {
  color: #b14a13;
}

.task-17-syll-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 10px 0 12px 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.4;
  color: #d96a3a;
}

.task-17-syll-piece {
  display: inline-block;
}

.task-17-syll-piece:not(:last-child)::after {
  content: ",";
  color: #d96a3a;
  margin-left: 2px;
}

.task-17-syll-piece--accent {
  color: #b14a13;
  font-size: 1.3rem;
}

.task-17-syll-piece--accent::after {
  content: "" !important;
}

.task-17-syll-hint {
  margin: 6px 0 0 0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: #6b5740;
  font-style: italic;
}

/* Trombiták 3×3 grid */

.task-17-syll-trumpets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #fff8eb 0%, #fff2e0 100%);
  border-radius: 18px;
  border: 2px dashed #f0b070;
  justify-items: center;
}

.task-17-syll-trumpets .task-17b-trumpet {
  width: 100%;
  max-width: 110px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px 4px 6px;
}

.task-17-syll-trumpets .task-17b-trumpet img {
  width: 100%;
  height: 64px;
  object-fit: contain;
}

.task-17-syll-label {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #b14a13;
  line-height: 1;
  margin-top: 2px;
}

.task-17-syll-trumpets .task-17b-trumpet.is-colored .task-17-syll-label {
  color: #8a3a0a;
}

/* Mobil */

@media (max-width: 768px) {
  .task-17-syll {
    padding: 16px 14px !important;
    margin: 14px 10px !important;
  }
  .task-17-syll-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .task-17-syll-list {
    font-size: 1.05rem;
  }
  .task-17-syll-piece--accent {
    font-size: 1.2rem;
  }
  .task-17-syll-trumpets {
    padding: 10px;
    gap: 8px;
  }
  .task-17-syll-trumpets .task-17b-trumpet {
    max-width: 100%;
    height: 110px;
    padding: 6px 4px 8px 4px;
  }
  .task-17-syll-trumpets .task-17b-trumpet img {
    height: 56px;
    flex-shrink: 0;
  }
  .task-17-syll-label {
    font-size: 0.82rem;
    margin-top: 4px;
    line-height: 1.1;
  }
}

/* Task 17 — big trumpet celebration overlay (viewport-fit, no overflow) */

.task-17-celebration {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 20px);
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: inherit;
}

.task-17-celebration.is-visible {
  opacity: 1;
}

.task-17-celebration-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  max-height: min(72vh, 100%);
  animation: task17TrumpetCelebrate 1.05s ease-in-out infinite;
}

.task-17-celebration-trumpet {
  width: min(72vw, 320px);
  max-width: 100%;
  max-height: min(68vh, 100%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(231, 122, 41, 0.45));
}

@keyframes task17TrumpetCelebrate {
  0%, 100% { transform: translateY(0) scale(1) rotate(-4deg); }
  25% { transform: translateY(-10px) scale(1.06) rotate(3deg); }
  50% { transform: translateY(-6px) scale(1.1) rotate(-2deg); }
  75% { transform: translateY(-12px) scale(1.05) rotate(4deg); }
}

@media (max-width: 768px) {
  .task-17-celebration-inner {
    width: min(100%, 300px);
  }
  .task-17-celebration-trumpet {
    width: min(78vw, 260px);
    max-height: min(58vh, 100%);
  }
}

/* Task-head subtitle (14/b — Szaladj haza, kis állat!) */

.task-head .task-subtitle {
  margin: 2px 0 4px 0;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #d96a3a;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .task-head .task-subtitle {
    font-size: 1rem;
  }
}

/* ============================================
   Task 18 — TR szavakban (12 kép → traktor)
   ============================================ */

.task-18 {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border: 2px solid #f3c89a;
  border-radius: 20px;
  padding: 20px 28px !important;
  margin: 18px auto !important;
  max-width: 1200px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

.task-18 .task-17b-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.task-18-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1.2vh, 14px);
}

.task-18-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: clamp(4px, 0.8vh, 10px) clamp(4px, 0.6vw, 8px);
  min-height: 0;
  min-width: 0;
  background: linear-gradient(135deg, #fffdf7 0%, #fff5e6 100%);
  border: 2px solid #f3c89a;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  font-family: inherit;
}

.task-18-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(231, 122, 41, 0.18);
  border-color: #e77a29;
}

.task-18-card:focus-visible {
  outline: 3px solid #e77a29;
  outline-offset: 2px;
}

.task-18-img-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-18-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.task-18-img--orig { opacity: 1; transform: scale(1); }

.task-18-img--traktor { opacity: 0; transform: scale(0.85); }

.task-18-card.is-traktor .task-18-img--orig { opacity: 0; transform: scale(0.85); }

.task-18-card.is-traktor .task-18-img--traktor { opacity: 1; transform: scale(1); }

.task-18-card.is-traktor {
  background: linear-gradient(135deg, #fff1d6 0%, #ffe2b3 100%);
  border-color: #e77a29;
  box-shadow: 0 4px 10px rgba(231, 122, 41, 0.25);
}

.task-18-label {
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(0.72rem, 1.6vw, 1.05rem);
  color: #b14a13;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.task-18-card.is-traktor .task-18-label {
  color: #8a3a0a;
}

.task-18-counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-family: 'Nunito', sans-serif;
}

/* Mobil */

@media (max-width: 768px) {
  .task-18 {
    padding: 16px 14px !important;
    margin: 14px 10px !important;
  }
  .task-18-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .task-18-card {
    padding: 6px 4px 4px 4px;
  }
}

/* ===== 18. feladat — viewport-fit (solo + classroom paged) ===== */

body.solo-mode .task-18.solo-task-active,
body.classroom-paged-mode .task-18.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(8px, 1.5vh, 16px) clamp(10px, 2vw, 20px) !important;
}

body.solo-mode .task-18.solo-task-active .task-17b-head,
body.classroom-paged-mode .task-18.solo-task-active .task-17b-head {
  flex-shrink: 0;
  margin-bottom: clamp(6px, 1vh, 12px);
}

body.solo-mode .task-18.solo-task-active .task-17b-title,
body.classroom-paged-mode .task-18.solo-task-active .task-17b-title {
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
}

body.solo-mode .task-18.solo-task-active .task-17b-subtitle,
body.classroom-paged-mode .task-18.solo-task-active .task-17b-subtitle {
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  line-height: 1.35;
}

body.solo-mode .task-18.solo-task-active .task-18-grid,
body.classroom-paged-mode .task-18.solo-task-active .task-18-grid {
  flex: 1 1 auto;
  min-height: 0;
}

body.solo-mode .task-18.solo-task-active .task-18-counter-row,
body.classroom-paged-mode .task-18.solo-task-active .task-18-counter-row {
  flex-shrink: 0;
  margin-top: clamp(6px, 1vh, 12px);
}

/* ===== 18b — viewport-fit ===== */

body.solo-mode .task-18b.solo-task-active,
body.classroom-paged-mode .task-18b.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(10px, 1.8vh, 18px) clamp(10px, 2vw, 20px);
}

body.solo-mode .task-18b.solo-task-active .task-17b-head,
body.classroom-paged-mode .task-18b.solo-task-active .task-17b-head {
  flex-shrink: 0;
}

body.solo-mode .task-18b.solo-task-active .task-18b-syllables,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-syllables {
  flex-shrink: 0;
  margin: clamp(4px, 0.8vh, 10px) 0;
}

body.solo-mode .task-18b.solo-task-active .task-18b-syl,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-syl {
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
  padding: 4px 12px;
}

body.solo-mode .task-18b.solo-task-active .task-18b-stage,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: clamp(36px, 8vh, 52px) clamp(8px, 1.5vw, 14px) clamp(8px, 1.2vh, 14px);
}

body.solo-mode .task-18b.solo-task-active .task-18b-butterfly,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-butterfly {
  width: clamp(64px, 12vw, 90px);
  height: clamp(64px, 12vw, 90px);
}

body.solo-mode .task-18b.solo-task-active .task-18b-rows,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-rows {
  gap: clamp(4px, 1vh, 10px);
}

body.solo-mode .task-18b.solo-task-active .task-18b-thumb,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-thumb {
  width: clamp(48px, 9vw, 72px);
  height: clamp(48px, 9vw, 72px);
}

body.solo-mode .task-18b.solo-task-active .task-18b-word,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-word {
  font-size: clamp(0.72rem, 1.8vw, 0.95rem);
}

body.solo-mode .task-18b.solo-task-active .task-18b-hint,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-hint,
body.solo-mode .task-18b.solo-task-active .task-18b-controls,
body.classroom-paged-mode .task-18b.solo-task-active .task-18b-controls {
  flex-shrink: 0;
}

/* ===== 18c — viewport-fit ===== */

body.solo-mode .task-18c.solo-task-active,
body.classroom-paged-mode .task-18c.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(10px, 1.8vh, 18px) clamp(10px, 2vw, 20px);
}

body.solo-mode .task-18c.solo-task-active .task-17b-head,
body.classroom-paged-mode .task-18c.solo-task-active .task-17b-head {
  flex-shrink: 0;
}

body.solo-mode .task-18c.solo-task-active .task-18c-sentences,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-sentences {
  flex-shrink: 0;
  font-size: clamp(0.72rem, 1.7vw, 0.88rem);
  gap: 4px;
  margin-bottom: clamp(6px, 1vh, 10px);
}

body.solo-mode .task-18c.solo-task-active .task-18c-sentences li,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-sentences li {
  padding: 4px 8px;
}

body.solo-mode .task-18c.solo-task-active .task-18c-game,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-game {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.solo-mode .task-18c.solo-task-active .task-18c-sub,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-sub {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  margin-bottom: 2px;
}

body.solo-mode .task-18c.solo-task-active .task-18c-hint,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-hint {
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  margin-bottom: 6px;
}

body.solo-mode .task-18c.solo-task-active .task-18c-slots,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-slots {
  flex-shrink: 0;
  gap: clamp(4px, 0.8vw, 8px);
}

body.solo-mode .task-18c.solo-task-active .task-18c-slot,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-slot {
  min-height: clamp(52px, 10vh, 72px);
}

body.solo-mode .task-18c.solo-task-active .task-18c-pool,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-pool {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
}

body.solo-mode .task-18c.solo-task-active .task-18c-card,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-card {
  width: clamp(72px, 14vw, 96px);
  height: clamp(52px, 9vh, 68px);
}

body.solo-mode .task-18c.solo-task-active .task-18c-status,
body.classroom-paged-mode .task-18c.solo-task-active .task-18c-status {
  flex-shrink: 0;
}

/* ===== 18d — viewport-fit ===== */

body.solo-mode .task-18d.solo-task-active,
body.classroom-paged-mode .task-18d.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
}

body.solo-mode .task-18d.solo-task-active .task-header,
body.classroom-paged-mode .task-18d.solo-task-active .task-header {
  flex-shrink: 0;
  padding-bottom: 2px;
}

body.solo-mode .task-18d.solo-task-active .task-instr,
body.classroom-paged-mode .task-18d.solo-task-active .task-instr {
  font-size: clamp(0.75rem, 1.7vw, 0.9rem);
  margin: 2px 0 6px;
}

body.solo-mode .task-18d.solo-task-active .task-18d-wrap,
body.classroom-paged-mode .task-18d.solo-task-active .task-18d-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(8px, 1.5vw, 14px);
  align-items: stretch;
  padding: 0 clamp(8px, 1.5vw, 14px) clamp(6px, 1vh, 10px);
}

body.solo-mode .task-18d.solo-task-active .task-18d-story,
body.classroom-paged-mode .task-18d.solo-task-active .task-18d-story {
  max-height: none;
  height: 100%;
  overflow-y: auto;
  font-size: clamp(0.68rem, 1.5vw, 0.76rem);
  line-height: 1.35;
  padding: clamp(6px, 1vh, 10px) clamp(8px, 1.2vw, 12px);
}

body.solo-mode .task-18d.solo-task-active .task-18d-puzzle-wrap,
body.classroom-paged-mode .task-18d.solo-task-active .task-18d-puzzle-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.solo-mode .task-18d.solo-task-active .task-18d-puzzle-board,
body.classroom-paged-mode .task-18d.solo-task-active .task-18d-puzzle-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding: clamp(8px, 1.2vh, 12px);
}

body.solo-mode .task-18d.solo-task-active .puzzle-header,
body.classroom-paged-mode .task-18d.solo-task-active .puzzle-header {
  flex-shrink: 0;
  margin-bottom: 8px;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

body.solo-mode .task-18d.solo-task-active .puzzle-board,
body.classroom-paged-mode .task-18d.solo-task-active .puzzle-board {
  --puzzle-size: min(34vh, 280px);
  flex-shrink: 0;
  margin-bottom: 10px;
}

body.solo-mode .task-18d.solo-task-active .puzzle-tray,
body.classroom-paged-mode .task-18d.solo-task-active .puzzle-tray {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 8px;
  padding: 8px;
  gap: 6px;
}

body.solo-mode .task-18d.solo-task-active .puzzle-foot,
body.classroom-paged-mode .task-18d.solo-task-active .puzzle-foot {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  body.solo-mode .task-18d.solo-task-active .task-18d-wrap,
  body.classroom-paged-mode .task-18d.solo-task-active .task-18d-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
}

/* ===================================================================
   18/b feladat — TR perdítés szavakban 2. (mozgatható pillangó)
   =================================================================== */

.task-18b {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 24px 24px;
  margin: 24px 14px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

/* Szótag fejléc — két nagy hangsor a stage fölött */

.task-18b-syllables {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 24px;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}

.task-18b-syl {
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.5px;
  color: #d96a3a;
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 18px;
  border-radius: 14px;
  border: 2px dashed #f0b070;
}

/* Stage — relatív, hogy a pillangó abszolút úszhasson rajta */

.task-18b-stage {
  position: relative;
  background: #fffdf7;
  border-radius: 18px;
  border: 2px solid #f3c89a;
  padding: 60px 16px 18px;
  min-height: 420px;
  overflow: visible;
}

/* Pillangó — abszolút pozícionált, drag&drop */

.task-18b-butterfly {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  cursor: grab;
  z-index: 30;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: filter 0.15s ease;
  filter: drop-shadow(0 4px 10px rgba(231, 122, 41, 0.3));
}

.task-18b-butterfly:hover {
  filter: drop-shadow(0 6px 14px rgba(231, 122, 41, 0.45));
}

.task-18b-butterfly.is-dragging {
  cursor: grabbing;
  z-index: 50;
  filter: drop-shadow(0 8px 18px rgba(231, 122, 41, 0.55));
}

.task-18b-butterfly:focus-visible {
  outline: 3px solid #e77a29;
  outline-offset: 4px;
  border-radius: 12px;
}

.task-18b-butterfly img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.task-18b-butterfly.is-idle {
  animation: butterflyFloat 2.4s ease-in-out infinite;
}

/* Sorok grid: 4 sor, mindegyikben bal slot + szó / szó + jobb slot */

.task-18b-rows {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.task-18b-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

.task-18b-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 8px 14px;
  min-height: 96px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.task-18b-slot--right {
  justify-content: flex-end;
}

.task-18b-slot.is-hover {
  background: rgba(255, 233, 196, 0.6);
  border-color: #e77a29;
  transform: scale(1.03);
}

.task-18b-slot.is-landed {
  background: rgba(255, 240, 216, 0.5);
  border-color: #e77a29;
}

.task-18b-thumb {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
}

.task-18b-word {
  font-family: 'Fredoka', 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  color: #d96a3a;
  letter-spacing: 0.3px;
}

.task-18b-word--rol {
  color: #b14a13;
}

.task-18b-word--ra {
  color: #b14a13;
}

.task-18b-hint {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: #4a3a2a;
  margin: 14px 0 6px;
  font-size: 1rem;
}

.task-18b-controls {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* Mobil */

@media (max-width: 768px) {
  .task-18b {
    padding: 16px 12px;
    margin: 14px 8px;
  }
  .task-18b-syl {
    font-size: 1.15rem;
    padding: 4px 12px;
  }
  .task-18b-stage {
    padding: 50px 8px 14px;
    min-height: 620px;
  }
  .task-18b-butterfly {
    width: 80px;
    height: 80px;
  }
  .task-18b-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .task-18b-slot {
    padding: 6px 10px;
    min-height: 78px;
    gap: 8px;
  }
  .task-18b-thumb {
    width: 60px;
    height: 60px;
  }
  .task-18b-word {
    font-size: 1.3rem;
  }
}

/* ===================================================================
   18/c feladat — TR perdítés mondatokban (sorba rendezős képtörténet)
   =================================================================== */

.task-18c {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 24px 24px;
  margin: 24px 14px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

/* Mondatok lista */

.task-18c-sentences {
  list-style: decimal;
  list-style-position: outside;
  padding: 18px 24px 18px 48px;
  margin: 12px 0 22px;
  background: #fffdf7;
  border-radius: 18px;
  border: 2px solid #f3c89a;
}

.task-18c-sentences li {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #4a3a2a;
  line-height: 1.75;
  padding: 2px 0;
}

.task-18c-sentences li b {
  color: #b14a13;
}

.task-18c-sentences li .tr-mark {
  color: #e77a29;
  font-weight: 800;
  background: none;
  padding: 0;
}

/* Game szekció */

.task-18c-game {
  margin-top: 8px;
}

.task-18c-sub {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #b14a13;
  margin: 6px 0 2px;
  text-align: center;
}

.task-18c-hint {
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: #4a3a2a;
  margin: 0 0 14px;
  font-size: 1rem;
}

/* Slot sor (1-6) */

.task-18c-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.task-18c-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff5e6;
  border: 3px dashed #f0b070;
  border-radius: 18px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-18c-slot.is-hover {
  background: #ffe9c4;
  border-color: #e77a29;
  border-style: solid;
  transform: scale(1.04);
}

.task-18c-slot.is-correct {
  background: #e7f7e0;
  border-color: #4eaa3a;
  border-style: solid;
}

.task-18c-slot.is-incorrect {
  background: #ffe1e1;
  border-color: #e94e4e;
  border-style: solid;
  animation: shakeOnce 0.4s ease;
}

.task-18c-num {
  position: absolute;
  top: 6px;
  left: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #b14a13;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.task-18c-slot.is-filled .task-18c-num {
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  font-size: 1rem;
}

/* Pool (kevert képek) */

.task-18c-pool {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background: #fffdf7;
  border-radius: 18px;
  border: 2px solid #f3c89a;
  padding: 14px;
  min-height: 140px;
}

/* Card (drag-elhető kép) */

.task-18c-card {
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 2px solid #f0b070;
  border-radius: 14px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* touch-action: none csak érintőképernyőn, hogy ne zavarja a desktop HTML5 drag-et */
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

@media (pointer: coarse) {
  .task-18c-card {
    touch-action: none;
  }
}

.task-18c-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(231, 122, 41, 0.25);
}

.task-18c-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.task-18c-card.is-locked {
  cursor: default;
  pointer-events: none;
  border-color: #4eaa3a;
  background: #f0fbea;
}

.task-18c-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  /* -webkit-user-drag: none ELTÁVOLÍTVA — blokkolta a parent HTML5 drag-et Chrome desktopon */
}

/* Card amikor egy slotban van */

.task-18c-slot .task-18c-card {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: none;
  background: transparent;
}

/* Status sor */

.task-18c-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.task-18c-counter {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #b14a13;
  background: #fff;
  padding: 6px 16px;
  border-radius: 14px;
  border: 2px solid #f0b070;
}

/* Mobil */

@media (max-width: 768px) {
  .task-18c {
    padding: 16px 12px;
    margin: 14px 8px;
  }
  .task-18c-sentences {
    padding: 14px 16px 14px 36px;
  }
  .task-18c-sentences li {
    font-size: 1.05rem;
    line-height: 1.6;
  }
  .task-18c-slots {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .task-18c-pool {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
  }
  .task-18c-num {
    width: 26px;
    height: 26px;
    font-size: 1.1rem;
  }
}

/* ============================================================
   21/a feladat — TR-DR szótagos lufik
   ============================================================ */

.task-21a {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 24px 28px;
  margin: 24px 14px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

.task-21a-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 24px;
  padding: 24px 12px 32px;
  max-width: 720px;
  margin: 0 auto;
}

.task-21a-board .balloon {
  position: relative;
  aspect-ratio: 1 / 1.18;
  width: auto;
  height: auto;
  bottom: auto;
  left: auto;
  top: auto;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  animation: none !important;
  opacity: 1 !important;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
  transition: transform 0.25s ease, opacity 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}

.task-21a-board .balloon::before {
  content: '';
  position: absolute;
  inset: 0;
  left: 0;
  bottom: auto;
  width: 100%;
  height: 100%;
  transform: none;
  border-radius: 50% 50% 48% 48% / 52% 52% 48% 48%;
  background: radial-gradient(ellipse at 35% 28%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 35%), var(--balloon-color, #e94e4e);
  box-shadow: inset -8px -10px 18px rgba(0,0,0,0.18), inset 8px 10px 14px rgba(255,255,255,0.25);
}

.task-21a-board .balloon::after {
  content: '';
  position: absolute;
  bottom: -3%;
  left: 50%;
  top: auto;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  background: transparent;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--balloon-color, #e94e4e);
  filter: brightness(0.85);
}

.task-21a-board .balloon-text {
  position: relative;
  z-index: 2;
  font-family: 'Fredoka', 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
  letter-spacing: 0.5px;
  margin-top: -8%;
}

.task-21a-board .balloon-string {
  position: absolute;
  left: 50%;
  bottom: -22%;
  transform: translateX(-50%);
  width: 2px;
  height: 22%;
  background: rgba(0,0,0,0.35);
  border-radius: 2px;
  z-index: 1;
}

.task-21a-board .balloon:hover { transform: translateY(-4px) scale(1.04); }

.task-21a-board .balloon--red    { --balloon-color: #ee5b5b; }

.task-21a-board .balloon--blue   { --balloon-color: #4f9be8; }

.task-21a-board .balloon--yellow { --balloon-color: #f3c84a; }

.task-21a-board .balloon--green  { --balloon-color: #5fb95f; }

.task-21a-board .balloon--purple { --balloon-color: #a06fd0; }

.task-21a-board .balloon--pink   { --balloon-color: #ee7eb0; }

.task-21a-board .balloon--orange { --balloon-color: #ef8a3a; }

.task-21a-board .balloon--teal   { --balloon-color: #4ec4b8; }

.task-21a-board .balloon--lime   { --balloon-color: #92c83f; }

.task-21a-board .balloon.is-popping {
  animation: balloonPop 0.45s ease forwards !important;
  pointer-events: none;
}

.task-21a-board .balloon.is-popped { display: none; }

@media (max-width: 768px) {
  .task-21a-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 14px;
    padding: 14px 4px 22px;
  }
  .task-21a-board .balloon-text { font-size: 0.95rem; }
}

@media (max-width: 420px) {
  .task-21a-board .balloon-text { font-size: 0.85rem; }
}

/* ============================================================
   21/b feladat — TR-DR szavak képekkel
   ============================================================ */

.task-21b {
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 24px;
  padding: 22px 24px 24px;
  margin: 24px 14px;
  box-shadow: 0 4px 14px rgba(231, 122, 41, 0.08);
}

.task-21b-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.task-21b-card {
  background: #fffdf7;
  border: 3px solid #f3c89a;
  border-radius: 18px;
  padding: 10px 8px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.task-21b-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  pointer-events: none;
}

.task-21b-word {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #4a3a2a;
}

.task-21b-word .tr-mark {
  color: #e77a29;
  font-weight: 800;
}

.task-21b-card:hover {
  transform: translateY(-4px);
  border-color: #e77a29;
  box-shadow: 0 8px 18px rgba(231, 122, 41, 0.22);
}

.task-21b-card.is-active {
  animation: cardBounce 0.5s ease;
  border-color: #4eaa3a;
  box-shadow: 0 6px 16px rgba(78, 170, 58, 0.3);
}

.task-21b-card.is-active .tr-mark {
  animation: trBlink 0.5s ease;
}

@media (max-width: 768px) {
  .task-21b-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .task-21b-word { font-size: 1.05rem; }
}

/* 21b — hiányzó szemek (vidra, trappoló ló) CSS overlay */
.task-21b-card {
  position: relative;
}

.task-21b-card[data-testid="task-21b-card-vidra"]::before,
.task-21b-card[data-testid="task-21b-card-vidra"]::after,
.task-21b-card[data-testid="task-21b-card-trappol"]::before {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff8f0 0%, #fff8f0 38%, #3a2a20 40%, #3a2a20 100%);
  pointer-events: none;
  z-index: 2;
}

.task-21b-card[data-testid="task-21b-card-vidra"]::before {
  width: 6%;
  height: 6%;
  left: 43.5%;
  top: 21%;
}

.task-21b-card[data-testid="task-21b-card-vidra"]::after {
  width: 6%;
  height: 6%;
  left: 51.5%;
  top: 21%;
}

.task-21b-card[data-testid="task-21b-card-trappol"]::before {
  width: 5.5%;
  height: 5.5%;
  left: 57%;
  top: 19%;
}

/* ===== 21/a-b — viewport-fit egy képernyő ===== */

body.solo-mode .task-21a.solo-task-active,
body.classroom-paged-mode .task-21a.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin: 0;
  padding: clamp(8px, 1.5vh, 18px) clamp(10px, 2vw, 20px);
}

body.solo-mode .task-21a.solo-task-active .task-17b-head,
body.classroom-paged-mode .task-21a.solo-task-active .task-17b-head {
  flex-shrink: 0;
}

body.solo-mode .task-21a.solo-task-active .task-21a-board,
body.classroom-paged-mode .task-21a.solo-task-active .task-21a-board {
  flex: 1 1 auto;
  min-height: 0;
  gap: clamp(6px, 1.2vh, 14px) clamp(8px, 1.5vw, 18px);
  padding: clamp(6px, 1vh, 16px) 4px;
  align-content: center;
}

body.solo-mode .task-21a.solo-task-active .task-20-status,
body.classroom-paged-mode .task-21a.solo-task-active .task-20-status {
  flex-shrink: 0;
  margin-top: 4px;
}

body.solo-mode .task-21b.solo-task-active,
body.classroom-paged-mode .task-21b.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin: 0;
  padding: clamp(8px, 1.5vh, 18px) clamp(10px, 2vw, 20px);
}

body.solo-mode .task-21b.solo-task-active .task-17b-head,
body.classroom-paged-mode .task-21b.solo-task-active .task-17b-head {
  flex-shrink: 0;
}

body.solo-mode .task-21b.solo-task-active .task-21b-grid,
body.classroom-paged-mode .task-21b.solo-task-active .task-21b-grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1vh, 12px);
  padding: 4px 0;
  align-content: center;
}

body.solo-mode .task-21b.solo-task-active .task-21b-card,
body.classroom-paged-mode .task-21b.solo-task-active .task-21b-card {
  min-height: 0;
  padding: clamp(6px, 1vh, 10px);
}

body.solo-mode .task-21b.solo-task-active .task-21b-word,
body.classroom-paged-mode .task-21b.solo-task-active .task-21b-word {
  font-size: clamp(0.78rem, 1.8vw, 1rem);
}

/* ============================================================
   20/c és 20/d feladat — DR mondatokban sorba rendezés
   ============================================================ */

.task-20c-slots,
.task-20c-pool,
.task-21c-slots,
.task-21c-pool {
  grid-template-columns: repeat(5, 1fr);
}

.task-20d-slots,
.task-20d-pool {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .task-20c-slots,
  .task-20c-pool,
  .task-21c-slots,
  .task-21c-pool {
    grid-template-columns: repeat(3, 1fr);
  }
  .task-20d-slots,
  .task-20d-pool {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   18/d. feladat — Képkirakó (3×3 jigsaw) — A Mátrában
   Cél: egy képernyőre férjen (desktop)
   ============================================================ */

.task-18d .task-instr {
  text-align: center;
  font-size: 0.95rem;
  color: #b14a13;
  margin: 4px 0 10px;
}

.task-18d .task-header {
  padding-bottom: 4px;
}

.task-18d .task-title {
  font-size: 1.15rem;
}

.task-18d-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 12px;
}

/* Bal: történet szöveg — kompakt */

.task-18d-story {
  background: #fffdf7;
  border: 2px solid #f3d6a8;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(231, 122, 41, 0.08);
  font-size: 0.78rem;
  line-height: 1.4;
  color: #4a3320;
  max-height: 520px;
  overflow-y: auto;
}

.task-18d-story-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.1rem;
  color: #e77a29;
  font-weight: 700;
  border-bottom: 1px dashed #f3d6a8;
  padding-bottom: 4px;
}

.task-18d-story p {
  margin: 4px 0;
  text-align: justify;
}

.task-18d-dialog {
  list-style: none;
  padding: 0 0 0 6px;
  margin: 4px 0;
}

.task-18d-dialog li {
  margin: 2px 0;
  padding-left: 4px;
}

.task-18d .tr-mark {
  color: #e77a29;
  font-weight: 800;
  font-size: 1.05em;
}

/* Jobb: puzzle */

.task-18d-puzzle-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-18d-puzzle-board {
  margin-top: 0;
  padding: 12px 14px;
  background: #fff;
  border: 2px dashed #f0b070;
  border-radius: 18px;
}

.task-18d-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #fff5e6;
  border: 3px solid #e77a29;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(231, 122, 41, 0.18);
}

.task-18d-slot {
  position: relative;
  background: transparent;
  border: 2px dashed transparent;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.task-18d-slot::before {
  content: attr(data-pos);
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(231, 122, 41, 0.45);
  pointer-events: none;
  z-index: 1;
}

.task-18d-slot.is-drag-over {
  border-color: #e77a29;
  background: rgba(231, 122, 41, 0.12);
}

.task-18d-slot.is-correct {
  border-color: transparent;
  background: transparent;
}

.task-18d-slot.is-correct::before {
  display: none;
}

.task-18d-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  position: relative;
  z-index: 0;
}

/* Pool: kevert darabok */

.task-18d-pool {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  max-width: 540px;
  margin: 0 auto;
  padding: 8px;
  background: #fffdf7;
  border: 2px solid #f3d6a8;
  border-radius: 12px;
  min-height: 60px;
}

.task-18d-piece {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid #f3d6a8;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  user-select: none;
  -webkit-user-select: none;
}

.task-18d-piece:hover {
  transform: translateY(-3px);
  border-color: #e77a29;
  box-shadow: 0 6px 14px rgba(231, 122, 41, 0.25);
}

.task-18d-piece.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.task-18d-piece img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.task-18d-piece.is-incorrect {
  animation: task18dShake 0.45s ease;
  border-color: #e94e4e;
  background: #ffe1e1;
}

/* Ghost drag for touch */

.task-18d-ghost {
  position: fixed;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  z-index: 9999;
  transform: translate(-50%, -50%);
  border: 3px solid #e77a29;
  background: #fff;
}

.task-18d-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Status sor */

.task-18d-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 4px;
}

.task-18d-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: #b14a13;
}

/* Mobil */

@media (max-width: 900px) {
  .task-18d-wrap {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 10px 16px;
  }
  .task-18d-story {
    max-height: 280px;
    font-size: 0.9rem;
    padding: 12px 14px;
  }
  .task-18d-board,
  .task-18d-pool,
  .task-18d-status {
    max-width: 100%;
  }
  .task-18d-board {
    max-width: 320px;
  }
  .task-18d-pool {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .task-18d-story-title {
    font-size: 1.05rem;
  }
  .task-18d-counter {
    font-size: 0.9rem;
  }
  .task-18d-board {
    padding: 4px;
    gap: 2px;
  }
  .task-18d-slot::before {
    font-size: 0.7rem;
    top: 2px;
    left: 4px;
  }
}

/* ============================================================
   19. feladat — Brumi céllövő verseny (DR)
   ============================================================ */

.task-19 .task-instr {
  text-align: center;
  font-size: 1rem;
  color: #b14a13;
  margin: 4px 0 14px;
  line-height: 1.45;
}

.task-19 .task-instr em {
  color: #e77a29;
  font-style: italic;
  font-weight: 600;
}

.task-19 .tr-mark {
  color: #e77a29;
  font-weight: 800;
  font-size: 1.05em;
}

.task-19-wrap {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 12px;
}

/* Brumi zóna */

.task-19-brumi-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.task-19-brumi-wrap {
  position: relative;
  width: 100%;
  max-width: 260px;
}

.task-19-brumi {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(231, 122, 41, 0.18));
}

.task-19-drrr {
  position: absolute;
  top: 38%;
  right: -28px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #b14a13;
  background: #fff5e6;
  border: 3px solid #e77a29;
  border-radius: 14px;
  padding: 6px 12px;
  box-shadow: 0 4px 12px rgba(231, 122, 41, 0.25);
  transform: rotate(-6deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.task-19-drrr.is-visible {
  opacity: 1;
  animation: task19Drrr 0.4s ease;
}

.task-19-hint {
  text-align: center;
  font-size: 0.95rem;
  color: #4a3320;
  margin: 0;
  padding: 8px 12px;
  background: #fffdf7;
  border: 2px dashed #f3d6a8;
  border-radius: 12px;
}

.task-19-hint strong {
  color: #b14a13;
}

/* Céltáblák — 4×2 grid */

.task-19-celtablak {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.task-19-celtabla {
  border: none;
  background: transparent;
  padding: 6px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  position: relative;
}

.task-19-celtabla img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.task-19-celtabla:hover:not(.is-hit) {
  transform: translateY(-4px) scale(1.04);
  background: rgba(231, 122, 41, 0.08);
  box-shadow: 0 8px 18px rgba(231, 122, 41, 0.22);
}

.task-19-celtabla:active:not(.is-hit) {
  transform: scale(0.96);
}

.task-19-celtabla.is-hit {
  cursor: default;
  animation: task19Hit 0.4s ease;
}

/* Lövés villanás overlay */

.task-19-celtabla::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, rgba(255, 230, 130, 0.95) 0%, rgba(255, 180, 60, 0.6) 40%, rgba(255, 180, 60, 0) 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.task-19-celtabla.is-flash::after {
  animation: task19Flash 0.35s ease;
}

/* Status */

.task-19-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 14px auto 0;
  padding: 0 16px 8px;
  max-width: 1180px;
}

.task-19-counter {
  font-size: 1.1rem;
  font-weight: 700;
  color: #b14a13;
  background: #fff5e6;
  border: 2px solid #e77a29;
  border-radius: 14px;
  padding: 6px 16px;
}

/* Mobil */

@media (max-width: 900px) {
  .task-19-wrap {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 10px 12px;
  }
  .task-19-brumi-wrap {
    max-width: 200px;
  }
  .task-19-celtablak {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .task-19-drrr {
    font-size: 1.3rem;
    right: -20px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .task-19-celtablak {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .task-19-celtabla {
    padding: 3px;
  }
  .task-19-counter {
    font-size: 0.95rem;
    padding: 5px 12px;
  }
  .task-19-brumi-wrap {
    max-width: 160px;
  }
}

/* ============================================================
   19/a-b-c — DR szótag színezős feladatok (puska)
   ============================================================ */

.task-19-szotag .task-header {
  margin-bottom: 6px;
}

.task-19-szotag-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 10px;
}

.task-19-szotag-page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.task-19-szotag-nav-btn {
  border: none;
  background: #e77a29;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.task-19-szotag-nav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.task-19-szotag-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.task-19-szotag-page-indicator {
  font-weight: 800;
  font-size: 14px;
  min-width: 72px;
  text-align: center;
  color: #b14a13;
}

.task-19-szotag-pages {
  flex: 1 1 auto;
  min-height: 0;
}

.task-19-szotag-page[hidden] {
  display: none !important;
}

.task-19-szotag-celebrate {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 12px 0 4px;
}

.task-19-szotag-celebrate.is-visible {
  display: flex;
  animation: task19SzotagCelebrate 0.55s ease;
}

.task-19-szotag-big-puska {
  width: min(220px, 55vw);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(231, 122, 41, 0.35));
}

@keyframes task19SzotagCelebrate {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.task-19-szotag-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 16px 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.szotag-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 14px;
  background: #fffdf7;
  border: 2px solid #f3d9b9;
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: 0 2px 6px rgba(231, 122, 41, 0.08);
}

.szotag-label {
  font-size: 1.7rem;
  font-weight: 800;
  color: #b14a13;
  text-align: center;
  font-family: 'Comic Sans MS', 'Baloo 2', 'Quicksand', sans-serif;
  background: #fff5e6;
  border-radius: 14px;
  padding: 6px 10px;
  letter-spacing: 1px;
}

.szotag-puskak {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
  justify-items: center;
}

.szotag-puska {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.15s ease, background 0.2s ease;
  width: 100%;
  max-width: 130px;
}

.szotag-puska:hover:not(.kilott) {
  transform: scale(1.06);
  background: rgba(231, 122, 41, 0.08);
}

.szotag-puska:active:not(.kilott) {
  transform: scale(0.96);
}

.szotag-puska img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.szotag-puska.kilott {
  cursor: default;
  animation: puska-villanas 0.45s ease-out;
}

.szotag-puska.kilott:hover {
  transform: none;
  background: transparent;
}

.szotag-counter {
  font-size: 1rem;
  font-weight: 700;
  color: #b14a13;
  background: #fff5e6;
  border: 2px solid #e77a29;
  border-radius: 12px;
  padding: 5px 12px;
  min-width: 56px;
  text-align: center;
}

.szotag-counter.done {
  background: #e7f7e0;
  color: #2e7a1c;
  border-color: #4eaa3a;
}

.task-19-szotag-status {
  display: flex;
  justify-content: center;
  padding: 4px 16px 10px;
}

body.solo-mode .task-19b.solo-task-active .task-19-szotag-shell,
body.solo-mode .task-19c.solo-task-active .task-19-szotag-shell,
body.solo-mode .task-19d.solo-task-active .task-19-szotag-shell,
body.classroom-paged-mode .task-19b.solo-task-active .task-19-szotag-shell,
body.classroom-paged-mode .task-19c.solo-task-active .task-19-szotag-shell,
body.classroom-paged-mode .task-19d.solo-task-active .task-19-szotag-shell {
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(72px, 14dvh, 120px));
}

body.solo-mode .task-19b.solo-task-active .task-19-szotag-pages,
body.solo-mode .task-19c.solo-task-active .task-19-szotag-pages,
body.solo-mode .task-19d.solo-task-active .task-19-szotag-pages,
body.classroom-paged-mode .task-19b.solo-task-active .task-19-szotag-pages,
body.classroom-paged-mode .task-19c.solo-task-active .task-19-szotag-pages,
body.classroom-paged-mode .task-19d.solo-task-active .task-19-szotag-pages {
  overflow: auto;
  min-height: 0;
}

/* Tablet */

@media (max-width: 900px) {
  .szotag-row {
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    padding: 7px 10px;
  }
  .szotag-label {
    font-size: 1.4rem;
    padding: 5px 8px;
  }
  .szotag-puskak {
    gap: 6px;
  }
  .szotag-puska {
    max-width: 90px;
  }
  .szotag-counter {
    font-size: 0.9rem;
    padding: 4px 9px;
    min-width: 48px;
  }
}

/* Mobil */

@media (max-width: 560px) {
  .task-19-szotag-wrap {
    padding: 8px 8px 12px;
    gap: 8px;
  }
  .szotag-row {
    grid-template-columns: 64px 1fr;
    grid-template-areas: "label puskak" "counter counter";
    gap: 8px;
    padding: 6px 8px;
  }
  .szotag-label {
    grid-area: label;
    font-size: 1.2rem;
    padding: 4px 6px;
  }
  .szotag-puskak {
    grid-area: puskak;
    gap: 4px;
  }
  .szotag-puska {
    max-width: 64px;
    padding: 2px;
  }
  .szotag-counter {
    grid-area: counter;
    justify-self: center;
    font-size: 0.85rem;
    padding: 3px 10px;
  }
}

/* ============================================================
   20/a-b — DR szavakban — kép → puska kattintás
   ============================================================ */

.task-20-szavak .task-header { margin-bottom: 6px; }

.task-20-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 10px 16px 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.task-20-card {
  background: #fffdf7;
  border: 2px solid #f3d9b9;
  border-radius: 20px;
  padding: 10px 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(231, 122, 41, 0.10);
}

.task-20-card:hover:not(.hit) {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(231, 122, 41, 0.22);
  background: #fff5e6;
}

.task-20-card:active:not(.hit) {
  transform: translateY(0);
}

.task-20-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-20-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.task-20-orig { opacity: 1; transform: scale(1); }

.task-20-puska { opacity: 0; transform: scale(0.6) rotate(-8deg); }

.task-20-card.hit .task-20-orig {
  opacity: 0;
  transform: scale(0.7) rotate(8deg);
}

.task-20-card.hit .task-20-puska {
  opacity: 1;
  transform: scale(1) rotate(0);
  animation: task20-villanas 0.5s ease-out;
}

.task-20-card.hit {
  background: #fff5e6;
  border-color: #e77a29;
  cursor: default;
}

.task-20-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: #b14a13;
  text-align: center;
  font-family: 'Comic Sans MS', 'Baloo 2', 'Quicksand', sans-serif;
}

.task-20-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 4px 16px 10px;
}

.task-20-counter {
  font-size: 1.05rem;
  font-weight: 700;
  color: #b14a13;
  background: #fff5e6;
  border: 2px solid #e77a29;
  border-radius: 14px;
  padding: 6px 16px;
}

.task-20-counter.done {
  background: #e7f7e0;
  color: #2e7a1c;
  border-color: #4eaa3a;
}

/* Tablet */

@media (max-width: 900px) {
  .task-20-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 8px 10px 12px;
  }
  .task-20-card { padding: 8px 6px 10px; border-radius: 16px; }
  .task-20-label { font-size: 1rem; }
}

/* Mobil */

@media (max-width: 560px) {
  .task-20-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
  }
  .task-20-card { padding: 6px 4px 8px; border-radius: 14px; gap: 4px; }
  .task-20-label { font-size: 0.88rem; }
  .task-20-status { gap: 10px; flex-direction: column; }
  .task-20-counter { font-size: 0.95rem; padding: 5px 12px; }
}

/* ===== 20/a-b — viewport-fit: 2 sor, egy képernyő ===== */

body.solo-mode .task-20-szavak.solo-task-active,
body.classroom-paged-mode .task-20-szavak.solo-task-active {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--solo-task-viewport, 100dvh) - clamp(56px, 10dvh, 96px));
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(6px, 1.2vh, 14px) clamp(8px, 2vw, 16px);
}

body.solo-mode .task-20-szavak.solo-task-active .task-header,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-header {
  flex-shrink: 0;
  margin-bottom: 4px;
}

body.solo-mode .task-20-szavak.solo-task-active .task-title,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-title {
  font-size: clamp(0.9rem, 2.3vw, 1.15rem);
}

body.solo-mode .task-20-szavak.solo-task-active .task-instr,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-instr {
  font-size: clamp(0.72rem, 1.7vw, 0.88rem);
  margin-bottom: 4px;
}

body.solo-mode .task-20-szavak.solo-task-active .task-20-grid,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-20-grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(4px, 0.9vh, 10px) clamp(4px, 0.9vw, 10px);
  padding: 4px 6px;
  max-width: none;
  align-content: center;
}

body.solo-mode .task-20-szavak.solo-task-active .task-20-card,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-20-card {
  padding: clamp(4px, 0.8vh, 8px) clamp(3px, 0.6vw, 6px) clamp(5px, 0.9vh, 8px);
  border-radius: clamp(10px, 1.8vw, 16px);
  gap: 2px;
  min-height: 0;
}

body.solo-mode .task-20-szavak.solo-task-active .task-20-label,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-20-label {
  font-size: clamp(0.68rem, 1.5vw, 0.92rem);
}

body.solo-mode .task-20-szavak.solo-task-active .task-20-status,
body.classroom-paged-mode .task-20-szavak.solo-task-active .task-20-status {
  flex-shrink: 0;
  margin-top: 4px;
}

@media (max-width: 560px) {
  body.solo-mode .task-20-szavak.solo-task-active .task-20-grid,
  body.classroom-paged-mode .task-20-szavak.solo-task-active .task-20-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

.task-pont-head .kicker {
  background: linear-gradient(135deg, #ffd166, #f59e0b);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
  margin-top: 4px;
  text-transform: uppercase;
}

.task-pont-head .subtitle {
  margin: 0;
  color: #5b5078;
  font-size: 0.98rem;
}

@media (max-width: 900px) {
  .task-pont {
    padding: 4px 8px 6px;
  }
  .task-pont-head {
    gap: 6px;
    margin-bottom: 6px;
  }
  .task-pont-head .kicker {
    font-size: 0.62rem;
    padding: 2px 8px;
  }
  .task-pont-head h2 {
    font-size: 0.95rem;
    line-height: 1.15;
  }
  .task-pont-head .subtitle {
    font-size: 0.78rem;
  }
  .task-pont-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 6px;
    padding: 8px;
    min-height: 0;
  }
  .chest-wrap {
    margin-bottom: 4px;
  }
  .chest-bin {
    max-width: 140px;
  }
  .chest-count {
    font-size: 0.78rem;
    padding: 4px 10px;
    bottom: -10px;
  }
  .treasure-yard {
    min-height: 460px;
  }
  .treasure-item {
    width: 80px;
    height: 80px;
  }
  .treasure-item img {
    height: 58px;
  }
  .treasure-label {
    font-size: 0.62rem;
  }
  /* Mobil pozíciók — 3 oszlop × 4 sor, 10 elem (utolsó sor 1 elem középen) */
  .treasure-item:nth-child(1)  { top:   4px; left:  10px; }
  .treasure-item:nth-child(2)  { top:   4px; left: 110px; }
  .treasure-item:nth-child(3)  { top:   4px; left: 215px; }
  .treasure-item:nth-child(4)  { top: 105px; left:  10px; }
  .treasure-item:nth-child(5)  { top: 105px; left: 110px; }
  .treasure-item:nth-child(6)  { top: 105px; left: 215px; }
  .treasure-item:nth-child(7)  { top: 215px; left:  10px; }
  .treasure-item:nth-child(8)  { top: 215px; left: 110px; }
  .treasure-item:nth-child(9)  { top: 215px; left: 215px; }
  .treasure-item:nth-child(10) { top: 320px; left: 110px; }
}

.task-pont2-head .kicker {
  background: linear-gradient(135deg, #86efac, #16a34a);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
  white-space: nowrap;
  margin-top: 4px;
  text-transform: uppercase;
}

.task-pont2-head .subtitle {
  margin: 0;
  color: #5b5078;
  font-size: 0.98rem;
}

@media (max-width: 900px) {
  .task-pont2 {
    padding: 4px 8px 6px;
  }
  .task-pont2-head {
    gap: 6px;
    margin-bottom: 6px;
  }
  .task-pont2-head .kicker {
    font-size: 0.62rem;
    padding: 2px 8px;
  }
  .task-pont2-head h2 {
    font-size: 0.95rem;
    line-height: 1.15;
  }
  .task-pont2-head .subtitle {
    font-size: 0.78rem;
  }
  .task-pont2-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 6px;
    padding: 8px;
    min-height: 0;
  }
  .maci-wrap {
    margin-bottom: 4px;
  }
  .maci-bin {
    max-width: 140px;
  }
  .maci-count {
    font-size: 0.78rem;
    padding: 4px 10px;
    bottom: -10px;
  }
  .food-yard {
    min-height: 460px;
  }
  .food-item {
    width: 80px;
    height: 80px;
  }
  .food-item img {
    height: 58px;
  }
  .food-label {
    font-size: 0.62rem;
  }
  .food-item:nth-child(1)  { top:   4px; left:  10px; }
  .food-item:nth-child(2)  { top:   4px; left: 110px; }
  .food-item:nth-child(3)  { top:   4px; left: 215px; }
  .food-item:nth-child(4)  { top: 105px; left:  10px; }
  .food-item:nth-child(5)  { top: 105px; left: 110px; }
  .food-item:nth-child(6)  { top: 105px; left: 215px; }
  .food-item:nth-child(7)  { top: 215px; left:  10px; }
  .food-item:nth-child(8)  { top: 215px; left: 110px; }
  .food-item:nth-child(9)  { top: 215px; left: 215px; }
  .food-item:nth-child(10) { top: 320px; left: 110px; }
}
/* === ÚJ FELADATOK 8-21 ADDITIVE MERGE END === */

/* ===================== 0. feladat — Artikuláció vizsgálata ===================== */
.task-0 {
  --task0-gap: clamp(3px, 0.45vw, 6px);
  --task0-cell-min: 64px;
  /* Viewport-fit defaults; JS overwrites to fill stage without overflow/distort */
  --task0-cell-max: 960px;
  --task0-img-max: 960px;
  --task0-cols: 4;
  --task0-cell: clamp(80px, 16vw, 220px);
  background: linear-gradient(180deg, #fff8f0 0%, #fff2e0 100%);
  border-radius: 20px;
  padding: clamp(10px, 1.8vw, 16px) clamp(10px, 2.5vw, 22px);
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}
.task-0-heading { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.task-0-heading .section-kicker {
  background: #ff8a3d; color: #fff; padding: 4px 12px;
  border-radius: 10px; font-weight: 700; font-size: 13px;
  white-space: nowrap;
}
.task-0-heading h2 { font-size: clamp(18px, 3vw, 24px); margin: 2px 0 4px; color: #3a2a1a; }
.task-0-heading p { color: #6e5a44; margin: 0; font-size: clamp(13px, 2.2vw, 14px); line-height: 1.35; }

.task-0-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 14px);
  margin: 2px 0 6px;
}
.task-0-subnav-btn {
  appearance: none;
  border: 1px solid rgba(255, 138, 61, 0.35);
  background: #fff;
  color: #c2410c;
  width: clamp(34px, 7vw, 40px);
  height: clamp(34px, 7vw, 40px);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 2px 6px rgba(255, 138, 61, 0.12);
}
.task-0-subnav-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(255, 138, 61, 0.2); }
.task-0-subnav-btn:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }
.task-0-subnav-indicator {
  min-width: 4.5rem;
  text-align: center;
  font-weight: 700;
  font-size: clamp(13px, 2.4vw, 15px);
  color: #9a3412;
}

.task-0-pages {
  max-width: 100%;
  width: 100%;
  margin-inline: auto;
}
.task-0-page { margin-top: 0; }
.task-0-page:not(.task-0-page--active) { display: none !important; }
.task-0-page--active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.task-0-page-title {
  font-size: clamp(15px, 2.6vw, 17px); color: #c2410c; margin: 0 0 4px 2px;
  font-weight: 700; letter-spacing: 0.4px;
  flex-shrink: 0;
}

/* Art I — skálázható rács; oszlop/cella méretet a JS állítja (--task0-cols, --task0-cell) */
.task-0-grid {
  display: grid;
  grid-template-columns: repeat(var(--task0-cols, 4), var(--task0-cell, clamp(80px, 16vw, 140px)));
  grid-auto-rows: var(--task0-cell, clamp(80px, 16vw, 140px));
  gap: var(--task0-gap, 6px);
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  align-content: start;
  justify-content: center;
  justify-items: center;
  box-sizing: border-box;
}

.task-0-card {
  border: none;
  padding: 1px;
  background: #fff; border-radius: 10px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  width: var(--task0-cell, clamp(80px, 16vw, 220px));
  height: var(--task0-cell, clamp(80px, 16vw, 220px));
  max-width: var(--task0-cell-max, 960px);
  max-height: var(--task0-cell-max, 960px);
  justify-self: center;
  align-self: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.15s ease, opacity 0.45s ease;
  transform-origin: center center;
}
.task-0-card:hover {
  box-shadow: 0 4px 12px rgba(255,138,61,0.16);
  transform: translateY(-1px);
}
.task-0-card img {
  width: 100%;
  height: 100%;
  max-width: min(100%, var(--task0-img-max, 960px));
  max-height: min(100%, var(--task0-img-max, 960px));
  object-fit: contain; /* no distortion */
  pointer-events: none; user-select: none;
  display: block;
}
.task-0-card-vanish {
  opacity: 0;
  transform: scale(0.82);
  pointer-events: none;
}
.task-0-card-hidden {
  display: none;
}
img.img-deferred-pending {
  background: rgba(233, 223, 200, 0.42);
}
img.img-deferred-pending[src^="data:"]:not(.art-lip-photo) {
  object-fit: contain;
}
img.art-lip-photo.img-deferred-pending[src^="data:"] {
  object-fit: cover;
}

/* Animációk — wireTask0 véletlenszerűen alkalmazza */
@keyframes task-0-bounce { 0%,100% {transform: translateY(0);} 30% {transform: translateY(-14px);} 60% {transform: translateY(4px);} }
@keyframes task-0-wiggle { 0%,100% {transform: rotate(0);} 25% {transform: rotate(-6deg);} 75% {transform: rotate(6deg);} }
@keyframes task-0-spin { 0% {transform: rotate(0);} 100% {transform: rotate(360deg);} }
@keyframes task-0-pop { 0% {transform: scale(1);} 50% {transform: scale(1.25);} 100% {transform: scale(1);} }
@keyframes task-0-hop { 0%,100% {transform: translateY(0) rotate(0);} 30% {transform: translateY(-18px) rotate(-8deg);} 70% {transform: translateY(-4px) rotate(4deg);} }
@keyframes task-0-shake { 0%,100% {transform: translateX(0);} 20% {transform: translateX(-6px);} 40% {transform: translateX(6px);} 60% {transform: translateX(-4px);} 80% {transform: translateX(4px);} }
@keyframes task-0-flipx { 0% {transform: rotateX(0);} 100% {transform: rotateX(360deg);} }
@keyframes task-0-flipy { 0% {transform: rotateY(0);} 100% {transform: rotateY(360deg);} }
@keyframes task-0-swing { 0%,100% {transform: rotate(0);} 30% {transform: rotate(12deg);} 70% {transform: rotate(-12deg);} }
@keyframes task-0-pulse { 0%,100% {transform: scale(1);} 50% {transform: scale(1.12);} }
@keyframes task-0-tada { 0% {transform: scale(1) rotate(0);} 20% {transform: scale(0.9) rotate(-3deg);} 40% {transform: scale(1.15) rotate(4deg);} 60% {transform: scale(1.15) rotate(-4deg);} 100% {transform: scale(1) rotate(0);} }
@keyframes task-0-rubber { 0% {transform: scale(1,1);} 30% {transform: scale(1.25,0.75);} 60% {transform: scale(0.85,1.15);} 100% {transform: scale(1,1);} }
@keyframes task-0-heartbeat { 0%,100% {transform: scale(1);} 14% {transform: scale(1.18);} 28% {transform: scale(1);} 42% {transform: scale(1.18);} 56% {transform: scale(1);} }

.task-0-anim-bounce { animation: task-0-bounce 0.7s ease; }
.task-0-anim-wiggle { animation: task-0-wiggle 0.6s ease; }
.task-0-anim-spin { animation: task-0-spin 0.8s ease-in-out; }
.task-0-anim-pop { animation: task-0-pop 0.5s ease; }
.task-0-anim-hop { animation: task-0-hop 0.8s ease; }
.task-0-anim-shake { animation: task-0-shake 0.6s ease; }
.task-0-anim-flipx { animation: task-0-flipx 0.8s ease; }
.task-0-anim-flipy { animation: task-0-flipy 0.8s ease; }
.task-0-anim-swing { animation: task-0-swing 0.7s ease; }
.task-0-anim-pulse { animation: task-0-pulse 0.6s ease; }
.task-0-anim-tada { animation: task-0-tada 0.8s ease; }
.task-0-anim-rubber { animation: task-0-rubber 0.7s ease; }
.task-0-anim-heartbeat { animation: task-0-heartbeat 0.9s ease; }

/* konfetti */
.task-0-confetti {
  position: fixed; pointer-events: none; z-index: 9999;
  width: 10px; height: 10px; border-radius: 2px;
  opacity: 1;
  animation: task-0-confetti-fly 900ms ease-out forwards;
}
@keyframes task-0-confetti-fly {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--cx,0), var(--cy,0)) rotate(720deg); opacity: 0; }
}

/* Art./I./5,10 — üres cella, hogy az 1. sor csak 3 kép legyen (pl. hajó, bohóc, felhő) */
.task-0-grid .task-0-spacer {
  width: var(--task0-cell, clamp(80px, 16vw, 220px));
  height: var(--task0-cell, clamp(80px, 16vw, 220px));
  max-width: var(--task0-cell-max, 960px);
  max-height: var(--task0-cell-max, 960px);
  visibility: hidden;
  pointer-events: none;
  border: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 1023px) {
  .task-0 {
    --task0-gap: clamp(4px, 0.6vw, 8px);
    /* Viewport-fit on tablet/phone — JS sets final cell; high ceiling */
    --task0-cell-max: 420px;
    --task0-img-max: 420px;
    --task0-cell: clamp(64px, 18vw, 180px);
    padding: clamp(12px, 2.5vw, 20px) clamp(12px, 3vw, 28px);
  }
  .task-0-card {
    padding: clamp(2px, 0.3vw, 4px);
    border-radius: 12px;
  }
}

/* ===================== Artikuláció — Ajak-, és nyelvgyakorlatok ===================== */
.task-art-lip-tongue {
  background: linear-gradient(180deg, #fff5f8 0%, #fffaf3 50%, #f3fbff 100%);
  border-radius: 20px;
  padding: clamp(12px, 2.5vw, 20px) clamp(12px, 3vw, 28px);
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(44, 36, 72, 0.06);
}
.task-art-lip-tongue-heading .section-kicker {
  background: #e85d8a;
  color: #fff;
}
.task-art-lip-tongue-heading h2 {
  font-size: clamp(18px, 3vw, 24px);
  margin: 2px 0 4px;
  color: #2c2448;
}
.task-art-lip-tongue-card {
  background: #fffdf9;
  border: 2px solid #f0d4dc;
  border-radius: 28px;
  padding: clamp(10px, 1.8vw, 16px) clamp(10px, 2vw, 16px);
  text-align: left;
  box-shadow: 0 8px 28px rgba(44, 36, 72, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.task-art-lip-tongue-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.art-lip-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.art-lip-page-nav--hidden,
.art-lip-page-nav[hidden] {
  display: none !important;
}
.art-lip-page-nav-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #e85d8a;
  border-radius: 12px;
  background: #fff;
  color: #e85d8a;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.art-lip-page-nav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(232, 93, 138, 0.2);
}
.art-lip-page-nav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.art-lip-page-indicator {
  font-weight: 800;
  font-size: 13px;
  min-width: 56px;
  text-align: center;
  color: #c24d74;
}
.art-lip-pages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.art-lip-page {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
}
.art-lip-page--active {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
}
.task-art-lip-tongue-grid.tongue-grid {
  margin: 0;
}
/* Ajak + fúvó/szívó: 3×2 rács, 6 kártya / képernyő */
.art-lip-paged-grid,
[data-testid="task-art-lip-grid"],
[data-testid="task-art-blow-suck-grid"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 10px);
  flex: 1 1 auto;
  min-height: clamp(280px, 58dvh, 72dvh);
  height: 100%;
  align-content: stretch;
  align-items: stretch;
}
/* Nyelvgyakorlatok: viewport-fit 3×2, fix cellaméret JS-ből (--tongue-cell-h) */
[data-testid="task-art-tongue-grid"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, var(--tongue-cell-h, 1fr));
  gap: clamp(4px, 0.8vw, 8px);
  flex: 0 0 auto;
  width: 100%;
  height: var(--tongue-grid-h, auto);
  min-height: 0;
  max-height: none;
  align-content: start;
  align-items: stretch;
}
[data-testid="task-art-tongue-grid"] .art-lip-text-card {
  height: var(--tongue-cell-h, 100%);
  min-height: 0;
  max-height: var(--tongue-cell-h, none);
}
.tongue-card.art-lip-text-card {
  min-height: 0;
  height: 100%;
  padding: clamp(3px, 0.55vw, 6px);
  border-radius: 12px;
  gap: 2px;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  overflow: hidden;
  aspect-ratio: auto !important;
  grid-template: none !important;
}
/* solo/classroom .tongue-card { display:grid } — flex + grid-area biztonsági háló */
body.solo-mode .tongue-card.art-lip-text-card,
body.classroom-paged-mode .tongue-card.art-lip-text-card {
  display: flex !important;
  flex-direction: column !important;
  aspect-ratio: auto !important;
  grid-template: none !important;
}
body.solo-mode .tongue-card.art-lip-text-card .art-lip-visual,
body.classroom-paged-mode .tongue-card.art-lip-text-card .art-lip-visual {
  grid-area: visual;
}
body.solo-mode .tongue-card.art-lip-text-card .art-lip-text-copy,
body.classroom-paged-mode .tongue-card.art-lip-text-card .art-lip-text-copy {
  grid-area: copy;
}
body.solo-mode .tongue-card.art-lip-text-card .art-lip-confirm,
body.classroom-paged-mode .tongue-card.art-lip-text-card .art-lip-confirm {
  grid-area: confirm;
}
.art-lip-paged-grid .tongue-card:not(.art-lip-text-card) {
  min-height: 0;
  height: 100%;
  padding: clamp(4px, 0.7vw, 8px);
}
.art-lip-paged-grid .tongue-play {
  flex: 1 1 auto;
  min-height: 0;
}
.art-lip-paged-grid .tongue-visual {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.art-lip-paged-grid .tongue-visual svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}
.art-lip-paged-grid .tongue-copy {
  flex: 0 0 auto;
}
.art-lip-paged-grid .tongue-title,
.art-lip-paged-grid .tongue-task-line {
  font-size: clamp(8px, 1.35vw, 10px);
  line-height: 1.2;
}
[data-testid="task-art-lip-grid"] .art-lip-text-card,
[data-testid="task-art-blow-suck-grid"] .art-lip-text-card,
[data-testid="task-art-tongue-grid"] .art-lip-text-card {
  min-height: 0;
}
[data-testid="task-art-lip-grid"] .art-lip-visual,
[data-testid="task-art-blow-suck-grid"] .art-lip-visual {
  flex: 1 1 auto;
  min-height: clamp(72px, 22vw, 160px);
  position: relative;
  width: 100%;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  align-self: stretch;
}
[data-testid="task-art-tongue-grid"] .art-lip-visual {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  align-self: stretch;
}
[data-testid="task-art-lip-grid"] .art-lip-visual {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .95), transparent 40%),
    linear-gradient(160deg, #FFF8FB, #FFE8F0);
  border: 1px solid #F0D4DE;
}
[data-testid="task-art-blow-suck-grid"] .art-lip-visual {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .95), transparent 40%),
    linear-gradient(160deg, #F5FAFF, #E3F0FF);
  border: 1px solid #C8DCF0;
}
[data-testid="task-art-tongue-grid"] .art-lip-visual {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .95), transparent 40%),
    linear-gradient(160deg, #F8FFF5, #E8F5E0);
  border: 1px solid #C5DFC0;
}
[data-testid="task-art-lip-grid"] .art-lip-icon,
[data-testid="task-art-lip-grid"] .art-lip-photo,
[data-testid="task-art-blow-suck-grid"] .art-lip-photo,
[data-testid="task-art-tongue-grid"] .art-lip-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}
[data-testid="task-art-tongue-grid"] .art-lip-photo {
  object-fit: contain;
  object-position: center center;
}
[data-testid="task-art-tongue-grid"] .art-lip-visual--video .art-lip-photo,
[data-testid="task-art-tongue-grid"] .art-lip-visual--video .photo-motion-video {
  object-fit: contain;
  object-position: center center;
}
/* Nyelvgyakorlatok: videó kitölti a vizuális területet */
[data-testid="task-art-tongue-pages"] .art-lip-page .art-lip-visual {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: none;
}
[data-testid="task-art-tongue-pages"] .art-lip-page .art-lip-text-copy {
  flex: 0 0 var(--tongue-text-h, 2.4em);
  height: var(--tongue-text-h, auto);
  min-height: 0;
  max-height: var(--tongue-text-h, none);
  overflow: hidden;
  padding: 1px 20px 0 0;
}
[data-testid="task-art-tongue-pages"] .art-lip-page .tongue-title {
  font-size: clamp(8px, 1.1vw, 11px);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: block;
}
[data-testid="task-art-tongue-pages"] .art-lip-page .tongue-card.art-lip-text-card {
  padding: clamp(2px, 0.35vw, 4px);
  gap: 2px;
}
[data-testid="task-art-tongue-pages"] .art-lip-page [data-testid="task-art-tongue-grid"] {
  min-height: 0;
  max-height: none;
  height: var(--tongue-grid-h, auto);
  gap: clamp(3px, 0.5vw, 6px);
}
[data-testid="task-art-tongue-pages"] .art-lip-page .art-lip-video-play {
  width: clamp(26px, 4.5vw, 36px);
  height: clamp(26px, 4.5vw, 36px);
  right: 4px;
  bottom: 4px;
}
[data-testid="task-art-tongue-pages"] .art-lip-page .art-lip-video-play svg {
  width: clamp(12px, 2.2vw, 18px);
  height: clamp(12px, 2.2vw, 18px);
}
[data-testid="task-art-tongue-grid"] .art-lip-visual--video {
  cursor: pointer;
}
[data-testid="task-art-tongue-grid"] .art-lip-video-play {
  position: absolute;
  right: clamp(4px, 1vw, 8px);
  bottom: clamp(4px, 1vw, 8px);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 5vw, 44px);
  height: clamp(28px, 5vw, 44px);
  color: #2B6B2E;
  background: rgba(255, 255, 255, .94);
  border: 2px solid rgba(43, 107, 46, .35);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
[data-testid="task-art-tongue-grid"] .art-lip-visual--video:hover .art-lip-video-play,
[data-testid="task-art-tongue-grid"] .art-lip-visual--video:focus-visible .art-lip-video-play {
  transform: scale(1.06);
}
[data-testid="task-art-tongue-grid"] .art-lip-video-play svg {
  display: block;
  width: clamp(14px, 2.8vw, 24px);
  height: clamp(14px, 2.8vw, 24px);
  margin-left: 2px;
}
[data-testid="task-art-tongue-grid"] .art-lip-text-card.is-playing .art-lip-video-play {
  opacity: 0;
}
/* Nyelvgyakorlat: lejátszáskor teljes képernyős overlay (body szint, transform-biztos) */
body.art-tongue-video-overlay-open {
  overflow: hidden;
}
.art-tongue-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  background: rgba(22, 18, 38, .72);
  animation: artTongueOverlayIn .22s ease;
}
.art-tongue-video-overlay__shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 560px);
  height: min(68dvh, 560px);
  max-height: 68dvh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .36);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .95), transparent 40%),
    linear-gradient(160deg, #F8FFF5, #E8F5E0);
  border: 1px solid #C5DFC0;
}
.art-tongue-video-overlay__shell .art-lip-visual {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  position: relative !important;
  transform: none !important;
  border-radius: 16px;
}
.art-tongue-video-overlay .photo-motion-poster {
  opacity: 0 !important;
}
.art-tongue-video-overlay .photo-motion-video {
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 3;
}
.art-tongue-video-overlay__shell .art-lip-photo,
.art-tongue-video-overlay__shell .photo-motion-video {
  object-fit: contain !important;
  object-position: center center !important;
}
.art-tongue-video-placeholder {
  width: 100%;
  flex: 1 1 auto;
  min-height: 72px;
}
@keyframes artTongueOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .art-tongue-video-overlay {
    animation: none;
  }
}
/* 7–9. és 13–15. fúvó: hangjelző ikon ne vágódjon le jobbról */
.tongue-card.art-lip-text-card[data-exercise-id="blow-paper-p"] .art-lip-photo,
.tongue-card.art-lip-text-card[data-exercise-id="blow-paper-t"] .art-lip-photo,
.tongue-card.art-lip-text-card[data-exercise-id="blow-paper-f"] .art-lip-photo,
.tongue-card.art-lip-text-card[data-exercise-id="blow-candle-p"] .art-lip-photo,
.tongue-card.art-lip-text-card[data-exercise-id="blow-candle-t"] .art-lip-photo,
.tongue-card.art-lip-text-card[data-exercise-id="blow-candle-f"] .art-lip-photo {
  object-position: 38% 18%;
}
[data-testid="task-art-lip-grid"] .art-lip-text-copy,
[data-testid="task-art-blow-suck-grid"] .art-lip-text-copy {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 22px 0 0;
}
[data-testid="task-art-lip-grid"] .tongue-title,
[data-testid="task-art-blow-suck-grid"] .tongue-title {
  font-size: clamp(8px, 1.45vw, 10.5px);
  line-height: 1.22;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-testid="task-art-tongue-grid"] .art-lip-text-copy {
  flex: 0 0 var(--tongue-text-h, 2.4em);
  height: var(--tongue-text-h, auto);
  min-height: 0;
  max-height: var(--tongue-text-h, none);
  padding: 1px 20px 0 0;
  overflow: hidden;
}
[data-testid="task-art-tongue-grid"] .tongue-title {
  font-size: clamp(8px, 1.1vw, 11px);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: block;
}
[data-testid="task-art-lip-grid"] .art-lip-num {
  font-weight: 800;
  color: #E85D8A;
}
[data-testid="task-art-blow-suck-grid"] .art-lip-num {
  font-weight: 800;
  color: #4A90D9;
}
[data-testid="task-art-tongue-grid"] .art-lip-num {
  font-weight: 800;
  color: #5A9E4A;
}
[data-testid="task-art-lip-grid"] .tongue-check,
[data-testid="task-art-blow-suck-grid"] .tongue-check,
[data-testid="task-art-tongue-grid"] .tongue-check {
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  z-index: 2;
}
[data-testid="task-art-lip-grid"] .art-lip-confirm,
[data-testid="task-art-blow-suck-grid"] .art-lip-confirm {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  margin-top: 0;
  z-index: 2;
}
[data-testid="task-art-tongue-grid"] .art-lip-confirm {
  position: absolute;
  right: 3px;
  top: 3px;
  bottom: auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  margin-top: 0;
  z-index: 5;
}
[data-testid="task-art-tongue-grid"] .tongue-check {
  display: none;
}
[data-testid="task-art-lip-grid"] .art-lip-text-card.is-done .art-lip-visual,
[data-testid="task-art-blow-suck-grid"] .art-lip-text-card.is-done .art-lip-visual,
[data-testid="task-art-tongue-grid"] .art-lip-text-card.is-done .art-lip-visual {
  opacity: 0.72;
  filter: saturate(0.85);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-lip-panel"]:not([hidden]) [data-testid="task-art-lip-grid"],
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-blow-suck-panel"]:not([hidden]) [data-testid="task-art-blow-suck-grid"],
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-lip-panel"]:not([hidden]) [data-testid="task-art-lip-grid"],
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-blow-suck-panel"]:not([hidden]) [data-testid="task-art-blow-suck-grid"],
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-lip-panel"]:not([hidden]) .art-lip-paged-grid,
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-blow-suck-panel"]:not([hidden]) .art-lip-paged-grid,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-lip-panel"]:not([hidden]) .art-lip-paged-grid,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-blow-suck-panel"]:not([hidden]) .art-lip-paged-grid,
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-lip-panel"]:not([hidden]) [data-testid="task-art-lip-grid"],
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-blow-suck-panel"]:not([hidden]) [data-testid="task-art-blow-suck-grid"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(4px, 0.8vw, 8px);
  min-height: clamp(280px, 58dvh, 72dvh);
  height: 100%;
  max-height: none;
  overflow: hidden;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) [data-testid="task-art-tongue-grid"],
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) [data-testid="task-art-tongue-grid"],
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) .art-lip-paged-grid,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) .art-lip-paged-grid,
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) [data-testid="task-art-tongue-grid"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, var(--tongue-cell-h, 1fr));
  gap: clamp(4px, 0.8vw, 8px);
  min-height: 0;
  height: var(--tongue-grid-h, auto);
  max-height: none;
  overflow: hidden;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) .tongue-card.art-lip-text-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) .tongue-card.art-lip-text-card,
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-panel"]:not([hidden]) .tongue-card.art-lip-text-card {
  height: var(--tongue-cell-h, 100%);
  min-height: 0;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .tongue-card.art-lip-text-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .tongue-card.art-lip-text-card,
body.solo-mode .task-art-lip-tongue.solo-task-active .tongue-card.art-lip-text-card {
  min-height: 0;
}
@media (max-width: 520px) {
  .art-lip-paged-grid,
  [data-testid="task-art-lip-grid"],
  [data-testid="task-art-blow-suck-grid"] {
    min-height: clamp(240px, 52dvh, 64dvh);
  }
  [data-testid="task-art-tongue-grid"] {
    min-height: 0;
  }
}
.art-lip-text-card {
  align-items: stretch;
}
.art-lip-text-card .art-lip-text-copy {
  padding: 0;
}
.art-lip-text-card .tongue-title {
  line-height: 1.3;
}
.task-art-lip-tongue-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
}
.task-art-lip-tongue-subnav-btn {
  width: 40px;
  height: 40px;
  border: 2px solid #e85d8a;
  border-radius: 12px;
  background: #fff;
  color: #e85d8a;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.task-art-lip-tongue-subnav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(232, 93, 138, 0.2);
}
.task-art-lip-tongue-subnav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}
.task-art-lip-tongue-subnav-indicator {
  min-width: 10em;
  text-align: center;
  font-weight: 700;
  color: #2c2448;
  font-size: clamp(14px, 2.5vw, 16px);
}
.task-art-lip-tongue-panel-title {
  margin: 0;
  font-size: clamp(16px, 2.8vw, 20px);
  color: #2c2448;
  text-align: left;
}
.task-art-lip-tongue-heading p {
  color: #6a6080;
  margin: 0;
  font-size: clamp(13px, 2.2vw, 14px);
  line-height: 1.4;
}
.task-art-lip-tongue-panel--active .task-art-lip-tongue-card {
  min-height: clamp(300px, 62dvh, 78dvh);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active .task-art-lip-tongue-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active .task-art-lip-tongue-card {
  flex: 1 1 auto;
  min-height: 0;
  border-color: #f0c4d4;
}

/* Nyelvgyakorlatok: 6 kártya egy képernyőre (viewport-fit lánc) */
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active,
body.solo-mode .task-art-lip-tongue.solo-task-active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  margin-bottom: 0;
  padding: clamp(6px, 0.8dvh, 12px) clamp(10px, 2vw, 20px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.4dvh, 6px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading h2,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading h2,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading h2 {
  font-size: clamp(14px, 2.4vw, 18px);
  margin: 0;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading p,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading p,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading p {
  display: none;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-subnav,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-subnav,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-subnav {
  flex-shrink: 0;
  margin: 0 0 clamp(2px, 0.4dvh, 6px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-pages,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-pages,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-pages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading-row,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading-row,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading-row {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.35dvh, 6px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel-title,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel-title,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel-title {
  font-size: clamp(13px, 2.2vw, 16px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-card,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: clamp(4px, 0.7dvh, 8px) clamp(6px, 1.2vw, 10px);
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .art-lip-pages,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .art-lip-pages,
body.solo-mode .task-art-lip-tongue.solo-task-active .art-lip-pages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .art-lip-page--active,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .art-lip-page--active,
body.solo-mode .task-art-lip-tongue.solo-task-active .art-lip-page--active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active .task-art-lip-tongue-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active .task-art-lip-tongue-card,
body.solo-mode .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-panel--active .task-art-lip-tongue-card {
  min-height: 0;
}
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-visual,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-visual,
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-visual {
  flex: 1 1 0;
  min-height: 0;
}
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-art-lip-tongue.solo-task-active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ===================== Artikuláció 2. feladat — Auditív differenciálás ===================== */
.task-art-aud {
  --task0-gap: clamp(4px, 0.6vw, 8px);
  --task0-cell-min: 56px;
  /* Viewport-fit: JS sets final cell; high ceiling (2×3 pairs). */
  --task0-cell-max: 960px;
  --task0-img-max: 960px;
  --task0-cols: 2;
  --task0-cell: clamp(56px, 12vw, 160px);
  background: linear-gradient(180deg, #f7f3ff 0%, #fff8ef 45%, #eef8ff 100%);
  border-radius: 20px;
  padding: clamp(12px, 2.5vw, 20px) clamp(12px, 3vw, 28px);
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(44, 36, 72, 0.06);
}
.task-art-aud-heading .section-kicker {
  background: #7c5cff;
  color: #fff;
}
.task-art-aud-heading h2 {
  font-size: clamp(18px, 3vw, 24px);
  margin: 2px 0 4px;
  color: #2c2448;
}
.task-art-aud-heading p {
  color: #6a6080;
  margin: 0;
  font-size: clamp(13px, 2.2vw, 14px);
  line-height: 1.4;
}
.task-art-aud-card {
  background: #fffdf9;
  border: 2px solid #f0e2cf;
  border-radius: 28px;
  padding: 18px 16px 20px;
  box-shadow: 0 8px 28px rgba(44, 36, 72, 0.08);
}
.task-art-aud-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.task-art-aud-section-title {
  margin: 0;
  font-size: clamp(16px, 2.8vw, 20px);
  color: #3d3358;
}
.task-art-aud-page-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.task-art-aud-nav-btn {
  border: none;
  background: #7c5cff;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.task-art-aud-nav-btn:hover:not(:disabled) { transform: translateY(-1px); }
.task-art-aud-nav-btn:disabled { opacity: 0.35; cursor: default; }
.staging-wrong-host-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  padding: 10px 14px;
  background: #ffe8e8;
  border-bottom: 2px solid #e74c3c;
  color: #5c1a1a;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.staging-wrong-host-banner a { color: #b91c1c; font-weight: 700; }
body:has(.staging-wrong-host-banner) .topbar { top: 52px; }

.task-art-aud-page-indicator {
  font-weight: 800;
  font-size: 14px;
  min-width: 72px;
  text-align: center;
  color: #5b4bb7;
}
.task-art-aud-hint {
  font-size: 13px;
  color: #6a6080;
  margin: 0 0 12px;
  line-height: 1.45;
}
.task-art-aud-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: linear-gradient(90deg, #fff4d6, #ffe8f0);
  border: 2px dashed #f0c987;
}
.task-art-aud-prompt-label {
  font-size: 14px;
  font-weight: 700;
  color: #6b4b2a;
}
.task-art-aud-target-word {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  color: #7c5cff;
  letter-spacing: 0.02em;
}
.task-art-aud-next-word-btn {
  margin-left: auto;
  border: none;
  background: #ff9f43;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 159, 67, 0.35);
}
.task-art-aud-grid {
  display: grid;
  grid-template-columns: repeat(var(--task0-cols, 2), var(--task0-cell, clamp(56px, 12vw, 88px)));
  grid-auto-rows: var(--task0-cell, clamp(56px, 12vw, 88px));
  gap: var(--task0-gap, 8px);
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  align-content: start;
  justify-content: center;
  justify-items: center;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.task-art-aud-cell {
  position: relative;
  border: 1px solid #e8dcc8;
  border-radius: 12px;
  background: #fff;
  padding: clamp(2px, 0.3vw, 4px);
  aspect-ratio: 1 / 1;
  width: var(--task0-cell, clamp(56px, 12vw, 160px));
  height: var(--task0-cell, clamp(56px, 12vw, 160px));
  max-width: var(--task0-cell-max, 960px);
  max-height: var(--task0-cell-max, 960px);
  min-height: 0;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  appearance: none;
  font: inherit;
  text-align: inherit;
  justify-self: center;
  align-self: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.task-art-aud-cell:hover:not(.is-picked) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.15);
  border-color: #c9b8ff;
}
.task-art-aud-cell.is-picked {
  transform: translateY(-4px) scale(1.03);
  z-index: 5;
  border-color: #7c5cff;
  box-shadow: 0 10px 22px rgba(124, 92, 255, 0.28);
}
.task-art-aud-cell img {
  width: auto;
  height: auto;
  max-width: min(100%, var(--task0-img-max, 960px));
  max-height: min(calc(100% - 1.1em), var(--task0-img-max, 960px));
  object-fit: contain;
  border-radius: 8px;
  background: #fafafa;
  pointer-events: none;
  user-select: none;
  display: block;
  flex: 1 1 auto;
  min-height: 0;
}
.task-art-aud-cell-label {
  text-align: center;
  font-size: clamp(9px, 2vw, 11px);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 1px;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3d3358;
}
.task-art-aud-pair-divider {
  position: absolute;
  top: 50%;
  right: calc(var(--task0-gap, 8px) / -2 - 1px);
  transform: translateY(-50%);
  width: clamp(8px, 1.6vw, 12px);
  height: clamp(8px, 1.6vw, 12px);
  border-radius: 50%;
  border: 1px solid #d4c4a8;
  background: #fff;
  z-index: 2;
  pointer-events: none;
}
.task-art-aud-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid #f0e8da;
  flex-shrink: 0;
}
.task-art-aud-counter {
  font-weight: 800;
  font-size: 15px;
  color: #3d3358;
}
.task-art-aud-reset {
  font-weight: 800;
}
@media (max-width: 520px) {
  .task-art-aud-card { padding: 14px 10px 16px; border-radius: 22px; }
  .task-art-aud-next-word-btn { margin-left: 0; width: 100%; }
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding: clamp(6px, 0.8dvh, 10px) clamp(10px, 2vw, 20px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-heading {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.4dvh, 6px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-heading h2 {
  font-size: clamp(14px, 2.8vw, 20px);
  margin: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-art-aud-card,
body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(8px, 1dvh, 14px) clamp(10px, 1.5vw, 16px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-heading-row,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-aud-heading-row {
  flex-shrink: 0;
  margin-bottom: clamp(4px, 0.6dvh, 8px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-grid,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-aud-grid {
  flex: 1 1 auto;
  min-height: 0;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  justify-content: center;
  align-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-aud.solo-task-active .task-art-aud-status,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-aud-status {
  flex-shrink: 0;
  margin-top: clamp(6px, 0.8dvh, 12px);
  padding-top: clamp(6px, 0.8dvh, 10px);
}

/* ===================== Artikuláció 3. feladat — Összefüggő beszéd (viewport-fit / full stage) ===================== */
.task-art-narr {
  --art-narr-stage-max-h: min(66dvh, 680px);
  background: linear-gradient(180deg, #f7f3ff 0%, #fff8ef 45%, #eef8ff 100%);
  border-radius: 20px;
  padding: clamp(6px, 1.2vw, 12px) clamp(8px, 2vw, 16px);
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(44, 36, 72, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100dvh - clamp(96px, 16dvh, 140px));
  overflow: hidden;
  box-sizing: border-box;
}
.task-art-narr-heading .section-kicker {
  background: #7c5cff;
  color: #fff;
}
.task-art-narr-heading h2 {
  font-size: clamp(18px, 3vw, 24px);
  margin: 2px 0 4px;
  color: #2c2448;
}
.task-art-narr-card {
  background: #fffdf9;
  border: 2px solid #f0e2cf;
  border-radius: 28px;
  padding: clamp(10px, 1.6vw, 16px) clamp(10px, 2vw, 18px) clamp(10px, 1.8vw, 14px);
  box-shadow: 0 8px 28px rgba(44, 36, 72, 0.08);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.task-art-narr-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: clamp(4px, 0.6dvh, 8px);
  flex-shrink: 0;
}
.task-art-narr-page-title {
  margin: 0;
  font-size: clamp(16px, 2.8vw, 20px);
  color: #3d3358;
}
.task-art-narr-page-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.task-art-narr-nav-btn {
  border: none;
  background: #7c5cff;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.task-art-narr-nav-btn:hover:not(:disabled) { transform: translateY(-1px); }
.task-art-narr-nav-btn:disabled { opacity: 0.35; cursor: default; }
.task-art-narr-page-indicator {
  font-weight: 800;
  font-size: 14px;
  min-width: 72px;
  text-align: center;
  color: #5b4bb7;
}
.task-art-narr-stage {
  /* Explicit height from JS --art-narr-stage-max-h. Absolute img does not
     contribute to parent size; flex:1 + min-height:0 collapsed the stage to ~0. */
  flex: 0 0 auto;
  width: 100%;
  height: var(--art-narr-stage-max-h, min(62dvh, 560px));
  min-height: min(34dvh, 260px);
  max-height: var(--art-narr-stage-max-h, min(62dvh, 560px));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ece3d4;
  position: relative;
}
.task-art-narr-stage img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* no distort / no overflow */
  object-position: center center;
}
.task-art-narr-status {
  display: flex;
  justify-content: flex-start;
  margin-top: clamp(6px, 0.8dvh, 10px);
  flex-shrink: 0;
}
.task-art-narr-reset {
  font-weight: 800;
}
body.solo-mode .task-art-narr.solo-task-active {
  max-height: calc(
    100dvh
    - var(--solo-topbar-height, 56px)
    - var(--solo-bottom-nav-height, 64px)
    - env(safe-area-inset-bottom, 0px)
    - clamp(4px, 1dvh, 12px)
  );
  height: 100%;
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(4px, 0.8dvh, 10px) clamp(8px, 1.5vw, 14px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  max-height: var(--solo-task-viewport, 100dvh);
  height: auto;
  padding: clamp(4px, 0.8dvh, 10px) clamp(8px, 1.5vw, 14px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-heading {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.4dvh, 6px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading .section-kicker,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading .section-kicker,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-heading .section-kicker {
  display: none;
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading h2,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading h2,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-heading h2 {
  font-size: clamp(14px, 2.6vw, 20px);
  margin: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-art-narr-card,
body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-card,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-card,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-card {
  max-height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(6px, 0.8dvh, 12px) clamp(8px, 1.2vw, 14px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading-row,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-narr-heading-row,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-heading-row,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-heading-row {
  flex-shrink: 0;
  margin-bottom: clamp(4px, 0.6dvh, 8px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-status,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-narr-status,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-status,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-status {
  flex-shrink: 0;
  margin-top: clamp(6px, 0.8dvh, 10px);
}

body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-art-narr-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-stage,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-art-narr-stage,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-narr.solo-task-active .task-art-narr-stage,
body.solo-mode .task-art-narr.solo-task-active .task-art-narr-stage {
  flex: 1 1 auto;
  min-height: min(36dvh, 280px);
  height: auto;
  max-height: none;
}
@media (max-width: 520px) {
  .task-art-narr-card { padding: 12px 10px 14px; border-radius: 22px; }
}

/* ===== Classroom paged mode (restored alongside solo pre-viewport-fit layout) ===== */

body.solo-mode .solo-task-section.solo-task-active .solo-task-nav--bottom,
body.solo-mode .orbit.solo-task-section.solo-task-active .solo-task-nav--bottom,
body.classroom-paged-mode .solo-task-section.solo-task-active .solo-task-nav--bottom {
  display: inline-flex;
}

/* Diák osztályterem: csak tanár vált feladatot (task:focus sync) */
body.classroom-paged-mode.classroom-student-no-task-nav .solo-task-nav--top,
body.classroom-paged-mode.classroom-student-no-task-nav .solo-task-nav--bottom,
body.classroom-paged-mode.classroom-student-no-task-nav .solo-task-nav--edge,
body.classroom-paged-mode.classroom-student-no-task-nav .solo-compact-header .solo-task-nav-btn {
  display: none !important;
  pointer-events: none !important;
}

body.classroom-paged-mode.classroom-student-no-task-nav:not(.classroom-locked) {
  --solo-bottom-nav-height: 0px;
  padding-bottom: calc(
    var(--classroom-teacher-dock-height, 0px)
    + env(safe-area-inset-bottom, 0px)
  );
}

body.classroom-paged-mode.classroom-student-no-task-nav.solo-mobile-edge-nav-active:not(.classroom-locked) {
  padding-bottom: calc(
    var(--classroom-teacher-dock-height, 0px)
    + env(safe-area-inset-bottom, 0px)
  );
}


  body.solo-mode.solo-mobile-edge-nav-active:not(.classroom-locked),
  body.classroom-paged-mode.solo-mobile-edge-nav-active:not(.classroom-locked) {
    padding-bottom: calc(
      var(--solo-edge-dots-height)
      + env(safe-area-inset-bottom, 0px)
    );
  }


  body.solo-mode.solo-mobile-edge-nav-active .solo-task-nav--edge,
  body.classroom-paged-mode.solo-mobile-edge-nav-active .solo-task-nav--edge {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 57;
    pointer-events: none;
  }


body.classroom-paged-mode .solo-task-section { display: none !important; }


body.classroom-paged-mode .solo-task-section.solo-task-active { display: block !important; }


body.classroom-paged-mode .orbit.solo-task-section.solo-task-active { display: grid !important; }


body.classroom-paged-mode:not(.classroom-locked) {
  --demo-banner-height: 0px;
  --classroom-panel-height: 52px;
  --solo-task-viewport: calc(
    100dvh
    - var(--demo-banner-height, 0px)
    - var(--solo-topbar-height, 0px)
    - var(--classroom-panel-height, 52px)
    - var(--solo-bottom-nav-height, 0px)
    - var(--classroom-teacher-dock-height, 0px)
    - env(safe-area-inset-top, 0px)
    - env(safe-area-inset-bottom, 0px)
  );
  padding-top: calc(var(--solo-topbar-height, 60px) + var(--classroom-panel-height, 52px));
  padding-bottom: calc(
    var(--solo-bottom-nav-height, 64px)
    + var(--classroom-teacher-dock-height, 0px)
    + env(safe-area-inset-bottom, 0px)
  );
}



/* Classroom paged: scrollable instructions + fixed interactive stage */
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions,
body.classroom-paged-mode:not(.classroom-locked) .stage > .solo-task-active.r-choice-heading {
  flex: 0 1 auto;
  max-height: var(--classroom-instructions-max);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive,
body.classroom-paged-mode:not(.classroom-locked) .stage > .solo-task-active.orbit,
body.classroom-paged-mode:not(.classroom-locked) .stage > .solo-task-active.orbit-2b {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-0-grid,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-0-pages,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .tongue-grid,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .cards-4-grid {
  flex: 1 1 auto;
  min-height: 0;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-floating-controls:not(.classroom-header-teacher-controls):not([hidden]) {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--solo-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
  z-index: 57;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 12px);
  width: auto;
  max-width: none;
  padding: 6px clamp(8px, 2vw, 16px);
  border-radius: 0;
  border-top: 1px solid rgba(233, 223, 200, .88);
  box-shadow: 0 -4px 18px -10px rgba(42, 34, 68, .28);
  background: rgba(255, 246, 230, 0.96);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-floating-controls:not(.classroom-header-teacher-controls) .classroom-floating-title {
  display: none;
}


body.classroom-paged-mode:not(.classroom-locked) .stage {
  gap: clamp(4px, 0.6dvh, 8px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .section-heading,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .task-0-heading,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .tongue-heading {
  margin-bottom: clamp(4px, 0.6dvh, 8px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .task-0-page-title {
  margin: clamp(2px, 0.4dvh, 6px) 0 clamp(2px, 0.4dvh, 4px) 2px;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel {
  position: fixed;
  top: var(--solo-topbar-height, 60px);
  left: 0;
  right: 0;
  z-index: 56;
  max-width: none;
  margin: 0;
  padding: 6px clamp(8px, 2vw, 20px) 0;
  pointer-events: none;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-shell {
  width: min(520px, 100%);
  margin: 0 auto;
  pointer-events: auto;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-shell {
  border-radius: 999px;
  box-shadow: 0 10px 24px -18px rgba(42, 34, 68, .28);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-toggle {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-toggle strong {
  font-size: clamp(16px, 2.4vw, 20px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel:not(.is-collapsed) .classroom-body {
  max-height: min(42dvh, 360px);
  overflow: auto;
  overscroll-behavior: contain;
}


body.classroom-paged-mode:not(.classroom-locked) .stage {
  margin-top: 0;
}


body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-heading,
body.classroom-paged-mode:not(.classroom-locked) .rabbit-task.solo-task-active .section-heading,
body.classroom-paged-mode:not(.classroom-locked) .r-choice-heading.solo-task-active {
  display: flex !important;
  flex-shrink: 0;
  margin-bottom: clamp(4px, 0.8dvh, 10px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .tongue-heading,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .section-heading,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-instructions .task-0-heading {
  margin-bottom: clamp(4px, 0.6dvh, 8px);
}


body.classroom-paged-mode:not(.classroom-locked) .task-banner {
  display: none !important;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .tongue-grid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}


}
body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-card {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  z-index: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "visual visual"
    "copy confirm";
  aspect-ratio: auto;
}


body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-grid {
  isolation: isolate;
}


body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-card:is(:hover, .is-playing) {
  transform: none;
  z-index: auto;
}


body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-visual {
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  grid-area: visual;
}


body.classroom-paged-mode:not(.classroom-locked) .tongue-task.solo-task-active .tongue-play {
  grid-area: visual;
  min-height: 0;
  height: 100%;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active {
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding: clamp(6px, 0.8dvh, 10px) clamp(10px, 2vw, 20px);
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-heading {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.5dvh, 5px);
  gap: clamp(4px, 0.8vw, 10px);
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-heading h2 {
  font-size: clamp(14px, 2.8vw, 20px);
  margin: 0;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-heading p {
  display: block;
  font-size: clamp(11px, 2.2vw, 13px);
  line-height: 1.3;
  margin: 2px 0 0;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-subnav {
  flex-shrink: 0;
  margin: clamp(1px, 0.25dvh, 4px) 0 clamp(2px, 0.4dvh, 5px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-subnav {
  flex-shrink: 0;
  margin: clamp(2px, 0.4dvh, 6px) 0 clamp(4px, 0.6dvh, 8px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-0-pages {
  flex: 0 1 auto;
}

body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-pages {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-page--active {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-page-title {
  flex-shrink: 0;
  margin-bottom: clamp(1px, 0.25dvh, 4px);
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-grid,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-0-grid {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  width: 100%;
  max-width: none;
  margin-inline: auto;
  align-content: center;
  justify-content: center;
  /* Viewport-fit: grid uses full interactive area; JS sizes square cells to fit */
  box-sizing: border-box;
  overflow: hidden;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-0-grid + .task-0-grid {
  margin-top: clamp(4px, 0.6dvh, 8px);
}


body.classroom-paged-mode:not(.classroom-locked) .task-0.solo-task-active .task-0-card,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .task-0-card {
  border-radius: 8px;
}



/* Classroom paged: task-4 position circles */
body.classroom-paged-mode:not(.classroom-locked) .task-4.solo-task-active {
  margin-top: 0;
  padding: clamp(6px, 1dvh, 12px);
  border-radius: clamp(16px, 3vw, 26px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .prompt-card-4 {
  flex-shrink: 0;
  max-width: none;
  width: 100%;
  margin: 0 0 clamp(4px, 0.6dvh, 8px);
  padding: clamp(4px, 0.8dvh, 8px) clamp(8px, 2vw, 12px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .cards-4-grid {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(4px, 0.6dvh, 8px);
  align-content: stretch;
  overflow: hidden;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .card-4 {
  min-height: 0;
  height: 100%;
  padding: clamp(3px, 0.5dvh, 6px);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .card-4-illu {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .card-4-illu img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .card-4-dots {
  flex-shrink: 0;
}

/* Classroom paged: task-4b vonat + kártyatálca — natural scroll, normál kártyaméret (ne viewport-fit lapítás) */
body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active {
  display: block;
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding: clamp(4px, 0.8dvh, 10px) clamp(8px, 1.6vw, 14px);
  border-radius: clamp(16px, 3vw, 26px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .section-heading,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .section-heading {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.4dvh, 6px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .section-heading h2,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .section-heading h2 {
  font-size: clamp(14px, 1.6dvh, 18px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .section-heading p,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .section-heading p {
  display: none;
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .prompt-card-4b,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .prompt-card-4b {
  flex-shrink: 0;
  max-width: none;
  width: 100%;
  margin: 0 0 clamp(2px, 0.4dvh, 6px);
  padding: clamp(3px, 0.6dvh, 6px) clamp(8px, 1.6vw, 12px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .train-4b,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .train-4b {
  flex-shrink: 0;
  margin-top: 0;
  padding: clamp(4px, 0.8dvh, 8px) clamp(4px, 1vw, 10px) clamp(2px, 0.4dvh, 4px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .train-svg,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .train-svg {
  max-height: clamp(52px, 11dvh, 88px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .cards-4b-tray,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .cards-4b-tray {
  flex: none;
  min-height: auto;
  margin-top: clamp(2px, 0.4dvh, 6px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  grid-template-rows: none;
  gap: clamp(3px, 0.5dvh, 6px);
  align-content: start;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .card-4b,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .card-4b {
  height: auto;
  min-height: unset;
  padding: clamp(2px, 0.4dvh, 5px);
  touch-action: none;
  pointer-events: auto;
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .card-4b-illu,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .card-4b-illu {
  flex: none;
  min-height: unset;
  aspect-ratio: 4 / 3;
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .card-4b-illu img,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .card-4b-illu img {
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
}

body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .card-4b-label,
body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .card-4b-label {
  flex-shrink: 0;
  font-size: clamp(9px, 1.1dvh, 11px);
  line-height: 1.1;
}

@media (max-width: 620px) {
  body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .train-4b,
  body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .train-4b {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  body.classroom-paged-mode:not(.classroom-locked) .task-4b.solo-task-active .cards-4b-tray,
  body.classroom-natural-scroll:not(.classroom-locked) .task-4b.solo-task-active .cards-4b-tray {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    grid-template-rows: none;
  }
}

/* Classroom: task-10 kacatok — grid layout, ne absolute clip diák nézetben */
body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active {
  display: block;
  max-height: none;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .task-10-head,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .task-10-head {
  flex-shrink: 0;
  margin-bottom: clamp(2px, 0.4dvh, 6px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .task-10-stage,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .task-10-stage,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(4px, 0.8dvh, 10px);
  min-height: auto;
  max-height: none;
  overflow: visible;
  padding: clamp(6px, 1dvh, 14px);
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .trash-bin-wrap,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .trash-bin-wrap,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .trash-bin-wrap {
  flex-shrink: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .trash-bin,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .trash-bin,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .trash-bin {
  max-width: clamp(72px, 16dvh, 110px);
  aspect-ratio: 1 / 1;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .junk-yard,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .junk-yard,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .junk-yard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  grid-template-rows: none;
  gap: clamp(3px, 0.5dvh, 6px);
  min-height: auto;
  max-height: none;
  position: relative;
  overflow: visible;
  align-content: start;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .junk-item,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .junk-item,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .junk-item {
  position: relative;
  top: auto !important;
  left: auto !important;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 44px;
  touch-action: none;
  pointer-events: auto;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .junk-item img,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .junk-item img,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .junk-item img {
  width: 88%;
  height: auto;
  max-height: 72%;
  object-fit: contain;
}

body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .junk-label,
body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .junk-label,
body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .junk-label {
  font-size: clamp(8px, 1dvh, 10px);
  line-height: 1.05;
}

@media (max-width: 620px) {
  body.classroom-paged-mode:not(.classroom-locked) .task-10.solo-task-active .junk-yard,
  body.classroom-natural-scroll:not(.classroom-locked) .task-10.solo-task-active .junk-yard,
  body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive > .task-10-stage .junk-yard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


  body.classroom-paged-mode:not(.classroom-locked) .classroom-paged-interactive .cards-4-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }


  body.classroom-paged-mode:not(.classroom-locked) {
    --solo-topbar-height: 54px;
    padding-top: calc(var(--solo-topbar-height) + var(--classroom-panel-height, 52px));
    padding-bottom: calc(
      var(--solo-bottom-nav-height)
      + env(safe-area-inset-bottom, 0px)
    );
  }


  body.classroom-paged-mode:not(.classroom-locked) .classroom-panel {
    top: var(--solo-topbar-height, 54px);
  }


  body.solo-mode .tongue-task,
  body.classroom-paged-mode .tongue-task,
  body.solo-mode .rabbit-task,
  body.classroom-paged-mode .rabbit-task {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 20px;
  }


  body.solo-mode .tongue-grid,
  body.classroom-paged-mode .tongue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }


  body.solo-mode .tongue-card,
  body.classroom-paged-mode .tongue-card {
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 6px;
    border-radius: 16px;
    gap: 4px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "visual visual"
      "copy confirm";
    align-content: stretch;
  }


  body.solo-mode .tongue-play,
  body.classroom-paged-mode .tongue-play {
    grid-area: visual;
    min-height: 0;
    height: 100%;
    align-self: stretch;
  }


  body.solo-mode .tongue-visual,
  body.classroom-paged-mode .tongue-visual {
    min-height: 0;
    height: 100%;
    aspect-ratio: 1 / 1;
  }


  body.solo-mode .mouth-scene.photo-motion-demo,
  body.classroom-paged-mode .mouth-scene.photo-motion-demo {
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
  }


  body.solo-mode .mouth-scene:not(.photo-motion-demo),
  body.classroom-paged-mode .mouth-scene:not(.photo-motion-demo) {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
  }


  body.solo-mode .photo-motion-frame,
  body.solo-mode .photo-motion-video,
  body.solo-mode .photo-motion-poster,
  body.classroom-paged-mode .photo-motion-frame,
  body.classroom-paged-mode .photo-motion-video,
  body.classroom-paged-mode .photo-motion-poster {
    max-height: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }


  body.solo-mode .tongue-copy,
  body.classroom-paged-mode .tongue-copy {
    grid-area: copy;
    align-self: end;
    min-width: 0;
  }


  body.solo-mode .tongue-confirm,
  body.classroom-paged-mode .tongue-confirm {
    grid-area: confirm;
    align-self: end;
    justify-self: end;
    width: 36px;
    height: 36px;
    margin-top: 0;
  }

  body.solo-mode [data-testid="task-art-tongue-grid"] .art-lip-confirm,
  body.classroom-paged-mode [data-testid="task-art-tongue-grid"] .art-lip-confirm {
    grid-area: unset;
    align-self: auto;
    justify-self: auto;
    width: 24px;
    height: 24px;
    top: 3px;
    bottom: auto;
    right: 3px;
    position: absolute;
    z-index: 5;
  }

  body.solo-mode [data-testid="task-art-tongue-grid"] .tongue-title,
  body.classroom-paged-mode [data-testid="task-art-tongue-grid"] .tongue-title {
    -webkit-line-clamp: 3;
  }


  body.solo-mode .tongue-task-line,
  body.classroom-paged-mode .tongue-task-line {
    display: none;
  }


  body.solo-mode .tongue-title,
  body.classroom-paged-mode .tongue-title {
    font-size: 10px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

/* Nyelvgyakorlatok: instrukciós sáv — fix magasság, többsoros tördelés (viewport JS) */
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-text-copy,
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-text-copy,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .art-lip-text-copy {
  flex: 0 0 var(--tongue-text-h, 2.4em);
  height: var(--tongue-text-h, auto);
  min-height: 0;
  max-height: var(--tongue-text-h, none);
  overflow: hidden;
}
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .tongue-title,
body.classroom-paged-mode:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .tongue-title,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-pages"] .tongue-title,
body.solo-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-grid"] .tongue-title,
body.classroom-paged-mode .task-art-lip-tongue.solo-task-active [data-testid="task-art-tongue-grid"] .tongue-title {
  font-size: clamp(8px, 1.1vw, 11px);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: block;
}

body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed [data-testid="classroom-toggle-title"],
body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed [data-testid="classroom-summary"] {
  display: none;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-panel.is-collapsed .classroom-toggle-code {
  display: block;
}


body.classroom-teacher-active:not(.classroom-paged-mode):not(.classroom-locked) .classroom-floating-controls:not(.classroom-header-teacher-controls):not([hidden]) {
  position: fixed;
  top: max(88px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 80;
}


body.classroom-paged-mode:not(.classroom-locked):not(.classroom-chrome-in-topbar) .classroom-header-teacher-controls:not([hidden]) {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 12px);
  width: 100%;
  max-width: none;
  padding: 6px clamp(10px, 2.5vw, 16px) 8px;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(233, 223, 200, .72);
  box-shadow: none;
  background: rgba(255, 246, 230, 0.96);
}


body.classroom-paged-mode:not(.classroom-locked):not(.classroom-chrome-in-topbar) .classroom-panel.is-collapsed .classroom-header-teacher-controls:not([hidden]) {
  padding-bottom: 10px;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-header-teacher-controls .classroom-floating-title {
  display: none;
}


body.classroom-paged-mode:not(.classroom-locked):not(.classroom-chrome-in-topbar) .classroom-header-teacher-controls .classroom-sync-toggle {
  flex: 0 1 auto;
  min-height: 30px;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-header-teacher-controls .classroom-end-lesson {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(239, 71, 111, 0.45);
  border-radius: 999px;
  background: rgba(239, 71, 111, 0.12);
  color: #b4234a;
  font: 600 0.78rem/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-header-teacher-controls .classroom-end-lesson:hover {
  background: rgba(239, 71, 111, 0.22);
}


body.classroom-paged-mode:not(.classroom-locked) .classroom-header-teacher-controls .classroom-end-lesson:focus-visible {
  outline: 2px solid #ef476f;
  outline-offset: 2px;
}



/* ===== Classroom paged: topbar-integrated óra mód + natural scroll (20260625j) ===== */
body.classroom-natural-scroll:not(.classroom-locked) {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: auto;
  --classroom-panel-height: 0px !important;
  --classroom-teacher-dock-height: 0px !important;
  padding-top: var(--solo-topbar-height, 50px) !important;
  padding-bottom: calc(
    var(--solo-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px)
  ) !important;
}



body.classroom-chrome-in-topbar .classroom-panel {
  display: none !important;
}



body.classroom-paged-mode:not(.classroom-locked) .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(6px, 1.2vw, 12px);
  padding: 4px clamp(8px, 1.6vw, 16px);
  min-height: 44px;
}



body.classroom-paged-mode:not(.classroom-locked) .topbar .task-banner,
body.classroom-paged-mode:not(.classroom-locked) .topbar .solo-compact-header {
  display: none !important;
}



.topbar-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}



.topbar-center[hidden] {
  display: none !important;
}



body.classroom-paged-mode .topbar-center:not([hidden]) {
  display: flex !important;
}



.topbar-center .classroom-header-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 10px);
  width: auto;
  max-width: min(560px, 100%);
  min-width: 0;
}



.topbar-center .classroom-toggle {
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1.5px solid rgba(233, 223, 200, .88);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px -14px rgba(42, 34, 68, .28);
  gap: 8px;
}



.topbar-center .classroom-toggle strong {
  font-size: clamp(12px, 1.8vw, 15px);
  white-space: nowrap;
}



.topbar-center .classroom-toggle small {
  display: none;
}



.topbar-center .classroom-toggle-chevron {
  width: 8px;
  height: 8px;
  margin-left: 2px;
}



.topbar-center .classroom-header-teacher-controls:not([hidden]) {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}



.topbar-center .classroom-header-teacher-controls .classroom-floating-title {
  display: none;
}



.topbar-center .classroom-sync-toggle {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.1;
  border-radius: 999px;
}



.topbar-center .classroom-sync-toggle input {
  width: 12px;
  height: 12px;
}



.topbar-center .classroom-end-lesson {
  margin-left: 4px;
  padding: 4px 10px;
  border: 1px solid rgba(239, 71, 111, 0.45);
  border-radius: 999px;
  background: rgba(239, 71, 111, 0.12);
  color: #b4234a;
  font: 700 10px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}


.topbar-center .classroom-end-lesson:hover {
  background: rgba(239, 71, 111, 0.22);
}


.topbar-center .classroom-end-lesson:focus-visible {
  outline: 2px solid #ef476f;
  outline-offset: 2px;
}



.topbar-center.is-collapsed .classroom-header-teacher-controls {
  display: none !important;
}



.topbar-center.is-collapsed [data-testid="classroom-toggle-title"],
.topbar-center.is-collapsed [data-testid="classroom-summary"] {
  display: none;
}



.topbar-center .classroom-toggle-code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.1;
  color: var(--ink);
}

.topbar-center.is-collapsed .classroom-toggle-code:not(:empty) {
  font-size: clamp(16px, 2.4vw, 20px);
}

.topbar-center.is-collapsed .classroom-toggle:has(.classroom-toggle-code:not(:empty)) {
  min-width: 5.5em;
}

body.classroom-natural-scroll:not(.classroom-locked) .classroom-panel {
  position: static !important;
  top: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .stage {
  flex: none !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 0 !important;
  padding: clamp(8px, 1.5vw, 16px) clamp(10px, 2.5vw, 20px) !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .solo-task-section.solo-task-active {
  display: block !important;
  flex: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .orbit.solo-task-section.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .orbit-2b.solo-task-section.solo-task-active {
  display: grid !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-instructions,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-interactive,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-shell {
  flex: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .tongue-task.solo-task-active .tongue-grid,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-interactive .tongue-grid:not(.art-lip-paged-grid) {
  flex: none !important;
  min-height: auto !important;
  height: auto !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .tongue-task.solo-task-active .tongue-card {
  min-height: unset !important;
  height: auto !important;
  aspect-ratio: auto !important;
  flex: unset !important;
}



body.classroom-natural-scroll:not(.classroom-locked) .classroom-floating-controls:not(.classroom-header-teacher-controls):not([hidden]) {
  display: none !important;
}


  body.classroom-natural-scroll:not(.classroom-locked) {
    padding-top: var(--solo-topbar-height, 54px) !important;
  }



  .topbar-center .classroom-header-stack {
    gap: 4px;
    max-width: 100%;
  }



  .topbar-center .classroom-toggle {
    padding: 5px 10px;
    min-height: 32px;
  }



  .topbar-center .classroom-sync-toggle {
    min-height: 26px;
    padding: 3px 6px;
    font-size: 9px;
  }

/* ===== Classroom paged: topbar-integrated óra mód + natural scroll (20260625j) ===== */
body.classroom-natural-scroll:not(.classroom-locked) {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: auto;
  --classroom-panel-height: 0px !important;
  --classroom-teacher-dock-height: 0px !important;
  padding-top: var(--solo-topbar-height, 50px) !important;
  padding-bottom: calc(
    var(--solo-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px)
  ) !important;
}

body.classroom-chrome-in-topbar .classroom-panel {
  display: none !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(6px, 1.2vw, 12px);
  padding: 4px clamp(8px, 1.6vw, 16px);
  min-height: 44px;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .task-banner,
body.classroom-paged-mode:not(.classroom-locked) .topbar .solo-compact-header {
  display: none !important;
}

.topbar-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.topbar-center[hidden] {
  display: none !important;
}

body.classroom-paged-mode .topbar-center:not([hidden]) {
  display: flex !important;
}

.topbar-center .classroom-header-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 10px);
  width: auto;
  max-width: min(560px, 100%);
  min-width: 0;
}

.topbar-center .classroom-toggle {
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1.5px solid rgba(233, 223, 200, .88);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px -14px rgba(42, 34, 68, .28);
  gap: 8px;
}

.topbar-center .classroom-toggle strong {
  font-size: clamp(12px, 1.8vw, 15px);
  white-space: nowrap;
}

.topbar-center .classroom-toggle small {
  display: none;
}

.topbar-center .classroom-toggle-chevron {
  width: 8px;
  height: 8px;
  margin-left: 2px;
}

.topbar-center .classroom-header-teacher-controls:not([hidden]) {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-center .classroom-header-teacher-controls .classroom-floating-title {
  display: none;
}

.topbar-center .classroom-sync-toggle {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.1;
  border-radius: 999px;
}

.topbar-center .classroom-sync-toggle input {
  width: 12px;
  height: 12px;
}

.topbar-center .classroom-end-lesson {
  margin-left: 4px;
  padding: 4px 10px;
  border: 1px solid rgba(239, 71, 111, 0.45);
  border-radius: 999px;
  background: rgba(239, 71, 111, 0.12);
  color: #b4234a;
  font: 700 10px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.topbar-center .classroom-end-lesson:hover {
  background: rgba(239, 71, 111, 0.22);
}
.topbar-center .classroom-end-lesson:focus-visible {
  outline: 2px solid #ef476f;
  outline-offset: 2px;
}

.topbar-center.is-collapsed .classroom-header-teacher-controls {
  display: none !important;
}

.topbar-center.is-collapsed [data-testid="classroom-toggle-title"],
.topbar-center.is-collapsed [data-testid="classroom-summary"] {
  display: none;
}

.topbar-center .classroom-toggle-code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 18px);
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1.1;
  color: var(--ink);
}

.topbar-center.is-collapsed .classroom-toggle-code:not(:empty) {
  font-size: clamp(16px, 2.4vw, 20px);
}

.topbar-center.is-collapsed .classroom-toggle:has(.classroom-toggle-code:not(:empty)) {
  min-width: 5.5em;
}

body.classroom-natural-scroll:not(.classroom-locked) .classroom-panel {
  position: static !important;
  top: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .stage {
  flex: none !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 0 !important;
  padding: clamp(8px, 1.5vw, 16px) clamp(10px, 2.5vw, 20px) !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .solo-task-section.solo-task-active {
  display: block !important;
  flex: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .orbit.solo-task-section.solo-task-active,
body.classroom-natural-scroll:not(.classroom-locked) .orbit-2b.solo-task-section.solo-task-active {
  display: grid !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-instructions,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-interactive,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-shell {
  flex: none !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .tongue-task.solo-task-active .tongue-grid,
body.classroom-natural-scroll:not(.classroom-locked) .classroom-paged-interactive .tongue-grid:not(.art-lip-paged-grid) {
  flex: none !important;
  min-height: auto !important;
  height: auto !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .tongue-task.solo-task-active .tongue-card {
  min-height: unset !important;
  height: auto !important;
  aspect-ratio: auto !important;
  flex: unset !important;
}

body.classroom-natural-scroll:not(.classroom-locked) .classroom-floating-controls:not(.classroom-header-teacher-controls):not([hidden]) {
  display: none !important;
}

@media (max-width: 640px) {
  body.classroom-natural-scroll:not(.classroom-locked) {
    padding-top: var(--solo-topbar-height, 54px) !important;
  }

  .topbar-center .classroom-header-stack {
    gap: 4px;
    max-width: 100%;
  }

  .topbar-center .classroom-toggle {
    padding: 5px 10px;
    min-height: 32px;
  }

  .topbar-center .classroom-sync-toggle {
    min-height: 26px;
    padding: 3px 6px;
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .topbar-center .classroom-header-teacher-controls:not([hidden]) {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: none;
    -webkit-overflow-scrolling: touch;
  }
}

.classroom-sync-toggle-label--short {
  display: none;
}

body.classroom-chrome-in-topbar .classroom-sync-toggle-label--long {
  display: none;
}

body.classroom-chrome-in-topbar .classroom-sync-toggle-label--short {
  display: inline;
}

@media (min-width: 900px) {
  body.classroom-chrome-in-topbar .classroom-sync-toggle-label--long {
    display: inline;
  }

  body.classroom-chrome-in-topbar .classroom-sync-toggle-label--short {
    display: none;
  }
}

/* ===== Classroom topbar TOC gomb + feladatválasztó overlay (20260701h) ===== */
.topbar-toc-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #5B3FD9;
  font: 600 12px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.topbar-toc-btn[hidden] {
  display: none !important;
}
.topbar-toc-btn:hover {
  background: #fff;
  border-color: rgba(124, 92, 255, 0.55);
}
.topbar-toc-btn:focus-visible {
  outline: 2px solid #7C5CFF;
  outline-offset: 2px;
}
.topbar-toc-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C5CFF, #4DA8FF);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.topbar-toc-btn-label {
  letter-spacing: 0.01em;
}
body.classroom-paged-mode:not(.classroom-locked) .topbar .brand--mini-logo {
  flex: 0 0 auto;
  max-width: min(38vw, 140px);
}
body.classroom-paged-mode:not(.classroom-locked) .topbar .brand-mini-logo {
  max-height: 28px;
  width: auto;
}
@media (max-width: 520px) {
  .topbar-toc-btn-label {
    display: none;
  }
  .topbar-toc-btn {
    padding: 4px 8px;
    min-width: 34px;
    justify-content: center;
  }
}

body.classroom-toc-open {
  overflow: hidden;
}
.classroom-toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(24, 18, 48, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.classroom-toc-overlay[hidden] {
  display: none !important;
}
.classroom-toc-sheet {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 14px 14px;
  background: #FFF9F0;
  border: 1px solid rgba(233, 223, 200, 0.9);
  box-shadow: 0 24px 60px -20px rgba(43, 33, 80, 0.45);
  overflow: hidden;
}
.classroom-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(233, 223, 200, 0.8);
}
.classroom-toc-head h2 {
  margin: 0;
  font: 700 18px/1.2 'Fredoka', system-ui, sans-serif;
  color: #2A2244;
}
.classroom-toc-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.12);
  color: #5B3FD9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.classroom-toc-nav {
  padding: 10px 16px 0;
  overflow: auto;
}
.classroom-toc-nav-label {
  display: block;
  margin-bottom: 8px;
  font: 700 11px/1.3 'Nunito', system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(42, 34, 68, 0.55);
}
.classroom-toc-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.classroom-toc-nav-item {
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: #2A2244;
  font: 600 12px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
}
.classroom-toc-nav-item.is-active {
  background: linear-gradient(135deg, #7C5CFF, #4DA8FF);
  border-color: transparent;
  color: #fff;
}
.classroom-toc-empty {
  margin: 0 0 10px;
  color: rgba(42, 34, 68, 0.65);
  font-size: 13px;
}
.classroom-toc-picker {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 16px 12px;
  overflow: auto;
}
.classroom-toc-picker .teacher-consonant-grid {
  max-height: none;
}
.classroom-toc-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(233, 223, 200, 0.8);
  background: rgba(255, 246, 230, 0.72);
}
.classroom-toc-cancel {
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: #5B3FD9;
  font: 700 13px/1 'Nunito', system-ui, sans-serif;
  cursor: pointer;
}
.classroom-toc-save {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
}
/* ===== Classroom paged: kompakt topbar + tartalomjegyzék (20260701h) ===== */
body.classroom-paged-mode:not(.classroom-locked) .brand--mini-logo {
  padding: 2px 6px;
}
body.classroom-paged-mode:not(.classroom-locked) .brand-mini-logo {
  height: 26px;
  max-height: 28px;
}

.topbar-toc-btn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1.5px solid rgba(124, 92, 255, .35);
  border-radius: 999px;
  background: rgba(124, 92, 255, .1);
  color: #5a3fd4;
  font: 700 11px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease;
}
.topbar-toc-btn:not([hidden]) {
  display: inline-flex;
}
.topbar-toc-btn:hover {
  background: rgba(124, 92, 255, .18);
}
.topbar-toc-btn-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}
body.classroom-paged-mode:not(.classroom-locked) .topbar {
  gap: clamp(4px, 1vw, 8px);
}
/* Topbar méret: a 20260701p blokk alatt — ne zsugorítsuk itt újra */

body.classroom-toc-open {
  overflow: hidden;
}
.classroom-toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 24px);
  background: rgba(42, 34, 68, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.classroom-toc-overlay[hidden] {
  display: none !important;
}
.classroom-toc-sheet {
  width: min(640px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border-radius: 24px;
  border: 1.5px solid rgba(233, 223, 200, .92);
  background: linear-gradient(180deg, #fff 0%, #FBF7EE 100%);
  box-shadow: 0 28px 60px -20px rgba(42, 34, 68, .35);
}
.classroom-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(233, 223, 200, .7);
}
.classroom-toc-head h2 {
  margin: 0;
  font: 800 18px/1.2 'Fredoka', 'Nunito', system-ui, sans-serif;
  color: #3A2D72;
}
.classroom-toc-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 92, 255, .1);
  color: #5a3fd4;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.classroom-toc-nav {
  padding: 12px 16px 4px;
}
.classroom-toc-nav-label {
  display: block;
  margin-bottom: 8px;
  font: 800 11px/1.2 'Nunito', system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(58, 45, 114, .72);
}
.classroom-toc-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.classroom-toc-nav-item {
  border: 1px solid rgba(124, 92, 255, .25);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: #3A2D72;
  font: 700 11px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
}
.classroom-toc-nav-item.is-active {
  background: rgba(124, 92, 255, .16);
  border-color: rgba(124, 92, 255, .45);
}
.classroom-toc-picker {
  padding: 8px 16px 12px;
}
.classroom-toc-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(233, 223, 200, .7);
}
.classroom-toc-cancel {
  min-height: 36px;
  padding: 8px 14px;
  border: 1.5px solid rgba(233, 223, 200, .92);
  border-radius: 999px;
  background: #fff;
  color: #3A2D72;
  font: 700 13px/1.2 'Nunito', system-ui, sans-serif;
  cursor: pointer;
}
.classroom-toc-save {
  min-height: 36px;
  padding: 8px 16px;
}

@media (max-width: 640px) {
  .topbar-toc-btn-label {
    display: none;
  }
  .topbar-toc-btn {
    padding: 4px 8px;
    min-width: 30px;
    justify-content: center;
  }
  body.classroom-paged-mode:not(.classroom-locked) .brand-mini-logo {
    height: 22px;
  }
  body.classroom-natural-scroll:not(.classroom-locked) {
    padding-top: var(--solo-topbar-height, 46px) !important;
  }
}

/* ===== Compact topbar row — balanced height (20260701p) ===== */
body.classroom-paged-mode.classroom-chrome-in-topbar:not(.classroom-locked),
body.classroom-paged-mode.classroom-natural-scroll:not(.classroom-locked) {
  --classroom-panel-height: 0px !important;
  --solo-topbar-min: 48px;
  padding-top: var(--solo-topbar-height, var(--solo-topbar-min, 48px)) !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar {
  box-sizing: border-box;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(5px, 1vw, 10px);
  padding-block: 6px 7px;
  padding-inline: clamp(8px, 1.4vw, 14px);
  min-height: 48px;
  max-height: none;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .brand--mini-logo {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 2px;
  max-width: min(30vw, 120px);
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .brand--mini-logo:hover {
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .brand-mini-logo {
  display: block;
  height: 26px;
  max-height: 28px;
  width: auto;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  justify-content: flex-start;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-header-stack {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 0.8vw, 8px);
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls:not([hidden]) {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(4px, 0.8vw, 6px);
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls:not([hidden])::-webkit-scrollbar {
  display: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-toggle {
  align-self: center;
  min-height: 32px;
  padding: 5px 10px;
  flex-shrink: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-toggle strong {
  font-size: clamp(12px, 1.7vw, 13px);
  line-height: 1.2;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle {
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  max-width: min(36vw, 140px);
  min-height: 32px;
  padding: 5px 10px;
  font-size: clamp(12px, 1.6vw, 12px);
  line-height: 1.25;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(233, 223, 200, .9);
  color: var(--ink);
  box-shadow: none;
  transform: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle:hover,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle:hover {
  background: rgba(124, 92, 255, .08);
  border-color: rgba(124, 92, 255, .35);
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle input {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-end-lesson {
  align-self: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 10px;
  font-size: clamp(12px, 1.6vw, 12px);
  line-height: 1.25;
  margin-left: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto;
  max-width: min(30vw, 104px);
  min-height: 32px;
  padding: 5px 10px;
  font-size: clamp(12px, 1.6vw, 12px);
  line-height: 1.25;
  border-radius: 999px;
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn:hover {
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn[hidden] {
  display: none !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn-icon {
  display: none !important;
}

@media (max-width: 640px) {
  body.classroom-paged-mode.classroom-chrome-in-topbar:not(.classroom-locked),
  body.classroom-paged-mode.classroom-natural-scroll:not(.classroom-locked) {
    --solo-topbar-min: 46px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar {
    min-height: 46px;
    padding-block: 5px 6px;
    padding-inline: 6px;
    gap: 5px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar .brand-mini-logo {
    height: 24px;
    max-height: 24px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-toggle {
    min-height: 30px;
    padding: 4px 8px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle,
  body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle,
  body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-end-lesson {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn-label {
    display: none;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn:not([hidden])::before {
    content: '+';
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
  }

  body.classroom-paged-mode.classroom-natural-scroll:not(.classroom-locked) {
    padding-top: var(--solo-topbar-height, var(--solo-topbar-min, 46px)) !important;
  }
}

/* ===== Unified topbar pills + icon tooltips (20260701q) ===== */
.topbar-btn,
.topbar-chip {
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-height: 34px;
  max-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(233, 223, 200, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font: 700 12px/1.2 'Nunito', system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  overflow: visible;
  text-overflow: clip;
}

.topbar-btn:hover,
.topbar-chip:hover {
  background: rgba(124, 92, 255, .08);
  border-color: rgba(124, 92, 255, .35);
}

.topbar-btn:focus-visible,
.topbar-chip:focus-visible,
.topbar-chip:focus-within {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.topbar-btn--icon {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding: 0;
}

.topbar-btn--text {
  max-width: min(28vw, 120px);
  padding: 0 10px;
}

.topbar-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: inherit;
}

.topbar-btn-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.topbar-tooltip {
  position: fixed;
  z-index: 10001;
  top: auto;
  bottom: auto;
  left: auto;
  margin-top: 0;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  border-radius: 8px;
  background: #2a2244;
  color: #fff;
  font: 600 11px/1.3 'Nunito', system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.topbar-btn:hover > .topbar-tooltip,
.topbar-btn:focus-visible > .topbar-tooltip,
.topbar-chip:hover > .topbar-tooltip,
.topbar-chip:focus-within > .topbar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.topbar,
.topbar-center,
.topbar-center .classroom-header-stack,
.topbar-center .classroom-header-teacher-controls:not([hidden]) {
  overflow: visible !important;
}

.topbar-chip:has(input:checked) {
  background: rgba(124, 92, 255, .14);
  border-color: rgba(124, 92, 255, .48);
  color: #5B3FD9;
}

.topbar-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.topbar-btn--end:hover {
  background: rgba(239, 71, 111, .1);
  border-color: rgba(239, 71, 111, .42);
  color: #b4234a;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 0.8vw, 8px);
  padding-block: 6px 7px;
  padding-inline: clamp(8px, 1.4vw, 14px);
  min-height: 48px;
  max-height: none;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .brand--mini-logo {
  flex: 0 0 auto;
  padding: 0 2px;
  max-width: min(28vw, 110px);
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .brand-mini-logo {
  height: 24px;
  max-height: 26px;
  width: auto;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-header-stack {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(4px, 0.8vw, 6px);
  width: auto;
  max-width: none;
  overflow: visible;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls:not([hidden]) {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(4px, 0.8vw, 6px);
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-toggle.topbar-btn {
  min-height: 34px;
  max-height: 36px;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(233, 223, 200, .92);
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
  padding: 0 10px;
  gap: 6px;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-toggle.topbar-btn strong {
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-toggle.topbar-btn small {
  display: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-toggle-chevron {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(69, 194, 107, .14);
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle,
body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-end-lesson,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-end-lesson,
body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn {
  min-height: 34px;
  max-height: 36px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(233, 223, 200, .92);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-end-lesson,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-end-lesson {
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font: inherit;
  padding: 0;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle-label,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle-label,
body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn-label,
body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-sync-toggle > span:not(.topbar-btn-icon):not(.topbar-tooltip),
body.classroom-paged-mode:not(.classroom-locked) .topbar-center .classroom-sync-toggle > span:not(.topbar-btn-icon):not(.topbar-tooltip) {
  display: none !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-toc-btn:not([hidden])::before {
  content: none !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-score.score-pill {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 34px;
  max-height: 36px;
  padding: 0 10px;
  gap: 5px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(233, 223, 200, .92);
  border-radius: 999px;
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-score .score-compact {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar-score .score-compact strong {
  font-variant-numeric: tabular-nums;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) {
  --solo-topbar-min: 48px;
}

@media (max-width: 640px) {
  body.classroom-paged-mode:not(.classroom-locked) .topbar {
    min-height: 46px;
    max-height: none;
    padding-block: 5px 6px;
    padding-inline: 6px;
    gap: 4px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar .brand-mini-logo {
    height: 22px;
    max-height: 22px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-btn,
  body.classroom-paged-mode:not(.classroom-locked) .topbar-chip,
  body.classroom-paged-mode:not(.classroom-locked) .topbar .classroom-toggle.topbar-btn,
  body.classroom-paged-mode:not(.classroom-locked) .topbar-score.score-pill {
    min-height: 32px;
    max-height: 34px;
  }

  body.classroom-paged-mode:not(.classroom-locked) .topbar-btn--icon {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
  }

  body.classroom-chrome-in-topbar:not(.classroom-locked) {
    --solo-topbar-min: 46px;
  }
}

/* ===== Topbar row order — egy vízszintes sor (20260702c) ===== */
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 0.8vw, 6px);
  width: auto;
  max-width: none;
  min-width: 0;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-toggle.topbar-btn {
  width: auto;
  flex: 0 0 auto;
  align-self: center;
  min-height: 34px;
  max-height: 36px;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls:not([hidden]) {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  gap: clamp(4px, 0.8vw, 6px);
  overflow: visible;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls .classroom-sync-toggle,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls .classroom-end-lesson {
  align-self: center;
  flex: 0 0 auto;
  min-height: 34px;
  max-height: 36px;
  margin: 0;
}

/* Topbar row order — finomhangolás (20260702c): width:100% toggle ne törje a sort */
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack > .classroom-toggle.topbar-btn,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack > .topbar-toc-btn,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack > .classroom-header-teacher-controls {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  align-self: center;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack > .classroom-toggle.topbar-btn {
  min-height: 34px;
  max-height: 36px;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-stack > .topbar-toc-btn {
  min-height: 34px;
  max-height: 36px;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls > .classroom-sync-toggle,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-header-teacher-controls > .classroom-end-lesson {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: auto;
  min-width: 0;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-end-lesson.topbar-btn--icon {
  width: auto;
  min-width: 34px;
  max-width: none;
  padding-inline: 8px;
}

body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center .classroom-end-lesson .topbar-btn-icon svg {
  display: block;
}

/* ===== Topbar tooltip + teacher controls clip fixes (20260702j) ===== */
.classroom-header-stack {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.classroom-floating-controls.classroom-header-teacher-controls {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(4px, 0.8vw, 6px);
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.classroom-header-teacher-controls .classroom-floating-title {
  display: none !important;
}

/* Home / role picker — never show teacher or classroom control chrome */
body.classroom-locked .classroom-floating-controls,
body.classroom-locked .classroom-header-teacher-controls,
body.classroom-locked [data-testid="teacher-floating-controls"],
body.classroom-locked .topbar-center .classroom-header-teacher-controls,
body.classroom-locked .topbar-center .classroom-header-stack {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.classroom-paged-mode:not(.classroom-locked) .topbar,
body.classroom-paged-mode:not(.classroom-locked) .topbar-center,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar-center {
  overflow: visible !important;
  max-height: none !important;
  align-items: center;
}

/* ===== Classroom landing/setup — Óra mód label clip fix (20260702k) ===== */
body.classroom-locked .classroom-shell .classroom-toggle.topbar-btn,
body.classroom-locked .classroom-shell .classroom-toggle.topbar-btn--text {
  width: 100%;
  max-width: none;
  min-height: 70px;
  max-height: none;
  padding: 16px 18px;
  justify-content: flex-start;
  overflow: visible;
}

body.classroom-locked .classroom-shell .classroom-toggle-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

body.classroom-locked .classroom-shell .classroom-toggle strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* ===== Topbar toggle active ring (20260702l) ===== */
.topbar-btn.is-active,
.topbar-chip.is-active {
  box-shadow: 0 0 0 2px var(--purple);
}

body.classroom-paged-mode:not(.classroom-locked) .topbar .topbar-btn.is-active,
body.classroom-paged-mode:not(.classroom-locked) .topbar .topbar-chip.is-active,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar .topbar-btn.is-active,
body.classroom-chrome-in-topbar:not(.classroom-locked) .topbar .topbar-chip.is-active {
  box-shadow: 0 0 0 2px var(--purple);
}

/* ===== Task-0 Art I: max 4 cols + unified cell sizing (20260702w) ===== */
body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding: clamp(6px, 0.8dvh, 10px) clamp(10px, 2vw, 20px);
}

body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-heading,
body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-subnav,
body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-page-title,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-subnav,
body.classroom-natural-scroll:not(.classroom-locked) .task-art-lip-tongue.solo-task-active .task-art-lip-tongue-heading-row {
  flex-shrink: 0;
}

body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-pages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-page--active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
}

body.classroom-natural-scroll:not(.classroom-locked) .task-0.solo-task-active .task-0-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-content: center;
  justify-content: center;
}

/* Osztályterem participant: húzásos feladatok — tanár ugyanúgy látja a fogantyúkat mint a diák */
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .prompts-5,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .cards-4b-tray,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .cards-5b-tray,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .tokens-6-tray,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .train-4b,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .houses-5b,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .task-5-board {
  flex-shrink: 0;
}

body.classroom-participant-view:not(.classroom-locked) .solo-task-active .train-4b,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .wagon-drop {
  touch-action: none;
  pointer-events: auto;
}

body.classroom-participant-view:not(.classroom-locked) .solo-task-active .wagon-drop {
  z-index: 3;
}

body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .card-4b,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .card-5,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .card-5b,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .token-6,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .prompt-5 {
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

body.classroom-teacher-view:not(.classroom-locked) .classroom-paged-interactive .card-4b,
body.classroom-teacher-view:not(.classroom-locked) .classroom-paged-interactive .card-5,
body.classroom-teacher-view:not(.classroom-locked) .classroom-paged-interactive .card-5b,
body.classroom-teacher-view:not(.classroom-locked) .classroom-paged-interactive .token-6,
body.classroom-teacher-view:not(.classroom-locked) .classroom-paged-interactive .prompt-5 {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Natural-scroll classroom paged: ugyanaz, de .solo-task-active szekcióban (nincs split shell) */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .card-4b,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .card-5,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .card-5b,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .token-6,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .prompt-5 {
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

body.classroom-teacher-view:not(.classroom-locked) .solo-task-active .card-4b,
body.classroom-teacher-view:not(.classroom-locked) .solo-task-active .card-5,
body.classroom-teacher-view:not(.classroom-locked) .solo-task-active .card-5b,
body.classroom-teacher-view:not(.classroom-locked) .solo-task-active .token-6,
body.classroom-teacher-view:not(.classroom-locked) .solo-task-active .prompt-5 {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Task 5 — vonalhúzás diák nézetben (natural-scroll + paged) */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .task-5-board,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .task-5-board,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .cards-5-row,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .cards-5-row,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .prompts-5,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .prompts-5 {
  touch-action: none;
  pointer-events: auto;
}

body.classroom-participant-view:not(.classroom-locked) .solo-task-active .card-5,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .card-5 {
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

/* Task 5b — ház alatti drop zóna */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .houses-5b,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .houses-5b,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .haz-5b-drop,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .haz-5b-drop {
  touch-action: none;
  pointer-events: auto;
}

body.classroom-participant-view:not(.classroom-locked) .solo-task-active .haz-5b-drop,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .haz-5b-drop {
  z-index: 4;
}

/* Task 6 — token drop cél kártyák */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .cards-6-grid,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .cards-6-grid,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .card-6,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .card-6 {
  touch-action: none;
  pointer-events: auto;
}

/* Task 11 — vonalhúzás diák nézetben */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .kid-card,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .kid-card,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .match-board,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .match-board {
  touch-action: none;
  pointer-events: auto;
  cursor: grab;
}

/* Task 11a — cselekvés húzás gyerek alá */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .action-card,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .action-card,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .kid-target,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .kid-target,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .actions-pool,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .actions-pool {
  touch-action: none;
  pointer-events: auto;
}

/* Task 10 — kacat húzás diák nézetben */
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .junk-item,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .junk-item,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .junk-yard,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .junk-yard,
body.classroom-participant-view:not(.classroom-locked) .solo-task-active .task-10-stage,
body.classroom-participant-view:not(.classroom-locked) .classroom-paged-interactive .task-10-stage {
  touch-action: none;
  pointer-events: auto;
}
