/* nimiq.talk — scaffold styles. On-brand foundation; the real lesson screens
 * (skill tree, lesson player, results) are built with nq components in Phase 2.
 *
 * @nimiq/style sets html { font-size: 8px } (1rem = 8px). All custom values here
 * are in px to avoid the half-size rem trap. */

:root {
  --navy: #1F2348;
  --navy-2: #171D2E;
  --light-blue: #0582CA;
  --gold: #E9B213;
  --page: #FAFAFA;
  --ink: #1F2348;
  --ink-60: rgba(31, 35, 72, 0.6);
  --light-blue-bg: radial-gradient(100% 100% at bottom right, #265DD7, #0582CA);
  --navy-bg: radial-gradient(100% 100% at bottom right, #260133, #1F2348);
  --green-bg: radial-gradient(100% 100% at bottom right, #41A38E, #21BCA5);
  --gold-bg: radial-gradient(100% 100% at bottom right, #EC991C, #E9B213);
  --heart: #D94432;
  --locked: #EAEBEF;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: 'Mulish', 'Muli', system-ui, sans-serif !important;
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

/* ---- header ---- */
.hdr { padding: 16px 0 8px; }
.hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hdr-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.hdr-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy-bg);
  border: 2px solid var(--gold);
  display: inline-block;
}
.hdr-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 8px;
}
.hdr-wallet { display: flex; align-items: center; }

/* ---- hero / welcome (scaffold) ---- */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}
.hero {
  text-align: center;
  padding: 8px 0 24px;
}
.hero-badge {
  width: 84px;
  height: 84px;
  margin: 0 auto 24px;
  border-radius: 24px;
  background: var(--navy-bg);
  display: grid;
  place-items: center;
}
.hero-badge svg { width: 46px; height: 46px; }
.hero-learning {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: balance;
}
.hero p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-60);
  margin: 0 auto 24px;
  max-width: 30ch;
}
.cta {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background-image: var(--light-blue-bg);
  border-radius: 999px;
  padding: 16px 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
.cta:active { transform: translateY(1px); box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); }
.cta:focus-visible { outline: 2px solid var(--light-blue); outline-offset: 3px; }
.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-60);
}

/* shell connect button (when app-shell renders it into #wallet-slot) */
.shell-connect {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background-image: var(--light-blue-bg);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ---- footer ---- */
.ftr {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 12px;
  color: var(--ink-60);
}

/* ---- home / skill tree (#8) ---- */
.home { padding: 8px 0 24px; }
.home-head { margin-bottom: 24px; }
.home-lang {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
  margin-bottom: 12px;
}
.stats {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.stat-ico { font-size: 16px; }
.stat-unit { font-weight: 700; font-size: 12px; color: var(--ink-60); }
/* 20px + bold qualifies as "large text" so the warm red still clears WCAG AA at 3:1. */
.hearts { color: var(--heart); letter-spacing: 2px; font-size: 20px; font-weight: 700; line-height: 1; }

.unit { margin-bottom: 8px; }
/* Sentence-case section label (not an uppercase eyebrow), navy-secondary grey. */
.unit-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-60);
  margin: 24px 0 12px;
}
.lessons { list-style: none; margin: 0; padding: 0; }
.lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}
.lesson--locked { opacity: 0.55; }
.lesson-node {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
  background: var(--locked);
}
.lesson--available .lesson-node,
.lesson--started .lesson-node { background-image: var(--light-blue-bg); }
.lesson--completed .lesson-node { background-image: var(--green-bg); font-weight: 800; }
.lesson--locked .lesson-node { color: rgba(31, 35, 72, 0.5); }
.lesson-info { flex: 1 1 auto; min-width: 0; }
.lesson-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.lesson-crowns { font-size: 13px; }
.lesson-sub { font-size: 13px; color: var(--ink-60); margin-top: 4px; }
.lesson-cta {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background-image: var(--light-blue-bg);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  flex: 0 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.lesson-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
.lesson-cta:active { transform: translateY(1px); box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); }
.lesson-cta:focus-visible { outline: 2px solid var(--light-blue); outline-offset: 3px; }

/* loading + empty + toast */
.loading { display: grid; place-items: center; padding: 64px 0; }
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(31, 35, 72, 0.15);
  border-top-color: var(--light-blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--ink-60); padding: 48px 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background-image: var(--navy-bg);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .lesson-cta, .cta, .toast { transition: none; }
}

/* ---- lesson player (#9) ---- */
.player { display: flex; flex-direction: column; min-height: calc(100vh - 140px); padding: 8px 0 24px; }
.player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.player-close {
  background: none; border: 0; cursor: pointer;
  font-size: 18px; color: var(--ink-60); width: 32px; height: 32px; flex: 0 0 auto;
}
.progress { flex: 1; height: 12px; background: var(--locked); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background-image: var(--green-bg); border-radius: 999px; transition: width 0.3s cubic-bezier(0.25, 0, 0, 1); }
.player-hearts { color: var(--heart); font-size: 16px; font-weight: 700; letter-spacing: 2px; flex: 0 0 auto; }

.ex-card { flex: 1; }
.ex-instruction { font-size: 13px; font-weight: 700; color: var(--ink-60); margin-bottom: 16px; }
.ex-prompt { font-size: 24px; font-weight: 700; color: var(--ink); margin-bottom: 24px; text-wrap: balance; }

.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  text-align: left; background: #fff; border: 0; border-radius: 12px; padding: 16px;
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
}
.choice.is-sel { box-shadow: inset 0 0 0 2px var(--light-blue), 0 8px 56px rgba(0, 0, 0, 0.08); }

.answer-line {
  min-height: 48px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 0; margin-bottom: 24px; border-bottom: 2px solid var(--locked);
}
.bank { display: flex; flex-wrap: wrap; gap: 8px; }
.token {
  background: #fff; border: 0; border-radius: 8px; padding: 8px 12px;
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.token.is-used { visibility: hidden; }

.match { display: flex; gap: 16px; }
.match-col { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.match-item {
  background: #fff; border: 0; border-radius: 12px; padding: 16px;
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
}
.match-item.is-sel { box-shadow: inset 0 0 0 2px var(--light-blue), 0 8px 56px rgba(0, 0, 0, 0.08); }
.match-item.is-matched { opacity: 0.4; }

.player-foot { margin-top: 24px; }
.cta.full { width: 100%; }

.feedback { border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.feedback--ok { background: rgba(33, 188, 165, 0.12); }
.feedback--no { background: rgba(217, 68, 50, 0.10); }
.feedback-title { font-weight: 800; font-size: 16px; }
.feedback--ok .feedback-title { color: #15786A; }
.feedback--no .feedback-title { color: #A82C1E; }
.feedback-ans { font-size: 14px; color: var(--ink); margin-top: 4px; }

/* ---- results (#9; polished in #10) ---- */
.results { text-align: center; padding: 32px 0; display: flex; flex-direction: column; align-items: center; }
.result-badge { font-size: 56px; margin-bottom: 16px; }
.results h1 { font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 24px; }
.result-stats { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; justify-content: center; }
.result-stat {
  background: #fff; border-radius: 12px; padding: 16px; min-width: 96px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
}
.result-val { font-size: 18px; font-weight: 800; color: var(--ink); }
.result-lbl { font-size: 12px; color: var(--ink-60); margin-top: 4px; }
.result-reward {
  background: rgba(233, 178, 19, 0.16); color: #7A5C00; font-weight: 700; font-size: 14px;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 24px;
}

/* ---- results polish (#10) ---- */
.result-badge.is-perfect { font-size: 56px; }
.result-perfect { color: #15786A; font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.result-crowns { font-size: 22px; margin-bottom: 16px; line-height: 1; }
.result-hearts { color: var(--heart); letter-spacing: 2px; }
.result-reward {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(233, 178, 19, 0.16); border-radius: 12px; padding: 16px 24px; margin-bottom: 16px;
}
.result-reward-amt { color: #7A5C00; font-weight: 800; font-size: 16px; }
.result-reward-sub { color: #7A5C00; font-weight: 600; font-size: 13px; }
.result-review { font-size: 13px; color: var(--ink-60); margin-bottom: 24px; }

@keyframes result-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes result-up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.result-badge { animation: result-pop 0.4s cubic-bezier(0.41, 0.34, 0.26, 1.55) both; }
.results h1, .result-perfect, .result-crowns { animation: result-up 0.4s cubic-bezier(0.25, 0, 0, 1) both; }
.result-stat { animation: result-up 0.4s cubic-bezier(0.25, 0, 0, 1) both; }
.result-stat:nth-child(2) { animation-delay: 0.06s; }
.result-stat:nth-child(3) { animation-delay: 0.12s; }
.result-stat:nth-child(4) { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .result-badge, .results h1, .result-perfect, .result-crowns, .result-stat { animation: none; }
}

/* ---- hearts: regen note + out-of-hearts (#19) ---- */
.next-heart { font-size: 12px; color: var(--ink-60); margin-top: 8px; }
.out-hearts { text-align: center; }
.out-hearts-title { font-weight: 800; font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.out-hearts-note { font-size: 13px; color: var(--ink-60); margin-bottom: 16px; }
.link-btn {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-60); font-family: inherit; font-weight: 700; font-size: 14px;
  margin-top: 12px; padding: 8px 16px;
}

/* ---- review card (#20) ---- */
.review-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 0; border-radius: 12px; padding: 16px; margin-bottom: 16px;
  background-image: var(--green-bg); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); font-family: inherit;
}
.review-ico { font-size: 22px; }
.review-text { display: flex; flex-direction: column; }
.review-title { font-weight: 800; font-size: 16px; }
.review-sub { font-size: 13px; opacity: 0.9; }

/* ---- daily goal ring + leaderboard (#21) ---- */
.goal { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ring { width: 48px; height: 48px; flex: 0 0 auto; }
.ring-bg { fill: none; stroke: var(--locked); stroke-width: 4; }
.ring-fg {
  fill: none; stroke: var(--light-blue); stroke-width: 4; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 0.4s cubic-bezier(0.25, 0, 0, 1);
}
.goal-label { font-size: 12px; color: var(--ink-60); font-weight: 600; }
.goal-val { font-size: 16px; color: var(--ink); font-weight: 800; }
.lb-link {
  background: none; border: 0; cursor: pointer; font-family: inherit;
  color: var(--ink); font-weight: 700; font-size: 14px; padding: 8px 0; margin-top: 12px;
}

.board { padding: 8px 0 24px; }
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.board-head h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0; }
.lb-you { font-size: 13px; color: var(--ink-60); font-weight: 700; margin-bottom: 16px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: #fff; border-radius: 12px; margin-bottom: 8px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.06);
}
.lb-row.is-you { box-shadow: inset 0 0 0 2px var(--light-blue), 0 8px 56px rgba(0, 0, 0, 0.06); }
.lb-rank { font-weight: 800; color: var(--ink-60); min-width: 24px; }
.lb-name { flex: 1 1 auto; font-weight: 700; color: var(--ink); }
.lb-xp { font-weight: 800; color: var(--ink); }

/* ---- claimable reward (#23) ---- */
.sim-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: #7A5C00; background: rgba(233, 178, 19, 0.28);
  border-radius: 999px; padding: 3px 8px;
}
.reward-claim {
  border: 0; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 14px;
  color: #fff; background-image: var(--gold-bg, radial-gradient(100% 100% at bottom right, #EC991C, #E9B213));
  border-radius: 999px; padding: 8px 20px; min-height: 40px; margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.reward-claim:disabled { opacity: 0.75; cursor: default; }

/* ---- a11y: global keyboard focus ring (#25) ---- */
:focus-visible { outline: 2px solid var(--light-blue); outline-offset: 2px; border-radius: 4px; }

/* ---- listen exercise (#32) ---- */
.listen-play {
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 30px; margin: 0 0 24px;
  background-image: var(--light-blue-bg); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.listen-play:hover { transform: translateY(-2px); }
.listen-play:active { transform: translateY(1px); }

/* ---- speak exercise (#33) ---- */
.mic-btn {
  width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 30px; margin: 0 auto 24px;
  background-image: var(--light-blue-bg); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.mic-btn:hover { transform: translateY(-2px); }
.mic-btn.is-listening { box-shadow: 0 0 0 6px rgba(5, 130, 202, 0.18), 0 8px 24px rgba(0, 0, 0, 0.15); }
/* Nimiq input: no border; an inset box-shadow is the border (brand rule 1). */
.speak-input {
  width: 100%; font-family: inherit; font-size: 16px; padding: 12px 16px;
  border: 0; border-radius: 8px; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--locked);
}
.speak-input:focus { box-shadow: inset 0 0 0 2px var(--light-blue); }

/* ---- target-language picker (#34) ---- */
.lang-switch {
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink-60); padding: 8px 0; margin-bottom: 8px;
  min-height: 36px; display: inline-flex; align-items: center; gap: 4px;
}
.lang-caret { font-size: 10px; }
.target-picker {
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 16px;
  box-shadow: 0 8px 56px rgba(0, 0, 0, 0.08);
}
.target-picker-title { font-size: 12px; font-weight: 700; color: var(--ink-60); margin-bottom: 8px; }
.target-opt {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font-family: inherit;
  font-size: 16px; font-weight: 700; color: var(--ink); background: none;
  border-radius: 8px; padding: 12px;
}
.target-opt:hover { background: var(--page); }
.target-opt.is-current { box-shadow: inset 0 0 0 2px var(--light-blue); }

/* ---- profile (#42) ---- */
.home-links { display: flex; gap: 16px; margin-top: 12px; }
.profile-lang { font-size: 13px; font-weight: 600; color: var(--ink-60); margin-bottom: 8px; }
.profile-wallet {
  font-size: 13px; color: var(--ink); margin-bottom: 24px; word-break: break-all;
  font-family: 'Fira Mono', monospace;
}
.profile-wallet--none { color: var(--ink-60); font-family: inherit; }
.profile-grid { justify-content: flex-start; }
