/* Full-screen activities: lesson player and results */

body.is-focus .tabbar, body.is-focus .rail, body.is-focus .topbar { display: none; }
body.is-focus .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; grid-template-areas: "main"; }
body.is-focus { background: var(--surface); }
.view.view--focus { max-width: calc(720px + 2 * var(--gutter)); padding: 0 var(--gutter); }

.lp { display: flex; flex-direction: column; min-height: 100dvh; }

/* ---------- Top bar ---------- */
.lp__top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--s-3);
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
  background: var(--surface);
}
.lp__close { --c: transparent; font-weight: 900; color: var(--text-muted); }
.lp__progress { flex: 1; height: 16px; --c: var(--cactus); }
.lp__combo { min-width: 54px; text-align: right; font-family: var(--font-display); font-weight: 800; }
.lp__flame { color: var(--coral-ink); animation: pop-in 300ms var(--ease-bounce); display: inline-block; }
.lp__xp { color: color-mix(in oklab, var(--sunny) var(--tint), var(--text)); }

/* ---------- Question ---------- */
.lp__body { flex: 1; padding: var(--s-3) 0 var(--s-6); animation: q-in 260ms var(--ease-out); }
@keyframes q-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.q-head { margin-bottom: var(--s-4); }
.q-head__tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--c) 15%, var(--surface));
  color: color-mix(in oklab, var(--c) var(--tint), var(--text));
  font-weight: 800; font-size: .85rem;
}
.q-head__title { font-size: var(--step-3); margin: var(--s-2) 0 0; outline: none; }

.prompt { display: flex; align-items: flex-end; gap: var(--s-2); margin-bottom: var(--s-5); }
.prompt__taco { margin-bottom: -6px; }
.prompt__bubble {
  position: relative; flex: 1; min-width: 0;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4);
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
.prompt__bubble::before {
  content: ""; position: absolute; left: -9px; bottom: 22px; width: 14px; height: 14px;
  background: var(--surface); border: 2px solid var(--border); border-top: 0; border-right: 0;
  transform: rotate(45deg);
}
.prompt__text { flex: 1; min-width: 0; }
.prompt__es { margin: 0; font-size: var(--step-2); line-height: 1.25; }
.prompt__en { margin: 6px 0 0; color: var(--text-2); }
.prompt .pron { margin: 4px 0 0; }

.blank {
  display: inline-block; min-width: 3.5em; margin: 0 4px;
  border-bottom: 3px solid var(--border);
  text-align: center; color: var(--link);
  transition: color var(--dur), border-color var(--dur);
}
.blank.is-filled { border-color: var(--lagoon); }
.blank.is-right { color: var(--cactus-ink); border-color: var(--cactus); }
.blank.is-fixed { color: var(--coral-ink); border-color: var(--coral); }

.speak-btn {
  --c: var(--lagoon);
  flex: none; display: grid; place-items: center;
  width: 54px; height: 54px; border: 0; border-radius: var(--r-sm);
  background: var(--c); color: var(--on-lagoon);
  box-shadow: 0 4px 0 color-mix(in oklab, var(--c) 72%, black);
  transition: transform var(--dur-fast);
}
.speak-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in oklab, var(--c) 72%, black); }
.speak-btn svg { width: 28px; height: 28px; }
.speak-btn--slow { --c: color-mix(in oklab, var(--sunny) 88%, black); width: 42px; height: 42px; font-size: 1.2rem; }
.speak-btn--sm { width: 38px; height: 38px; box-shadow: 0 3px 0 color-mix(in oklab, var(--c) 72%, black); }
.speak-btn--sm svg { width: 20px; height: 20px; }

/* ---------- Answer tiles ---------- */
.choices { display: grid; gap: var(--s-3); }
.choices--grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice {
  --edge: var(--border);
  --tint: var(--surface);
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 60px; width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--edge); border-radius: var(--r-md);
  background: var(--tint); color: var(--text);
  box-shadow: 0 4px 0 var(--edge);
  font-size: 1.05rem; font-weight: 700; text-align: left;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast), opacity var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.choices--grid .choice { justify-content: center; font-family: var(--font-display); font-size: 1.2rem; }
.choice:hover:not(:disabled) { background: color-mix(in oklab, var(--tint) 92%, var(--text)); }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.choice__num {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--border);
  font-size: .85rem; font-weight: 800; color: var(--text-muted);
}
.choices--grid .choice__num { display: none; }
.choice.is-selected { --edge: var(--lagoon); --tint: color-mix(in oklab, var(--lagoon) 12%, var(--surface)); }
.choice.is-selected .choice__num { background: var(--lagoon); border-color: var(--lagoon); color: #fff; }
.choice.is-correct { --edge: var(--cactus); --tint: color-mix(in oklab, var(--cactus) 14%, var(--surface)); }
.choice.is-correct .choice__num { background: var(--cactus); border-color: var(--cactus); color: #fff; }
.choice.is-wrong { --edge: var(--coral); --tint: color-mix(in oklab, var(--coral) 12%, var(--surface)); animation: shake 380ms; }
.choice.is-wrong .choice__num { background: var(--coral); border-color: var(--coral); color: #fff; }
.choice.is-dimmed { opacity: .45; }
.choice:disabled { cursor: default; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.match__col { display: grid; gap: var(--s-3); align-content: start; }
.choice--match { justify-content: center; text-align: center; min-height: 72px; font-size: 1rem; }
.choice--match[lang="es"] { font-family: var(--font-display); font-size: 1.1rem; }
.choice.is-matched { opacity: .5; box-shadow: 0 2px 0 var(--edge); }

/* ---------- Bottom bar ---------- */
.lp__bar {
  position: sticky; bottom: 0; z-index: 5;
  padding: var(--s-4) 0 max(var(--s-4), env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 2px solid var(--border-light);
  /* Colour reaches the screen edges on wide windows */
  box-shadow: 0 0 0 100vmax var(--surface);
  clip-path: inset(0 -100vmax);
}
.lp__bar--right { --bar: color-mix(in oklab, var(--cactus) 16%, var(--surface)); background: var(--bar); box-shadow: 0 0 0 100vmax var(--bar); border-color: transparent; animation: bar-up 220ms var(--ease-out); }
.lp__bar--wrong { --bar: color-mix(in oklab, var(--coral) 14%, var(--surface)); background: var(--bar); box-shadow: 0 0 0 100vmax var(--bar); border-color: transparent; animation: bar-up 220ms var(--ease-out); }
@keyframes bar-up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.lp__hint { margin: 0; text-align: center; color: var(--text-2); font-weight: 600; }

.feedback { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.feedback__text { flex: 1 1 260px; min-width: 0; }
.feedback__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); line-height: 1.2; }
.lp__bar--right .feedback__title { color: color-mix(in oklab, var(--cactus) var(--tint), var(--text)); }
.lp__bar--wrong .feedback__title { color: color-mix(in oklab, var(--coral) var(--tint), var(--text)); }
.feedback__combo { font-size: .9rem; color: var(--coral-ink); margin-left: 6px; }
.feedback__detail { margin: 4px 0 0; }
.feedback__btn { flex: 1 1 200px; }

/* ---------- Results ---------- */
.lp--done { justify-content: center; }
.results { display: grid; gap: var(--s-5); padding: var(--s-6) 0 var(--s-7); animation: q-in 300ms var(--ease-out); }
.results__hero { display: grid; justify-items: center; text-align: center; }
.results__hero h1 { margin: var(--s-2) 0 0; font-size: var(--step-5); outline: none; }
.results__hero p { margin: 0; }
.results__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.result-tile {
  display: grid; justify-items: center; gap: 2px;
  padding: var(--s-3);
  border: 2px solid var(--c); border-radius: var(--r-md);
  background: color-mix(in oklab, var(--c) 10%, var(--surface));
}
.result-tile span { font-size: .8rem; font-weight: 800; color: color-mix(in oklab, var(--c) var(--tint), var(--text)); }
.result-tile strong { font-family: var(--font-display); font-size: clamp(1.15rem, 4.6vw, var(--step-3)); line-height: 1.1; white-space: nowrap; }
.results__note { margin: 0; text-align: center; font-weight: 700; color: color-mix(in oklab, var(--sunny) var(--tint), var(--text)); }
.results__phrases { padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.results__phrases h2 { font-size: var(--step-1); }
.results__phrases ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.results__phrases li { display: flex; align-items: center; gap: var(--s-3); }
.results__actions { display: grid; gap: var(--s-3); }

/* Message screens (not found / locked) */
.lp--message { justify-content: center; }
.lp__message { display: grid; justify-items: center; gap: var(--s-3); text-align: center; padding: var(--s-7) 0; }
.lp__message-emoji { font-size: 3.5rem; margin: 0; }
.lp__message h1 { margin: 0; font-size: var(--step-4); }
.lp__message p { margin: 0; }

@media (max-width: 420px) {
  .prompt__taco { display: none; }
  .prompt__bubble::before { display: none; }
  .q-head__title { font-size: var(--step-2); }
  .results__hero h1 { font-size: var(--step-4); }
  .result-tile { padding: var(--s-3) var(--s-2); }
}
