/* Новые блоки бесплатных шпаргалок (free-*.html, ru и uk): тренажёр,
   ловушки, таблица kein, сцена с предлогами, чек-лист, диалог, меню.

   Отдельным файлом, а не в standalone.css: у CSS на сайте кеш 4 часа,
   и новые блоки на закешированных старых стилях у вернувшихся
   посетителей выглядели бы сломанными. Новый адрес браузер скачивает
   сразу. Токены (--ink, --blue, --mint…) — из standalone.css. */

.fx-block {
  margin-top: 28px;
}

.cafe-shell .fx-block {
  margin-top: 110px;
}

.fx-head {
  max-width: 680px;
}

.fx-head h2 {
  margin: 8px 0 12px;
  color: var(--ink);
  font-size: var(--text-h2-widget);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.fx-head > p:last-child {
  margin: 0;
  color: var(--soft);
  font-size: var(--text-body);
  line-height: 1.6;
}

/* ------------------------------------------------------------ тренажёр */

.drill {
  padding: 42px;
  color: white;
  background: var(--ink);
  border-radius: 30px;
}

.drill .kicker {
  color: #aebcff;
}

.drill .fx-head h2 {
  color: white;
}

.drill .fx-head > p:last-child {
  color: #c3cddd;
}

.drill-stage {
  margin-top: 28px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
}

.drill-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.drill-count {
  color: #aebcff;
  font-size: var(--text-label);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.drill-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drill-dots i {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.drill-dots i.now {
  background: white;
}

.drill-dots i.ok {
  background: #62d0ac;
}

.drill-dots i.bad {
  background: #ff8a7a;
}

.drill-q {
  margin: 26px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.drill-q:focus {
  outline: none;
}

.drill-hint {
  margin: 0;
  color: #c3cddd;
  font-size: var(--text-body-sm);
}

.drill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.drill--list .drill-options {
  flex-direction: column;
  align-items: stretch;
}

.drill-options button {
  min-height: 48px;
  padding: 12px 20px;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease;
}

.drill-options button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.drill-options button:disabled {
  cursor: default;
  opacity: 0.5;
}

.drill-options button.is-right {
  background: #62d0ac;
  opacity: 1;
}

.drill-options button.is-wrong {
  background: #ff8a7a;
  opacity: 1;
}

.drill-feedback {
  min-height: 24px;
  margin: 18px 0 0;
  color: #e6ebf3;
  font-size: var(--text-body-sm);
  line-height: 1.6;
}

.drill-feedback b {
  color: white;
}

.drill-feedback u,
.drill-q u {
  text-decoration-color: #ffd66b;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.drill-next,
.drill-restart {
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 22px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.drill-next:hover,
.drill-restart:hover {
  background: var(--blue-dark);
}

.drill-result {
  padding: 8px 0;
  text-align: center;
}

.drill-result strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.drill-result p {
  max-width: 460px;
  margin: 12px auto 0;
  color: #c3cddd;
  line-height: 1.6;
}

/* ------------------------------------------------------------- ловушки */

.trap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.trap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.trap h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
}

.trap-bad,
.trap-good {
  position: relative;
  margin: 0;
  padding: 10px 12px 10px 36px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.trap-bad {
  color: #8a2d22;
  background: #fdecea;
}

.trap-good {
  color: #1b6149;
  background: #e2f4ec;
}

.trap-bad::before,
.trap-good::before {
  position: absolute;
  top: 10px;
  left: 14px;
}

.trap-bad::before {
  content: "✗";
}

.trap-good::before {
  content: "✓";
}

.trap-bad u,
.trap-good u {
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.trap-why {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: var(--text-body-sm);
  line-height: 1.6;
}

/* -------------------------------------------------------- таблица kein */

.kein-lab {
  padding: 38px 42px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 30px;
}

.kein-result {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--lavender);
  border-radius: 18px;
}

.kein-result p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kein-result u {
  color: var(--blue);
  text-decoration: none;
}

.kein-result small {
  display: block;
  margin-top: 8px;
  color: var(--soft);
  font-size: var(--text-body-sm);
}

.kein-table-wrap {
  margin-top: 16px;
}

/* Сетка форм kein. Клетка знает свои --r (строка) и --c (столбец);
   на телефоне они меняются местами — см. медиазапрос ниже. */
.kein-grid {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}

.kein-grid > * {
  grid-row: var(--r);
  grid-column: var(--c);
}

.kg-head,
.kg-case {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px 6px;
  color: var(--soft);
  font-size: var(--text-label);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.kg-case {
  justify-content: center;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}

.kg-head small,
.kg-case small {
  margin-top: 3px;
  color: var(--soft);
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0;
}

.kg-head small {
  color: var(--ink);
}

.kein-grid button {
  min-width: 0;
  min-height: 48px;
  padding: 0 4px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  transition: background 0.15s ease;
}

.kein-grid button b {
  color: var(--blue);
}

.kein-grid button:hover {
  background: var(--lavender);
}

.kein-grid button[aria-pressed="true"] {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.kein-grid button[aria-pressed="true"] b {
  color: #ffd66b;
}

/* ------------------------------------------------ сцена с предлогами */

.prep-lab {
  padding: 38px 42px;
  background: var(--mint);
  border-radius: 30px;
}

.prep-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.prep-chips button {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--ink);
  background: white;
  border: 1px solid rgba(24, 49, 80, 0.15);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.prep-chips button[aria-pressed="true"] {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.prep-body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 20px;
}

.prep-scene {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: white;
  border-radius: 20px;
}

.scene-floor {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
  background: #e7efec;
}

/* Шкаф на ножках: под ним остаётся место для «unter» */
.scene-schrank {
  position: absolute;
  z-index: 2;
  left: 22%;
  bottom: 48px;
  width: 30%;
  height: 50%;
  background: #c9d6f3;
  border: 3px solid var(--ink);
  border-radius: 6px;
  transition: background 0.3s ease;
}

.scene-schrank::before,
.scene-schrank::after {
  content: "";
  position: absolute;
  bottom: -29px;
  width: 4px;
  height: 26px;
  background: var(--ink);
}

.scene-schrank::before {
  left: 10%;
}

.scene-schrank::after {
  right: 10%;
}

.scene-bett {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: 22px;
  width: 26%;
  height: 20%;
  background: #ffd9b8;
  border: 3px solid var(--ink);
  border-radius: 10px 10px 4px 4px;
}

.scene-cat {
  --s: 1;
  position: absolute;
  z-index: 3;
  left: 37%;
  bottom: calc(50% + 48px);
  font-size: 34px;
  line-height: 1;
  transform: translateX(-50%) scale(var(--s));
  transform-origin: bottom center;
  transition:
    left 0.55s cubic-bezier(0.3, 1.4, 0.5, 1),
    bottom 0.55s cubic-bezier(0.3, 1.4, 0.5, 1),
    transform 0.4s ease;
}

.prep-scene[data-pos="auf"] .scene-cat { left: 37%; bottom: calc(50% + 48px); }
.prep-scene[data-pos="über"] .scene-cat { left: 37%; bottom: calc(50% + 92px); }
.prep-scene[data-pos="in"] .scene-cat { left: 37%; bottom: 72px; --s: 0.85; }
.prep-scene[data-pos="in"] .scene-schrank { background: rgba(201, 214, 243, 0.35); }
.prep-scene[data-pos="unter"] .scene-cat { left: 37%; bottom: 22px; --s: 0.55; }
.prep-scene[data-pos="hinter"] .scene-cat { z-index: 1; left: 45%; bottom: calc(50% + 28px); }
.prep-scene[data-pos="vor"] .scene-cat { left: 37%; bottom: 20px; --s: 1.25; }
.prep-scene[data-pos="neben"] .scene-cat { left: 11%; bottom: 22px; }
.prep-scene[data-pos="an"] .scene-cat { left: 56%; bottom: 96px; }
.prep-scene[data-pos="zwischen"] .scene-cat { left: 59%; bottom: 22px; }

.prep-cards {
  display: grid;
  gap: 12px;
  align-content: start;
}

.prep-card {
  padding: 18px 20px;
  background: white;
  border-radius: 18px;
}

.prep-card > span {
  color: var(--blue);
  font-size: var(--text-caption);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prep-wohin > span {
  color: #b45309;
}

.prep-card p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.prep-card u {
  padding: 1px 4px;
  background: var(--yellow);
  border-radius: 5px;
  text-decoration: none;
}

.prep-note {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-body-sm);
  font-weight: 700;
}

/* ------------------------------------------------------ глаголы-пары */

.pair-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.pair-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: white;
}

.pair-table th,
.pair-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.pair-table tbody tr:last-child td {
  border-bottom: 0;
}

.pair-table thead th {
  color: white;
  background: var(--ink);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pair-table td b {
  color: var(--ink);
}

.pair-table td small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: var(--text-body-sm);
}

/* ------------------------------------------------------------ чек-лист */

.check-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.check-count {
  color: #1b6f5d;
  font-size: var(--text-label);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.check-bar {
  flex: 1;
  height: 8px;
  overflow: hidden;
  background: rgba(24, 49, 80, 0.12);
  border-radius: 999px;
}

.check-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: #2f947d;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.question.is-checkable {
  justify-content: flex-start;
  gap: 16px;
}

.question.is-checkable code {
  flex: 1;
}

.check-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: transparent;
  background: white;
  border: 2px solid rgba(24, 49, 80, 0.25);
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.check-toggle:hover {
  border-color: #2f947d;
}

.check-toggle[aria-pressed="true"] {
  color: white;
  background: #2f947d;
  border-color: #2f947d;
}

.question.is-done code {
  color: #1b6f5d;
}

.check-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 14px;
  padding: 16px 20px;
  background: white;
  border-radius: 16px;
}

.check-done p {
  margin: 0;
  color: #1b6f5d;
  font-weight: 800;
}

.check-done button {
  min-height: 44px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

/* -------------------------------------------------- диалог с бариста */

.dialog-box {
  max-width: 760px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 26px;
}

.dialog-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding: 4px 4px 10px;
}

.bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  animation: bubble-in 0.25s ease both;
}

.bubble b {
  display: block;
  margin-bottom: 4px;
  color: #b45309;
  font-size: var(--text-caption);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bubble p {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.bubble small {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: var(--text-label);
  line-height: 1.45;
}

.bubble.them {
  align-self: flex-start;
  color: var(--ink);
  background: #fff3e6;
  border-bottom-left-radius: 6px;
}

.bubble.me {
  align-self: flex-end;
  color: white;
  background: var(--ink);
  border-bottom-right-radius: 6px;
}

.bubble.me small {
  color: #c3cddd;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.dialog-choices {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dialog-choices > button {
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid rgba(24, 49, 80, 0.15);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.dialog-choices > button:hover:not(:disabled) {
  border-color: var(--ink);
}

.dialog-choices > button.is-wrong {
  color: #8a2d22;
  background: #fdecea;
  border-color: #f3b6ad;
  cursor: default;
}

.dialog-note {
  min-height: 22px;
  margin: 10px 0 0;
  color: #8a2d22;
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.dialog-end {
  text-align: center;
}

.dialog-end p {
  margin: 0;
  color: #1b6149;
  font-weight: 800;
}

/* ----------------------------------------------------------- меню кафе */

.menu-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.menu-col {
  padding: 26px 28px;
  color: white;
  background: var(--ink);
  border-radius: 24px;
}

.menu-col h3 {
  margin: 0 0 10px;
  color: #ffd6a8;
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-col li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}

.menu-col li:last-child {
  border-bottom: 0;
}

.menu-col li b {
  flex: 0 0 auto;
  font-weight: 800;
}

.menu-col li b i {
  color: #aebcff;
  font-style: normal;
  font-weight: 700;
}

.menu-col li span {
  color: #c3cddd;
  font-size: var(--text-body-sm);
  text-align: right;
}

/* ---------------------------------------------------------- адаптив */

@media (max-width: 768px) {
  .drill,
  .kein-lab,
  .prep-lab {
    padding: 26px 20px;
  }

  .drill-stage {
    padding: 20px 16px;
  }

  .trap-grid,
  .menu-board,
  .prep-body {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Роды — строками, падежи — столбцами: три колонки форм вместо
     четырёх, иначе в ~280px формы обрезаются до «kei». */
  .kein-lab {
    padding: 26px 14px;
  }

  .kein-grid {
    grid-template-columns: minmax(70px, 1fr) repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .kein-grid > * {
    grid-row: var(--c);
    grid-column: var(--r);
  }

  .kg-head {
    justify-content: center;
    font-size: var(--text-caption);
  }

  .kg-case {
    justify-content: flex-end;
    font-size: 13px;
  }

  /* Окончание — второй строкой под «kein»: самая широкая форма
     сжимается до четырёх букв и влезает даже в 320px, а заодно
     окончание видно отдельно — ровно то, что здесь учим. */
  .kein-grid button {
    padding: 6px 2px;
    font-size: 15px;
    line-height: 1.1;
  }

  .kein-grid button b {
    display: block;
  }

  .menu-col li {
    flex-direction: column;
    gap: 2px;
  }

  .menu-col li span {
    text-align: left;
  }

  .bubble {
    max-width: 92%;
  }

  .cafe-shell .fx-block {
    margin-top: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-cat,
  .scene-schrank,
  .check-bar i,
  .drill-options button {
    transition: none;
  }

  .bubble {
    animation: none;
  }
}

/* Книга на экране результата тренажёра (аудит пути покупателя, №21) */
.drill-offer {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  max-width: 520px;
  margin: 26px auto 0;
  padding: 18px 20px;
  color: var(--ink);
  background: white;
  border-radius: 18px;
  text-align: left;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.drill-offer:hover {
  transform: translateY(-2px);
}

.drill-offer img {
  width: 72px;
  height: auto;
  border-radius: 3px 6px 6px 3px;
  box-shadow: 6px 8px 16px rgba(24, 49, 80, 0.2);
}

.drill-offer-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.drill-offer-lead {
  color: var(--blue);
  font-size: var(--text-caption);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drill-offer strong {
  font-size: 17px;
  line-height: 1.25;
}

.drill-offer-text {
  color: var(--soft);
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.drill-offer-link {
  margin-top: 4px;
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 600px) {
  .drill-offer {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 16px;
  }

  .drill-offer img {
    width: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drill-offer {
    transition: none;
  }
}
