* {
  box-sizing: border-box
}

html {
  color-scheme: light
}

body {
  margin: 0;
  background: #f6f8fa;
  color: #233c43;
  font-family: ui-rounded, "Avenir Next", Arial, sans-serif;
  letter-spacing: 0;
  font-size: 16px;
  line-height: 1.5
}

button,
input,
select {
  font: inherit
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent
}

button,
a {
  touch-action: manipulation
}

button {
  cursor: pointer
}

button:disabled {
  cursor: default;
  opacity: .5
}

button,
a,
select,
input {
  outline-offset: 4px
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #a66008
}

a {
  color: inherit
}

h1,
h2,
h3,
p {
  margin-top: 0
}

h1 {
  font-size: 30px;
  line-height: 1.25;
  margin-bottom: 10px
}

h2 {
  font-size: 20px;
  line-height: 1.3
}

h3 {
  font-size: 17px
}

small {
  font-size: 12px
}

[hidden] {
  display: none !important
}

.muted {
  color: #576c72
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid #dde7e8;
  gap: 20px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3
}

.brand small {
  display: block;
  color: #60767a;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px
}

.offline {
  font-size: 12px;
  color: #53736a
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid #d2dfe1;
  background: #fff;
  border-radius: 6px;
  color: #35565d;
  font-size: 23px
}

.app-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto
}

.navigation {
  padding: 32px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid #e1e9ea;
  min-height: calc(100vh - 88px)
}

.navigation a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  padding: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px
}

.navigation a span {
  width: 22px;
  font-size: 21px;
  text-align: center
}

.navigation a:hover {
  background: #e9f1f0
}

.navigation a[aria-current=page] {
  background: #d9eee7;
  color: #115e52
}

.nav-special {
  border-top: 1px solid #dce6e7;
  margin-top: 18px;
  padding-top: 12px
}

.privacy {
  font-size: 12px;
  line-height: 1.9;
  color: #60747a;
  margin: 42px 12px
}

main {
  min-width: 0;
  padding: 34px 40px 60px;
  outline: none;
  max-width: 1300px
}

.page-heading {
  margin-bottom: 26px
}

.page-heading p {
  margin: 0
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px
}

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 3px solid #e1ecec;
  padding: 8px 4px 16px
}

.stat strong {
  display: block;
  font-size: 26px;
  line-height: 1.2
}

.stat small {
  display: block;
  color: #5c7076;
  font-size: 11px;
  margin-top: 3px
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff0be;
  color: #8a5b05;
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0
}

.stat:nth-child(2) .stat-icon {
  background: #e2edf8;
  color: #3672a3
}

.stat:nth-child(3) .stat-icon {
  background: #fce3e1;
  color: #ae4d47
}

.stat:nth-child(4) .stat-icon {
  background: #dcefe6;
  color: #1c7458
}

.study-shortcuts {
  display: flex;
  gap: 12px;
  margin: -8px 0 24px;
}
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px
}

.world {
  min-width: 0
}

.trail {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: cover;
  border-radius: 6px
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 16px;
  gap: 12px
}

.section-heading h2 {
  margin: 0
}

.section-heading span {
  font-size: 12px;
  white-space: nowrap
}

.levels {
  position: relative;
  padding: 4px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 17px
}

.levels:before {
  content: "";
  position: absolute;
  width: 4px;
  background: #cddfda;
  top: 15px;
  bottom: 45px;
  left: 40px
}

.level {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 28px);
  text-align: left;
  border: 1px solid #d6e4e2;
  border-bottom: 3px solid #bdcfc9;
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  min-height: 84px;
  color: inherit
}

.level:nth-child(even) {
  margin-left: 28px
}

.level.locked {
  background: #edf1f2;
  border-color: #dce3e5;
  opacity: 1;
  color: #6c7c80
}

.level-number {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #157567;
  color: white;
  font-size: 20px;
  font-weight: bold
}

.locked .level-number {
  background: #d5dfe1;
  color: #657a7f
}

.level-text {
  min-width: 0;
  flex: 1
}

.level-text strong {
  display: block;
  font-size: 15px;
  line-height: 1.3
}

.level-text small {
  display: block;
  margin-top: 4px;
  color: #6b7d81
}

.stars {
  color: #9a690b;
  white-space: nowrap;
  font-size: 19px
}

.locked .stars {
  color: #879598
}

.mission {
  padding-top: 10px
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: #317b6a;
  margin-bottom: 12px
}

.mission h2 {
  font-size: 22px
}

.mission .primary,
.mission .secondary {
  width: 100%;
  margin-bottom: 10px
}

.mission p {
  font-size: 14px
}

hr {
  border: 0;
  border-top: 1px solid #dae4e5;
  margin: 24px 0
}

.primary,
.secondary,
.danger,
.answer-button,
.token {
  min-height: 48px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 12px 20px;
  line-height: 1.3;
  font-weight: 650;
  overflow-wrap: anywhere
}

.primary {
  background: #157567;
  color: white;
  border-color: #0d6456;
  border-bottom-width: 3px
}

.primary:hover:not(:disabled) {
  background: #0f6559
}

.secondary {
  background: white;
  color: #2c555d;
  border-color: #cbdcdf;
  border-bottom-width: 2px
}

.secondary:hover:not(:disabled) {
  background: #eaf3f1
}

.danger {
  background: #fff0ef;
  color: #a43236;
  border-color: #eac3c1
}

.text-button {
  background: transparent;
  border: 0;
  color: #32665d;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 44px;
  padding: 10px 4px
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 22px 0
}

.centered {
  justify-content: center
}

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

.chapter-card {
  text-align: left;
  color: inherit;
  background: white;
  border: 1px solid #d2e2df;
  border-radius: 8px;
  padding: 22px;
  position: relative;
  min-height: 165px
}

.chapter-card h2 {
  font-size: 18px;
  padding-right: 14px
}

.chapter-card .muted {
  font-size: 13px
}

.card-arrow {
  position: absolute;
  bottom: 18px;
  right: 20px;
  font-size: 24px;
  color: #147567
}

.setup {
  max-width: 600px;
  margin: 36px auto;
  border-top: 1px solid #d8e3e2;
  padding: 28px 0
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  margin: 20px 0;
  max-width: 600px
}

.field select,
input[type=text] {
  width: 100%;
  min-height: 50px;
  border: 1px solid #b9cfd0;
  border-radius: 6px;
  background: #fff;
  color: #243e45;
  padding: 12px
}

.audio-note {
  font-size: 13px;
  color: #5c6f76;
  margin-top: 20px
}

.flashcard {
  max-width: 690px;
  min-height: 320px;
  margin: 32px auto 20px;
  background: #fff;
  border: 1px solid #cbdedb;
  border-bottom: 5px solid #cbdedb;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 22px;
  animation: appear .22s ease-out
}

.flash-word {
  font-size: 34px;
  line-height: 1.35;
  overflow-wrap: anywhere
}

.translation {
  font-size: 22px;
  margin: 0;
  color: #5e7275
}

.number-value {
  font-size: 40px;
  font-weight: 800;
  color: #147567
}

.badge {
  font-size: 12px;
  display: inline-block;
  border-radius: 4px;
  padding: 5px 9px;
  background: #eef2f4;
  color: #526970;
  white-space: nowrap
}

.badge.mastered {
  background: #dff1e6;
  color: #236e4f
}

.badge.review {
  background: #fff0c7;
  color: #775409
}

.badge.hard {
  background: #fce2df;
  color: #963d37
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px
}

.quiz-top span {
  font-size: 13px;
  color: #547078
}

progress {
  height: 12px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  background: #dce8e5;
  accent-color: #17816e
}

progress::-webkit-progress-bar {
  background: #dce8e5;
  border-radius: 10px
}

progress::-webkit-progress-value {
  background: #17816e;
  border-radius: 10px
}

.question {
  max-width: 760px;
  margin: 34px auto 26px;
  text-align: center
}

.question-title {
  font-size: 24px;
  margin-bottom: 25px
}

.prompt {
  font-size: 32px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  margin: 28px 0
}

.equals {
  font-size: 23px;
  color: #688178
}

.question .audio-button {
  margin-bottom: 15px
}

.answers {
  margin-top: 26px
}

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

.answer-button {
  color: #294950;
  background: white;
  border: 2px solid #d1e0e1;
  min-height: 85px;
  font-size: 20px;
  font-weight: 500
}

.answer-button:hover:not(:disabled) {
  border-color: #16816e;
  background: #edf8f4;
  transform: translateY(-2px)
}

.feedback {
  max-width: 760px;
  margin: 0 auto;
  padding: 0
}

.feedback.success,
.feedback.retry {
  padding: 22px;
  border-top: 3px solid #72bba1;
  background: #e3f3eb
}

.feedback.retry {
  background: #fff0d2;
  border-color: #d5ae50
}

.feedback h2 {
  font-size: 19px
}

.feedback .primary {
  display: block;
  margin-top: 18px
}

.correction {
  display: block;
  font-size: 24px;
  overflow-wrap: anywhere
}

.listen-large {
  font-size: 25px;
  min-height: 110px;
  padding: 24px !important
}

.writing {
  max-width: 560px;
  margin: auto
}

.writing input {
  font-size: 23px
}

.accents {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0
}

.accents button {
  padding: 8px;
  min-width: 42px
}

.built-sentence {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 95px;
  padding: 14px;
  background: #e6efed;
  border: 2px dashed #9abbb2;
  border-radius: 6px;
  margin-bottom: 18px
}

.token-bank {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 22px
}

.token {
  background: white;
  border-color: #b6cfc8;
  color: #274b45
}

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

.memory-card {
  border: 2px solid #bad8cf;
  border-radius: 8px;
  background: #197767;
  color: white;
  min-height: 138px;
  padding: 14px;
  overflow-wrap: anywhere;
  font-size: 28px;
  transition: background .18s, transform .18s
}

.memory-card.flipped {
  background: #fff;
  color: #294d47;
  font-size: 18px;
  transform: rotate(1deg)
}

.memory-card.matched {
  background: #e4f3e8;
  color: #245d41;
  font-size: 18px;
  opacity: 1;
  border-style: dashed
}

.result {
  text-align: center;
  padding: 26px 0
}

.trophy {
  display: block;
  font-size: 70px;
  color: #bb830f
}

.result-stars {
  font-size: 42px;
  color: #b17a08
}

.result-score {
  font-size: 48px;
  margin: 15px 0
}

.streak {
  font-weight: bold;
  color: #397259
}

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

.chapter-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #d9e4e4;
  cursor: pointer;
  font-size: 15px
}

.check-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  cursor: pointer
}

input[type=checkbox] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: #157567
}

.word-list {
  margin: 24px 0
}

.word-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #d9e3e4;
  padding: 20px 0
}

.word-row>div {
  flex: 1;
  min-width: 0
}

.word-title {
  font-size: 18px;
  overflow-wrap: anywhere
}

.word-row p {
  margin: 5px 0 0
}

.word-row .audio-button {
  white-space: nowrap
}

.progress-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0
}

.chapter-progress-row {
  display: grid;
  grid-template-columns: 150px 1fr 120px;
  gap: 12px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #dce6e7
}

.chapter-progress-row h2 {
  font-size: 16px;
  margin: 0
}

.chapter-progress-row>span:not(.stars) {
  font-size: 13px;
  color: #5f7379
}

.chapter-progress-row progress {
  grid-column: 1/3;
  grid-row: 2
}

.chapter-progress-row .stars {
  grid-column: 3;
  grid-row: 1/3;
  text-align: right
}

.parent-controls {
  border-block: 1px solid #d4e3df;
  margin: 28px 0;
  padding: 10px 0
}

.parent-controls p {
  font-size: 13px
}

.empty {
  text-align: center;
  padding: 50px 12px
}

.empty-symbol {
  display: block;
  font-size: 64px;
  color: #c4922b
}

.empty h2 {
  margin: 20px 0 12px
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  padding: 14px 22px;
  max-width: min(92%, 650px);
  width: max-content;
  background: #243f46;
  color: white;
  border-radius: 6px;
  z-index: 40;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: transform .2s, opacity .2s
}

#toast.show {
  transform: translateX(-50%);
  opacity: 1
}

dialog {
  border: 1px solid #bfd6d0;
  border-radius: 8px;
  max-width: min(92%, 470px);
  padding: 30px;
  color: #29474c
}

dialog::backdrop {
  background: #142e3f66
}

dialog h2 {
  font-size: 23px
}

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

#confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 15px;
  animation: fall 1.8s var(--delay) ease-in forwards
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(540deg)
  }
}

@keyframes appear {
  from {
    opacity: .5;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@media(min-width:1400px) {
  .level {
    width: calc(100% - 65px)
  }

  .level:nth-child(even) {
    margin-left: 65px
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 45px
  }
}

@media(max-width:1100px) {
  .app-shell {
    grid-template-columns: 175px minmax(0, 1fr)
  }

  main {
    padding: 28px 25px
  }

  .navigation {
    padding: 25px 10px
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr)
  }

  .mission {
    display: none
  }

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

  .stats {
    gap: 8px
  }

  .stat {
    gap: 8px
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 18px
  }
}

@media(max-width:760px) {
  .topbar {
    height: 76px;
    padding: 0 16px;
    gap: 10px
  }

  .brand {
    font-size: 16px;
    gap: 9px
  }

  .brand img {
    width: 35px;
    height: 35px
  }

  .brand small {
    font-size: 10px
  }

  .header-tools {
    gap: 4px
  }

  .offline {
    display: none
  }

  .icon-button {
    width: 38px;
    height: 40px;
    font-size: 20px
  }

  .app-shell {
    display: block
  }

  .navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    background: white;
    min-height: 0;
    border-right: 0;
    border-top: 1px solid #d8e5e1;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px
  }

  .navigation>a {
    font-size: 10px;
    min-height: 52px;
    padding: 5px 2px;
    flex-direction: column;
    gap: 0;
    text-align: center
  }

  .navigation a span {
    font-size: 21px
  }

  .navigation .nav-special,
  .privacy {
    display: none
  }

  main {
    padding: 24px 17px 100px
  }

  .page-heading {
    margin-bottom: 22px
  }

  h1 {
    font-size: 25px
  }

  .page-heading p {
    font-size: 14px
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px
  }

  .stat {
    padding-bottom: 12px
  }

  .stat strong {
    font-size: 24px
  }

  .stat small {
    font-size: 11px
  }

  .stat-icon {
    width: 38px;
    height: 38px
  }

  .section-heading h2 {
    font-size: 18px
  }

  .trail {
    height: 135px
  }

  .level {
    padding: 12px;
    gap: 10px;
    width: calc(100% - 14px)
  }

  .level:nth-child(even) {
    margin-left: 14px
  }

  .level-number {
    width: 38px;
    height: 38px;
    font-size: 18px
  }

  .level-text strong {
    font-size: 14px
  }

  .level-text small {
    font-size: 11px
  }

  .level .stars {
    font-size: 16px
  }

  .chapter-grid {
    gap: 12px
  }

  .chapter-card {
    padding: 15px;
    min-height: 165px
  }

  .chapter-card h2 {
    font-size: 16px
  }

  .flashcard {
    padding: 24px 18px;
    min-height: 300px
  }

  .flash-word {
    font-size: 28px
  }

  .translation {
    font-size: 19px
  }

  .quiz-top {
    flex-wrap: wrap;
    font-size: 13px
  }

  .quiz-top span {
    flex-basis: 100%;
    text-align: right
  }

  .question {
    margin-top: 25px
  }

  .question-title {
    font-size: 21px
  }

  .prompt {
    font-size: 27px
  }

  .choice-grid {
    gap: 10px
  }

  .answer-button {
    font-size: 17px;
    padding: 12px;
    min-height: 85px
  }

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

  .memory-card {
    min-height: 116px
  }

  .memory-card.flipped,
  .memory-card.matched {
    font-size: 16px
  }

  .chapter-checks {
    grid-template-columns: 1fr
  }

  .word-row {
    flex-wrap: wrap
  }

  .word-row>div {
    flex-basis: 100%
  }

  .chapter-progress-row {
    grid-template-columns: 110px 1fr 64px;
    gap: 8px
  }

  .chapter-progress-row h2 {
    font-size: 14px
  }

  .chapter-progress-row>span:not(.stars) {
    font-size: 11px
  }

  .chapter-progress-row .stars {
    font-size: 17px
  }

  .feedback h2 {
    font-size: 17px
  }

  #toast {
    bottom: 85px
  }

  .actions {
    gap: 10px
  }

  .primary,
  .secondary {
    padding: 12px 15px
  }

  .result-score {
    font-size: 42px
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}
