@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f3ea;
  color: #101218;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: #f5f3ea; }
button { font: inherit; }
.boot-screen { display: none; position: fixed; z-index: 20; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #edf3f8; color: #0f2824; }
.boot-screen img { width: 64px; height: 64px; object-fit: contain; }
.boot-screen strong { font-size: 27px; }
.boot-screen span { color: #446b61; font-size: 14px; }
body.is-booting .boot-screen { display: flex; }
body.is-booting .app-shell { visibility: hidden; }
body.is-unavailable .page-head, body.is-unavailable .pet-panel, body.is-unavailable .tabs, body.is-unavailable .tab-panel { display: none; }

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

.page-head, .pet-identity, .section-heading { display: flex; align-items: center; }
.page-head, .section-heading { justify-content: space-between; gap: 18px; }
.page-head { margin: 2px 0 24px; }

.eyebrow { margin: 0; color: #446b61; font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1.35; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 5px 0 0; color: #0f2824; font-size: 32px; font-weight: 750; letter-spacing: 0; line-height: 1.05; }
h2 { margin: 5px 0 0; color: #0f2824; font-size: 22px; font-weight: 720; letter-spacing: 0; line-height: 1.15; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #bfd0c0;
  border-radius: 50%;
  background: #fcf9f2;
  color: #16322d;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.icon-button:active { background: #d3dbcc; transform: rotate(25deg); }

.pet-panel { padding: 22px; border: 1px solid #c7d2c2; border-radius: 8px; background: #fcf9f2; }
.pet-identity { gap: 13px; }
.pet-mark { display: grid; width: 61px; height: 61px; flex: 0 0 61px; place-items: center; }
.pet-mark img { width: 50px; height: 50px; object-fit: contain; }
.pet-identity h2 { font-size: 25px; }
.pet-stage { margin: 5px 0 0; color: #446b61; font-size: 14px; font-weight: 620; }
.level { margin-left: auto; min-width: 62px; text-align: right; }
.level span { display: block; color: #446b61; font-size: 10px; font-weight: 750; letter-spacing: 0; }
.level strong { color: #d7684c; font-size: 29px; line-height: 1; }
.pet-line { margin: 16px 0 0; color: #1e232a; font-size: 15px; font-weight: 520; line-height: 1.5; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 25px 0 22px; padding: 3px; background: #d3dbcc; border-radius: 7px; }
.tab { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: #446b61; font-size: 14px; font-weight: 680; cursor: pointer; }
.tab.is-active { background: #fcf9f2; color: #0f2824; box-shadow: 0 1px 2px rgb(15 40 36 / .09); }

.section-heading { margin-bottom: 14px; }.count { color: #d7684c; font-size: 28px; font-variant-numeric: tabular-nums; }
.word-list { border-top: 1px solid #cfd7cc; }
.word-row { width: 100%; display: grid; gap: 3px; padding: 17px 2px; border: 0; border-bottom: 1px solid #cfd7cc; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.word-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.word-term { color: #0f2824; font-size: 19px; font-weight: 710; }.word-ipa { color: #446b61; font-size: 14px; }.word-tag { color: #7b755f; font-size: 12px; font-weight: 600; }
.word-details { color: #1e232a; font-size: 14px; line-height: 1.5; }.translation { color: #d7684c; font-weight: 650; }.example-ru { color: #446b61; }
.load-more { width: 100%; min-height: 46px; margin-top: 18px; border: 1px solid #16322d; border-radius: 6px; background: transparent; color: #16322d; font-weight: 700; cursor: pointer; }

.mission-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 26px; padding: 20px; border: 1px solid #a9c1b3; border-radius: 8px; background: #e4eee0; }
.mission-card h2 { font-size: 23px; }.mission-card p:not(.eyebrow) { margin: 9px 0 0; color: #446b61; font-size: 14px; line-height: 1.45; }
.mission-button, .answer-button { min-height: 47px; border: 0; border-radius: 6px; background: #16322d; color: #fcf9f2; font-weight: 750; cursor: pointer; }
.mission-button { min-width: 110px; padding: 0 17px; flex: 0 0 auto; }.mission-button:disabled, .answer-button:disabled, .choice-button:disabled, .text-button:disabled { cursor: wait; opacity: .55; }

body.is-modal-open { overflow: hidden; }
.recall-screen { position: fixed; z-index: 10; inset: 0; overflow-y: auto; background: #f5f3ea; scroll-padding-bottom: 24px; }
.recall-sheet { width: min(100%, 720px); min-height: 100%; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
.recall-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-bottom: 1px solid #c7d2c2; }
.close-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #e4eee0; color: #16322d; font-size: 29px; line-height: 1; cursor: pointer; }
.recall-progress { display: flex; align-items: end; gap: 12px; color: #446b61; font-size: 12px; font-weight: 750; letter-spacing: 0; }.recall-progress strong { color: #0f2824; font-size: 14px; letter-spacing: 0; }
.recall-content { display: flex; min-height: calc(100dvh - 104px); flex-direction: column; padding: 42px 0 8px; }
.recall-prompt { max-width: 580px; margin-top: 11px; font-size: 29px; line-height: 1.18; }
.recall-context { margin: 28px 0 0; padding: 21px 0; border-top: 1px solid #c7d2c2; border-bottom: 1px solid #c7d2c2; color: #1e232a; font-size: 22px; line-height: 1.45; }
.recall-form { display: grid; gap: 12px; margin-top: 8px; }.recall-input { width: 100%; min-height: 53px; border: 1px solid #9eb9aa; border-radius: 6px; background: #fcf9f2; color: #0f2824; font: inherit; font-size: 19px; padding: 0 16px; outline: none; scroll-margin-top: 130px; }.recall-input:focus { border-color: #16322d; box-shadow: 0 0 0 3px rgb(22 50 45 / .12); }
.choice-list { display: grid; gap: 10px; margin-top: 30px; }.choice-button { width: 100%; min-height: 55px; padding: 10px 16px; border: 1px solid #a9c1b3; border-radius: 6px; background: #fcf9f2; color: #0f2824; font: inherit; font-size: 18px; font-weight: 670; text-align: left; cursor: pointer; }.choice-button:active { background: #d3dbcc; }
.recall-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; }.text-button { border: 0; background: transparent; color: #446b61; font: inherit; font-size: 14px; font-weight: 720; cursor: pointer; padding: 10px 0; }.hint-copy { margin: 4px 0 0; color: #446b61; font-size: 14px; font-weight: 650; }
.recall-status { margin: 16px 0 0; color: #446b61; font-size: 14px; font-weight: 650; }.recall-status.is-error { color: #9c3d2c; }
.recall-content.is-result > .recall-eyebrow, .recall-content.is-result > .recall-prompt, .recall-content.is-result > .recall-context { display: none; }
.recall-feedback, .recall-summary { display: grid; gap: 15px; margin: 20px 0 0; padding: 12px 0 8px; }.recall-feedback h2, .recall-summary h2 { font-size: 28px; }.recall-feedback > p:not(.eyebrow), .recall-summary > p:not(.eyebrow) { margin: 0; color: #1e232a; font-size: 16px; line-height: 1.5; }
.feedback-example { display: grid; gap: 7px; margin: 8px 0 10px; padding: 18px; border-left: 3px solid #8db6a0; background: #fcf9f2; color: #1e232a; line-height: 1.45; }.feedback-example p { margin: 0; }.feedback-example .example-ru { color: #446b61; }
.recall-feedback .answer-button, .recall-summary .answer-button { width: 100%; margin-top: 12px; }

.progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.progress-item { min-height: 112px; padding: 16px; border: 1px solid #c7d2c2; border-radius: 7px; background: #fcf9f2; }.progress-item span { color: #446b61; font-size: 12px; font-weight: 700; letter-spacing: 0; }.progress-item strong { display: block; margin-top: 12px; color: #0f2824; font-size: 28px; line-height: 1; }.progress-item p { margin: 8px 0 0; color: #1e232a; font-size: 13px; line-height: 1.35; }
.notice { margin-top: 32px; padding: 24px 0; border-top: 1px solid #c7d2c2; }.notice p:last-child { color: #446b61; line-height: 1.5; }
.is-hidden { display: none !important; }

@media (min-width: 680px) {
  .app-shell, .recall-sheet { padding-inline: 32px; }.pet-panel { padding: 28px; }.word-row { padding-block: 20px; }.recall-content { padding-top: 58px; }
}

@media (max-width: 420px) {
  .mission-card { align-items: flex-start; flex-direction: column; }.mission-button { width: 100%; }.recall-prompt { font-size: 26px; }.recall-context { font-size: 20px; }
}

/* Home screen mirrors the editable 440px Figma composition; Recall keeps its own layout. */
body { background: #edf3f8; color: #0b1632; touch-action: pan-x pan-y; }
.app-shell {
  width: min(100%, 440px);
  min-height: 100dvh;
  padding: 16px 16px calc(30px + env(safe-area-inset-bottom));
  background: #f0f4f8 url("/assets/miniapp/nyc-background.png") top center / 100% auto no-repeat;
}
.page-head {
  align-items: flex-start;
  min-height: 118px;
  margin: 0 0 20px;
  padding: 0 8px;
}
.page-head .eyebrow, .mission-card .eyebrow, .section-heading .eyebrow {
  color: #334d7b;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}
.page-head h1 {
  margin-top: 10px;
  color: #07112b;
  font-size: 37px;
  font-weight: 790;
  line-height: 1.02;
}
.page-head h1 span { color: inherit; }
.head-subtitle { max-width: 300px; margin: 8px 0 0; color: #38517c; font-size: 17px; font-weight: 520; line-height: 1.23; }
.pet-panel {
  position: relative;
  height: 226px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .86);
  border-radius: 22px;
  background: rgb(255 255 255 / .73);
  box-shadow: 0 8px 22px rgb(43 70 114 / .11), inset 0 1px rgb(255 255 255 / .8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.pet-art { position: absolute; z-index: 1; top: 2px; left: 0; width: 150px; height: auto; object-fit: contain; }
.pet-card-content { position: absolute; inset: 0; }
.pet-identity { position: absolute; top: 13px; right: 16px; left: 143px; align-items: flex-start; gap: 4px; }
.pet-title { min-width: 0; }
.pet-identity h2 { overflow-wrap: anywhere; margin: 0; color: #0a1532; font-size: 38px; font-weight: 770; line-height: 1; }
.pet-identity h2.is-long { font-size: 27px; }
.pet-identity h2.is-very-long { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 20px; }
.pet-stage { margin-top: 8px; color: #3c4d75; font-size: 12px; font-weight: 560; line-height: 1.2; }
.level { position: relative; width: 68px; height: 68px; min-width: 68px; margin: -2px 0 0 auto; text-align: center; }
.level img { position: absolute; inset: 0; width: 100%; height: 100%; }
.level span, .level strong { position: relative; z-index: 1; display: block; color: #162756; }
.level span { padding-top: 19px; font-size: 7px; font-weight: 750; letter-spacing: 0; }
.level strong { margin-top: 0; font-size: 25px; font-weight: 790; line-height: 1; }
.pet-line {
  position: absolute;
  top: 89px;
  right: 16px;
  left: 148px;
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: 5px 11px 5px 16px;
  background: url("/assets/miniapp/speech-bubble.svg") center / 100% 100% no-repeat;
  color: #384d78;
  font-size: 13px;
  font-weight: 530;
  line-height: 1.2;
}
.week-heading { position: absolute; top: 141px; right: 18px; left: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #3b507d; font-size: 10px; font-weight: 650; letter-spacing: 0; }
.week-heading strong { color: #1f315e; font-size: 10px; font-weight: 690; letter-spacing: 0; text-align: right; }
.week-days { position: absolute; top: 166px; right: 13px; left: 13px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.week-day { display: grid; justify-items: center; gap: 1px; color: #56678a; font-size: 10px; font-weight: 620; }
.week-day img { width: 25px; height: 25px; object-fit: contain; }
.week-day.is-today span { color: #cc4a45; font-weight: 770; }
.tabs {
  height: 51px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 12px 0;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / .86);
  border-radius: 26px;
  background: rgb(255 255 255 / .66);
  box-shadow: 0 5px 18px rgb(44 72 115 / .08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tab { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; border-radius: 22px; color: #344b77; font-size: 13px; font-weight: 650; white-space: nowrap; }
.tab img { width: 17px; height: 17px; object-fit: contain; }
.tab.is-active { background: #354c78; color: #fff; box-shadow: 0 2px 7px rgb(29 49 95 / .2); }
.tab.is-active img { filter: brightness(0) invert(1); }
.mission-card {
  position: relative;
  display: block;
  height: 181px;
  overflow: hidden;
  margin: 0 0 13px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .95);
  border-radius: 20px;
  background: #f9fbff url("/assets/miniapp/stairway.png") center / cover no-repeat;
  box-shadow: 0 8px 19px rgb(50 75 115 / .12);
}
.mission-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(255 255 255 / .38), transparent 76%); pointer-events: none; }
.mission-content { position: relative; z-index: 1; width: min(70%, 272px); height: 100%; padding: 17px 0 12px 18px; }
.mission-card h2 { max-width: 265px; margin-top: 8px; color: #07112b; font-size: 26px; font-weight: 790; line-height: 1.04; }
.mission-copy { display: none; }
.mission-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 211px);
  min-width: 0;
  min-height: 43px;
  margin-top: 13px;
  padding: 0 17px;
  border-radius: 25px;
  background: #e65143;
  color: #fff;
  font-size: 14px;
  font-weight: 710;
  white-space: nowrap;
}
.mission-button img { width: 17px; height: 17px; filter: brightness(0) invert(1); }
.mission-button:active { background: #cf4035; }
.section-heading { min-height: 28px; margin: 0 0 8px; padding: 0 4px; }
.focus-heading { min-height: 0; }
.section-heading h2 { margin-top: 2px; color: #0b1632; font-size: 17px; font-weight: 760; line-height: 1.1; }
.count { color: #d84c42; font-size: 23px; }
.word-list { display: grid; gap: 6px; border-top: 0; }
.word-row {
  display: block;
  min-height: 62px;
  padding: 11px 14px;
  border: 1px solid rgb(255 255 255 / .94);
  border-radius: 15px;
  background: rgb(255 255 255 / .72);
  box-shadow: 0 3px 12px rgb(39 64 107 / .06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.word-row:focus-visible { outline: 2px solid #354c78; outline-offset: 2px; }
.word-top { display: grid; grid-template-columns: minmax(0, 1fr) auto 25px; align-items: center; gap: 10px; }
.word-main { display: grid; min-width: 0; gap: 2px; }
.word-term { overflow-wrap: anywhere; color: #0a1531; font-size: 16px; font-weight: 750; line-height: 1.05; }
.word-ipa { color: #3b507b; font-size: 11px; line-height: 1.15; }
.word-tag { max-width: 82px; padding: 4px 7px; overflow: hidden; border-radius: 10px; background: #e6efff; color: #4168aa; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.word-chevron { width: 25px; height: 25px; padding: 6px; border-radius: 50%; background: #ebeff6; transition: transform .28s ease; }
.word-row.is-open .word-chevron { transform: rotate(180deg); }
.word-details {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  margin-top: 0;
  padding: 0;
  border-top: 1px solid transparent;
  color: #1e2c4a;
  opacity: 0;
  transition: grid-template-rows .28s ease, margin-top .28s ease, padding .28s ease, border-color .28s ease, opacity .2s ease;
}
.word-details-inner { display: grid; min-height: 0; overflow: hidden; gap: 8px; }
.word-row.is-open .word-details { grid-template-rows: 1fr; margin-top: 10px; padding: 9px 0 3px; border-color: #dfe7f0; opacity: 1; }
.word-details .translation { color: #cf5044; }
.word-details .example-ru { color: #567098; }
.empty-words { margin: 2px 0 0; padding: 16px; border-radius: 14px; background: rgb(255 255 255 / .75); color: #3b507b; font-size: 14px; line-height: 1.45; }
.progress-item { border-color: rgb(255 255 255 / .8); border-radius: 15px; background: rgb(255 255 255 / .76); }
.notice { padding: 18px; border: 1px solid #d7e1ed; border-radius: 12px; background: rgb(255 255 255 / .84); }
body.is-unavailable .app-shell { background-color: #f0f4f8; }
body.is-telegram-fullscreen .app-shell {
  padding-top: calc(16px + max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)));
}
body.is-telegram-fullscreen .recall-sheet {
  padding-top: calc(18px + max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)));
}

@media (prefers-reduced-motion: reduce) {
  .word-chevron, .word-details { transition: none; }
}

@media (max-width: 370px) {
  .page-head h1 { font-size: 31px; }
  .head-subtitle { font-size: 15px; }
  .pet-art { width: 123px; top: 9px; }
  .pet-identity { left: 116px; }
  .pet-identity h2 { font-size: 32px; }
  .pet-identity h2.is-long { font-size: 23px; }
  .pet-identity h2.is-very-long { font-size: 18px; }
  .level { width: 59px; height: 59px; min-width: 59px; }
  .level span { padding-top: 16px; font-size: 6px; }
  .level strong { font-size: 22px; }
  .pet-line { left: 119px; font-size: 11px; }
  .tab { gap: 4px; font-size: 11px; }
  .tab img { width: 15px; height: 15px; }
  .mission-content { width: 72%; }
  .mission-card h2 { font-size: 23px; }
  .mission-button { width: 190px; padding-inline: 13px; font-size: 12px; }
}
