/* Clean and light, in the spirit of Brilliant: white canvas, one strong blue, soft
   pastel washes per subject, crisp type, objects you can touch. */
:root {
  --bg: #ffffff;
  --ink: #15142b;
  --ink-2: #3b3a55;
  --muted: #74778f;
  --line: #e7e8f0;
  --soft: #f4f5fa;
  --blue: #3d5afe;
  --blue-2: #2b43d6;
  --blue-soft: #eef1ff;
  --good: #1fb860;
  --good-soft: #e7f9ee;
  --bad: #ef4462;
  --bad-soft: #ffedf0;
  --amber: #ffb020;
  --violet: #8b5cf6;
  --wash: #eef1ff;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --read: "Andika", "Inter", system-ui, sans-serif;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.trail-leitura {
  --wash: #fff2e6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: hidden must beat component display rules */
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: linear-gradient(180deg, var(--wash) 0, #fff 260px);
}

.primary,
.dark {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 17px;
  transition:
    transform 0.12s var(--spring),
    box-shadow 0.2s,
    opacity 0.2s;
}

.primary {
  background: var(--blue);
  color: #fff;
  box-shadow:
    0 2px 0 var(--blue-2),
    0 10px 24px rgba(61, 90, 254, 0.25);
}

.dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 0 #000;
}

.primary:active,
.dark:active {
  transform: translateY(2px) scale(0.99);
}

.primary:disabled,
.dark:disabled {
  opacity: 0.28;
  box-shadow: none;
  transform: none;
}

.ghost {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  font-weight: 600;
  color: var(--ink-2);
  background: #fff;
}

.link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-weight: 700;
  font-size: 14px;
}

.xp-gem {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #b69cff, var(--violet));
}

/* ---------------- trail (path) ---------------- */
.path {
  padding: max(14px, env(safe-area-inset-top)) 18px 230px;
  overflow-x: hidden;
}

.p-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.p-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.p-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition:
    background 0.25s,
    color 0.25s;
}

.p-tab.on {
  background: var(--ink);
  color: #fff;
}

.p-tab svg {
  width: 18px;
  height: 18px;
}

.p-stats {
  display: flex;
  gap: 6px;
}

.p-head {
  margin: 22px 2px 6px;
}

.p-subject {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-title {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 10px;
}

.p-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.p-progress .bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(21, 20, 43, 0.06);
  overflow: hidden;
}

.p-progress .bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--blue);
  transition: width 0.9s var(--spring);
}

.p-level {
  margin: 30px auto 6px;
  width: fit-content;
  padding: 10px 18px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: #fff;
  text-align: center;
  box-shadow: 0 3px 0 var(--ink);
}

.p-level small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.p-level b {
  font-size: 16px;
}

.p-nodes {
  position: relative;
  padding: 6px 0;
}

.p-wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.p-wire path {
  fill: none;
  stroke: #d3d8e8;
  stroke-width: 4;
  stroke-dasharray: 1 12;
  stroke-linecap: round;
}

.p-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
  transform: translateX(var(--x, 0));
}

.p-node .coin {
  position: relative;
  width: 88px;
  height: 88px;
  transition: transform 0.25s var(--spring);
}

.p-node .coin:active {
  transform: scale(0.94);
}

.p-node .coin svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.p-node .halo {
  position: absolute;
  inset: -6px -4px 2px;
  border-radius: 50%;
  border: 3px solid rgba(61, 90, 254, 0.35);
  animation: halo 1.8s ease-out infinite;
}

@keyframes halo {
  from {
    transform: scale(0.85);
    opacity: 1;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

.p-node.current .coin {
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-5px);
  }
}

.p-node .label {
  position: relative;
  text-align: center;
  max-width: 210px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.p-node .label b {
  display: block;
  font-size: 15px;
}

.p-node .label span {
  font-size: 13px;
  color: var(--muted);
}

.p-node.locked .label,
.p-node.soon .label {
  opacity: 0.5;
}

.p-mascot {
  position: absolute;
  top: 22px;
  width: 62px;
  height: 62px;
  z-index: 2;
}

.p-mascot.left {
  right: calc(50% + 70px);
}

.p-mascot.right {
  left: calc(50% + 70px);
}

.p-mascot-bubble {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 8px 20px rgba(21, 20, 43, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.p-reset {
  display: block;
  margin: 40px auto 0;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(21, 20, 43, 0.12);
  z-index: 10;
}

.sheet .grab {
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: var(--line);
  margin: -4px auto 12px;
}

.sheet h3 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 4px;
}

.sheet p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ---------------- lesson ---------------- */
.lesson {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  gap: 8px;
}

.lhead {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.lprogress {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: rgba(21, 20, 43, 0.06);
  overflow: hidden;
}

.lprogress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c93ff, var(--blue));
  transition: width 0.7s var(--spring);
}

.cost-pill {
  color: var(--good);
  font-size: 12px;
  border-color: #cdeedb;
}

.cost-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  min-width: 270px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 16px 40px rgba(21, 20, 43, 0.14);
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.cost-panel div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cost-panel span {
  color: var(--muted);
}

.stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.question {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding: 6px 2px 0;
}

.question:empty {
  display: none;
}

#scene {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
}

.board {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 8px 0;
}

.board > * {
  pointer-events: auto;
}

.board:empty {
  display: none;
}

/* bars */
.block {
  fill: #f1f3f9;
  stroke: #d6dbea;
  stroke-width: 1.5;
  transition:
    fill 0.22s,
    stroke 0.22s;
}

.block.on {
  fill: url(#life);
  stroke: #3047d8;
}

.block.pulse {
  animation: pulse 0.9s ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    opacity: 0.55;
  }
}

.interactive .block {
  cursor: pointer;
}

.interactive .block:not(.on) {
  stroke: #aab5e6;
  stroke-dasharray: 4 3;
}

.pickable {
  cursor: pointer;
}

.bar.selected .block {
  stroke: var(--blue);
  stroke-width: 3;
}

.bar.good .block {
  stroke: var(--good);
  stroke-width: 3;
}

.bar-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  fill: var(--muted);
}

.frac-num,
.frac-den {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  fill: var(--ink);
  text-anchor: middle;
  transition: fill 0.2s;
}

.frac-num.hl,
.frac-den.hl {
  fill: var(--blue);
}

.frac-line {
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.tick {
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
}

.group-box {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
}

.group-box.bad {
  stroke: var(--bad);
  stroke-dasharray: 5 4;
}

.brace {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
}

.brace-text {
  fill: var(--blue);
  stroke: none;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.mult-badge {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  fill: var(--blue);
  transform-box: fill-box;
  transform-origin: center;
}

.guide {
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
}

.guide.equal {
  stroke: var(--good);
}

.guide.different {
  stroke: var(--bad);
}

.expr-num,
.expr-den,
.expr-op {
  font-family: var(--display);
  font-weight: 700;
  font-size: 42px;
  fill: var(--ink);
  text-anchor: middle;
}

.expr-op {
  fill: var(--muted);
}

.expr-line {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.q {
  fill: var(--blue);
}

.solved {
  fill: var(--good);
}

.stage-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.title-main {
  font-family: var(--display);
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tag {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 6px 16px rgba(21, 20, 43, 0.08);
}

.tag.good {
  color: var(--good);
  background: var(--good-soft);
  border-color: #bfeccf;
}

.tag.bad {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: #ffc9d3;
}

.tag.info {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #d3dafe;
}

/* dock: mascot + tutor bubble */
.dock {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 64px;
}

.dock-mascot {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: end center;
}

.bubble {
  position: relative;
  flex: 1;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 8px 22px rgba(21, 20, 43, 0.07);
  font-size: 16px;
  line-height: 1.38;
}

.bubble p {
  margin: 0;
}

.bubble .w {
  opacity: 0.12;
  transition: opacity 0.18s;
}

.bubble .w.in {
  opacity: 1;
}

.heard {
  justify-self: end;
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 18px 18px 6px 18px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.action {
  display: grid;
  gap: 10px;
  align-content: end;
  min-height: 60px;
}

.action.locked {
  pointer-events: none;
}

.action.locked > * {
  opacity: 0.6;
}

.feedback {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 18px 20px max(22px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  z-index: 15;
}

.feedback.good {
  background: var(--good-soft);
  color: #11843f;
}

.feedback.bad {
  background: var(--bad-soft);
  color: #c4213f;
}

.feedback .fb-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}

.feedback .fb-icon svg {
  width: 20px;
  height: 20px;
}

.feedback.good .fb-icon {
  background: var(--good);
}

.feedback.bad .fb-icon {
  background: var(--bad);
}

.feedback small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

/* controls */
.options {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.opt {
  padding: 15px 10px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 0 var(--line);
  transition:
    transform 0.12s var(--spring),
    border-color 0.15s,
    background 0.15s;
}

.options.symbols .opt {
  font-family: var(--display);
  font-size: 28px;
  padding: 10px;
}

.opt.sel {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-2);
  box-shadow: 0 3px 0 #c6cffd;
}

.opt:active {
  transform: translateY(2px);
}

.composer {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
}

.frac-input {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.slot {
  width: 62px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
}

.slot.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.12);
}

.slot-line {
  width: 54px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
}

.num-input {
  width: 74px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 2px solid var(--blue);
  background: #fff;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  justify-self: center;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.key {
  padding: 11px 0;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 2px 0 var(--line);
}

.key:active {
  background: var(--soft);
  transform: translateY(1px);
}

.knob {
  position: relative;
  padding: 4px 6px 0;
  user-select: none;
  touch-action: none;
}

.knob-track {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: rgba(21, 20, 43, 0.07);
  margin: 16px 22px;
}

.knob-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
  background: var(--blue);
  transition: width 0.25s var(--spring);
}

.knob-handle {
  position: absolute;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
  box-shadow: 0 6px 16px rgba(61, 90, 254, 0.35);
  transition: left 0.25s var(--spring);
  cursor: grab;
}

.knob.dragging .knob-handle,
.knob.dragging .knob-fill {
  transition: none;
}

.knob.dragging .knob-handle {
  transform: scale(1.12);
}

.knob-stops {
  display: flex;
  justify-content: space-between;
  margin: 0 4px;
}

.knob-stop {
  min-width: 36px;
  padding: 4px 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  border-radius: 8px;
}

.knob-stop.on {
  color: var(--blue);
}

.knob-caption {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin-top: 4px;
}

.fill-count {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

/* listening */
.listen {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.mic-btn {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 26px rgba(21, 20, 43, 0.25);
  transition: background 0.25s;
}

.mic-btn svg {
  width: 30px;
  height: 30px;
}

.mic-btn::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid rgba(21, 20, 43, 0.15);
  animation: halo 1.4s ease-out infinite;
}

.hearing .mic-btn {
  background: var(--blue);
}

.thinking .mic-btn {
  background: var(--violet);
}

.listen-state {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.levels {
  display: flex;
  gap: 3px;
  height: 18px;
  align-items: center;
}

.levels i {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: #d6dbea;
  transition: height 0.08s;
}

.levels i.on {
  height: 18px;
  background: var(--blue);
}

/* reading board */
.tiles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.tile {
  min-width: 78px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff;
  border: 2.5px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  font-family: var(--read);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: center;
  transition:
    transform 0.2s var(--spring),
    border-color 0.2s,
    background 0.2s,
    opacity 0.2s;
}

.tile:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--line);
}

.tile .c {
  color: #e2551f;
}

.tile .v {
  color: var(--blue-2);
}

.tile.cons {
  background: #fff4ec;
  border-color: #ffc9a8;
  box-shadow: 0 4px 0 #ffc9a8;
  color: #e2551f;
}

.tile.vowel {
  background: var(--blue-soft);
  border-color: #c9d2ff;
  box-shadow: 0 4px 0 #c9d2ff;
  color: var(--blue-2);
  font-size: 32px;
  min-width: 58px;
}

.tile.used {
  opacity: 0.25;
  pointer-events: none;
}

.tile.big {
  font-size: 72px;
  padding: 14px 30px;
}

.tile.word {
  font-size: 54px;
  padding: 12px 26px;
  border-color: var(--blue);
  box-shadow: 0 4px 0 #c6cffd;
}

.tile.sel {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 4px 0 #c6cffd;
}

.emoji {
  font-size: 84px;
  line-height: 1;
  filter: drop-shadow(0 8px 12px rgba(21, 20, 43, 0.12));
}

.r-col {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  width: 100%;
}

.slots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.slot-tile {
  min-width: 82px;
  height: 74px;
  padding: 0 10px;
  border-radius: 18px;
  border: 2.5px dashed #c9cfe2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--read);
  font-weight: 700;
  font-size: 38px;
}

.slot-tile.filled {
  border-style: solid;
  border-color: #ffd0b5;
  background: #fff;
  box-shadow: 0 4px 0 #ffd0b5;
}

.pics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.pic {
  padding: 16px 6px;
  border-radius: 20px;
  border: 2.5px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 0 var(--line);
  font-size: 54px;
  line-height: 1;
  transition:
    transform 0.2s var(--spring),
    border-color 0.2s,
    background 0.2s;
}

.pic.sel {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-3px);
}

.pic.good {
  border-color: var(--good);
  background: var(--good-soft);
}

.speaker {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(61, 90, 254, 0.3);
}

.speaker svg {
  width: 28px;
  height: 28px;
}

.family-row {
  display: flex;
  gap: 8px;
  min-height: 72px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------- done ---------------- */
.done {
  padding: max(20px, env(safe-area-inset-top)) 18px 30px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.d-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding-top: 16px;
}

.d-mascot {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.d-hero h1 {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.d-hero p {
  margin: 0;
  color: var(--muted);
}

.d-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.d-stat {
  padding: 12px 6px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: center;
}

.d-stat b {
  display: block;
  font-family: var(--display);
  font-size: 20px;
}

.d-stat span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.d-unlock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--blue-soft);
  border: 1.5px solid #d3dafe;
}

.d-unlock svg {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.d-unlock small {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--blue);
  text-transform: uppercase;
}

.rep-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.rep-card h2 {
  font-family: var(--display);
  font-size: 18px;
  margin: 0;
}

.rep-card h3 {
  font-size: 12px;
  margin: 6px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rep-skill {
  display: grid;
  gap: 6px;
}

.rep-skill > div:first-child,
.rep-misc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.rep-meter {
  height: 8px;
  border-radius: 99px;
  background: var(--soft);
  overflow: hidden;
}

.rep-meter i {
  display: block;
  height: 100%;
  background: var(--good);
}

.st {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.st.dominada {
  color: #11843f;
  background: var(--good-soft);
}

.st.reforcada {
  color: var(--blue-2);
  background: var(--blue-soft);
}

.st.em-progresso {
  color: #a3640a;
  background: #fff4dc;
}

blockquote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: var(--soft);
  border-radius: 8px;
  font-style: italic;
}

small,
.muted {
  color: var(--muted);
}

.rep-big {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  color: var(--good);
}

.rep-big span {
  font-size: 15px;
  color: var(--muted);
}

.rep-rows {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.rep-rows div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rep-rows b {
  white-space: nowrap;
}

.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rep-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 4px;
}

.rep-table td {
  padding: 8px 4px;
  border-top: 1px solid var(--line);
}

.screen-enter {
  animation: enter 0.45s var(--spring) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion must win */
    animation-duration: 0.01ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion must win */
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- celebration layer ---------------- */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}

.fx-layer > * {
  position: absolute;
}

.fx-confetti {
  width: 9px;
  height: 14px;
  border-radius: 2px;
}

.fx-gem {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #c9b8ff, #8b5cf6);
  box-shadow:
    0 0 0 2px #fff,
    0 4px 10px rgba(139, 92, 246, 0.45);
  rotate: 45deg;
}

.fx-coin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc145 55%, #e39400);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(227, 148, 0, 0.45);
}

.fx-float {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  white-space: nowrap;
  text-shadow: 0 2px 0 #fff;
}

.fx-float.xp {
  color: var(--violet);
}

.fx-float.coin {
  color: #e39400;
}

.fx-celebrate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 6px;
  background: radial-gradient(circle at 50% 42%, #ffffff 0, #ffffff 38%, #f2f4ff 100%);
  overflow: hidden;
}

.fx-celebrate.combo {
  background: radial-gradient(circle at 50% 42%, #fff 0, #fff 36%, #fff3e6 100%);
}

.fx-celebrate.lesson {
  /* the kind class collides with the .lesson screen layout */
  grid-template-rows: none;
  height: auto;
  padding: 0;
  gap: 6px;
}

.fx-celebrate.trail,
.fx-celebrate.lesson {
  background: radial-gradient(circle at 50% 42%, #fff 0, #fffbea 40%, #fff1c7 100%);
}

.fx-rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 900px;
  height: 900px;
  margin: -450px 0 0 -450px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(61, 90, 254, 0.07) 0 9deg, transparent 9deg 22deg);
  animation: rays 9s linear infinite;
  mask: radial-gradient(circle, #000 20%, transparent 62%);
}

.fx-celebrate.combo .fx-rays {
  background: repeating-conic-gradient(rgba(255, 107, 61, 0.09) 0 9deg, transparent 9deg 22deg);
}

.fx-celebrate.trail .fx-rays,
.fx-celebrate.lesson .fx-rays {
  background: repeating-conic-gradient(rgba(255, 176, 32, 0.16) 0 9deg, transparent 9deg 22deg);
}

@keyframes rays {
  to {
    transform: rotate(360deg);
  }
}

.fx-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
}

.fx-mascot {
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
}

.fx-celebrate.trail .fx-mascot {
  width: 190px;
  height: 190px;
}

.fx-badge {
  position: absolute;
  right: 4px;
  top: 0;
  width: 76px;
  height: 76px;
  z-index: 2;
  filter: drop-shadow(0 8px 14px rgba(21, 20, 43, 0.18));
}

.fx-badge svg {
  width: 100%;
  height: 100%;
}

.fx-title {
  position: relative;
  font-family: var(--display);
  font-size: clamp(36px, 11vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.fx-celebrate.combo .fx-title {
  color: #ff5a1f;
}

.fx-sub {
  position: relative;
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
}

.fx-go {
  position: relative;
  margin-top: 18px;
  width: 220px;
}

.fx-flash {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #fff;
  pointer-events: none;
}

.coin-pill b,
.xp-pill b {
  min-width: 1.2em;
  text-align: right;
}

.coin-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc145 55%, #e39400);
}

.d-reward {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.d-reward .pill {
  font-size: 16px;
  padding: 8px 14px;
}

.d-top {
  display: flex;
  justify-content: flex-end;
}
