/* Camino Español — mobile-first, Camino Barcelona brand */
:root {
  --brand: #FD7900;
  --brand-dark: #E1580B;
  --brand-light: #FFEDE3;
  --bg: #FFF8F0;
  --card: #FFFFFF;
  --ink: #212121;
  --ink-soft: #8A857D;
  --line: #EDE5DA;
  --sun: #FFDA01;
  --green: #58CC02;
  --green-dark: #46A302;
  --red: #FF4B4B;
  --red-dark: #E03B3B;
  --blue: #1CB0F6;
  --blue-dark: #1899D6;
  --gold: #FFC800;
  --purple: #CE82FF;
  --radius: 16px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: block; width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 17px; font-weight: 800; text-align: center;
  text-transform: uppercase; letter-spacing: .4px;
  color: #fff; background: var(--brand);
  box-shadow: 0 4px 0 var(--brand-dark);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--brand-dark); }
.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.btn.green:active { box-shadow: 0 0 0 var(--green-dark); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dark); }
.btn.blue:active { box-shadow: 0 0 0 var(--blue-dark); }
.btn.red { background: var(--red); box-shadow: 0 4px 0 var(--red-dark); }
.btn.red:active { box-shadow: 0 0 0 var(--red-dark); }
.btn.ghost {
  background: var(--card); color: var(--brand);
  border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
}
.btn.ghost:active { box-shadow: 0 0 0 var(--line); }
.btn:disabled { filter: grayscale(.7) opacity(.6); pointer-events: none; }

/* ---------- Top stats bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.stat { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 16px; }
.stat .ico { font-size: 20px; }
.stat.streak { color: #FF9600; }
.stat.gems { color: var(--blue); }
.stat.hearts { color: var(--red); }
.stat.xp { color: var(--gold); }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 2px solid var(--line);
  padding: 6px 0 calc(6px + var(--safe-bottom));
}
.bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 22px; padding: 6px 0; border-radius: 12px; opacity: .55;
}
.bottomnav button span { font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.bottomnav button.active { opacity: 1; background: var(--brand-light); }
.bottomnav button.active span { color: var(--brand); }

.screen { padding: 16px 16px calc(var(--nav-h) + var(--safe-bottom) + 24px); }
/* Screens without the top bar have to keep clear of the notch themselves */
.auth-screen { padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); min-height: 100vh; }

/* ---------- Path (home) ---------- */
.unit-header {
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; padding: 16px; margin: 20px 0 8px;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.unit-header .uh-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.unit-header .uh-title { font-size: 18px; font-weight: 900; margin-top: 2px; }
.unit-header .uh-sub { font-size: 13px; opacity: .9; margin-top: 2px; }
.unit-header.locked { background: #CFC8BE; box-shadow: 0 4px 0 #B8B0A4; }

.path-nodes { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.path-node {
  width: 74px; height: 68px; margin: 10px 0;
  border-radius: 50% / 46%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: var(--green); box-shadow: 0 6px 0 var(--green-dark);
  transition: transform .06s;
  position: relative;
}
.path-node:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--green-dark); }
.path-node.done { background: var(--gold); box-shadow: 0 6px 0 #D9A800; }
.path-node.locked { background: #E3DCD2; box-shadow: 0 6px 0 #CFC8BE; filter: grayscale(1); pointer-events: none; }
.path-node.current::after {
  content: attr(data-here); position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  background: var(--card); color: var(--brand); border: 2px solid var(--line);
  font-size: 10px; font-weight: 900; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 8px; white-space: nowrap;
  animation: bounce 1.4s infinite;
}
@keyframes bounce { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,-5px);} }
.path-node .crown {
  position: absolute; bottom: -4px; right: -4px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 50%; font-size: 12px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.path-offset-l { transform: translateX(-44px); }
.path-offset-r { transform: translateX(44px); }
.path-offset-l:active, .path-offset-r:active { transform: translateX(var(--tx,0)) translateY(4px); }
.path-offset-l { --tx: -44px; } .path-offset-r { --tx: 44px; }

/* ---------- Lesson ---------- */
.lesson-top {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.lesson-top .close, .voice-top .close { font-size: 22px; color: var(--ink-soft); font-weight: 900; padding: 4px 8px; }
.progressbar { flex: 1; height: 14px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progressbar .fill {
  height: 100%; width: 0%;
  background: var(--green); border-radius: 8px;
  transition: width .4s cubic-bezier(.3,1.4,.5,1);
}
.lesson-hearts { font-weight: 900; color: var(--red); font-size: 16px; }

.exercise { padding: 8px 16px calc(140px + var(--safe-bottom)); }
.ex-prompt { font-size: 20px; font-weight: 900; margin: 10px 0 16px; }
.ex-sentence {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 600; margin-bottom: 20px; flex-wrap: wrap;
}
.speaker-btn {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: var(--blue); color: #fff; font-size: 20px;
  box-shadow: 0 3px 0 var(--blue-dark);
}
.speaker-btn:active { transform: translateY(3px); box-shadow: none; }
.speaker-btn.big { width: 100px; height: 84px; font-size: 40px; border-radius: 20px; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-size: 17px; font-weight: 600; text-align: left;
  transition: transform .06s;
}
.choice:active { transform: translateY(3px); box-shadow: none; }
.choice.selected { border-color: var(--blue); box-shadow: 0 3px 0 var(--blue); background: #EAF7FE; color: var(--blue-dark); }
.choice.correct { border-color: var(--green); box-shadow: 0 3px 0 var(--green); background: #EAFBDC; }
.choice.wrong { border-color: var(--red); box-shadow: 0 3px 0 var(--red); background: #FFECEC; }
.choices.grid2 { display: grid; grid-template-columns: 1fr 1fr; }

/* word bank */
.wb-answer {
  min-height: 56px; display: flex; flex-wrap: wrap; gap: 8px;
  border-bottom: 2px solid var(--line); padding: 8px 2px; margin-bottom: 24px;
}
.wb-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wb-chip {
  padding: 10px 14px; border-radius: 12px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  font-size: 16px; font-weight: 700;
}
.wb-chip:active { transform: translateY(3px); box-shadow: none; }
.wb-chip.used { opacity: 0; pointer-events: none; }

/* match pairs */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-grid .choice { text-align: center; }
.choice.matched { opacity: .35; pointer-events: none; border-color: var(--green); }

/* type answer */
.type-input {
  width: 100%; padding: 14px; font-size: 18px; font-family: inherit;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
.type-input:focus { outline: none; border-color: var(--blue); }

/* grammar tip card */
.tip-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; font-size: 16px; line-height: 1.55;
}
.tip-card h3 { color: var(--brand); margin-bottom: 10px; font-size: 18px; }
.tip-card table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.tip-card td { border: 1px solid var(--line); padding: 6px 10px; font-size: 15px; }
.tip-card .es { color: var(--brand-dark); font-weight: 800; }

/* feedback footer */
.lesson-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  background: var(--card); border-top: 2px solid var(--line);
}
.lesson-footer.ok { background: #EAFBDC; border-color: #C8EFA8; }
.lesson-footer.bad { background: #FFECEC; border-color: #FFC9C9; }
.fb-title { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.fb-title.ok { color: var(--green-dark); }
.fb-title.bad { color: var(--red-dark); }
.fb-sub { font-size: 15px; margin-bottom: 12px; color: var(--ink-soft); }

/* lesson complete */
.complete { text-align: center; padding: 60px 24px; }
.complete .big-emoji { font-size: 76px; animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(.2);} 100% { transform: scale(1);} }
.complete h2 { font-size: 26px; font-weight: 900; color: var(--brand); margin: 12px 0 20px; }
.reward-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 28px; }
.reward-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; min-width: 90px;
}
.reward-card .rc-label { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--ink-soft); }
.reward-card .rc-value { font-size: 22px; font-weight: 900; margin-top: 4px; }
.reward-card.xp .rc-value { color: var(--gold); }
.reward-card.acc .rc-value { color: var(--green); }
.reward-card.time .rc-value { color: var(--blue); }

/* ---------- Cards / lists ---------- */
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.card h3 { font-size: 16px; margin-bottom: 8px; }
.section-title { font-size: 20px; font-weight: 900; margin: 18px 0 12px; }

/* quests */
.quest { display: flex; align-items: center; gap: 12px; }
.quest .q-ico { font-size: 30px; }
.quest .q-body { flex: 1; }
.quest .q-name { font-weight: 800; font-size: 15px; }
.quest .q-bar { height: 12px; background: var(--line); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.quest .q-bar .fill { height: 100%; background: var(--gold); border-radius: 6px; transition: width .4s; }
.quest .q-progress { font-size: 12px; color: var(--ink-soft); margin-top: 3px; font-weight: 700; }
.quest .q-reward { font-weight: 900; color: var(--blue); font-size: 14px; white-space: nowrap; }
.quest.done { opacity: .6; }

/* league */
.league-head { text-align: center; margin-bottom: 16px; }
.league-head .trophy { font-size: 56px; }
.league-head h2 { font-size: 22px; font-weight: 900; color: var(--brand); }
.league-head p { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 4px;
  background: var(--card); border: 2px solid transparent;
}
.lb-row.me { border-color: var(--brand); background: var(--brand-light); }
.lb-row .lb-rank { width: 26px; font-weight: 900; color: var(--ink-soft); text-align: center; }
.lb-row .lb-rank.promo { color: var(--green); }
.lb-row .lb-rank.demote { color: var(--red); }
.lb-row .lb-avatar { font-size: 26px; }
.lb-row .lb-name { flex: 1; font-weight: 700; font-size: 15px; }
.lb-row .lb-xp { font-weight: 900; color: var(--gold); font-size: 14px; }
.lb-zone {
  text-align: center; font-size: 11px; font-weight: 900; letter-spacing: 1px;
  margin: 10px 0 6px;
}
.lb-zone.promo { color: var(--green); }
.lb-zone.demote { color: var(--red); }

/* profile */
.profile-head { text-align: center; padding: 10px 0 18px; }
.profile-head .avatar { font-size: 64px; }
.profile-head h2 { font-size: 22px; font-weight: 900; margin-top: 6px; }
.profile-head p { color: var(--ink-soft); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.stat-card .sc-ico { font-size: 26px; }
.stat-card .sc-value { font-size: 18px; font-weight: 900; }
.stat-card .sc-label { font-size: 11px; color: var(--ink-soft); font-weight: 700; }

/* badges */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; text-align: center;
}
.badge .b-ico { font-size: 34px; }
.badge .b-name { font-size: 11px; font-weight: 800; margin-top: 6px; }
.badge .b-what { font-size: 9px; color: var(--ink-soft); margin-top: 3px; line-height: 1.25; }
.badge .b-desc { font-size: 10px; color: var(--brand-dark); font-weight: 800; margin-top: 3px; }
.badge .b-bar { height: 5px; background: var(--line); border-radius: 3px; margin: 5px 6px 0; overflow: hidden; }
.badge .b-bar .fill { height: 100%; background: var(--gold); border-radius: 3px; }
.badge .b-progress { font-size: 9px; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }
.badge.locked { filter: grayscale(1); opacity: .45; }
.badge.earned { border-color: var(--gold); box-shadow: 0 0 0 2px #FFEDAD; }

/* ---------- Modal / toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(60,58,54,.55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--card); border-radius: 20px; padding: 24px;
  width: 100%; max-width: 380px; text-align: center;
  animation: pop .35s cubic-bezier(.3,1.6,.5,1);
}
.modal .m-emoji { font-size: 60px; }
.modal h2 { font-size: 21px; font-weight: 900; margin: 10px 0 6px; }
.modal p { color: var(--ink-soft); font-size: 15px; line-height: 1.5; margin-bottom: 18px; }

#toast-root { position: fixed; top: calc(16px + var(--safe-top)); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 14px;
  animation: toast-in 3s forwards;
}
@keyframes toast-in {
  0% { opacity: 0; transform: translateY(-14px); }
  8%, 85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-14px); }
}

/* ---------- Onboarding ---------- */
.onb { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(32px + var(--safe-top)) 24px calc(32px + var(--safe-bottom)); text-align: center; }
.onb .logo { font-size: 72px; }
.onb h1 { font-size: 28px; font-weight: 900; color: var(--brand); margin: 14px 0 8px; }
.onb p { color: var(--ink-soft); font-size: 16px; line-height: 1.5; margin-bottom: 26px; }
.onb .choices { text-align: left; margin-bottom: 20px; }
.onb .brand-note { font-size: 12px; color: var(--ink-soft); margin-top: 22px; }

/* streak calendar */
.streak-cal { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.streak-day { width: 34px; text-align: center; }
.streak-day .d-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 15px; }
.streak-day.lit .d-dot { background: #FFE1B8; }
.streak-day .d-label { font-size: 10px; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }

/* ---------- Spanish characters bar ---------- */
.accent-bar {
  display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.accent-key {
  flex: 1 1 0; min-width: 34px;
  padding: 10px 0; font-size: 18px; font-weight: 800;
  background: var(--card); color: var(--brand-dark);
  border: 2px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 0 var(--line);
}
.accent-key:active { transform: translateY(2px); box-shadow: none; background: var(--brand-light); }

/* ---------- level switcher ---------- */
.level-switch { display: flex; gap: 8px; margin: 4px 0 2px; }
.level-chip {
  flex: 1; padding: 9px 8px; border-radius: 12px;
  font-size: 13px; font-weight: 800;
  background: var(--card); color: var(--ink-soft);
  border: 2px solid var(--line);
}
.level-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.level-chip.locked { opacity: .55; }
.level-chip .lc-sub { display: block; font-size: 10px; font-weight: 700; opacity: .8; margin-top: 1px; }

/* ---------- level test ---------- */
.test-screen { padding: calc(20px + var(--safe-top)) 16px calc(20px + var(--safe-bottom)); min-height: 100vh; }
.test-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.test-count { font-size: 12px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.test-band {
  display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 8px; margin-bottom: 10px;
  background: var(--brand-light); color: var(--brand-dark);
}

/* ---------- community feed ---------- */
.school-logo { height: 56px; max-width: 90%; object-fit: contain; margin: 0 auto; display: block; }
.bell { position: relative; font-size: 20px; padding: 2px 4px; }
.bell-badge {
  position: absolute; top: -5px; right: -7px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 900;
  border-radius: 9px; padding: 1px 5px; min-width: 10px; text-align: center;
}
.fpost .ftime { font-size: 11px; color: var(--ink-soft); }
.ach-chip {
  background: var(--brand-light); color: var(--brand-dark);
  font-size: 12px; font-weight: 800;
  padding: 4px 10px; border-radius: 10px;
}
.flike { font-size: 15px; font-weight: 800; color: var(--ink-soft); display: flex; gap: 4px; align-items: center; }
.flike.liked { color: var(--red); }
.fcomments { margin-top: 6px; }
.fcomment { font-size: 13px; padding: 6px 0 0; line-height: 1.4; }
.fcomment .ftime { font-size: 10px; color: var(--ink-soft); }
.fdel { font-size: 15px; }

/* ---------- pull-to-refresh ---------- */
.ptr-bar {
  height: 0; overflow: hidden; transition: height .15s;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 12px; font-weight: 800;
}

/* ---------- avatar picker ---------- */
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-cell {
  font-size: 26px; padding: 8px 0; border-radius: 12px;
  background: var(--card); border: 2px solid var(--line);
}
.avatar-cell.current { border-color: var(--brand); background: var(--brand-light); }
.avatar-cell:active { transform: scale(1.15); }

/* skill label under each path node */
.node-row { display: flex; flex-direction: column; align-items: center; margin: 16px 0 8px; }
.node-row .path-node { margin: 0; }
.node-label {
  font-size: 11px; font-weight: 800; color: var(--ink-soft);
  margin-top: 4px; letter-spacing: .2px;
}
.node-label.locked { opacity: .45; }
.node-label.current { color: var(--brand); }

/* ---------- word introduction (picture + word + audio, no translation) ---------- */
.learn-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 20px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
}
.word-img {
  object-fit: contain; border-radius: 18px;
  background: #fff;
}
.learn-word {
  font-size: 30px; font-weight: 900; color: var(--brand-dark);
  text-align: center; letter-spacing: .3px;
}
.mic-btn {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 34px;
  box-shadow: 0 5px 0 var(--green-dark);
}
.mic-btn:active { transform: translateY(4px); box-shadow: none; }
.mic-btn.listening { animation: mic-pulse 1s infinite; background: var(--red); box-shadow: 0 5px 0 var(--red-dark); }
@keyframes mic-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- end-of-lesson mistake review ---------- */
.mistake-review { text-align: left; border-color: #FFC9C9; background: #FFF7F5; }
.mistake-review h3 { color: var(--red-dark); margin-bottom: 8px; }
.mr-row { padding: 8px 0; border-bottom: 1px solid #FFE3E3; }
.mr-row:last-of-type { border-bottom: none; }
.mr-q { font-size: 14px; color: var(--ink-soft); }
.mr-a { font-size: 15px; margin-top: 2px; }
.mr-tr { color: var(--ink-soft); font-weight: 400; }
.mr-note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }

/* white-background illustrations displayed on cream: frame them as cards */
.league-head .ui-ico, .complete .ui-ico {
  background: #fff; border-radius: 24px; padding: 8px;
  border: 2px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
}

.hidden { display: none !important; }

/* "⋯" — report / block on someone else's post or comment */
.fmore { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--ink-soft); cursor: pointer; padding: 0 6px; }
.fcomment .fmore { font-size: 15px; float: right; }

/* translation under a newly introduced word — visible but secondary to the picture */
.learn-translation { font-size: 15px; color: var(--ink-soft); margin: -6px 0 10px; font-weight: 700; }

/* conversation story: the teacher asks, the student answers out loud */
.story-ask { display: flex; gap: 10px; align-items: flex-start; }
.story-avatar { flex: 0 0 auto; }
.story-bubble {
  background: #fff; border: 2px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 12px 14px; font-size: 17px; font-weight: 700; line-height: 1.35; flex: 1;
}

/* level the school has not sold to this student yet */
.level-chip.locked { opacity: .55; }

/* pronunciation coach notes under the microphone */
.speak-tips { text-align: left; margin: 0; padding-left: 18px; width: 100%; }
.speak-tips li { font-size: 13px; color: var(--ink-soft); line-height: 1.45; margin-bottom: 4px; }

/* conversation feedback card */
.talk-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: left; }
.talk-card .muted-label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.talk-scores { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.talk-scores b { color: var(--ink); }
.talk-flag { margin-top: 10px; background: #FFF0E0; color: #B45300; border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; }

/* microphone: it has to be obvious that the phone is listening */
.mic-btn { transition: transform .12s ease, box-shadow .2s ease; }
.mic-btn.listening {
  transform: scale(var(--level, 1));
  box-shadow: 0 0 0 6px rgba(88, 204, 2, .18), 0 0 0 14px rgba(88, 204, 2, .10);
  animation: micPulse 1.6s ease-in-out infinite;
}
@keyframes micPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); margin-right: 7px; vertical-align: baseline;
  animation: recBlink 1s steps(2, start) infinite;
}
@keyframes recBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* the teacher "types" while their spoken answer is being prepared */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft);
  animation: typingDot 1.1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- voice lesson: a hands-free talk with the teacher ---------- */
.voice-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: calc(12px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); text-align: center; }
.voice-top { width: 100%; display: flex; align-items: center; gap: 12px; }
.voice-dots { flex: 1; display: flex; gap: 6px; justify-content: center; }
.voice-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.voice-dots i.done { background: var(--green); }
.voice-dots i.now { background: var(--brand); transform: scale(1.25); }
.voice-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.voice-avatar { position: relative; width: 148px; height: 148px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.voice-avatar img, .voice-avatar .ico { font-size: 72px; }
.voice-ring { position: absolute; inset: -10px; border-radius: 50%; border: 4px solid transparent;
  transition: transform .1s ease, border-color .25s ease; }
.voice-avatar.speaking .voice-ring { border-color: var(--blue, #1CB0F6); animation: voiceTalk 1.1s ease-in-out infinite; }
.voice-avatar.listening .voice-ring { border-color: var(--green); transform: scale(var(--level, 1)); }
.voice-avatar.thinking .voice-ring { border-color: var(--brand); animation: voiceThink 1.4s linear infinite; border-top-color: transparent; }
@keyframes voiceTalk { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes voiceThink { to { transform: rotate(360deg); } }
.voice-state { font-size: 17px; font-weight: 700; min-height: 24px; }
.voice-sub { font-size: 13px; color: var(--ink-soft); min-height: 18px; }
.voice-bars { display: flex; gap: 4px; align-items: flex-end; height: 26px; }
.voice-bars i { width: 5px; border-radius: 3px; background: var(--green); height: 6px; transition: height .08s; }
.voice-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
.voice-intro { max-width: 380px; text-align: left; }
.voice-intro li { margin: 8px 0; line-height: 1.45; }
.voice-turn { text-align: left; }
.voice-turn .q { font-weight: 800; }
.voice-turn .said { margin-top: 6px; }
.voice-turn .fix { color: var(--green); font-weight: 700; margin-top: 4px; }
.voice-turn .score { float: right; font-weight: 900; }
.voice-text { width: 100%; max-width: 380px; text-align: left; padding: 12px 14px; }
.voice-text .q { font-weight: 800; font-size: 16px; }

/* ---------- paywall ---------- */
.pw-hero { text-align: center; }
.pw-hero h2 { margin: 8px 0 4px; }
.pw-hero p { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; }
.pw-avatar { width: 88px; height: 88px; border-radius: 50%; background: #fff; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.pw-list { text-align: left; margin: 0 auto 12px; padding-left: 20px; max-width: 360px; font-size: 14px; }
.pw-list li { margin: 4px 0; }
.pw-plans { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.pw-plan { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: #fff; text-align: left; font: inherit; color: inherit; }
.pw-plan.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(88,204,2,.18); }
.pw-plan-l b, .pw-plan-r b { display: block; font-size: 16px; }
.pw-plan-l span, .pw-plan-r span { font-size: 12px; color: var(--ink-soft); }
.pw-plan-r { text-align: right; }
.pw-badge { position: absolute; top: -10px; right: 12px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 10px; }
.pw-terms { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 6px 0 10px; }
.pw-links { text-align: center; font-size: 13px; margin-top: 10px; }
.pw-links a, .linklike { color: var(--brand); font-weight: 700; text-decoration: none; background: none; border: 0; font: inherit; padding: 0; }
.pw-fine { font-size: 11px; color: var(--ink-soft); text-align: center; line-height: 1.4; margin: 10px 0 0; }
