/* LINGO — play.
   The game feel: what a lesson does when you answer, what it does when you
   finish, the flame, the path. Loaded last so it can lean on everything
   before it; its own phone rules sit at the foot of each section. */

/* ======================================================================
   Lesson bar: progress that reacts, and the run of right answers
   ====================================================================== */

.lesson-bar .bar { height: 12px; }
.lesson-bar .bar-fill {
  transition: width 520ms var(--ease-spring);
  box-shadow: 0 0 0 0 transparent;
}
.lesson-bar .bar-fill::after {
  /* the highlight along the top of the fill, like light on a tube */
  content: "";
  position: absolute;
  left: 6px; right: 6px; top: 3px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
}
.lesson-bar .bar.is-shine .bar-fill { animation: barShine 620ms var(--ease-out); }
@keyframes barShine {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.45); }
  100% { filter: brightness(1); }
}
.lesson-bar .bar.is-hot .bar-fill {
  background: linear-gradient(90deg, #ff8a3d, #ffcf3d 55%, var(--accent));
  box-shadow: 0 0 18px -2px rgba(255, 160, 61, 0.65);
}

.combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 138, 61, 0.4);
  color: #ffb27a;
  font-size: var(--step--2);
  font-weight: 700;
  white-space: nowrap;
}
.combo-chip[hidden] { display: none; }
.combo-chip.is-pop { animation: comboPop 520ms var(--ease-spring); }
.combo-chip.is-out { animation: comboOut 260ms var(--ease) forwards; }
@keyframes comboPop {
  0% { transform: scale(0.6); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes comboOut { to { transform: scale(0.6); opacity: 0; } }

/* ======================================================================
   Answers: the option itself reacts before the verdict says anything
   ====================================================================== */

.option { transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease); }
.option:active:not(:disabled) { transform: scale(0.985); }
.option.is-correct { animation: optionYes 480ms var(--ease-spring); }
.option.is-correct .option-key { background: var(--ok); color: #04140c; border-color: var(--ok); }
.option.is-wrong { animation: optionNo 420ms var(--ease); }
.option.is-wrong .option-key { background: var(--danger); color: #1a0504; border-color: var(--danger); }
@keyframes optionYes { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes optionNo {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.token { transition: transform var(--t-fast) var(--ease-spring), background var(--t) var(--ease), border-color var(--t) var(--ease); }
.token:active { transform: scale(0.94); }
.order-slot.is-right { border-style: solid; border-color: rgba(62, 224, 160, 0.55); background: rgba(62, 224, 160, 0.06); }
.order-slot.is-right .token { color: var(--ok); border-color: rgba(62, 224, 160, 0.45); background: rgba(62, 224, 160, 0.1); }
.order-slot.is-wrong { border-style: solid; border-color: rgba(255, 95, 87, 0.55); animation: optionNo 420ms var(--ease); }

/* ======================================================================
   The verdict: the footer turns green or red and says why
   ====================================================================== */

.lesson-foot { transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.lesson-foot.is-right {
  background: linear-gradient(180deg, rgba(20, 52, 38, 0.97), rgba(12, 34, 25, 0.98));
  border-top-color: rgba(62, 224, 160, 0.45);
}
.lesson-foot.is-wrong {
  background: linear-gradient(180deg, rgba(58, 20, 20, 0.97), rgba(38, 13, 13, 0.98));
  border-top-color: rgba(255, 95, 87, 0.45);
}
.lesson-foot.is-right .lesson-foot-inner,
.lesson-foot.is-wrong .lesson-foot-inner {
  align-items: center;
  gap: var(--sp-5);
  animation: verdictIn 360ms var(--ease-out) both;
}
@keyframes verdictIn { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

.verdict { display: flex; align-items: flex-start; gap: var(--sp-4); min-width: 0; }
.lesson-foot-inner > .verdict { flex: 1 1 auto; }
.lesson-foot-inner > .verdict-next { flex: 0 0 auto; min-width: 200px; }
.verdict-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  animation: pop 460ms var(--ease-spring) both;
}
.is-right .verdict-icon { background: var(--ok); color: #04140c; box-shadow: 0 8px 26px -8px rgba(62, 224, 160, 0.8); }
.is-wrong .verdict-icon { background: var(--danger); color: #1a0504; box-shadow: 0 8px 26px -8px rgba(255, 95, 87, 0.8); }
.verdict-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.verdict-title { font-family: var(--font-display); font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.15; }
.is-right .verdict-title { color: #6ff0bb; }
.is-wrong .verdict-title { color: #ff8a84; }
.verdict-answer { font-size: var(--step-0); color: #ffd0cc; line-height: 1.45; }
.verdict-answer b { color: #fff; font-weight: 600; }
.verdict-detail { font-size: var(--step--1); color: var(--text-2); line-height: 1.5; }
.is-right .verdict-detail { color: #b9e8d3; }
.is-wrong .verdict-detail { color: #e9c0bc; }

.lesson-foot.is-right .verdict-next {
  --btn-bg: var(--ok);
  background: var(--ok);
  color: #04140c;
  border-color: transparent;
  box-shadow: 0 12px 34px -14px rgba(62, 224, 160, 0.9);
}
.lesson-foot.is-wrong .verdict-next {
  background: var(--danger);
  color: #1a0504;
  border-color: transparent;
  box-shadow: 0 12px 34px -14px rgba(255, 95, 87, 0.9);
}
.lesson-foot.is-right .verdict-next:hover { filter: brightness(1.08); }
.lesson-foot.is-wrong .verdict-next:hover { filter: brightness(1.08); background: var(--danger); }

.foot-wait { text-align: center; font-size: var(--step--1); padding: 14px 0; }

@media (max-width: 640px) {
  .lesson-foot.is-right .lesson-foot-inner,
  .lesson-foot.is-wrong .lesson-foot-inner { flex-direction: column; align-items: stretch; gap: var(--sp-4); }
  .lesson-foot-inner > .verdict-next { min-width: 0; width: 100%; }
  .verdict-icon { width: 40px; height: 40px; }
  .verdict-title { font-size: var(--step-1); }
  .lesson-bar { gap: var(--sp-3); }
  .combo-chip span:last-child { display: none; }
  .combo-chip::after { content: attr(data-n); }
}

/* ======================================================================
   The streak moment
   ====================================================================== */

.streak-moment {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-4);
  padding-top: clamp(8px, 4vh, 40px);
}
.streak-fire {
  position: relative;
  width: 168px; height: 168px;
  display: grid;
  place-items: center;
}
.streak-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 160, 61, 0.55), rgba(255, 90, 31, 0.18) 45%, transparent 70%);
  animation: glowBreath 2.2s ease-in-out infinite;
}
.streak-emoji {
  position: relative;
  font-size: 112px;
  line-height: 1;
  filter: drop-shadow(0 10px 30px rgba(255, 120, 40, 0.55));
  animation: flameIn 900ms var(--ease-spring) both, flameFlicker 1.6s 900ms ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes flameIn {
  0% { transform: scale(0.2) translateY(30px); opacity: 0; }
  60% { transform: scale(1.15) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.03, 0.98) rotate(-1.5deg); }
  50% { transform: scale(0.98, 1.04) rotate(1deg); }
  75% { transform: scale(1.02, 0.99) rotate(-0.5deg); }
}
@keyframes glowBreath { 0%, 100% { transform: scale(0.92); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 1; } }
.ember {
  position: absolute;
  left: calc(38% + var(--i) * 5%);
  bottom: 34%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffcf3d;
  box-shadow: 0 0 8px #ff8a3d;
  opacity: 0;
  animation: ember 1.8s calc(var(--i) * 280ms + 700ms) ease-out infinite;
}
@keyframes ember {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(calc((var(--i) - 2.5) * 14px), -110px) scale(0.2); opacity: 0; }
}
.streak-count { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.streak-num {
  font-family: var(--font-display);
  font-size: clamp(72px, 16vw, 112px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #ffe08a, #ff8a3d 70%, #ff5f1f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.streak-num.is-bump { animation: numBump 700ms var(--ease-spring); }
@keyframes numBump { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.streak-unit { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; color: #ffb27a; letter-spacing: -0.02em; }
.streak-body { max-width: 34ch; }

.streak-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 420px;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 138, 61, 0.25);
  background: rgba(255, 138, 61, 0.05);
}
.streak-day { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.streak-day-name { font-size: var(--step--2); color: var(--text-3); text-transform: capitalize; font-weight: 600; }
.streak-day-dot {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 19px;
}
.streak-day.is-on .streak-day-dot { background: linear-gradient(160deg, rgba(255, 207, 61, 0.28), rgba(255, 95, 31, 0.28)); box-shadow: 0 0 0 1.5px rgba(255, 138, 61, 0.55) inset; }
.streak-day.is-today .streak-day-name { color: #ffb27a; }
.streak-day.is-today .streak-day-dot { animation: dayLight 900ms 1100ms var(--ease-spring) both; }
@keyframes dayLight {
  0% { transform: scale(0.6); filter: grayscale(1); opacity: 0.4; }
  60% { transform: scale(1.25); filter: none; opacity: 1; }
  100% { transform: scale(1); }
}

@media (max-width: 420px) {
  .streak-week { gap: 4px; padding: var(--sp-3); }
  .streak-day-dot { width: 32px; height: 32px; font-size: 16px; }
}

/* ======================================================================
   Lesson complete
   ====================================================================== */

.complete { gap: var(--sp-5); }
.complete-mark { position: relative; width: 112px; height: 112px; }
.complete-mark > svg { position: relative; }
/* The global .icon rule pins every icon at 20px whatever size it was drawn
   at, which left a 112px medal holding a check the size of a letter. */
.complete-mark .icon { width: 54px; height: 54px; stroke-width: 2.2; }
.verdict-icon .icon { width: 26px; height: 26px; stroke-width: 2.8; }
.complete-rays {
  position: absolute;
  inset: -34px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(200, 255, 77, 0.16) 0deg 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: spin 14s linear infinite;
  pointer-events: none;
}
.complete-mark.is-perfect { background: linear-gradient(140deg, #ffe08a, #ffb547 55%, #ff8a3d); box-shadow: 0 16px 50px -14px rgba(255, 181, 71, 0.8); }
.complete-mark.is-perfect .complete-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 207, 61, 0.2) 0deg 10deg, transparent 10deg 30deg); }
.complete-mark.is-miss { box-shadow: none; }
.complete-mark.is-miss .complete-rays { display: none; }
.complete-title { font-size: var(--step-5); letter-spacing: -0.035em; animation: rise 520ms 120ms var(--ease-out) both; }

.cstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); width: 100%; }
.cstat {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  border: 2px solid var(--cs);
  background: var(--cs);
  overflow: hidden;
  animation: statIn 560ms calc(var(--d) + 300ms) var(--ease-spring) both;
}
@keyframes statIn { from { transform: translateY(16px) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.cstat-label {
  padding: 6px 8px 5px;
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cs-ink);
}
.cstat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 8px 16px;
  border-radius: calc(var(--r-md) - 4px) calc(var(--r-md) - 4px) calc(var(--r-md) - 2px) calc(var(--r-md) - 2px);
  background: var(--surface);
  color: var(--cs);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cstat-xp { --cs: var(--accent); --cs-ink: #10170a; }
.cstat-time { --cs: var(--info); --cs-ink: #041322; }
.cstat-acc.is-great { --cs: var(--ok); --cs-ink: #04140c; }
.cstat-acc.is-good { --cs: var(--warn); --cs-ink: #1d1203; }
.cstat-acc.is-low { --cs: var(--danger); --cs-ink: #1a0504; }

.combo-strip { animation: rise 500ms 700ms var(--ease-out) both; }
.learned-panel { width: 100%; text-align: left; }

@media (max-width: 640px) {
  .complete-title { font-size: var(--step-4); }
  .cstat-value { font-size: var(--step-2); padding: 12px 4px 13px; gap: 5px; }
  .cstat-value svg { width: 16px; height: 16px; }
  .cstat-label { font-size: 10px; letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  .streak-emoji, .streak-glow, .ember, .complete-rays, .streak-day.is-today .streak-day-dot { animation: none !important; }
  .ember { display: none; }
}

@media (pointer: coarse) { .kbd-hint { display: none; } }

/* ======================================================================
   The learning path
   ====================================================================== */

.can-do-more { margin-top: var(--sp-3); }
.can-do-more summary { cursor: pointer; list-style: none; }
.can-do-more summary::-webkit-details-marker { display: none; }
.can-do-more[open] summary { display: none; }
.can-do-more ul { margin-top: 0; }

.path { display: flex; flex-direction: column; gap: var(--sp-7); }
.path-unit { --node: 72px; --swing: 54px; display: flex; flex-direction: column; gap: var(--sp-6); }

.unit-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--unit) 30%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in oklab, var(--unit) 22%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in oklab, var(--unit) 38%, transparent);
  overflow: hidden;
}
.unit-no {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--unit);
  font-weight: 700;
}
.unit-title { font-size: var(--step-3); letter-spacing: -0.025em; }
.unit-summary { color: var(--text-2); font-size: var(--step--1); line-height: 1.5; max-width: 60ch; }
.unit-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.unit-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); }
.unit-count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
}

.path-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.path-step {
  position: relative;
  display: flex;
  justify-content: center;
  width: var(--node);
  transform: translateX(calc(var(--x) * var(--swing)));
}

.path-node {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--node);
  height: calc(var(--node) * 0.92);
  border-radius: 50%;
  color: var(--text-3);
  background: var(--surface-3);
  box-shadow: 0 7px 0 0 #0d1016, inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t) var(--ease);
}
.path-node .icon { width: 30px; height: 30px; stroke-width: 2.2; }
a.path-node:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 9px 0 0 #0d1016, inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
a.path-node:active { transform: translateY(5px); box-shadow: 0 2px 0 0 #0d1016; }

.path-step.is-done .path-node {
  background: linear-gradient(160deg, color-mix(in oklab, var(--unit) 88%, #fff), var(--unit));
  color: #0b1203;
  box-shadow: 0 7px 0 0 color-mix(in oklab, var(--unit) 45%, #000), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.path-step.is-perfect .path-node {
  background: linear-gradient(160deg, #ffe08a, #ffb547);
  color: #2a1700;
  box-shadow: 0 7px 0 0 #a8661a, inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.path-step.is-retry .path-node {
  background: linear-gradient(160deg, #ffd27a, var(--warn));
  color: #241500;
  box-shadow: 0 7px 0 0 #8f5c12;
}
.path-step.is-current .path-node {
  background: linear-gradient(160deg, color-mix(in oklab, var(--unit) 80%, #fff), var(--unit));
  color: #0b1203;
  box-shadow: 0 7px 0 0 color-mix(in oklab, var(--unit) 45%, #000), 0 0 0 7px var(--ground), 0 0 0 11px color-mix(in oklab, var(--unit) 55%, transparent);
}
.path-step[data-current] .path-node::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid var(--unit);
  opacity: 0;
  animation: pathPulse 2s var(--ease-out) infinite;
}
@keyframes pathPulse {
  0% { transform: scale(0.92); opacity: 0.75; }
  100% { transform: scale(1.32); opacity: 0; }
}
.path-step.is-ahead .path-node { opacity: 0.75; }
.path-step.is-ahead a.path-node:hover { opacity: 1; }

.path-start {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid var(--unit);
  color: var(--unit);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: startBob 1.6s ease-in-out infinite;
  z-index: 2;
}
.path-start::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 12px; height: 12px;
  background: var(--surface-2);
  border-right: 2px solid var(--unit);
  border-bottom: 2px solid var(--unit);
  transform: translate(-50%, -6px) rotate(45deg);
}
@keyframes startBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.path-step[data-current] { margin-top: 44px; }

.path-label {
  position: absolute;
  top: 50%;
  transform: translateY(-58%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: max-content;
  max-width: 230px;
  color: var(--text);
  text-decoration: none;
}
.path-step[data-side="right"] .path-label { left: calc(100% + 18px); text-align: left; }
.path-step[data-side="left"] .path-label { right: calc(100% + 18px); text-align: right; }
.path-label strong { font-size: var(--step--1); font-weight: 600; line-height: 1.3; }
.path-label span { font-size: var(--step--2); color: var(--text-3); }
.path-step.is-ahead .path-label strong { color: var(--text-2); }
.path-step.is-current .path-label strong { color: var(--unit); }

.path-chest .path-node {
  width: calc(var(--node) * 0.86);
  height: calc(var(--node) * 0.8);
  border-radius: 22px;
  opacity: 0.6;
}
.path-chest.is-open .path-node {
  opacity: 1;
  background: linear-gradient(160deg, #ffe08a, #ffb547);
  color: #2a1700;
  box-shadow: 0 7px 0 0 #a8661a, 0 0 30px -6px rgba(255, 181, 71, 0.6);
}

@media (max-width: 640px) {
  .path { gap: var(--sp-6); }
  .path-unit { --node: 62px; --swing: 34px; gap: var(--sp-5); }
  .unit-banner { padding: var(--sp-4); }
  .unit-title { font-size: var(--step-2); }
  .unit-emoji { font-size: 34px; }
  .path-node .icon { width: 26px; height: 26px; }
  .path-label { max-width: 128px; }
  .path-label strong { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .path-label span { font-size: 11px; }
  .path-step[data-side="right"] .path-label { left: calc(100% + 12px); }
  .path-step[data-side="left"] .path-label { right: calc(100% + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .path-step[data-current] .path-node::after, .path-start { animation: none; }
}

/* ======================================================================
   Dashboard hero: the next lesson, the flame, today's goal
   ====================================================================== */

.dh {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: stretch;
}
.dh-main { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.dh-lesson {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  margin-inline: calc(var(--sp-4) * -1);
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
  transition: background var(--t) var(--ease);
}
.dh-lesson:hover { background: rgba(255, 255, 255, 0.03); }
.dh-emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 22px;
  font-size: 42px;
  line-height: 1;
  background: linear-gradient(160deg, rgba(200, 255, 77, 0.16), rgba(91, 60, 240, 0.14));
  border: 1px solid var(--accent-line);
  box-shadow: 0 10px 30px -14px var(--accent-glow);
}
.dh-where { font-size: var(--step--1); color: var(--text-3); font-weight: 600; }
.dh-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.dh-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--step--1);
  color: var(--text-2);
}
.dh-meta .icon { width: 14px; height: 14px; color: var(--text-3); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); margin-inline: 4px; }
.dh-go { align-self: flex-start; min-width: 240px; }
.dh-level { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: var(--sp-2); }
.dh-level-name { font-weight: 600; font-size: var(--step--1); }

.dh-side { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); }

.dh-streak {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 138, 61, 0.28);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(255, 138, 61, 0.2), transparent 60%),
    var(--surface-2);
}
.dh-streak-top { display: flex; align-items: center; gap: var(--sp-3); }
.dh-flame { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 16px rgba(255, 120, 40, 0.5)); transform-origin: 50% 90%; }
.dh-streak.is-lit .dh-flame { animation: flameFlicker 1.8s ease-in-out infinite; }
.dh-streak.is-cold .dh-flame { filter: grayscale(1) brightness(0.7); opacity: 0.55; }
.dh-streak.is-risk .dh-flame { filter: saturate(0.6) drop-shadow(0 6px 16px rgba(255, 120, 40, 0.25)); animation: riskPulse 2.4s ease-in-out infinite; }
@keyframes riskPulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
.dh-streak-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #ffb27a;
}
.dh-streak.is-cold .dh-streak-num { color: var(--text-3); }
.dh-streak-unit { font-size: var(--step--1); font-weight: 600; color: var(--text-2); }
.dh-streak-note { font-size: var(--step--1); color: var(--text-2); line-height: 1.45; }
.dh-streak.is-risk .dh-streak-note { color: #ffcf9e; }

.dh-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dh-day { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.dh-day i {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  font-style: normal;
  font-size: 14px;
}
.dh-day.is-on i { background: rgba(255, 138, 61, 0.2); box-shadow: 0 0 0 1.5px rgba(255, 138, 61, 0.55) inset; }
.dh-day.is-today i { outline: 2px dashed rgba(255, 178, 122, 0.6); outline-offset: 2px; }
.dh-day.is-today.is-on i { outline: 2px solid #ffb27a; }
.dh-day b { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: capitalize; }
.dh-day.is-today b { color: #ffb27a; }

.dh-goal {
  flex-direction: row !important;
  align-items: center !important;
  gap: var(--sp-3) !important;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--surface-inset);
  border: 1px solid var(--line);
}
.dh-goal .dash-goal-value { font-size: var(--step-1); }

.h-quests { font-size: var(--step-2); letter-spacing: -0.02em; }

@media (max-width: 1080px) {
  .dh { grid-template-columns: 1fr; }
  .dh-side { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: stretch; }
  .dh-goal { flex-direction: column !important; justify-content: center; text-align: center; }
  .dh-goal .stack { align-items: center; }
}
@media (max-width: 640px) {
  .dh-side { grid-template-columns: 1fr; }
  .dh-goal { flex-direction: row !important; text-align: left; justify-content: flex-start; }
  .dh-goal .stack { align-items: flex-start; }
  .dh-emoji { width: 60px; height: 60px; font-size: 32px; border-radius: 18px; }
  .dh-lesson { padding: var(--sp-3); margin-inline: calc(var(--sp-3) * -1); gap: var(--sp-3); }
  .dh-go { align-self: stretch; min-width: 0; }
  .dh-day i { width: 30px; height: 30px; }
}
.dh-of { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .dh-of { display: none; } }

/* ======================================================================
   Landing: the headline that fits, the lesson you can try, the comparison
   ====================================================================== */

/* The copy column was 36ch of body text wide while the headline beside it
   was set at up to 6.2rem, so a long word had nowhere to go: at 1440px
   Russian broke "английс-кий" across two lines. The column now has room for
   the longest word of every language, and the size follows the viewport. */
.hero-copy { max-width: 640px; }
.hero-h1 {
  font-size: clamp(2.6rem, 5.4vw, 5.4rem);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-wrap: balance;
}
.hero-line { display: block; }

.try-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(29, 34, 44, 0.92), rgba(16, 19, 25, 0.96));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  min-height: 380px;
}
.try-card.is-right { border-color: rgba(62, 224, 160, 0.5); box-shadow: var(--shadow-3), 0 0 60px -20px rgba(62, 224, 160, 0.45); }
.try-card.is-wrong { border-color: rgba(255, 95, 87, 0.45); }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.try-dots { display: inline-flex; gap: 6px; }
.try-dots i { width: 22px; height: 6px; border-radius: 99px; background: var(--surface-3); }
.try-dots i.is-past { background: var(--accent); }
.try-dots i.is-now { background: var(--accent-line); }
.try-prompt { font-family: var(--font-display); font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.2; }
.try-option { padding-block: 12px; }
.try-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  animation: verdictIn 320ms var(--ease-out) both;
}
.try-verdict[hidden] { display: none; }
.is-right .try-verdict { background: rgba(62, 224, 160, 0.12); }
.is-wrong .try-verdict { background: rgba(255, 95, 87, 0.12); }
.try-verdict-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--step--1); color: var(--text-2); min-width: 0; }
.try-verdict-text strong { font-size: var(--step-1); font-family: var(--font-display); }
.is-right .try-verdict-text strong { color: #6ff0bb; }
.is-wrong .try-verdict-text strong { color: #ff8a84; }
.try-verdict-text b { color: var(--text); }
.try-xp { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; animation: pop 500ms var(--ease-spring) both; }
.try-xp .icon { width: 13px; height: 13px; }
.try-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); margin-block: auto; }
.try-done-mark { font-size: 64px; line-height: 1; animation: flameIn 800ms var(--ease-spring) both; }
.try-done-title { font-family: var(--font-display); font-size: var(--step-3); letter-spacing: -0.03em; }
.try-done .dim { max-width: 36ch; line-height: 1.5; }

.vs-table { padding: var(--sp-2) var(--sp-5); max-width: 860px; margin-inline: auto; }
.vs-list { list-style: none; margin-block: 0; }
.vs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.vs-row:last-child { border-bottom: 0; }
.vs-us { display: flex; justify-content: center; text-align: center; }
.vs-what { font-size: var(--step-0); line-height: 1.4; }
.vs-yes {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-style: normal;
  font-weight: 800;
}
.vs-yes { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 6px 20px -8px var(--accent-glow); }
.vs-yes .icon { width: 18px; height: 18px; stroke-width: 2.8; }

@media (max-width: 1080px) {
  .hero-copy { max-width: none; }
}
@media (max-width: 640px) {
  .try-card { padding: var(--sp-4); min-height: 0; }
  .try-prompt { font-size: var(--step-1); }
  .vs-table { padding: var(--sp-1) var(--sp-4); }
  .vs-row { grid-template-columns: minmax(0, 1fr) 44px; gap: var(--sp-2); }
  .vs-what { font-size: var(--step--1); }
}

/* The floating chips frame the try-it card instead of sitting on it: the
   card is something to press now, and a chip over an answer is in the way. */
.hero-stage .hero-chip-1 { top: -46px; right: 18px; }
.hero-stage .hero-chip-2 { bottom: -40px; left: -36px; }
.hero-stage .hero-chip-3 { bottom: -74px; right: 8%; }
@media (max-width: 1080px) {
  .hero-stage { margin-top: var(--sp-6); margin-bottom: var(--sp-7); }
}
@media (max-width: 640px) {
  .hero-stage .hero-chip { display: none; }
  .hero-stage { min-height: 0; margin-bottom: 0; }
}
.try-done .link-sm { align-self: center; }

/* ======================================================================
   Missions: the other person speaks
   ====================================================================== */

.chat-bubble-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-say {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.chat-say .icon { width: 15px; height: 15px; }
.chat-say:hover, .chat-say.is-speaking { color: var(--accent); border-color: var(--accent-line); }
.chat-wave { display: none; align-items: flex-end; gap: 2px; height: 10px; margin-left: 7px; vertical-align: middle; }
.chat-wave i { width: 2px; height: 100%; border-radius: 2px; background: var(--accent); animation: chatWave 900ms ease-in-out infinite; }
.chat-wave i:nth-child(2) { animation-delay: 150ms; }
.chat-wave i:nth-child(3) { animation-delay: 300ms; }
.chat-turn.is-speaking .chat-wave { display: inline-flex; }
.chat-turn.is-speaking .chat-bubble { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes chatWave { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chat-wave i { animation: none; } }

/* ======================================================================
   Invite a friend
   ====================================================================== */

.invite-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  border-color: rgba(255, 181, 71, 0.35);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(255, 181, 71, 0.16), transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(91, 60, 240, 0.16), transparent 60%),
    var(--surface);
}
.invite-card[hidden] { display: none; }
.invite-glow { position: absolute; inset: auto -20% -60% auto; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 181, 71, 0.12); filter: blur(40px); pointer-events: none; }
.invite-head { position: relative; display: flex; align-items: flex-start; gap: var(--sp-4); }
.invite-gift { font-size: 40px; line-height: 1; animation: giftBob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes giftBob { 0%, 100% { transform: rotate(0deg); } 10% { transform: rotate(-8deg); } 20% { transform: rotate(6deg); } 30% { transform: rotate(0deg); } }
.invite-title { font-size: var(--step-2); letter-spacing: -0.02em; }
.invite-body { color: var(--text-2); font-size: var(--step--1); line-height: 1.5; }
.invite-link { position: relative; display: flex; gap: var(--sp-2); }
.invite-link .input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--step--1); color: #ffd08a; }
.invite-stats { font-size: var(--step--2); color: var(--text-3); }
.invite-card.is-compact .invite-gift { font-size: 32px; }
.invite-card.is-compact .invite-title { font-size: var(--step-1); }

.invited-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 181, 71, 0.4);
  background: rgba(255, 181, 71, 0.1);
  color: #ffd9a3;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.4;
}
.invited-banner span:first-child { font-size: 22px; }

@media (max-width: 640px) {
  .invite-link { flex-direction: column; }
  .invite-card .row.between { flex-direction: column; align-items: stretch; }
  .invite-card .btn-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .invite-gift { animation: none; } }

/* ======================================================================
   Story cards
   ====================================================================== */

.story-preview {
  display: grid;
  place-items: center;
  /* Tall enough to see, short enough that both buttons stay on screen. */
  width: min(100%, 300px, calc((100dvh - 330px) * 0.5625));
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-inset);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.story-preview img { width: 100%; height: 100%; object-fit: cover; display: block; animation: rise 420ms var(--ease-out) both; }
.story-wait { color: var(--accent); animation: spin 1.4s linear infinite; }
.story-wait .icon { width: 26px; height: 26px; }
.share-result { align-self: center; color: var(--text-2); }
.share-result:hover { color: var(--accent); }
.modal:has(.story-preview) .modal-actions { flex-direction: row; flex-wrap: nowrap; margin-top: var(--sp-4); }
.modal:has(.story-preview) .modal-actions .btn { flex: 1; justify-content: center; }

/* ======================================================================
   Skills: what you can do now
   ====================================================================== */

.can-do-line { display: flex; align-items: flex-start; gap: 10px; font-size: var(--step--1); line-height: 1.45; color: var(--text-3); list-style: none; }
.can-do-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}
.can-do-mark .icon { width: 13px; height: 13px; stroke-width: 3; }
.can-do-line.is-done { color: var(--text); }
.can-do-line.is-done .can-do-mark { background: var(--ok); border-color: var(--ok); color: #04140c; }
.can-do ul { padding: 0; }

.skills-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.skills-list { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; }
.skills-none { font-size: var(--step--1); color: var(--text-2); line-height: 1.5; }
.skills-next {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-size: var(--step--2);
  line-height: 1.45;
}
.skills-next .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }

.skill-unlock {
  display: flex;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  text-align: left;
  border: 1px solid rgba(62, 224, 160, 0.45);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(62, 224, 160, 0.16), transparent 60%),
    var(--surface);
  animation: statIn 640ms 700ms var(--ease-spring) both;
}
.skill-unlock-badge { font-size: 38px; line-height: 1; }
.skill-unlock-title { font-family: var(--font-display); font-size: var(--step-1); color: #6ff0bb; }

/* ======================================================================
   Friendlier type, and the promises on the landing page
   ====================================================================== */

/* Small labels were set in the monospace face, spaced wide. In Latin that
   reads as technical; in Cyrillic it falls apart into separate letters —
   "П Р О В Е Р И Т Ь". The interface face, a little bolder and closer
   set, keeps them as labels and reads as words. */
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  color: var(--text-3);
}

.no-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.no-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 600;
}
.no-list .icon { width: 14px; height: 14px; color: var(--accent); stroke-width: 3; }

/* ======================================================================
   Trial and upgrade
   ====================================================================== */

.trial-flag {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 181, 71, 0.14);
  border: 1px solid rgba(255, 181, 71, 0.45);
  color: #ffd08a;
  font-size: var(--step--2);
  font-weight: 700;
}
.trial-then { font-size: var(--step--2); color: var(--text-3); line-height: 1.45; text-align: center; margin-top: -6px; }

.upgrade-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  text-align: left;
  border: 1px solid var(--accent-line);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(200, 255, 77, 0.16), transparent 60%),
    radial-gradient(70% 100% at 0% 100%, rgba(91, 60, 240, 0.2), transparent 60%),
    var(--surface);
  animation: statIn 640ms 900ms var(--ease-spring) both;
}
.upgrade-glow { position: absolute; inset: -40% -10% auto auto; width: 240px; height: 240px; border-radius: 50%; background: rgba(200, 255, 77, 0.1); filter: blur(40px); pointer-events: none; }
.upgrade-title { position: relative; font-family: var(--font-display); font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.2; }
.upgrade-body { position: relative; color: var(--text-2); font-size: var(--step--1); line-height: 1.5; }
.upgrade-cta { position: relative; align-self: flex-start; }
.upgrade-then { position: relative; font-size: var(--step--2); color: var(--text-3); }
@media (max-width: 640px) { .upgrade-cta { align-self: stretch; } }

/* ======================================================================
   The app on the home screen, and the evening reminder
   ====================================================================== */

.app-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  border-color: rgba(200, 255, 77, 0.32);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(200, 255, 77, 0.12), transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(86, 182, 255, 0.12), transparent 60%),
    var(--surface);
}
.app-card[hidden] { display: none; }
.app-head { display: flex; align-items: flex-start; gap: var(--sp-4); }
.app-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(200, 255, 77, 0.35), 0 8px 24px rgba(200, 255, 77, 0.18);
}
.app-title { font-size: var(--step-1); letter-spacing: -0.02em; }
.app-card-body { color: var(--text-2); font-size: var(--step--1); line-height: 1.5; }
.app-close { margin: -6px -6px 0 0; color: var(--text-3); }

.app-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); counter-reset: appstep; }
.app-steps li {
  counter-increment: appstep;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  line-height: 1.45;
}
.app-steps li::before {
  content: counter(appstep);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #0a0f03;
  background: var(--accent, #c8ff4d);
}
.app-step-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(86, 182, 255, 0.14); color: #8fd0ff; }
.app-step-icon img { border-radius: 6px; }
.app-warn { padding: 10px 14px; border-radius: var(--r-md); background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.4); color: #ffd9a3; font-size: var(--step--1); line-height: 1.45; }

.push-note { color: #ffd9a3; font-size: var(--step--1); line-height: 1.45; }
.push-note[hidden] { display: none; }
.push-row [data-push-extra]:empty { display: none; }

@media (max-width: 640px) {
  .app-card [data-app-actions] .btn { width: 100%; }
}

/* ======================================================================
   Words: the card on its deck — drag, throw, the next one comes up
   ====================================================================== */

/* The cards underneath. They sit lower and smaller, and rise as the top
   card is dragged away (--pull, 0 to 1, set while dragging). */
.qz-deck { position: relative; isolation: isolate; --pull: 0; }
.qz-deck.has-more { padding-bottom: 12px; }
.qz-deck.has-two { padding-bottom: 22px; }
.qz-deck.has-more::before,
.qz-deck.has-two::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 12px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  pointer-events: none;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.qz-deck.has-two::before,
.qz-deck.has-two::after { bottom: 22px; }
.qz-deck.has-more::before {
  z-index: -1;
  opacity: calc(0.75 + 0.25 * var(--pull));
  transform: translateY(calc(12px - 12px * var(--pull))) scale(calc(0.95 + 0.05 * var(--pull)));
}
.qz-deck.has-two::after {
  z-index: -2;
  opacity: 0.4;
  transform: translateY(calc(22px - 10px * var(--pull))) scale(calc(0.9 + 0.05 * var(--pull)));
}
.qz-deck:has(.is-dragging)::before,
.qz-deck:has(.is-dragging)::after { transition: none; }

.qz-swipe { z-index: 0; }
.qz-swipe.qz-enter { animation: qzEnter 0.36s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes qzEnter {
  from { transform: translateY(12px) scale(0.95); opacity: 0.55; }
  to { transform: none; opacity: 1; }
}
.qz-swipe.is-leaving { transition: transform 0.3s cubic-bezier(0.4, 0.1, 0.6, 1), opacity 0.3s ease-in; }
.qz-swipe.is-returning { transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* The stamp grows in with the lean, Tinder-style: KNOW top left when it
   goes right, STILL LEARNING top right when it goes left. */
.qz-stamp {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: var(--step-0);
  background: rgba(8, 9, 12, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.qz-swipe.lean-yes .qz-stamp-yes { opacity: var(--lean, 1); transform: rotate(-12deg) scale(calc(0.75 + 0.3 * var(--lean, 1))); }
.qz-swipe.lean-no .qz-stamp-no { opacity: var(--lean, 1); transform: rotate(12deg) scale(calc(0.75 + 0.3 * var(--lean, 1))); }

/* And the card takes the colour of the pile it is heading for. */
.qz-swipe .qz-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}
.qz-swipe.lean-yes .qz-face::after { opacity: var(--lean, 1); background: radial-gradient(130% 110% at 0% 0%, rgba(62, 224, 160, 0.3), transparent 62%); }
.qz-swipe.lean-no .qz-face::after { opacity: var(--lean, 1); background: radial-gradient(130% 110% at 100% 0%, rgba(255, 138, 92, 0.3), transparent 62%); }
.qz-swipe.lean-yes .qz-face { border-color: rgba(62, 224, 160, calc(0.15 + 0.85 * var(--lean, 1))); }
.qz-swipe.lean-no .qz-face { border-color: rgba(255, 138, 92, calc(0.15 + 0.85 * var(--lean, 1))); }

.qz-hero .qz-tally-live { animation: qzEnter 0.3s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .qz-swipe.qz-enter, .qz-hero .qz-tally-live { animation: none; }
  .qz-swipe.is-leaving, .qz-swipe.is-returning, .qz-deck::before, .qz-deck::after { transition: none; }
}

/* A card thrown off the side must not widen the page: on an iPhone that
   lets the whole screen slide sideways under the thumb. clip, not hidden,
   so nothing inside becomes a scroll box and sticky bars still stick. */
.words-view { overflow-x: hidden; overflow-x: clip; }

/* The word card a shade lighter than the page, with light falling on its
   top edge, so it reads as a card in the hand rather than a hole. */
.qz-front { background: linear-gradient(165deg, #1c212b 0%, #151920 100%); border-color: rgba(255, 255, 255, 0.14); }
.qz-back { background: linear-gradient(165deg, #20262f 0%, #181c24 100%); border-color: rgba(255, 255, 255, 0.14); }
.qz-face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-2); }

/* ======================================================================
   My Words: three piles and a strength meter on every word
   ====================================================================== */

.qz-strength { display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; vertical-align: middle; }
.qz-strength i { width: 14px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.qz-strength.is-learning i.is-on { background: #ff8a5c; }
.qz-strength.is-known i.is-on { background: var(--ok, #3ee0a0); }
.qz-strength.is-mastered i.is-on { background: var(--accent, #c8ff4d); }

.qz-group-learning { color: #ffb08a; }
.qz-group-known { color: var(--ok, #3ee0a0); }
.qz-group-mastered { color: var(--accent, #c8ff4d); }
.qz-group-hint { font-size: var(--step--1); line-height: 1.45; margin-top: calc(var(--sp-2) * -1); }

/* ======================================================================
   Two screens that were wider than a phone (found 17.10.2026)
   ====================================================================== */

/* Practice: "3 of 3 left this week" sat on one line beside a large Start
   button and pushed the sticky bar ~100px past the screen edge. */
@media (max-width: 640px) {
  .practice-start .row { min-width: 0; flex-direction: column; align-items: stretch; gap: 6px; }
  .practice-start .pill { align-self: center; white-space: normal; text-align: center; font-size: var(--step--2); padding: 3px 10px; }
  .practice-start .btn { width: 100%; flex: none; }
}

/* Settings: a 1fr column grows to its widest child, and the Reset button
   with its long label made the whole Danger zone wider than the phone.
   minmax(0, 1fr) keeps the column at the screen; the button rows wrap. */
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .settings-view .toggle-row:has(> .btn) { flex-wrap: wrap; }
  .settings-view .toggle-row:has(> .btn) > .btn { width: 100%; justify-content: center; }
}
.qz-hero[hidden] { display: none; }

/* ---- where a step comes from: a warm-up from an earlier lesson, or a
   mistake from this one asked again ---- */
.step-origin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin: 0 0 var(--sp-4);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.step-origin.is-retry { color: #ffb38a; background: rgba(255, 138, 92, 0.1); border-color: rgba(255, 138, 92, 0.32); }

/* ---- a word typed from memory ---- */
.step-spell { display: flex; flex-direction: column; gap: var(--sp-4); }
.spell-sentence { font-size: var(--step-2); line-height: 1.35; letter-spacing: -0.02em; }
.spell-gap {
  display: inline-block;
  min-width: 3.2em;
  padding: 0 0.35em;
  margin: 0 0.1em;
  border-bottom: 3px solid var(--accent-line);
  color: var(--text-3);
  text-align: center;
}
.spell-gap.is-right { color: var(--ok); border-color: var(--ok); }
.spell-gap.is-wrong { color: #ff8a84; border-color: var(--danger); }
.spell-hint { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); }
.spell-hint svg { flex: none; margin-top: 3px; color: var(--accent); }
.spell-input { font-size: 18px; padding-block: 14px; }
.spell-input:disabled { opacity: 0.7; }

/* ---- the lesson's mistakes, on the result screen ---- */
.fix-panel .eyebrow { display: inline-flex; align-items: center; gap: 6px; }

/* The cookie banner (components/consent.js). Bottom corner, never a wall in
   front of the page, and both choices in the same style: neither is the one
   the design wants you to press. */
.consent {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 250;
  width: min(440px, calc(100vw - 32px));
  padding: var(--sp-4);
  border-radius: var(--radius-lg, 18px);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  display: grid;
  gap: var(--sp-3);
}
.consent-title { margin: 0; font-size: var(--step-0); font-family: var(--font-ui); font-weight: 700; letter-spacing: 0; }
.consent-body { margin: 0; font-size: var(--step--1); line-height: 1.5; color: var(--text-2); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.consent-actions .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.consent-short { display: none; }
@media (max-width: 640px) {
  /* A slim strip on phones: short text, no visible heading (it stays for
     screen readers), the two equal buttons side by side. */
  .consent {
    left: 8px; right: 8px; width: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: var(--sp-3); gap: var(--sp-2);
  }
  .consent-title {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .consent-long { display: none; }
  .consent-short { display: inline; }
  .consent-body { font-size: 13px; line-height: 1.4; }
  .consent-actions .btn { min-height: 40px; padding-block: 8px; }
}

/* The level hours are an estimate; this line says so under the cards. */
.hours-note { font-size: var(--step--2); margin-top: var(--sp-4); max-width: 60ch; }

/* ---------------------------------------------------------------------
   Speaking trainers: «Как сказать?», «Тень», «Без ступора»
   (views/say.js, shadow.js, reflex.js; the hub is C.trainersCard)
   --------------------------------------------------------------------- */
.trainers-card { position: relative; overflow: hidden; }
.trainers-card::before {
  content: ''; position: absolute; inset: -50% -30% auto auto; width: 340px; height: 340px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(200, 255, 77, 0.12), transparent 70%);
  filter: blur(30px); pointer-events: none;
}
.trainers-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); position: relative; }
.trainer-tile {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease-spring), background var(--t) var(--ease);
}
.trainer-tile:hover { border-color: var(--accent-line); transform: translateY(-2px); background: var(--surface-3); }
.trainer-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trainer-tile > svg:last-child { color: var(--text-3); flex: none; }
.trainer-icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.trainer-shadow .trainer-icon { background: rgba(124, 196, 255, 0.12); color: var(--info); border-color: rgba(124, 196, 255, 0.3); }
.trainer-reflex .trainer-icon { background: rgba(255, 150, 80, 0.12); color: var(--streak); border-color: rgba(255, 150, 80, 0.3); }
.trainer-tag { font-size: var(--step--1); color: var(--text-2); line-height: 1.35; }
.trainer-meta { font-size: var(--step--2); color: var(--accent); }
@media (max-width: 860px) { .trainers-grid { grid-template-columns: 1fr; } }

/* the words of a line, coloured after an attempt, lit while spoken */
.sh-word { border-radius: 6px; padding: 0 2px; transition: color 120ms var(--ease), background 120ms var(--ease); }
.sh-word.is-lit { color: var(--accent); }
.sh-word.is-now { background: var(--accent-soft); color: var(--accent); }
.sh-word.is-ok { color: var(--ok); }
.sh-word.is-miss { color: var(--danger); text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* «Как сказать?» */
.say-wrap, .sh-wrap, .rx-wrap { max-width: 760px; }
.say-input { min-height: 96px; resize: vertical; font-size: 16px; }
.say-options { display: grid; gap: var(--sp-3); }
.say-option { border-left: 3px solid var(--line-2); }
.say-option[data-option="0"] { border-left-color: var(--accent); }
.say-option[data-option="1"] { border-left-color: var(--info); }
.say-option[data-option="2"] { border-left-color: var(--streak); }
.say-tone { align-self: flex-start; }
.say-english { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.25; margin: 0; }
.say-note { margin: 0; }
.say-tried { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.say-chunks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.say-tip {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--r-md);
  background: rgba(255, 196, 0, 0.08); border: 1px solid rgba(255, 196, 0, 0.25); color: var(--text);
}
.say-tip svg { flex: none; margin-top: 3px; color: var(--warn); }
.say-understood { margin: 0; }
.say-recent { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* «Тень» */
.sh-how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.sh-how li { display: flex; gap: var(--sp-3); align-items: flex-start; color: var(--text-2); }
.sh-how li svg { flex: none; margin-top: 3px; color: var(--accent); }
.sh-blind { align-items: flex-start; cursor: pointer; }
.sh-blind input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.sh-card { align-items: stretch; }
.sh-line { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.3; text-align: center; margin: var(--sp-3) 0 0; }
.sh-line.is-blind .sh-word { filter: blur(7px); user-select: none; }
.sh-line.is-blind .sh-word.is-now, .sh-line.is-blind .sh-word.is-lit { filter: blur(4px); }
.sh-mic { align-items: center; text-align: center; }
.sh-heard { margin: 0; max-width: 46ch; }
.sh-result { align-items: center; }
.sh-summary { list-style: none; margin: 0; padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.sh-summary li { align-items: center; }
.sh-note { display: flex; gap: var(--sp-2); align-items: flex-start; }

/* «Без ступора» */
.rx-card { text-align: center; align-items: center; }
.rx-scene { align-self: center; }
.rx-line { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.25; margin: 0; max-width: 24ch; }
.rx-clock { font-family: var(--font-mono); font-size: var(--step-4); color: var(--text-2); font-variant-numeric: tabular-nums; transition: color var(--t) var(--ease); }
.rx-clock.is-late { color: var(--streak); }
.rx-nudge { margin: 0; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--step--1); }
.rx-card form { width: 100%; text-align: left; }
.rx-score { text-align: left; }
.rx-big { font-family: var(--font-display); font-size: var(--step-5); line-height: 1; color: var(--accent); }
.rx-summary { margin: var(--sp-2) 0 0; }
.rx-item p { margin: 0; }
.rx-heard-line { font-family: var(--font-display); font-size: var(--step-1); }
.rx-better { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.rx-alt { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.rx-fillers .chip, .rx-alt .chip { gap: 6px; }

/* Landing: the trainers as a section of their own */
.land-trainers .trainers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.land-trainer { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.land-trainer h3 { margin: 0; }
.land-trainer p { margin: 0; color: var(--text-2); }
.land-trainer .land-demo { margin-top: auto; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-inset); font-size: var(--step--1); }
.land-demo b { color: var(--accent); font-weight: 600; }
@media (max-width: 860px) { .land-trainers .trainers-grid { grid-template-columns: 1fr; } }
.say-wrap .chip { text-align: left; }
.rx-where { display: inline-flex; gap: 6px; align-items: center; }
.rx-alt .chip, .rx-fillers .chip { text-align: left; }

/* ---------------------------------------------------------------------
   «Мелодия»: the native tune and the learner's voice as two lines
   (lib/melody.js, components/melody.js, views/melody.js, lesson step)
   --------------------------------------------------------------------- */
.trainers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trainer-melody .trainer-icon { background: linear-gradient(135deg, rgba(200, 255, 77, 0.22), rgba(120, 200, 255, 0.18)); color: var(--accent); }
.melody { display: flex; flex-direction: column; gap: var(--sp-4); }
.melody-stage {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(200, 255, 77, 0.08), transparent 60%),
    linear-gradient(180deg, var(--surface-inset), var(--ground-2));
}
.melody-canvas { display: block; width: 100%; height: 210px; }
.melody-legend {
  position: absolute; top: 10px; right: 12px; display: flex; align-items: center; gap: 6px;
  font-size: var(--step--2); color: var(--text-3);
}
.melody-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-left: 6px; }
.melody-key.is-native { background: var(--accent); box-shadow: 0 0 8px rgba(200, 255, 77, 0.8); }
.melody-key.is-mine { background: #e8f4ff; box-shadow: 0 0 8px rgba(120, 200, 255, 0.8); }
.melody-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: var(--sp-4); text-align: center; color: var(--text-3); font-size: var(--step--1); }
.melody-wait[hidden] { display: none; }
.melody-line { margin: 0; text-align: center; font-family: var(--font-display); font-size: var(--step-2); line-height: 1.3; }
.melody-controls { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); flex-wrap: wrap; }
.melody-mic { width: 78px; height: 78px; }
.melody-mic:disabled { opacity: 0.4; cursor: not-allowed; }
.melody-hint { text-align: center; margin: 0; }
.melody-score { padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: var(--sp-3); }
.melody-score[hidden] { display: none; }
.melody-result { display: flex; align-items: center; gap: var(--sp-4); }
.melody-ring {
  --p: 0; position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
}
.melody-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface-2); }
.melody-ring strong { position: relative; font-family: var(--font-display); font-size: var(--step-0); }
.melody-advice { margin: 0; color: var(--text-2); }
.step-melody { display: flex; flex-direction: column; gap: var(--sp-4); }
.step-melody h2, .melody-lead { margin: 0; text-align: center; }
@media (max-width: 640px) { .melody-canvas { height: 180px; } .melody-controls { gap: var(--sp-3); } }

/* The landing's still of it: the native tune glows, the learner's line
   draws itself over it, again and again. */
.land-melody { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--sp-6); align-items: center; padding: var(--sp-6); border-radius: var(--r-xl); background: var(--surface-2); border: 1px solid var(--accent-line); position: relative; overflow: hidden; }
.land-melody h3 { margin: 0; font-size: var(--step-3); }
.land-melody p { margin: 0; color: var(--text-2); }
.land-melody > svg { width: 100%; height: auto; display: block; }
.land-melody .badge-eyebrow { align-self: flex-start; }
.land-melody .lm-private { display: flex; gap: 6px; align-items: flex-start; font-size: var(--step--1); }
.land-melody .lm-private svg { flex: none; margin-top: 3px; }
.land-melody .lm-native { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(200, 255, 77, 0.8)); opacity: 0.85; }
.land-melody .lm-mine { fill: none; stroke: #e8f4ff; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.9)); stroke-dasharray: 520; stroke-dashoffset: 520; animation: lm-draw 4.5s var(--ease-out) infinite; }
.land-melody .lm-beat { fill: var(--ok); }
.land-melody .lm-try { margin-top: var(--sp-2); }
.hero-melody { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--sp-2); padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer; text-align: left; }
.hero-melody:hover { border-color: var(--accent); }
.hero-melody:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-melody-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); flex: none; }
.land-melody .lm-live { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.land-melody .lm-next { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; padding-top: var(--sp-3); border-top: 1px solid var(--accent-line); }
.land-melody .lm-next[hidden] { display: none; }
@keyframes lm-draw { 0% { stroke-dashoffset: 520; } 60%, 100% { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .land-melody .lm-mine { animation: none; stroke-dashoffset: 0; } }
@media (max-width: 860px) { .land-melody { grid-template-columns: 1fr; padding: var(--sp-5); } .land-trainers .trainers-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .trainers-grid { grid-template-columns: 1fr; } }

/* ---- «Урок про что угодно» (views/topic.js) ---- */
.trainers-grid .trainer-topic { grid-column: 1 / -1; background: linear-gradient(120deg, var(--accent-soft), var(--surface-2) 70%); border-color: rgba(200, 255, 77, 0.35); }
.trainers-grid .trainer-topic .trainer-icon { color: var(--accent); }
.topic-input { font-size: 18px; padding-top: 14px; padding-bottom: 14px; }
.topic-words { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.topic-word {
  display: inline-flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(200, 255, 77, 0.32);
  animation: topicPop 520ms var(--ease-spring) both; animation-delay: calc(var(--i) * 90ms);
}
.topic-word strong { color: var(--text); font-size: var(--step-0); line-height: 1.2; }
.topic-word span { color: var(--text-2); font-size: var(--step--1); line-height: 1.25; }
.topic-word.is-ghost { width: 118px; height: 54px; justify-content: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); animation: topicGhost 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * 120ms); }
.topic-word.is-ghost span { display: block; height: 10px; border-radius: 6px; background: var(--line); width: 70%; }
.topic-word.is-ghost span + span { width: 45%; height: 8px; }
@keyframes topicPop { from { opacity: 0; transform: translateY(14px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes topicGhost { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.topic-forge-spark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); animation: glowBreath 1.6s ease-in-out infinite; }
.topic-ready { border-color: rgba(200, 255, 77, 0.4); }
.topic-emoji, .topic-recent-emoji { font-size: 40px; line-height: 1; }
.topic-recent-emoji { font-size: 26px; }
.topic-recent {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.topic-recent:hover { border-color: var(--line-lit); }
.topic-refused { flex-direction: row; align-items: flex-start; }
@media (prefers-reduced-motion: reduce) { .topic-word, .topic-word.is-ghost, .topic-forge-spark { animation: none; } }
.land-topic { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-6); align-items: center; padding: var(--sp-6); border-radius: var(--r-xl); background: linear-gradient(135deg, var(--accent-soft), var(--surface-2) 55%); border: 1px solid var(--accent-line); }
.land-topic h3 { margin: 0; font-size: var(--step-3); }
.land-topic p { margin: 0; color: var(--text-2); }
.land-topic-demo { display: flex; flex-direction: column; gap: var(--sp-4); }
.land-topic-ask { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 12px 14px 12px 18px; border-radius: var(--r-lg); background: var(--surface-inset); border: 1px solid var(--line); font-size: var(--step-1); font-weight: 600; }
.land-topic-typed { overflow: hidden; white-space: nowrap; border-right: 2px solid var(--accent); width: 0; animation: topicType 900ms steps(9) 200ms forwards, topicCaret 900ms step-end infinite; }
.land-topic-go { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #0b0d10; flex: none; }
@keyframes topicType { to { width: 9.2ch; } }
@keyframes topicCaret { 50% { border-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .land-topic-typed { animation: none; width: auto; } }
@media (max-width: 860px) { .land-topic { grid-template-columns: 1fr; padding: var(--sp-5); } }
/* The typing and the words wait until the card is on screen (.in, lib/motion.js). */
.js .land-topic.reveal:not(.in) .land-topic-typed, .js .land-topic.reveal:not(.in) .topic-word { animation-play-state: paused; }

/* ---- «Ловушки акцента» (views/accent.js) ---- */
.accent-traps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.accent-trap { display: flex; align-items: center; gap: var(--sp-3); }
.accent-pair { flex: none; min-width: 112px; font-family: var(--font-mono, monospace); font-size: var(--step--1); color: var(--text-2); }
.accent-good { color: var(--ok); }
.accent-weak { color: var(--warn, #ffb547); }
.accent-new { font-size: var(--step--1); }
.accent-note { font-size: var(--step--1); }
.accent-listen { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-4) 0; }
.accent-listen h2 { margin: 0; font-size: var(--step-2); }
.accent-play-btn {
  width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #0b0d10; background: var(--accent);
  box-shadow: 0 0 0 10px var(--accent-soft), 0 12px 40px rgba(200, 255, 77, 0.25);
  transition: transform var(--t) var(--ease-spring);
}
.accent-play-btn:active { transform: scale(0.94); }
.accent-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.accent-option {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  min-height: 84px; padding: var(--sp-4); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font: 700 var(--step-3)/1 var(--font-display, inherit); cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease-spring);
}
.accent-option:hover:not([disabled]) { border-color: var(--line-lit); transform: translateY(-2px); }
.accent-option .option-key { font-size: var(--step--1); }
.accent-option.is-right { border-color: var(--ok); background: rgba(74, 222, 128, 0.12); animation: optionYes 420ms var(--ease); }
.accent-option.is-wrong { border-color: var(--danger, #ff6b6b); background: rgba(255, 107, 107, 0.1); animation: optionNo 420ms var(--ease); }
.accent-option.is-dim { opacity: 0.55; }
.accent-option[disabled] { cursor: default; }
.accent-tip, .accent-heard { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0; }
.accent-tip svg, .accent-heard svg { flex: none; margin-top: 3px; }
.accent-heard { padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-inset); }
.accent-heard.is-ok { color: var(--ok); }
.accent-heard.is-bad { color: var(--warn, #ffb547); }
.accent-done h1 { font-size: clamp(3rem, 12vw, 5rem); margin: 0; line-height: 1; }
.accent-done .pill { align-self: flex-start; }
@media (max-width: 420px) { .accent-option { min-height: 72px; font-size: var(--step-2); } .accent-pair { min-width: 96px; } }
/* «Спорим?» (views/duel.js): two scores side by side. */
.duel-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-3); }
.duel-score {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--sp-4) var(--sp-3); border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
}
.duel-score small { color: var(--text-2); font-size: var(--step--1); font-weight: 600; }
.duel-score strong { font-size: clamp(2rem, 9vw, 3rem); line-height: 1.1; }
.duel-score.is-you { border-color: var(--accent-line); }
.duel-score.is-winner { background: var(--accent-soft); border-color: var(--accent); }
.duel-score.is-winner strong { color: var(--accent); }
.duel-versus { color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.duel-invite { border-color: var(--accent-line); }
/* Long labels in some languages: wrap rather than spill out of the card. */
.duel-view .btn-block, .duel-invite .btn-block { white-space: normal; height: auto; min-height: 48px; padding-block: 10px; text-align: center; line-height: 1.25; }
.accent-label { color: var(--text-2); font-size: var(--step--1); font-weight: 600; }
.topic-modes { align-self: flex-start; }
.topic-text { min-height: 160px; resize: vertical; font-size: 16px; line-height: 1.5; }
.topic-hint { margin: 0; font-size: var(--step--1); }
.topic-summary { margin: 0; }
/* A pasted text (lesson from a text) keeps its paragraphs. */
.passage { white-space: pre-line; }

/* ---- «Квест» (views/story.js) ---- */
.trainer-story .trainer-icon { background: rgba(192, 132, 252, 0.14); color: var(--lvl-c2); border-color: rgba(192, 132, 252, 0.34); }
.story-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.story-card {
  display: flex; align-items: center; gap: var(--sp-4); text-align: left;
  padding: var(--sp-4); border-radius: var(--r-lg); cursor: pointer;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.08), var(--surface-2) 60%);
  border: 1px solid var(--line); color: var(--text); font: inherit;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease-spring);
}
.story-card:hover:not([disabled]) { border-color: rgba(192, 132, 252, 0.5); transform: translateY(-2px); }
.story-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.story-card[disabled] { cursor: default; opacity: 0.6; }
.story-card.is-loading { opacity: 1; border-color: rgba(192, 132, 252, 0.6); animation: topicGhost 1.4s ease-in-out infinite; }
.story-card > svg:last-child { color: var(--text-3); flex: none; }
.story-done { align-self: flex-start; gap: 4px; margin-top: 2px; }
.story-card-emoji { font-size: 34px; line-height: 1; flex: none; }
.story-play { max-width: 720px; }
.story-top { align-items: center; }
.story-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-top .mono { flex: none; }
.story-feed { display: flex; flex-direction: column; gap: var(--sp-3); }
.story-nar { display: flex; gap: var(--sp-3); align-items: flex-start; animation: rise 420ms var(--ease-out) both; }
.story-nar p {
  margin: 0; padding: 14px 16px; border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--step-1); line-height: 1.5; color: var(--text); min-width: 0;
}
.story-nar-mark {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  font-size: 20px; background: rgba(192, 132, 252, 0.14); box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.34);
}
.story-nar.is-thinking p { font-size: var(--step-0); }
.story-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.story-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--lvl-c2); animation: typingDot 1.2s ease-in-out infinite; }
.story-dots i:nth-child(2) { animation-delay: 0.15s; }
.story-dots i:nth-child(3) { animation-delay: 0.3s; }
.story-me-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-left: 15%; animation: rise 320ms var(--ease-out) both; }
.story-me {
  padding: 12px 16px; border-radius: var(--r-lg) 4px var(--r-lg) var(--r-lg);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--text); line-height: 1.45; overflow-wrap: anywhere;
}
.story-fix {
  display: flex; flex-direction: column; gap: 2px; max-width: 100%;
  padding: 8px 12px; border-radius: var(--r-md); font-size: var(--step--1);
  background: rgba(255, 181, 71, 0.08); border: 1px dashed rgba(255, 181, 71, 0.45);
  animation: topicPop 480ms var(--ease-spring) both;
}
.story-fix strong { color: var(--text); }
.story-compose { position: sticky; bottom: var(--sp-3); z-index: 2; padding: var(--sp-3); border-radius: var(--r-lg); background: var(--ground-2); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.story-hints-label { font-size: var(--step--1); }
.story-ideas { align-self: flex-start; gap: 6px; }
.story-nar { scroll-margin-top: calc(var(--topbar-h) + var(--sp-4)); }
.story-compose .chip { max-width: 100%; white-space: normal; text-align: left; }
.story-form { display: flex; gap: var(--sp-2); align-items: flex-end; }
.story-input { flex: 1; min-width: 0; min-height: 52px; resize: none; font-size: 16px; line-height: 1.4; }
.story-mic.is-recording { color: var(--danger); border-color: var(--danger); animation: pulseBtn 1s ease-in-out infinite; }
.story-end { border-color: rgba(192, 132, 252, 0.45); background: linear-gradient(160deg, rgba(192, 132, 252, 0.1), var(--surface) 55%); }
.story-end .pill { align-self: flex-start; }
@media (max-width: 900px) { .story-compose { bottom: calc(var(--tabbar-space) + var(--sp-3)); } }
@media (max-width: 560px) {
  .story-cards { grid-template-columns: 1fr; }
  .story-nar p { font-size: var(--step-0); padding: 12px 14px; }
  .story-me-wrap { padding-left: 8%; }
  .story-nar-mark { width: 32px; height: 32px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .story-nar, .story-me-wrap, .story-fix, .story-dots i, .story-card.is-loading { animation: none; } }
.land-story { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-6); align-items: center; padding: var(--sp-6); border-radius: var(--r-xl); background: linear-gradient(135deg, rgba(192, 132, 252, 0.12), var(--surface-2) 55%); border: 1px solid rgba(192, 132, 252, 0.35); }
.land-story h3 { margin: 0; font-size: var(--step-3); }
.land-story > .stack > p { margin: 0; color: var(--text-2); }
.land-story-demo { display: flex; flex-direction: column; gap: var(--sp-3); }
.land-story-demo .story-nar p { font-size: var(--step-0); }
.land-story-demo > * { animation-delay: calc(var(--i) * 700ms); }
.js .land-story.reveal:not(.in) .land-story-demo > * { animation-play-state: paused; }
@media (max-width: 860px) { .land-story { grid-template-columns: 1fr; padding: var(--sp-5); } }

/* ---- «Урок по фото» (views/topic.js, mode 'photo') ---- */
.topic-photo-pick {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center;
  padding: var(--sp-6) var(--sp-4); border-radius: var(--r-lg); cursor: pointer;
  border: 2px dashed var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease-spring);
}
.topic-photo-pick:hover { border-color: var(--accent); transform: translateY(-2px); }
#topic-photo:focus-visible + .topic-photo-pick, #topic-photo:focus-visible ~ .topic-photo-again { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-photo-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); box-shadow: 0 0 0 8px var(--accent-soft); margin-bottom: var(--sp-2); }
.topic-photo { position: relative; display: flex; justify-content: center; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-inset); border: 1px solid var(--line); }
.topic-photo img { display: block; max-width: 100%; max-height: 340px; object-fit: contain; }
.topic-photo.is-scanning img { filter: saturate(0.75) brightness(0.8); }
.topic-photo.is-scanning::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(200, 255, 77, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(200, 255, 77, 0.09) 1px, transparent 1px);
  background-size: 28px 28px;
}
.topic-scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); box-shadow: 0 0 18px 5px rgba(200, 255, 77, 0.55); animation: topicScan 1.7s ease-in-out infinite alternate; z-index: 1; }
@keyframes topicScan { from { top: 0; } to { top: calc(100% - 3px); } }
.topic-photo-again { align-self: flex-start; gap: 6px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .topic-scan { animation: none; top: 50%; } }
.land-topic-photo { display: inline-flex; align-items: center; gap: var(--sp-2); align-self: flex-start; color: var(--accent); font-weight: 600; text-decoration: none; }
.land-topic-photo:hover span { text-decoration: underline; }
.land-topic-photo svg { flex: none; }

/* ---- «Дневник» (views/diary.js) ---- */
.trainer-diary .trainer-icon { background: rgba(255, 138, 61, 0.12); color: var(--streak); border-color: rgba(255, 138, 61, 0.32); }
/* An odd tile out at the end of a two-column grid takes the whole row. */
.trainers-grid > .trainer-tile:last-child:nth-child(even) { grid-column: 1 / -1; }
.land-trainers .trainers-grid > .land-trainer:last-child:nth-child(odd) { grid-column: 1 / -1; }
.diary-input { min-height: 150px; resize: vertical; font-size: 16px; line-height: 1.5; }
.diary-dictate { gap: 6px; }
.diary-dictate.is-recording, .diary-read-btn.is-recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulseBtn 1s ease-in-out infinite; }
.diary-count { font-size: var(--step--1); }
.diary-thinking { align-items: center; }
.diary-reply p { font-size: var(--step-0); }
.diary-better { margin: 0; font-size: var(--step-1); line-height: 1.6; color: var(--text); }
.diary-mark { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 3px; padding: 0 2px; }
.diary-legend { font-size: var(--step--1); }
.diary-mine { margin: 0; font-size: var(--step--1); line-height: 1.5; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-inset); }
.diary-fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.diary-fixes li { padding-left: var(--sp-3); border-left: 3px solid rgba(255, 181, 71, 0.6); }
.diary-read-btn { gap: 8px; }
.diary-better .sh-word.is-ok { color: var(--ok); }
.diary-better .sh-word.is-miss { color: var(--warn, #ffb547); text-decoration: underline dotted; }
.diary-entry { border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.diary-entry summary { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-4); cursor: pointer; list-style: none; }
.diary-entry summary::-webkit-details-marker { display: none; }
.diary-entry summary .dim { font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-entry p { margin: 0; padding: 0 var(--sp-4) var(--sp-4); line-height: 1.55; }
.diary-entry[open] summary .dim { display: none; }
.diary-streak { align-self: center; }
@media (max-width: 560px) { .diary-better { font-size: var(--step-0); } }
.diary-care { align-items: flex-start; border-color: rgba(255, 138, 61, 0.4); }
.diary-care p { margin: 0; }
.diary-care svg { flex: none; color: var(--streak); margin-top: 3px; }

/* "Vérifier le certificat de quelqu’un d’autre" and the Spanish one are wider
   than a 360px phone on one line: let the button wrap instead of widening the page. */
.cert-verify-row .btn { max-width: 100%; white-space: normal; height: auto; min-height: 44px; padding-block: 8px; text-align: center; line-height: 1.25; }

/* ---------------------------------------------------------------------
   «Входящий звонок» (components/phone.js, views/phone.js): the phone rings
   over whatever page is open, full screen, like a real call.
   --------------------------------------------------------------------- */
.trainers-grid .trainer-phone .trainer-icon { background: rgba(74, 222, 128, 0.14); color: var(--ok); border-color: rgba(74, 222, 128, 0.35); }
.phone-open, .phone-open body { overflow: hidden; }
.phone-layer {
  position: fixed; inset: 0; z-index: 400;
  background: radial-gradient(120% 70% at 50% 0%, #17351f 0%, #0b120d 55%, #050806 100%);
  color: #fff; overflow-y: auto; animation: phone-in .25s var(--ease, ease-out);
}
@keyframes phone-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.phone-screen {
  min-height: 100%; max-width: 440px; margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
}
.phone-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.phone-app { font-size: 13px; letter-spacing: .04em; color: rgba(255, 255, 255, .6); }
.phone-name { margin: 0; font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 700; letter-spacing: -.01em; }
.phone-sub { color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.phone-avatar { position: relative; width: 132px; height: 132px; margin-top: 8px; }
.phone-face {
  position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; font-size: 60px; background: linear-gradient(160deg, #2b4b33, #14251a);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 20px 50px -18px rgba(0, 0, 0, .8);
}
.phone-avatar.is-ringing::before, .phone-avatar.is-ringing::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(74, 222, 128, .55);
  animation: phone-ripple 1.8s ease-out infinite;
}
.phone-avatar.is-ringing::after { animation-delay: .9s; }
.phone-avatar.is-ringing .phone-face { animation: phone-shake 3s ease-in-out infinite; }
@keyframes phone-ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes phone-shake { 0%, 30%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-6deg); } 10%, 20% { transform: rotate(6deg); } }
.phone-wave { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); display: flex; gap: 4px; height: 18px; align-items: flex-end; opacity: 0; transition: opacity .2s; }
.phone-wave i { width: 4px; height: 6px; border-radius: 2px; background: var(--ok, #4ade80); }
.phone-avatar.is-speaking .phone-wave { opacity: 1; }
.phone-avatar.is-speaking .phone-wave i { animation: phone-bar .7s ease-in-out infinite; }
.phone-avatar.is-speaking .phone-wave i:nth-child(2) { animation-delay: .1s; }
.phone-avatar.is-speaking .phone-wave i:nth-child(3) { animation-delay: .25s; }
.phone-avatar.is-speaking .phone-wave i:nth-child(4) { animation-delay: .4s; }
.phone-avatar.is-speaking .phone-wave i:nth-child(5) { animation-delay: .15s; }
@keyframes phone-bar { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.phone-mid { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }
.phone-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: rgba(255, 255, 255, .75); font-weight: 600; }
.phone-status.is-you { color: var(--ok, #4ade80); }
.phone-status.is-you svg { animation: phone-pulse 1.2s ease-in-out infinite; }
@keyframes phone-pulse { 50% { opacity: .35; } }
.phone-lines { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.phone-line { margin: 0; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .08); font-size: 17px; line-height: 1.4; }
.phone-heard { margin: 0; min-height: 1.4em; font-size: 20px; font-weight: 600; color: #fff; }
.phone-hint { margin: 0; color: rgba(255, 255, 255, .7); }
.phone-hint span:first-child { color: var(--accent, #c8ff4d); font-weight: 600; }
.phone-ring-actions { width: 100%; display: flex; justify-content: space-around; margin-top: auto; }
.phone-ring-labels { width: 100%; display: flex; justify-content: space-around; color: rgba(255, 255, 255, .7); font-size: 14px; margin-top: -12px; }
.phone-btn {
  width: 74px; height: 74px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer;
  transition: transform .15s var(--ease-spring, ease);
}
.phone-btn:active { transform: scale(.92); }
.phone-btn svg { width: 34px; height: 34px; }
.phone-brief { margin: 0; max-width: 32ch; color: rgba(255, 255, 255, .8); font-size: 17px; line-height: 1.45; }
.phone-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.phone-btn.is-accept { background: #22c55e; animation: phone-bounce 1.2s ease-in-out infinite; }
.phone-btn.is-decline { background: #ef4444; }
.phone-btn.is-hangup { margin: 0 auto; }
@keyframes phone-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.phone-controls { width: 100%; margin-top: auto; }
.phone-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.phone-tool {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; border: 0;
  background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.phone-tool.is-on { background: rgba(255, 255, 255, .22); }
.phone-tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.phone-type { display: flex; gap: 8px; }
.phone-type .input { flex: 1; min-width: 0; }
.phone-end { width: 100%; text-align: left; }
.phone-end h2 { margin: 0; font-size: clamp(1.7rem, 7vw, 2.2rem); }
.phone-end .muted, .phone-end .dim { color: rgba(255, 255, 255, .7); }
.phone-end .pill { align-self: flex-start; }
.phone-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.phone-review li { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.phone-review-line { font-size: 14px; }
.phone-better { color: var(--accent, #c8ff4d); font-weight: 600; }
.phone-end .btn-ghost { color: #fff; }
.phone-callers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); }
.phone-caller-face { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; font-size: 28px; background: var(--surface-2); border: 1px solid var(--line); }
.phone-level { align-self: flex-start; }
.phone-surprise { border-color: rgba(74, 222, 128, .35); }
.phone-note { display: flex; align-items: center; gap: 6px; font-size: var(--step--1); }

/* «Дубляж» (views/dub.js): the cartoon is a 9:16 canvas, as tall as fits. */
.trainers-grid .trainer-dub .trainer-icon { background: rgba(255, 150, 80, 0.14); color: var(--streak, #ff9650); border-color: rgba(255, 150, 80, 0.35); }
.dub-stage { max-width: 520px; margin-inline: auto; }
.dub-screen { display: flex; justify-content: center; }
.dub-screen canvas, .dub-screen video {
  height: min(62vh, 640px); max-width: 100%; aspect-ratio: 9 / 16; width: auto;
  border-radius: 22px; background: #0b0d10; box-shadow: 0 0 0 1px var(--line), 0 24px 60px -24px rgba(0, 0, 0, .8);
}
.dub-stage.is-take canvas { height: min(42vh, 500px); }
.dub-line { margin: 0; font-size: var(--step-1); font-weight: 700; text-align: center; }
.dub-meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; opacity: .4; }
.dub-meter.is-on { opacity: 1; }
.dub-meter span { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform .08s linear; }
.dub-score { margin: 0; text-align: center; }
.dub-score strong { font-size: var(--step-2); color: var(--accent); margin-right: 6px; }
.dub-faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.dub-face { padding: 0; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); overflow: hidden; cursor: pointer; aspect-ratio: 5 / 6; }
.dub-face svg { width: 100%; height: 100%; display: block; }
.dub-face.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dub-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The people of data/cast.js (components/cast.js): the face in a call. */
.phone-face svg { width: 100%; height: 100%; display: block; }
.phone-face { overflow: hidden; }
.phone-caller-face svg { width: 120%; height: 120%; margin-top: 8%; display: block; }
.phone-caller-face { overflow: hidden; }
.phone-bio { font-size: var(--step--1); margin-top: calc(-1 * var(--sp-2)); }
.cast-live .cast-m { display: none; }
.cast-live[data-mouth="0"] .cast-m0, .cast-live[data-mouth="1"] .cast-m1, .cast-live[data-mouth="2"] .cast-m2 { display: inline; }
.cast-live .cast-eyes { transform-box: fill-box; transform-origin: center; animation: cast-blink 4.2s infinite; }
@keyframes cast-blink { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(.08); } }
@media (prefers-reduced-motion: reduce) { .cast-live .cast-eyes { animation: none; } }
/* The landing's call and cartoon cards (views/landing.js castCards). */
.land-cast { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-6); align-items: center; padding: var(--sp-6); border-radius: var(--r-xl, 28px); background: var(--surface); border: 1px solid var(--line); }
.land-phone {
  justify-self: center; width: min(280px, 100%); padding: 22px 18px 20px; border-radius: 34px; color: #fff; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, #17351f 0%, #0b120d 60%, #050806 100%);
  box-shadow: 0 0 0 6px #10141a, 0 30px 60px -26px rgba(0,0,0,.9); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.land-phone .phone-avatar { width: 112px; height: 112px; margin: 10px 0 4px; }
.land-phone-name { font-size: 1.8rem; }
.land-phone-sub { color: rgba(255,255,255,.7); font-size: 14px; }
.land-phone-line { margin: 6px 0 4px; font-size: 15px; color: rgba(255,255,255,.88); }
.land-phone-actions { display: flex; justify-content: space-around; width: 100%; }
.land-phone-actions .phone-btn { width: 58px; height: 58px; cursor: default; }
.land-phone-actions .phone-btn svg { width: 26px; height: 26px; }
.land-dub {
  justify-self: center; position: relative; width: min(260px, 100%); aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden;
  background: linear-gradient(#5a3b2b, #2a1a12); box-shadow: 0 30px 60px -26px rgba(0,0,0,.9);
}
.land-dub-mark { position: absolute; left: 14px; top: 12px; color: #fff; font-weight: 900; font-size: 14px; }
.land-dub-mark b { color: var(--accent); }
.land-dub-sub { position: absolute; left: 10px; right: 10px; top: 26%; margin: 0; text-align: center; color: #fff; font-weight: 800; font-size: 19px; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.7); }
.land-dub-sub b { color: var(--accent); }
.land-dub-people { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; display: flex; align-items: flex-end; justify-content: space-around; background: linear-gradient(transparent 76%, #8b5a3c 76%); }
.land-dub-face { position: relative; width: 64%; margin: 0 -9%; }
.land-dub-face svg { width: 100%; display: block; }
.land-dub-face.is-you svg { transform: scaleX(-1); }
.land-dub-face i { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-style: normal; font-weight: 800; font-size: 11px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.92); color: #0b0d10; }
.land-dub-face.is-you i { background: var(--accent); }
@media (max-width: 760px) { .land-cast { grid-template-columns: 1fr; padding: var(--sp-5); } }
.phone-end-face { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #2b4b33, #14251a); }
.phone-end-face svg { width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------------------
   «Паспорт акцента» (views/passport.js)
   --------------------------------------------------------------------------- */
.pass-steps { display: flex; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.pass-steps li {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-3); font-size: var(--step--2); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pass-steps li.is-now { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.pass-steps li.is-done { color: var(--text-2); }
.pass-step-num {
  flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-2); font-size: 11px;
}
.pass-steps li.is-now .pass-step-num { background: var(--accent); color: var(--text-on-accent); }
.pass-steps li.is-done .pass-step-num { background: var(--ok); color: #04150d; }
.pass-steps .icon { width: 12px; height: 12px; }

.pass-plan { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.pass-plan li { display: flex; align-items: flex-start; gap: var(--sp-3); }
.pass-plan .dim { font-size: var(--step--1); }
.pass-label { font-size: var(--step--1); }
.pass-faces { max-width: 340px; }
.pass-private { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: var(--step--1); }
.pass-private .icon { flex: none; margin-top: 2px; color: var(--accent); }
.pass-friend { align-items: center; }

.pass-history { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pass-history li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3); font-size: var(--step--1); }
.pass-history strong { min-width: 2.2em; text-align: right; }

/* The mouth: four words, then what the recogniser wrote under each. */
.pass-words { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.pass-word {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  min-width: 0; text-align: center;
}
.pass-word strong { font-size: clamp(1.1rem, 5vw, 1.6rem); letter-spacing: -0.02em; }
.pass-word-heard { display: inline-flex; align-items: center; gap: 4px; font-size: var(--step--1); font-weight: 700; max-width: 100%; }
.pass-word-heard span { overflow-wrap: anywhere; line-height: 1.2; }
.pass-word.is-ok { border-color: rgba(62, 224, 160, 0.45); background: rgba(62, 224, 160, 0.08); }
.pass-word.is-ok .pass-word-heard { color: var(--ok); }
.pass-word.is-bad { border-color: rgba(255, 95, 87, 0.5); background: rgba(255, 95, 87, 0.08); }
.pass-word.is-bad .pass-word-heard { color: #ff8a80; }
.pass-mic { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; text-align: center; }
.pass-mic .mic-btn { width: 84px; height: 84px; }
.pass-mic .mic-hint { min-height: 2.8em; max-width: 30ch; margin: 0; overflow-wrap: anywhere; }
.pass-heard-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--text-2); font-size: var(--step--1); }
.pass-heard-note .icon { flex: none; margin-top: 2px; color: var(--info); }
.pass-actions { align-items: center; justify-content: space-between; }
.pass-none .input { min-width: 0; font-size: 16px; }

/* The passport page. */
.passport {
  position: relative;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.passport-top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 12px 18px; background: var(--accent); color: var(--text-on-accent);
}
.passport-kind { font-weight: var(--w-display); font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase; min-width: 0; overflow-wrap: anywhere; }
.passport-brand { font-weight: 700; font-size: var(--step--1); }
.passport-body {
  position: relative;
  display: grid; grid-template-columns: minmax(92px, 132px) 1fr; gap: var(--sp-4);
  padding: 18px 18px 8px;
}
.passport-photo {
  aspect-ratio: 5 / 6; border-radius: 16px; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line);
}
.passport-photo svg { width: 100%; height: 100%; display: block; }
.passport-fields { display: grid; gap: 10px; margin: 0; align-content: start; padding-right: 92px; }
.passport-fields div { min-width: 0; }
.passport-fields dt { color: var(--text-3); font-size: var(--step--2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.passport-fields dd { margin: 2px 0 0; font-size: var(--step-2); font-weight: 700; line-height: 1.1; }
.passport-fields dd.is-date { font-size: var(--step-0); white-space: nowrap; }
.passport-stamp {
  position: absolute; right: 14px; top: 18px;
  width: 92px; height: 92px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 4px solid var(--accent); color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface-2), inset 0 0 0 6px var(--accent-line);
  transform: rotate(-12deg);
  animation: pass-stamp 520ms var(--ease-spring) both 180ms;
}
.passport-stamp small { font-size: 9px; font-weight: var(--w-display); letter-spacing: 0.08em; text-transform: uppercase; max-width: 70px; text-align: center; line-height: 1.1; }
.passport-stamp strong { font-size: 2rem; line-height: 1; }
@keyframes pass-stamp {
  from { opacity: 0; transform: rotate(-24deg) scale(1.8); }
  to { opacity: 1; transform: rotate(-12deg) scale(1); }
}
.passport-sounds { width: calc(100% - 36px); margin: 6px 18px 0; border-collapse: collapse; font-size: var(--step--1); }
.passport-sounds th, .passport-sounds td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.passport-sounds thead th { border-top: 0; color: var(--text-3); font-size: var(--step--2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.passport-sounds th:first-child { text-align: left; }
.passport-sounds tbody th { font-weight: 700; }
.passport-sounds tbody th .mono { color: var(--accent); font-weight: 500; margin-right: 4px; }
.pass-yes, .pass-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; }
.pass-yes { background: rgba(62, 224, 160, 0.16); color: var(--ok); }
.pass-no { background: rgba(255, 95, 87, 0.16); color: var(--danger); }
.passport-as { display: block; margin-top: 2px; color: #ff8a80; font-weight: 700; font-size: var(--step--2); }
.passport-mrz {
  margin: 10px 18px 16px; padding-top: 10px; border-top: 1px dashed var(--line-2);
  color: var(--text-3); font-size: clamp(8px, 2.5vw, 12px); letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden;
}
.pass-how { margin: 0; font-size: var(--step--1); }
.pass-progress { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; }
.pass-progress.is-up { color: var(--ok); }
.pass-progress.is-down { color: var(--text-2); }
.pass-share { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.pass-next .btn, .pass-share .btn { white-space: normal; text-align: center; line-height: 1.25; }
.pass-again { align-self: center; }
.pass-from { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
@media (max-width: 420px) {
  .pass-share { grid-template-columns: 1fr; }
  .passport-body { grid-template-columns: 96px 1fr; gap: var(--sp-3); padding: 14px 14px 6px; }
  .passport-fields { padding-right: 76px; }
  .passport-stamp { width: 76px; height: 76px; right: 10px; top: 14px; }
  .passport-stamp strong { font-size: 1.6rem; }
  .passport-stamp small { font-size: 8px; max-width: 58px; }
  .passport-sounds { width: calc(100% - 28px); margin: 4px 14px 0; }
  .passport-mrz { margin: 8px 14px 14px; }
  .pass-steps li { padding: 6px 8px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .passport-stamp { animation: none; } }

/* The landing's way in: under the hero's buttons, and the tile a guest can open. */
.lx-pass-link {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 9px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--accent-line);
  color: var(--text); font-weight: 700; font-size: var(--step--1);
  max-width: 100%;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease);
}
.lx-pass-link:hover { background: var(--surface-2); transform: translateY(-1px); }
.lx-pass-link > span:not(.lx-pass-icon) { min-width: 0; }
.lx-pass-icon { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); }
.lx-tile.is-open { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
