:root {
  --ink: #20332c;
  --muted: #68736e;
  --paper: #f7f3e8;
  --card: rgba(255, 253, 247, 0.92);
  --green: #2f8062;
  --green-dark: #225e49;
  --green-soft: #dceee3;
  --coral: #f47d65;
  --yellow: #ffd66f;
  --purple: #8277c9;
  --blue: #65a9c4;
  --line: rgba(35, 75, 60, 0.12);
  --shadow: 0 16px 42px rgba(72, 70, 50, 0.1);
  --radius: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 214, 111, 0.2), transparent 26rem),
    radial-gradient(circle at 90% 15%, rgba(101, 169, 196, 0.14), transparent 28rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(47, 128, 98, 0.35);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-one {
  width: 230px;
  height: 230px;
  left: -90px;
  top: 35%;
  background: rgba(244, 125, 101, 0.09);
}

.ambient-two {
  width: 260px;
  height: 260px;
  right: -120px;
  bottom: 10%;
  background: rgba(47, 128, 98, 0.08);
}

#app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) 10px max(22px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(47, 128, 98, 0.08);
  background: rgba(247, 243, 232, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #ffe48c, #ffab83);
  box-shadow: 0 8px 18px rgba(244, 125, 101, 0.18);
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-pill,
.xp-pill {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid rgba(244, 125, 101, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
}

.streak-pill b,
.xp-pill b {
  font-size: 18px;
}

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

.xp-pill {
  border-color: rgba(130, 119, 201, 0.17);
}

.xp-pill b {
  color: #6559ad;
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-size: 20px;
}

#mainContent {
  width: min(1160px, calc(100% - 38px));
  margin: 0 auto;
  padding: 26px 0 calc(108px + var(--safe-bottom));
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.page-heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(285px, 0.8fr);
  gap: 20px;
}

.hero-card,
.panel,
.topic-card,
.mission-card,
.stat-card,
.report-card {
  border: 1px solid rgba(47, 128, 98, 0.09);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  padding: clamp(25px, 4vw, 44px);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.97), rgba(246, 252, 244, 0.95)),
    var(--card);
}

.hero-card::after {
  position: absolute;
  right: -32px;
  bottom: -52px;
  width: 235px;
  height: 235px;
  border: 42px solid rgba(255, 214, 111, 0.25);
  border-radius: 50%;
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.hero-copy h1 {
  max-width: 600px;
  margin: 7px 0 13px;
  font-size: clamp(31px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.hero-copy h1 em {
  color: var(--green);
  font-style: normal;
}

.hero-copy p {
  max-width: 600px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 50px;
  padding: 13px 20px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(47, 128, 98, 0.2);
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button {
  border: 1px solid rgba(47, 128, 98, 0.16);
  background: #fff;
}

.ghost-button {
  border: 0;
  color: var(--green-dark);
  background: var(--green-soft);
}

.mission-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 330px;
  padding: 26px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(155deg, #377f68, #225e49);
}

.mission-card h2 {
  margin: 8px 0 6px;
  font-size: 27px;
}

.mission-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.mission-ring {
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  margin: 16px auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--progress), rgba(255, 255, 255, 0.13) 0);
}

.mission-ring::before {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #2a6a54;
  content: "";
}

.mission-ring span {
  position: relative;
  z-index: 1;
  font-size: 27px;
  font-weight: 900;
}

.mission-card .primary-button {
  width: 100%;
  border-color: var(--yellow);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: none;
}

.section {
  margin-top: 25px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 13px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p,
.section-head small {
  margin: 0;
  color: var(--muted);
}

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

.stat-card {
  padding: 19px;
  border-radius: 22px;
  box-shadow: 0 9px 25px rgba(72, 70, 50, 0.07);
}

.stat-card .stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 13px;
  background: var(--green-soft);
}

.stat-card:nth-child(2) .stat-icon {
  background: #fff0c9;
}

.stat-card:nth-child(3) .stat-icon {
  background: #eeeafd;
}

.stat-card:nth-child(4) .stat-icon {
  background: #fde5df;
}

.stat-card b {
  display: block;
  font-size: 28px;
  line-height: 1.2;
}

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

.chapter-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chapter-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 112px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  text-align: left;
}

.chapter-card::after {
  position: absolute;
  right: -28px;
  bottom: -45px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--chapter-soft);
  content: "";
}

.chapter-icon {
  display: grid;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 20px;
  background: var(--chapter-soft);
  font-size: 31px;
}

.chapter-card strong,
.chapter-card small {
  display: block;
}

.chapter-card strong {
  font-size: 17px;
}

.chapter-card small {
  margin-top: 4px;
  color: var(--muted);
}

.progress-line {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(47, 128, 98, 0.1);
}

.progress-line > i {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.chapter-card .progress-line {
  width: min(220px, 40vw);
  margin-top: 10px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.map-chapter {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 29px;
  background: rgba(255, 255, 255, 0.72);
}

.map-chapter-head {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px;
  background: linear-gradient(135deg, var(--chapter-soft), rgba(255, 255, 255, 0.38));
}

.map-chapter-head .chapter-icon {
  background: rgba(255, 255, 255, 0.7);
}

.map-chapter-head h2 {
  margin: 0;
  font-size: 22px;
}

.map-chapter-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topic-list {
  display: grid;
  gap: 1px;
  padding: 8px;
}

.topic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 11px 13px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.topic-row:hover {
  background: rgba(47, 128, 98, 0.055);
}

.topic-status {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: #edf2ed;
  font-size: 18px;
}

.topic-row strong,
.topic-row small {
  display: block;
}

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

.mastery-badge,
.source-badge,
.stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
}

.mastery-badge {
  color: var(--green-dark);
  background: var(--green-soft);
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.topic-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: flex-start;
  padding: 21px;
  border-radius: 25px;
  cursor: pointer;
  text-align: left;
}

.topic-card:hover {
  transform: translateY(-2px);
}

.topic-card .topic-emoji {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 17px;
  background: var(--topic-soft);
  font-size: 26px;
}

.topic-card h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.topic-card p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 13px;
}

.topic-card .progress-line {
  width: 100%;
  margin-top: auto;
}

.topic-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.study-shell {
  width: min(850px, 100%);
  margin: 0 auto;
}

.study-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.back-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 21px;
}

.study-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.study-card {
  position: relative;
  min-height: 530px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(47, 128, 98, 0.11);
  border-radius: 34px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 24px 64px rgba(67, 66, 50, 0.12);
}

.study-card::before {
  position: absolute;
  top: 0;
  right: 38px;
  left: 38px;
  height: 6px;
  border-radius: 0 0 10px 10px;
  background: var(--stage-color);
  content: "";
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 23px;
}

.source-badge {
  color: var(--muted);
  background: #f0eee6;
}

.stage-badge {
  color: var(--stage-text);
  background: var(--stage-soft);
}

.study-card h1 {
  margin: 0 0 22px;
  font-size: clamp(26px, 4.5vw, 40px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.scaffold-box,
.answer-box,
.memory-box {
  padding: 17px 19px;
  border-radius: 19px;
}

.scaffold-box {
  margin-top: 20px;
  border: 1px dashed rgba(130, 119, 201, 0.28);
  background: #f3f0ff;
}

.scaffold-box b,
.answer-box b,
.memory-box b {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.scaffold-box p,
.answer-box p,
.memory-box p {
  margin: 0;
}

.answer-box {
  margin-top: 18px;
  border: 1px solid rgba(47, 128, 98, 0.13);
  background: #eff8f1;
  animation: rise 0.24s ease-out;
}

.answer-main {
  color: var(--green-dark);
  font-size: 21px;
  font-weight: 900;
  white-space: pre-line;
}

.answer-explain {
  margin-top: 9px !important;
  color: var(--muted);
}

.memory-box {
  margin-top: 12px;
  background: #fff5da;
}

.recall-prompt {
  display: grid;
  min-height: 150px;
  place-items: center;
  margin-top: 20px;
  padding: 24px;
  border: 2px dashed rgba(47, 128, 98, 0.16);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
}

.reveal-button {
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  border: 1px solid var(--green);
  border-radius: 18px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
}

.rating-area {
  margin-top: 23px;
  animation: rise 0.24s ease-out;
}

.rating-area > p {
  margin: 0 0 10px;
  color: var(--muted);
  text-align: center;
}

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

.rating-button {
  min-height: 65px;
  padding: 10px 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.rating-button span,
.rating-button small {
  display: block;
}

.rating-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.rating-button.again {
  background: #fff0eb;
}

.rating-button.hard {
  background: #fff7df;
}

.rating-button.good {
  background: #edf7ee;
}

.rating-button.easy {
  background: #eeeffd;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.choice-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.choice-button .choice-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: #f0eee6;
  font-weight: 900;
}

.choice-button.correct {
  border-color: #75b88a;
  background: #edf8ef;
}

.choice-button.wrong {
  border-color: #e39a8b;
  background: #fff0ec;
}

.choice-button:disabled {
  cursor: default;
}

.quiz-feedback {
  margin-top: 15px;
  padding: 15px 17px;
  border-radius: 17px;
  background: #f3f0ff;
}

.quiz-feedback strong {
  display: block;
  margin-bottom: 4px;
}

.quiz-finish {
  padding: 35px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.finish-orb {
  display: grid;
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe693, #ffac85);
  font-size: 45px;
}

.quiz-finish h1 {
  margin: 0;
  font-size: 36px;
}

.quiz-finish p {
  color: var(--muted);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.report-card {
  padding: 24px;
  border-radius: 27px;
}

.report-card.wide {
  grid-column: 1 / -1;
}

.report-card h2 {
  margin: 0 0 4px;
  font-size: 21px;
}

.report-card > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 190px;
  padding-top: 18px;
}

.day-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  height: 170px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.bar-track {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #eeece4;
}

.bar-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 4px;
  border-radius: inherit;
  background: linear-gradient(#73b58b, #2f8062);
}

.mastery-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mastery-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 45px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.mastery-row b {
  text-align: right;
}

.coach-note {
  padding: 18px;
  border-radius: 19px;
  background: #fff5d8;
}

.coach-note strong {
  display: block;
  margin-bottom: 7px;
}

.coach-note p {
  margin: 0;
  color: #625b47;
}

.exam-hero {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(255, 246, 222, 0.95)),
    var(--card);
}

.daily-focus {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: 34px;
  min-height: 430px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(47, 128, 98, 0.1);
  border-radius: 35px;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 214, 111, 0.32), transparent 17rem),
    linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(244, 251, 243, 0.95));
  box-shadow: var(--shadow);
}

.daily-focus h1 {
  margin: 3px 0 8px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.daily-focus h2 {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 24px;
}

.daily-focus-copy > p {
  max-width: 650px;
  margin: 0 0 23px;
  color: var(--muted);
}

.daily-main-button {
  display: flex;
  width: min(430px, 100%);
  min-height: 76px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 13px 23px;
  border: 0;
  border-bottom: 6px solid #1f6048;
  border-radius: 20px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  text-align: left;
}

.daily-main-button:active {
  border-bottom-width: 2px;
  transform: translateY(4px);
}

.daily-main-button span {
  font-size: 20px;
  font-weight: 900;
}

.daily-main-button small {
  color: rgba(255, 255, 255, 0.76);
}

.fixed-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.fixed-flow > i {
  width: 28px;
  height: 5px;
  border-radius: 99px;
  background: #dcded8;
}

.flow-step {
  display: grid;
  min-height: 148px;
  place-items: center;
  align-content: center;
  padding: 13px 8px;
  border: 3px solid #e0e1dc;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.flow-step > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: #a5aaa5;
  font-size: 21px;
  font-weight: 900;
}

.flow-step b,
.flow-step small {
  display: block;
}

.flow-step b {
  margin-top: 7px;
  font-size: 14px;
}

.flow-step small {
  color: var(--muted);
  font-size: 10px;
}

.flow-step.active {
  border-color: #8277c9;
  background: #f1eeff;
  transform: translateY(-8px);
}

.flow-step.active > span {
  background: #8277c9;
}

.flow-step.done {
  border-color: #72b887;
  background: #edf8f0;
}

.flow-step.done > span {
  background: var(--green);
}

.plan-readonly {
  margin-top: 13px;
  padding: 8px;
  border-radius: 12px;
  color: var(--muted);
  background: #efede6;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.sprint-day.today .plan-readonly {
  color: var(--green-dark);
  background: var(--green-soft);
}

.concept-figure {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid rgba(130, 119, 201, 0.18);
  border-radius: 20px;
  background: #f7f4ff;
}

.concept-figure > div {
  padding: 11px 15px;
}

.concept-figure b,
.concept-figure span {
  display: block;
}

.concept-figure b {
  color: #5b5194;
  font-size: 13px;
}

.concept-figure span {
  color: var(--muted);
  font-size: 12px;
}

.concept-figure img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: #fff;
}

.countdown-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(244, 125, 101, 0.17);
  border-radius: 999px;
  color: #a34c3c;
  background: #fff0eb;
  font-size: 13px;
  font-weight: 900;
}

.sprint-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sprint-day {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(72, 70, 50, 0.06);
}

.sprint-day.today {
  border: 2px solid rgba(47, 128, 98, 0.5);
  background: #f6fcf6;
  box-shadow: 0 15px 35px rgba(47, 128, 98, 0.12);
  transform: translateY(-4px);
}

.sprint-day.past:not(.today) {
  background: rgba(245, 243, 236, 0.78);
}

.sprint-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.day-orb {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.sprint-day:nth-child(2) .day-orb {
  background: #c68b39;
}

.sprint-day:nth-child(3) .day-orb {
  background: #8277c9;
}

.sprint-day:nth-child(4) .day-orb {
  background: #d06d78;
}

.sprint-day:nth-child(5) .day-orb {
  background: #374f73;
}

.plan-status {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eeece4;
  font-size: 11px;
  font-weight: 800;
}

.sprint-day.today .plan-status {
  color: var(--green-dark);
  background: var(--green-soft);
}

.sprint-day > small {
  color: var(--muted);
}

.sprint-day h3 {
  margin: 5px 0 3px;
  font-size: 18px;
  line-height: 1.3;
}

.sprint-day > p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sprint-day ul {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding-left: 18px;
  color: #4f5f58;
  font-size: 12px;
}

.sprint-day .progress-line {
  margin-top: auto;
  margin-bottom: 13px;
}

.sprint-day button {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
}

.figure-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid rgba(130, 119, 201, 0.15);
  border-radius: 28px;
  background: linear-gradient(135deg, #f4f1ff, #fffdf7);
  box-shadow: var(--shadow);
}

.figure-banner h2 {
  margin: 0 0 4px;
}

.figure-banner p {
  margin: 0;
  color: var(--muted);
}

.adventure-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(130, 119, 201, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 5%, rgba(255, 214, 111, 0.32), transparent 16rem),
    linear-gradient(135deg, #f5f2ff, #fffdf6);
  box-shadow: var(--shadow);
}

.adventure-copy h2 {
  margin: 0 0 6px;
  font-size: 27px;
}

.adventure-copy > p {
  margin: 0 0 15px;
  color: var(--muted);
}

.adventure-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.adventure-stats span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #5d6260;
  font-size: 12px;
  font-weight: 800;
}

.quest-path {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.quest-path > i {
  flex: 1;
  height: 5px;
  min-width: 18px;
  border-radius: 99px;
  background: #dedbe8;
}

.quest-node {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 88px;
  min-height: 112px;
  place-items: center;
  align-content: center;
  padding: 9px;
  border: 4px solid #e5e2ec;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(66, 58, 100, 0.1);
  text-align: center;
}

.quest-node span {
  font-size: 29px;
}

.quest-node b,
.quest-node small {
  display: block;
}

.quest-node b {
  margin-top: 2px;
  font-size: 13px;
}

.quest-node small {
  color: var(--muted);
  font-size: 10px;
}

.quest-node.done {
  border-color: #84c597;
  background: #eff9f1;
}

.quest-node.active {
  border-color: #8277c9;
  background: #f0edff;
  transform: translateY(-12px) rotate(-2deg);
}

.quest-node.boss {
  border-color: #f1b964;
  background: #fff6dc;
}

.game-mode-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid rgba(130, 119, 201, 0.18);
  border-radius: 25px;
  background: linear-gradient(135deg, #f1edff, #fffdf8);
}

.game-mode-strip > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-mode-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 19px;
  background: #ded8ff;
  font-size: 28px;
}

.game-mode-strip strong,
.game-mode-strip small {
  display: block;
}

.game-mode-strip small {
  color: var(--muted);
}

.exam-challenge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 25px;
  border: 1px solid rgba(130, 119, 201, 0.22);
  border-radius: 28px;
  background: linear-gradient(135deg, #eeeaff 0%, #fff8df 100%);
  box-shadow: 0 18px 42px rgba(69, 58, 121, 0.08);
}

.exam-challenge-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.exam-challenge-copy strong,
.exam-challenge-copy small {
  display: block;
}

.exam-challenge-copy strong {
  margin-bottom: 5px;
  font-size: 20px;
}

.exam-challenge-copy small {
  max-width: 610px;
  color: var(--muted);
  line-height: 1.65;
}

.exam-bank-summary {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fffdf8;
}

.exam-bank-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.exam-bank-numbers span {
  padding: 14px;
  border-radius: 18px;
  background: #f5f2e9;
  text-align: center;
}

.exam-bank-numbers b,
.exam-bank-numbers small {
  display: block;
}

.exam-bank-numbers b {
  font-size: 25px;
}

.exam-bank-numbers small,
.exam-bank-summary > p {
  color: var(--muted);
}

.exam-topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 17px 0;
}

.exam-topic-cloud span {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.exam-bank-summary > p {
  margin: 0;
  line-height: 1.65;
}

.game-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.game-hud {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 17px;
}

.hud-stat {
  min-width: 62px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.hud-stat.hearts {
  min-width: 86px;
  letter-spacing: 1px;
}

.game-card {
  position: relative;
  min-height: 620px;
  padding: clamp(25px, 5vw, 46px);
  border: 1px solid rgba(130, 119, 201, 0.15);
  border-radius: 34px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 24px 64px rgba(67, 66, 50, 0.13);
}

.game-card::before {
  position: absolute;
  top: 0;
  right: 34px;
  left: 34px;
  height: 7px;
  border-radius: 0 0 9px 9px;
  background: #8277c9;
  content: "";
}

.game-card.game-correct::before {
  background: #4fa86f;
}

.game-card.game-wrong::before {
  background: #e07b64;
}

.game-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.game-kicker > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #efecfb;
  color: #5b5194;
  font-size: 12px;
  font-weight: 900;
}

.game-kicker > span:nth-child(2) {
  color: var(--green-dark);
  background: var(--green-soft);
}

.game-kicker .combo-badge {
  color: #9d4c29;
  background: #fff0d1;
  animation: comboPulse 0.7s ease both;
}

.game-kicker .real-exam-badge {
  color: #965423;
  background: #fff0d5;
}

.game-card h1 {
  margin: 0 0 22px;
  font-size: clamp(25px, 4.5vw, 38px);
  line-height: 1.35;
}

.game-instruction {
  margin: -10px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 15px;
  border: 2px solid #e5e3dc;
  border-bottom-width: 5px;
  border-radius: 19px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.game-option:hover {
  border-color: #bdb6e5;
}

.game-option:active {
  border-bottom-width: 2px;
  transform: translateY(3px);
}

.option-marker {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: #5f5a73;
  background: #eeece5;
  font-weight: 900;
}

.game-option.selected {
  border-color: #8277c9;
  background: #f0edff;
}

.game-option.selected .option-marker {
  color: #fff;
  background: #8277c9;
}

.game-option.correct {
  border-color: #57aa73;
  background: #eaf8ee;
}

.game-option.correct .option-marker {
  color: #fff;
  background: #4fa86f;
}

.game-option.wrong {
  border-color: #dc806c;
  background: #fff0ec;
}

.game-option.wrong .option-marker {
  color: #fff;
  background: #dc806c;
}

.true-false-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.true-false-grid .game-option {
  min-height: 112px;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.true-false-grid .option-marker {
  width: 56px;
  height: 56px;
  font-size: 25px;
}

.game-check-button {
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  border: 0;
  border-bottom: 5px solid #514698;
  border-radius: 17px;
  color: #fff;
  background: #8277c9;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.game-check-button:active:not(:disabled) {
  border-bottom-width: 2px;
  transform: translateY(3px);
}

.game-check-button:disabled {
  border-bottom-color: #cac7d7;
  color: #898793;
  background: #e4e2e9;
  cursor: default;
}

.order-answer {
  display: flex;
  min-height: 100px;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 15px;
  border: 2px dashed #cbc5e7;
  border-radius: 19px;
  background: #f8f6ff;
}

.order-answer > small {
  margin: auto;
  color: var(--muted);
}

.order-answer > span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(91, 81, 148, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.order-answer em {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #8277c9;
  font-size: 11px;
  font-style: normal;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.word-bank button {
  min-height: 46px;
  padding: 9px 13px;
  border: 2px solid #dfdcd4;
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.game-action-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 19px;
}

.game-action-row .game-check-button {
  margin-top: 0;
}

.match-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.match-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.match-column > strong {
  padding: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.match-arrows {
  display: grid;
  width: 30px;
  place-items: center;
  color: #8277c9;
  font-size: 22px;
  font-weight: 900;
}

.match-card {
  min-height: 64px;
  padding: 10px;
  border: 2px solid #e1ded6;
  border-bottom-width: 5px;
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.mistake-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.mistake-summary > div {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.mistake-summary b,
.mistake-summary small {
  display: block;
}

.mistake-summary b {
  font-size: 30px;
}

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

.mistake-list {
  display: grid;
  gap: 12px;
}

.mistake-item {
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 6px solid #e0a24e;
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.77);
}

.mistake-item.urgent {
  border-left-color: #d86050;
  background: #fff8f5;
}

.mistake-topic {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.mistake-item h2 {
  margin: 5px 0 12px;
  font-size: 18px;
}

.mistake-item > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mistake-item > div span,
.mistake-item > div strong {
  padding: 5px 8px;
  border-radius: 999px;
  background: #efede6;
  color: var(--muted);
  font-size: 11px;
}

.mistake-item > div strong {
  color: #9c3f31;
  background: #ffe5df;
}

.nav-icon-wrap {
  position: relative;
}

.nav-icon-wrap i {
  position: absolute;
  top: -7px;
  right: -13px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #fffdf7;
  border-radius: 99px;
  color: #fff;
  background: #d65f4d;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.nav-icon-wrap i[hidden] {
  display: none;
}

.match-card.selected {
  border-color: #8277c9;
  color: #554b92;
  background: #eeebff;
}

.match-card.matched {
  border-color: #65ad7b;
  color: #2f8062;
  background: #eaf8ee;
  opacity: 0.72;
}

.mini-feedback {
  margin: 13px 0 0;
  padding: 10px 13px;
  border-radius: 13px;
  background: #fff0f1;
  color: #994b57;
  font-size: 13px;
  font-weight: 800;
}

.game-figure {
  margin: -5px 0 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #f0eee6;
}

.game-figure img {
  display: block;
  width: 100%;
  max-height: 270px;
  object-fit: contain;
  background: #fff;
}

.game-figure small {
  display: block;
  padding: 7px 12px;
  color: var(--muted);
  text-align: right;
}

.exam-question-figure img {
  max-height: 360px;
}

.exam-image-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  background: #fffdf8;
}

.exam-image-caption small {
  padding: 0;
  text-align: left;
}

.ghost-button.compact {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 11px;
  font-size: 12px;
}

.game-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 20px;
  animation: rise 0.22s ease-out;
}

.game-feedback.correct {
  color: #245f40;
  background: #dcf3e2;
}

.game-feedback.wrong {
  color: #7b4036;
  background: #ffe5de;
}

.feedback-icon {
  font-size: 29px;
}

.game-feedback strong,
.game-feedback p,
.game-feedback small {
  display: block;
}

.game-feedback p {
  margin: 3px 0 0;
}

.game-feedback small {
  margin-top: 5px;
  font-weight: 800;
}

.game-feedback button {
  min-width: 100px;
  min-height: 48px;
  border: 0;
  border-bottom: 4px solid rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  color: #fff;
  background: #338757;
  cursor: pointer;
  font-weight: 900;
}

.game-feedback.correct button {
  background: #338757;
}

.game-feedback.wrong button {
  background: #c35e4c;
}

.confetti {
  position: fixed;
  z-index: 130;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  --x: calc((var(--i) * 47) % 100);
  position: absolute;
  top: -30px;
  left: calc(var(--x) * 1%);
  width: 9px;
  height: 17px;
  border-radius: 3px;
  background: hsl(calc(var(--i) * 53), 75%, 60%);
  animation: confettiFall 1.2s calc(var(--i) * 0.025s) ease-in forwards;
  transform: rotate(calc(var(--i) * 29deg));
}

.game-finish {
  padding: 35px;
  border: 1px solid rgba(130, 119, 201, 0.15);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 214, 111, 0.3), transparent 20rem),
    #fffdf7;
  box-shadow: var(--shadow);
  text-align: center;
}

.finish-burst {
  display: grid;
  width: 130px;
  height: 130px;
  margin: 0 auto 18px;
  place-items: center;
  border: 8px solid #fff1b9;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe78f, #ffad84);
  box-shadow: 0 0 0 13px rgba(255, 214, 111, 0.16);
  font-size: 54px;
  animation: trophyPop 0.6s ease both;
}

.game-finish h1 {
  margin: 0;
  font-size: 40px;
}

.game-finish > p {
  max-width: 620px;
  margin: 8px auto 22px;
  color: var(--muted);
}

.reward-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.reward-row > span {
  padding: 17px 10px;
  border-radius: 18px;
  background: #f3f0ff;
}

.reward-row b,
.reward-row small {
  display: block;
}

.reward-row b {
  font-size: 22px;
}

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

.badge-unlock {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 550px;
  margin: 0 auto 23px;
  padding: 15px 18px;
  border: 1px solid #f0d583;
  border-radius: 19px;
  background: #fff5d7;
  text-align: left;
}

.badge-unlock > span {
  font-size: 39px;
}

.badge-unlock strong,
.badge-unlock small {
  display: block;
}

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

.ipad-reward,
.reward-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 590px;
  margin: 0 auto 15px;
  padding: 16px 18px;
  border-radius: 19px;
  text-align: left;
}

.ipad-reward {
  border: 1px solid #e8c461;
  background: linear-gradient(135deg, #fff3bd, #fffaf0);
}

.ipad-reward > span {
  font-size: 36px;
}

.ipad-reward strong,
.ipad-reward small,
.reward-progress strong,
.reward-progress span {
  display: block;
}

.ipad-reward small,
.reward-progress span {
  margin-top: 3px;
  color: var(--muted);
}

.reward-progress {
  display: block;
  border: 1px solid #d9d3f4;
  background: #f4f1ff;
}

@keyframes comboPulse {
  0% { transform: scale(0.7); }
  65% { transform: scale(1.12) rotate(-2deg); }
  100% { transform: scale(1); }
}

@keyframes confettiFall {
  to { top: 100vh; transform: translateX(80px) rotate(580deg); opacity: 0.2; }
}

@keyframes trophyPop {
  0% { transform: scale(0.2) rotate(-18deg); }
  70% { transform: scale(1.14) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

.figure-filters {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin: -4px 0 20px;
  padding: 5px 2px 10px;
  scrollbar-width: none;
}

.figure-filters::-webkit-scrollbar {
  display: none;
}

.figure-filters button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.figure-filters button.active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.figure-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 30px rgba(72, 70, 50, 0.07);
  cursor: pointer;
  text-align: left;
}

.figure-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1.7;
  background: #eceae2;
}

.figure-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.figure-card:hover .figure-image-wrap img {
  transform: scale(1.025);
}

.key-figure,
.viewed-figure {
  position: absolute;
  top: 10px;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 99px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 5px 16px rgba(32, 51, 44, 0.16);
}

.key-figure {
  left: 10px;
  background: #d46c57;
}

.viewed-figure {
  right: 10px;
  background: var(--green);
}

.figure-card-copy {
  display: block;
  padding: 16px;
}

.figure-card-copy small,
.figure-card-copy strong,
.figure-card-copy span {
  display: block;
}

.figure-card-copy small {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.figure-card-copy strong {
  margin: 4px 0;
  font-size: 17px;
}

.figure-card-copy span {
  color: var(--muted);
  font-size: 12px;
}

.figure-modal-backdrop {
  padding: 14px;
}

.figure-modal {
  width: min(1120px, 100%);
  max-height: calc(100vh - 28px);
}

.figure-question {
  margin-bottom: 14px;
  padding: 14px 17px;
  border-radius: 17px;
  background: #fff3d5;
}

.figure-question strong {
  display: block;
  margin-bottom: 3px;
}

.figure-question p,
.figure-tip {
  margin: 0;
}

.figure-full {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.figure-tip {
  padding: 12px 2px 15px;
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(25, 38, 33, 0.38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  background: #fffdf7;
  box-shadow: 0 30px 80px rgba(25, 38, 33, 0.24);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
}

.exam-image-backdrop {
  padding: 14px;
}

.exam-image-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 28px);
}

.exam-image-scroll {
  max-height: calc(100vh - 140px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.exam-image-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row strong,
.setting-row small {
  display: block;
}

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

.setting-row select {
  min-width: 110px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.danger-button {
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid #efb3a7;
  border-radius: 13px;
  color: #a94432;
  background: #fff2ef;
  cursor: pointer;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(14px + var(--safe-bottom));
  left: max(18px, env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(560px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(47, 128, 98, 0.12);
  border-radius: 23px;
  background: rgba(255, 253, 247, 0.91);
  box-shadow: 0 16px 48px rgba(40, 52, 45, 0.17);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  display: grid;
  min-height: 54px;
  place-items: center;
  align-content: center;
  border: 0;
  border-radius: 17px;
  background: transparent;
  cursor: pointer;
}

.nav-item span,
.nav-item small {
  display: block;
}

.nav-item span {
  font-size: 21px;
  line-height: 1.1;
}

.nav-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.nav-item.active {
  background: var(--green-soft);
}

.nav-item.active small {
  color: var(--green-dark);
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 200;
  top: calc(86px + env(safe-area-inset-top, 0px));
  left: 50%;
  max-width: calc(100% - 36px);
  padding: 11px 17px;
  border-radius: 99px;
  color: #fff;
  background: #263c33;
  box-shadow: 0 10px 30px rgba(38, 60, 51, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty-state {
  padding: 46px 24px;
  border: 1px dashed rgba(47, 128, 98, 0.2);
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state .big-emoji {
  font-size: 48px;
}

.empty-state h2 {
  margin: 8px 0 4px;
}

.empty-state p {
  margin: 0 0 17px;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .hero-grid,
  .map-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-card.wide {
    grid-column: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sprint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adventure-panel {
    grid-template-columns: 1fr;
  }

  .daily-focus {
    grid-template-columns: 1fr;
  }

  .quest-path {
    justify-content: stretch;
  }

  .hero-card,
  .mission-card {
    min-height: auto;
  }

  .chapter-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 70px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .streak-pill {
    padding: 8px 10px;
  }

  .xp-pill {
    padding: 8px 9px;
  }

  .xp-pill small,
  .streak-pill small {
    display: none;
  }

  #mainContent {
    width: min(100% - 24px, 1160px);
    padding-top: 17px;
  }

  .hero-card {
    padding: 25px 22px;
    border-radius: 28px;
  }

  .hero-copy h1 {
    font-size: 35px;
  }

  .mission-card {
    border-radius: 27px;
  }

  .practice-grid {
    grid-template-columns: 1fr;
  }

  .sprint-grid,
  .figure-grid {
    grid-template-columns: 1fr;
  }

  .sprint-day {
    min-height: 310px;
  }

  .figure-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .figure-banner .primary-button {
    width: 100%;
  }

  .adventure-panel {
    padding: 22px 18px;
  }

  .daily-focus {
    min-height: auto;
    padding: 27px 21px;
    border-radius: 28px;
  }

  .fixed-flow {
    grid-template-columns: 1fr;
  }

  .fixed-flow > i {
    width: 5px;
    height: 20px;
    margin: 0 auto;
  }

  .flow-step {
    min-height: 96px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    column-gap: 12px;
    padding: 12px 16px;
    text-align: left;
  }

  .flow-step > span {
    grid-row: 1 / 3;
  }

  .flow-step b {
    margin-top: 0;
  }

  .match-board {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 6px;
  }

  .match-arrows {
    width: 18px;
    font-size: 15px;
  }

  .match-card {
    min-height: 72px;
    padding: 8px 5px;
    font-size: 12px;
  }

  .mistake-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .mistake-summary > div {
    padding: 14px 5px;
  }

  .mistake-summary b {
    font-size: 24px;
  }

  .quest-path {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 16px 3px 4px;
  }

  .quest-path > i {
    flex: 0 0 22px;
  }

  .quest-node {
    flex-basis: 82px;
  }

  .game-mode-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-challenge-card {
    align-items: stretch;
    flex-direction: column;
  }

  .exam-challenge-card .primary-button {
    width: 100%;
  }

  .exam-bank-numbers {
    grid-template-columns: 1fr;
  }

  .exam-image-caption {
    align-items: stretch;
    flex-direction: column;
  }

  .game-hud {
    grid-template-columns: auto minmax(70px, 1fr) auto;
  }

  .game-hud .hud-stat:last-child {
    display: none;
  }

  .game-card {
    min-height: 540px;
    padding: 27px 19px;
    border-radius: 27px;
  }

  .game-options,
  .true-false-grid {
    grid-template-columns: 1fr;
  }

  .true-false-grid .game-option {
    min-height: 78px;
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
  }

  .true-false-grid .option-marker {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .game-feedback {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .game-feedback button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .reward-row {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-top {
    gap: 10px;
  }

  .study-card {
    min-height: 490px;
    padding: 27px 21px;
    border-radius: 27px;
  }

  .study-card::before {
    right: 25px;
    left: 25px;
  }

  .rating-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mastery-row {
    grid-template-columns: 86px minmax(0, 1fr) 39px;
    gap: 8px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 88vh;
    padding-bottom: calc(26px + var(--safe-bottom));
    border-radius: 29px 29px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
