/* Learn AI */

.join-card {
  margin-top: 28px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 440px;
}
.join-card h2 { margin: 0 0 16px; font-size: 1.2rem; }
.join-card .hint { margin-top: 10px; font-size: 0.82rem; color: var(--ink-soft); }
#rollName { flex: none; }

/* ---- learner bar ---- */
.learner-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin: 28px 0 32px;
}
.learner-id { display: flex; align-items: center; gap: 12px; }
.learner-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum), var(--rose));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem;
}
.learner-name { font-weight: 800; font-size: 1.05rem; }
.learner-sub { font-size: 0.84rem; color: var(--ink-soft); }
.learner-stats { display: flex; gap: 22px; margin-left: auto; }
.learner-stats .stat { text-align: center; }
.learner-stats .stat b { display: block; font-size: 1.3rem; }
.learner-stats .stat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); font-weight: 700; }

.track-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.track-head > div { flex: 1; }
.progress-ring {
  width: 74px; height: 74px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  background: conic-gradient(var(--plum) var(--pct, 0%), var(--line) 0);
  flex: none;
}
.progress-ring span {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

/* ---- activity cards ---- */
.activity-list { display: grid; gap: 16px; }
.activity {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  flex-wrap: wrap;
}
.activity .kind-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex: none;
  background: var(--plum-soft);
}
.activity .meta { flex: 1; min-width: 200px; }
.activity h3 { margin: 0 0 2px; font-size: 1.08rem; }
.activity p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.activity .stars { font-size: 1rem; letter-spacing: 2px; color: var(--amber); min-width: 56px; text-align: right; }
.activity.done { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }

/* ---- leaderboard ---- */
.board-block {
  margin: 40px 0 60px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.board-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.board-head .section-title { margin: 0; }
.board-head select { width: auto; margin-left: auto; }
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}
.board li:last-child { border-bottom: none; }
.board .rank { width: 28px; font-weight: 800; color: var(--ink-soft); }
.board .who { flex: 1; font-weight: 700; }
.board .pts { font-weight: 800; }
.board .me { color: var(--plum); }
.board .empty { color: var(--ink-soft); padding: 12px 6px; }

/* ---- activity player ---- */
.player {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 26, 0.55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.player[hidden] { display: none; }

.player-shell {
  background: var(--paper);
  border-radius: 20px;
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.player-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--paper-raised);
}
.player-head h2 { margin: 6px 0 0; font-size: 1.25rem; }
.player-body { padding: 24px 22px; overflow-y: auto; flex: 1; }
.player-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper-raised);
  flex-wrap: wrap;
}
.player-progress { color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; }
.player-foot .row { margin-left: auto; }

/* lesson cards */
.lesson-card { text-align: center; padding: 10px 0 20px; }
.lesson-card .art { font-size: 4.5rem; line-height: 1; margin-bottom: 18px; }
.lesson-card p { font-size: 1.15rem; max-width: 46ch; margin: 0 auto; }

/* questions */
.question { font-size: 1.15rem; font-weight: 700; margin: 0 0 18px; }
.options { display: grid; gap: 10px; }
.option {
  text-align: left;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  font: inherit;
  color: inherit;
  cursor: pointer;
  font-weight: 600;
}
.option:hover:not(:disabled) { border-color: var(--plum); }
.option.correct { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.option.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 14%, transparent); }
.option:disabled { cursor: default; }

.feedback { margin-top: 16px; font-weight: 700; }
.feedback.good { color: var(--teal); }
.feedback.bad { color: var(--rose); }
.explain { margin-top: 8px; color: var(--ink-soft); font-weight: 500; font-size: 0.94rem; }

/* sorter game */
.sorter-item { text-align: center; margin-bottom: 22px; }
.sorter-item .art { font-size: 4.5rem; line-height: 1; }
.sorter-item .label { color: var(--ink-soft); font-weight: 700; }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bin {
  padding: 26px 14px;
  border-radius: 16px;
  border: 2px dashed var(--line);
  background: var(--paper-raised);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.bin:hover:not(:disabled) { border-color: var(--plum); background: var(--plum-soft); }
.bin.correct { border-style: solid; border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.bin.wrong { border-style: solid; border-color: var(--rose); background: color-mix(in srgb, var(--rose) 14%, transparent); }

/* pattern game */
.sequence { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.sequence span {
  width: 62px; height: 62px;
  border-radius: 14px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800;
}
.sequence span.blank { border-style: dashed; color: var(--ink-soft); }
.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.choice {
  width: 76px; height: 76px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  font-size: 2rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.choice:hover:not(:disabled) { border-color: var(--plum); }
.choice.correct { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.choice.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 14%, transparent); }

/* word-next game */
.context-line {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}
.context-line .blank { color: var(--plum); letter-spacing: 2px; }
.score-bars { margin-top: 18px; display: grid; gap: 8px; }
.score-bar { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 700; }
.score-bar .word { width: 96px; }
.score-bar .track { flex: 1; height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.score-bar .fill { height: 100%; background: var(--plum); }

/* weights game */
.weight-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.weight-row label { flex: 1; font-weight: 700; font-size: 0.94rem; }
.weight-row input[type='range'] { flex: 1.4; width: auto; padding: 0; }
.weight-row output { width: 42px; text-align: right; font-weight: 800; }
.examples { margin-top: 18px; display: grid; gap: 8px; }
.example-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  font-size: 0.94rem;
}
.example-row .name { flex: 1; font-weight: 700; }
.example-row .score { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 700; }
.example-row.hit { border-color: var(--teal); }
.example-row.miss { border-color: var(--rose); }

/* bias game */
.samples { display: flex; gap: 10px; font-size: 2.2rem; margin: 8px 0 18px; flex-wrap: wrap; }
.round-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 4px; }

/* prompt builder */
.slot { margin-bottom: 18px; }
.slot h4 { margin: 0 0 8px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.goal-line { font-weight: 700; margin-bottom: 18px; font-size: 1.05rem; }
.prompt-preview {
  margin-top: 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  color: var(--ink-soft);
}

/* results */
.result { text-align: center; padding: 20px 0; }
.result .big { font-size: 4rem; line-height: 1; }
.result h3 { margin: 12px 0 4px; font-size: 1.5rem; }
.result p { color: var(--ink-soft); margin: 0; }
.result .stars-earned { font-size: 2rem; letter-spacing: 6px; color: var(--amber); margin-top: 12px; }

@media (max-width: 620px) {
  .learner-stats { width: 100%; margin-left: 0; justify-content: space-between; }
  .bins { grid-template-columns: 1fr; }
}
