@import url("ui/raster/completion/runtime-frames.css");

body.play-screen #panel.lesson-result {
  --completion-u: 1px;
  background: var(--completion-scene-phone) center / cover no-repeat,#ead8f2;
}
body.play-screen #panel.lesson-result .lesson-completion {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(804px,calc(100vw - 16px));
  height: calc(100dvh - 128px);
  max-height: none;
  min-height: 0;
  margin: 116px auto 12px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-ink);
  overflow: visible;
}
body.play-screen #panel.lesson-result .lesson-completion::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  box-sizing: border-box;
  border: 4px solid transparent;
  border-image: var(--completion-phone-paper) 36 fill / 18px stretch;
  background: none;
  background-clip: padding-box;
  pointer-events: none;
}
body.play-screen #panel.lesson-result .completion-heading {
  position: relative;
  display: block;
  z-index: 1;
  border: 0;
  background: none;
  box-shadow: none;
  gap: 0;
  flex: none;
  width: min(636px,calc(100% - 32px));
  min-height: 112px;
  margin: -32px auto 0;
  padding: 30px 18px 8px;
  text-align: center;
}
body.play-screen #panel.lesson-result .completion-heading::before {
  content: "";
  position: absolute;
  inset: -52px -14px 0;
  z-index: -1;
  background: var(--completion-crown) center / 100% 100% no-repeat;
  pointer-events: none;
}
body.play-screen #panel.lesson-result .completion-hero {
  position: absolute;
  top: -84px;
  left: 50%;
  width: 170px;
  height: 110px;
  margin: 0;
  overflow: visible;
  transform: translateX(-50%);
}
body.play-screen #panel.lesson-result .completion-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 1;
  background: var(--completion-rays) center / 100% 100% no-repeat;
  animation: none;
  transform: none;
  filter: none;
}
body.play-screen #panel.lesson-result .completion-hero canvas,
body.play-screen #panel.lesson-result .completion-hero::after {
  position: absolute;
  left: calc(50% - 40px);
  top: 0;
  width: 80px;
  height: 100px;
  margin: 0;
  filter: none;
  image-rendering: pixelated;
}
body.play-screen #panel.lesson-result .completion-heading h2 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 900; color: var(--ui-ink); text-shadow: none; overflow-wrap: anywhere; }
body.play-screen #panel.lesson-result .completion-subtitle { margin: 4px 0 0; font-size: 14px; font-weight: 800; line-height: 1.2; color: #74816b; }
body.play-screen #panel.lesson-result .perfect-badge { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 12px; line-height: 1.1; color: #a57428; }
body.play-screen #panel.lesson-result .completion-scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scroll-padding-block: 12px; }
body.play-screen #panel.lesson-result .completion-content { width: 100%; max-width: none; margin: 0; padding: 10px 22px 18px; }
body.play-screen #panel.lesson-result .completion-rewards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 0 6px 12px; }
body.play-screen #panel.lesson-result .completion-rewards:has([data-completion-reward="seeds"]) { grid-template-columns: repeat(3,minmax(0,1fr)); }
body.play-screen #panel.lesson-result .completion-rewards > div {
  min-width: 0;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 10px 6px;
  border: 4px solid transparent;
  border-image: var(--completion-reward) 28 fill / 14px stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.play-screen #panel.lesson-result .completion-icon,
body.play-screen #panel.lesson-result .completion-rewards canvas { display: block; flex: none; width: 44px; height: 44px; margin: 0; font-size: 0; background: center / contain no-repeat; }
body.play-screen #panel.lesson-result .completion-icon .farm-reward-icon { display: block; width: 100%; height: 100%; margin: 0; }
body.play-screen #panel.lesson-result .perfect-badge .farm-reward-icon { width: 1em; height: 1em; margin: 0; }
body.play-screen #panel.lesson-result .completion-rewards strong { font-size: 24px; font-weight: 900; line-height: 1.1; color: var(--ui-ink); }
body.play-screen #panel.lesson-result .completion-rewards div > span:last-child { font-size: 14px; font-weight: 800; line-height: 1.1; color: #805359; overflow-wrap: anywhere; }
body.play-screen #panel.lesson-result :is(.completion-streak,.completion-new-words,.completion-topic) { margin: 12px 0 0; padding: 14px 16px; border: 4px solid transparent; border-image: var(--completion-words) 28 fill / 14px stretch; border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
body.play-screen #panel.lesson-result .completion-streak { display: flex; align-items: center; gap: 12px; min-height: 90px; border-image-source: var(--completion-streak); }
body.play-screen #panel.lesson-result .completion-streak svg { flex: none; width: 44px; height: 44px; padding: 8px; border-radius: 50%; color: #fffbee; background: linear-gradient(#ffcc64,#ff861f); }
body.play-screen #panel.lesson-result .completion-streak > div { min-width: 0; }
body.play-screen #panel.lesson-result .completion-streak strong { font-size: 20px; font-weight: 900; line-height: 1.1; color: var(--ui-ink); }
body.play-screen #panel.lesson-result .completion-streak p { margin: 4px 0 0; font-size: 14px; font-weight: 700; line-height: 1.2; color: #75836e; }
body.play-screen #panel.lesson-result .completion-new-words { min-height: 110px; }
body.play-screen #panel.lesson-result .completion-new-words > strong { font-size: 17px; font-weight: 900; line-height: 1.15; color: #347832; }
body.play-screen #panel.lesson-result .completion-words { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 10px 0 0; }
body.play-screen #panel.lesson-result .completion-words span { max-width: 100%; padding: 5px 10px; border: 0; border-radius: 999px; background: #dce7c4; color: #28672e; font-size: 17px; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
body.play-screen #panel.lesson-result .completion-topic { align-items: center; gap: 12px; }
body.play-screen #panel.lesson-result .completion-topic > :first-child { width: 60px; height: 60px; flex: none; }
body.play-screen #panel.lesson-result .completion-topic strong { font-size: 17px; color: #9b681f; }
body.play-screen #panel.lesson-result .completion-topic p { font-size: 18px; line-height: 1.2; color: var(--ui-ink); }
body.play-screen #panel.lesson-result .completion-topic small { font-size: 14px; line-height: 1.25; color: #75836e; }
body.play-screen #panel.lesson-result .completion-footer { flex: none; max-height: 43dvh; overflow: auto; padding: 8px 22px 18px; border: 0; background: none; }
body.play-screen #panel.lesson-result .completion-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: none; margin: 0; }
body.play-screen #panel.lesson-result .completion-actions button { width: 100%; min-width: 44px; min-height: 46px; margin: 0; padding: 10px 14px; border: 4px solid transparent; border-image: var(--completion-secondary) 32 fill / 16px stretch; border-radius: 0; background: transparent; box-shadow: none; color: var(--ui-ink); font-size: 16px; font-weight: 900; line-height: 1.15; text-shadow: none; overflow-wrap: anywhere; }
body.play-screen #panel.lesson-result .completion-actions #return-farm { min-height: 54px; border-image: var(--completion-primary) 44 fill / 20px stretch; font-size: 19px; }
body.play-screen #panel.lesson-result .completion-actions button:focus-visible { outline: 2px solid #8b57b3; outline-offset: -5px; }
@media (max-height: 560px) {
  body.play-screen #panel.lesson-result .lesson-completion { margin-top: 92px; height: calc(100dvh - 104px); }
  body.play-screen #panel.lesson-result .completion-heading { min-height: 96px; padding-top: 24px; }
  body.play-screen #panel.lesson-result .completion-heading h2 { font-size: 24px; }
  body.play-screen #panel.lesson-result .completion-subtitle { font-size: 13px; }
  body.play-screen #panel.lesson-result .completion-hero { top: -64px; height: 90px; }
  body.play-screen #panel.lesson-result .completion-hero canvas,
  body.play-screen #panel.lesson-result .completion-hero::after { width: 64px; height: 80px; left: calc(50% - 32px); }
}
@media (min-width: 900px) and (min-height: 650px) {
  body.play-screen #panel.lesson-result { --completion-u: min(calc(100vw / 1586),calc(100dvh / 992)); --completion-x: calc(100vw / 1586); --completion-y: calc(100dvh / 992); background-image: var(--completion-scene); background-size: 100% 100%; }
  body.play-screen #panel.lesson-result .lesson-completion { width: calc(804 * var(--completion-x)); height: calc(724 * var(--completion-y)); margin: calc(246 * var(--completion-y)) auto 0; }
  body.play-screen #panel.lesson-result .lesson-completion::before { display: none; }
  body.play-screen #panel.lesson-result .completion-heading { width: calc(636 * var(--completion-x)); min-height: calc(150 * var(--completion-y)); margin-top: calc(-53 * var(--completion-y)); padding: calc(34 * var(--completion-y)) calc(40 * var(--completion-x)) calc(6 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-heading::before { inset: calc(-69 * var(--completion-y)) calc(-29.5 * var(--completion-x)) 0; }
  body.play-screen #panel.lesson-result .completion-heading h2 { font-size: calc(48 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-subtitle { font-size: calc(24 * var(--completion-u)); margin-top: calc(4 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .perfect-badge { display: block; font-size: max(12px,calc(14 * var(--completion-u))); }
  body.play-screen #panel.lesson-result .completion-hero { top: calc(-193 * var(--completion-y)); width: calc(330 * var(--completion-x)); height: calc(230 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-hero canvas,
  body.play-screen #panel.lesson-result .completion-hero::after { left: calc(50% - 80 * var(--completion-u)); top: calc(35 * var(--completion-y)); width: calc(160 * var(--completion-u)); height: calc(200 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-content { padding: calc(0 * var(--completion-y)) calc(66 * var(--completion-x)) calc(18 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-rewards { gap: calc(12 * var(--completion-x)); margin: 0 calc(8 * var(--completion-x)) calc(8 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-rewards > div { min-height: calc(156 * var(--completion-y)); padding: calc(8 * var(--completion-u)); border-image-slice: 14 fill; border-image-width: calc(14 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-icon,
  body.play-screen #panel.lesson-result .completion-rewards canvas { width: calc(56 * var(--completion-u)); height: calc(56 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-rewards strong { font-size: calc(38 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-rewards div > span:last-child { font-size: calc(22 * var(--completion-u)); }
  body.play-screen #panel.lesson-result :is(.completion-streak,.completion-new-words,.completion-topic) { padding: calc(12 * var(--completion-u)) calc(34 * var(--completion-u)); margin-top: calc(12 * var(--completion-u)); border-image-width: calc(14 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-streak { min-height: calc(100 * var(--completion-y)); padding-block: calc(10 * var(--completion-u)); border-width: calc(4 * var(--completion-u)); gap: calc(24 * var(--completion-u)); margin-top: 0; }
  body.play-screen #panel.lesson-result .completion-streak svg { width: calc(68 * var(--completion-u)); height: calc(68 * var(--completion-u)); padding: calc(14 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-streak strong { font-size: calc(36 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-streak p { font-size: calc(22 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-new-words { min-height: calc(116 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-new-words > strong { font-size: calc(28 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-words { margin-top: calc(10 * var(--completion-u)); gap: calc(12 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-words span { padding: calc(7 * var(--completion-u)) calc(14 * var(--completion-u)); font-size: calc(22 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-footer { padding: calc(3 * var(--completion-y)) calc(88 * var(--completion-x)) calc(42 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-actions { gap: calc(9 * var(--completion-y)); }
  body.play-screen #panel.lesson-result .completion-actions button { min-height: max(44px,calc(70 * var(--completion-y))); padding: calc(10 * var(--completion-u)) calc(20 * var(--completion-u)); font-size: calc(28 * var(--completion-u)); border-image-width: calc(16 * var(--completion-u)); }
  body.play-screen #panel.lesson-result .completion-actions #return-farm { min-height: max(44px,calc(88 * var(--completion-y))); font-size: calc(34 * var(--completion-u)); border-image-width: calc(20 * var(--completion-u)); }
}

body.play-screen #panel.lesson-result .completion-hero::after {
  content: "";
  background: url("ui/raster/completion-family-v2/hero-flower.svg") center / contain no-repeat;
  pointer-events: none;
}
body.play-screen #panel.lesson-result .completion-hero canvas { opacity: 0; }
@media (min-width: 900px) and (min-height: 650px) {
  body.play-screen #panel.lesson-result .completion-hero::after {
    top: calc(40 * var(--completion-y));
    height: calc(184 * var(--completion-u));
  }
  body.play-screen #panel.lesson-result .completion-rewards > div > * {
    position: relative;
    top: calc(-5 * var(--completion-u));
  }
}
