/* Duolingo-like lesson interaction, re-skinned for Maho */
.duo-course {
  --duo-bg: #111f26;
  --duo-panel: #1b2d35;
  --duo-line: #38505b;
  --duo-text: #f5f7f8;
  --duo-muted: #8ba0aa;
  --duo-green: #91d72f;
  --duo-green-dark: #6fae15;
  --duo-purple: #dd7ef4;
  --duo-blue: #40b9ec;
  color: var(--duo-text);
  background: var(--duo-bg);
  position: relative;
  overflow: hidden;
}

.duo-top {
  height: 64px;
  display: grid;
  grid-template-columns: 34px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 0;
  flex-shrink: 0;
}

.duo-close {
  border: 0;
  background: none;
  color: #708792;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.duo-progress-track {
  height: 15px;
  background: #354a54;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, .24);
}

.duo-progress-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(180deg, #a7e63d, #86cd20);
  transition: width .28s ease;
  position: relative;
}

.duo-progress-track i::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 2px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
}

.duo-energy {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #f28ae9;
  font-weight: 800;
  font-size: 14px;
}

.duo-energy span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(145deg, #f793eb, #c84aca);
  font-size: 14px;
}

.duo-exercise {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 18px 130px;
  -webkit-overflow-scrolling: touch;
}

.duo-new-word {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--duo-purple);
  font-size: 14px;
  font-weight: 800;
  margin: 4px 0 14px;
}

.duo-new-word span {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--duo-purple);
  color: var(--duo-bg);
  display: grid;
  place-items: center;
}

.duo-exercise > h1 {
  margin: 0 0 16px;
  color: var(--duo-text);
  font-size: 23px;
  line-height: 1.3;
}

.duo-prompt-row {
  display: grid;
  grid-template-columns: 125px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 190px;
  margin-bottom: 16px;
}

.maho-mascot {
  width: 125px;
  height: 176px;
  position: relative;
  flex-shrink: 0;
}

.mascot-shadow {
  position: absolute;
  left: 22px;
  bottom: 2px;
  width: 80px;
  height: 19px;
  border-radius: 50%;
  background: #344650;
}

.mascot-body {
  position: absolute;
  left: 25px;
  bottom: 12px;
  width: 76px;
  height: 93px;
  border-radius: 34px 34px 27px 27px;
  background: #d17421;
  border-bottom: 7px solid #9e4e14;
}

.mascot-sleeve {
  position: absolute;
  top: 16px;
  width: 24px;
  height: 53px;
  border-radius: 20px;
  background: inherit;
}

.mascot-sleeve.left { left: -13px; transform: rotate(18deg); }
.mascot-sleeve.right { right: -13px; transform: rotate(-18deg); }

.mascot-collar {
  position: absolute;
  left: 26px;
  top: 0;
  width: 24px;
  height: 58px;
  background: #f8f1e4;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
}

.mascot-head {
  position: absolute;
  left: 27px;
  top: 19px;
  width: 73px;
  height: 70px;
  border-radius: 42% 48% 45% 45%;
  background: #f1b17d;
  z-index: 2;
}

.mascot-ear {
  position: absolute;
  top: 28px;
  width: 18px;
  height: 20px;
  border-radius: 50%;
  background: #f1b17d;
}
.mascot-ear.left { left: -9px; }.mascot-ear.right { right: -9px; }

.mascot-hair {
  position: absolute;
  left: 0;
  top: -7px;
  width: 72px;
  height: 35px;
  border-radius: 35px 35px 12px 12px;
  background: #3e4241;
  clip-path: polygon(0 0,100% 0,100% 70%,75% 50%,55% 78%,37% 48%,18% 72%,0 55%);
}

.mascot-eye {
  position: absolute;
  top: 30px;
  width: 8px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 -4px #313839;
}
.mascot-eye.left { left: 20px; }.mascot-eye.right { right: 20px; }
.mascot-mouth { position: absolute; left: 31px; top: 48px; width: 13px; height: 6px; border-bottom: 2px solid #9d4c3d; border-radius: 50%; }

.maho-mascot--maho .mascot-body { background: #6b8d57; border-color: #48623b; }
.maho-mascot--maho .mascot-hair { background: #273d32; }
.maho-mascot--ren .mascot-body { background: #cf6b9e; border-color: #9c3e72; }
.maho-mascot--ren .mascot-hair { background: #3e302e; border-radius: 45% 55% 30% 25%; }
.maho-mascot--saki .mascot-body { background: #e59c13; border-color: #ad7004; }
.maho-mascot--saki .mascot-head { border-radius: 50%; }
.maho-mascot--saki .mascot-hair { height: 42px; }

.duo-speech {
  min-height: 96px;
  border: 3px solid var(--duo-line);
  border-radius: 14px;
  background: transparent;
  color: var(--duo-text);
  padding: 15px 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  position: relative;
  cursor: pointer;
}

.duo-speech::before {
  content: "";
  position: absolute;
  left: -22px;
  bottom: 13px;
  width: 24px;
  height: 20px;
  background: var(--duo-bg);
  border-left: 3px solid var(--duo-line);
  border-bottom: 3px solid var(--duo-line);
  transform: skew(-42deg);
}

.duo-speech .icon { color: var(--duo-blue); flex-shrink: 0; margin-top: 2px; }
.duo-speech > span:last-child {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.65;
  text-decoration: underline dotted #627782 3px;
  text-underline-offset: 7px;
}

.duo-choice-list {
  display: grid;
  gap: 10px;
  margin-top: 62px;
}

.duo-choice-list.compact { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }

.duo-choice-list button {
  min-height: 55px;
  border: 3px solid var(--duo-line);
  border-radius: 13px;
  background: transparent;
  box-shadow: 0 4px 0 #283b44;
  color: var(--duo-text);
  font-family: var(--font-sans);
  font-size: 19px;
  cursor: pointer;
}

.duo-choice-list button.selected {
  border-color: #719a19;
  color: var(--duo-green);
  background: rgba(145, 215, 47, .07);
}

.duo-choice-list button.correct { border-color: var(--duo-green); color: var(--duo-green); }
.duo-choice-list button.wrong { border-color: #ff785c; color: #ff785c; }

.duo-answer-lines {
  min-height: 152px;
  padding-top: 5px;
}

.duo-answer-drop {
  min-height: 61px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: center;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--duo-line);
}

.duo-answer-line {
  height: 61px;
  border-bottom: 2px solid var(--duo-line);
}

.duo-answer-drop button,
.duo-word-bank button {
  height: 46px;
  border: 3px solid var(--duo-line);
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 4px 0 #283b44;
  color: var(--duo-text);
  padding: 0 12px;
  font-size: 17px;
  cursor: pointer;
}

.duo-word-bank {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 55px;
}

.duo-word-bank button.used {
  min-width: 62px;
  border-color: transparent;
  background: #344751;
  box-shadow: none;
  cursor: default;
}

.duo-fill-preview {
  min-height: 75px;
  border-bottom: 2px solid var(--duo-line);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  margin-top: 15px;
}

.duo-fill-preview i {
  min-width: 45px;
  color: var(--duo-purple);
  border-bottom: 3px dotted var(--duo-purple);
  font-style: normal;
  text-align: center;
}

.duo-check-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 13px 18px 22px;
  background: linear-gradient(180deg, rgba(17,31,38,0), var(--duo-bg) 22%);
}

.duo-check {
  width: 100%;
  min-height: 53px;
  border: 0;
  border-radius: 13px;
  background: var(--duo-green);
  box-shadow: 0 5px 0 var(--duo-green-dark);
  color: #132019;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.duo-check:disabled {
  color: #60737c;
  background: #3b4e58;
  box-shadow: none;
  cursor: default;
}

.duo-feedback {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 172px;
  padding: 16px 18px 22px;
  background: #1d3038;
  border-top: 1px solid rgba(255,255,255,.04);
  box-shadow: 0 -10px 30px rgba(0,0,0,.15);
}

.duo-feedback.correct { color: var(--duo-green); }
.duo-feedback.wrong { color: #ff8a6e; }

.duo-feedback-title { display: flex; align-items: center; gap: 9px; }
.duo-feedback-title > span { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: currentColor; color: var(--duo-bg); font-weight: 900; }
.duo-feedback-title strong { font-size: 20px; }
.duo-feedback p { margin: 8px 0 2px; font-size: 13px; color: currentColor; }
.duo-feedback small { color: #c2cdd2; }
.duo-feedback-tools { position: absolute; right: 18px; top: 16px; display: flex; gap: 7px; }
.duo-feedback-tools button { border: 0; background: none; color: currentColor; font-size: 12px; }
.duo-feedback-tools button:first-child { position: absolute; right: 0; top: 43px; width: 112px; height: 38px; border: 2px solid currentColor; border-radius: 10px; }
.duo-continue { position: absolute; left: 18px; right: 18px; bottom: 18px; height: 50px; border: 0; border-radius: 12px; background: var(--duo-green); color: #132019; font-size: 17px; font-weight: 800; }
.duo-feedback.wrong .duo-continue { background: #ff785c; color: #251511; }

.duo-course-finish {
  padding: 70px 20px 25px;
  align-items: center;
  text-align: center;
  overflow-y: auto;
}

.duo-course-finish .maho-mascot { transform: scale(.8); height: 145px; margin-top: -5px; }
.duo-confetti { color: #f9cb4c; letter-spacing: 10px; font-size: 19px; }
.duo-finish-seal { width: 67px; height: 67px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg,#ff914f,#c2410c); color: #fff; font-size: 27px; font-family: var(--font-serif); margin-top: -12px; box-shadow: 0 10px 25px rgba(194,65,12,.3); }
.duo-course-finish > small { margin-top: 12px; color: var(--duo-green); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.duo-course-finish > h1 { margin: 5px 0; font-size: 25px; }
.duo-course-finish > p { margin: 0; max-width: 300px; color: var(--duo-muted); font-size: 12px; line-height: 1.6; }
.duo-finish-stats { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 18px 0 10px; }
.duo-finish-stats div { border: 2px solid var(--duo-line); border-radius: 12px; padding: 9px 3px; }
.duo-finish-stats strong,.duo-finish-stats span { display: block; }
.duo-finish-stats strong { font-size: 18px; color: var(--duo-green); }.duo-finish-stats span { font-size: 9px; color: var(--duo-muted); }
.duo-finish-learned { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.duo-finish-learned span { padding: 4px 8px; border-radius: 99px; background: var(--duo-panel); color: #b7c7ce; font-size: 10px; }
.duo-course-finish .zen-btn { width: 100%; margin-top: 8px; }
