:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #2d504d;
  --muted: #6b817d;
  --paper: #fffdf7;
  --line: #ddd5b9;
  --green: #58a879;
  --green-dark: #347a59;
  --gold: #f0b944;
  --coral: #e97668;
  --blue: #62acd6;
  --purple: #8b73bd;
  --shadow: 0 20px 48px rgba(52, 79, 68, .14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #eff7ea; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(240, 185, 68, .2) 0 125px, transparent 127px),
    radial-gradient(circle at 92% 28%, rgba(98, 172, 214, .15) 0 170px, transparent 172px),
    linear-gradient(145deg, #eef7e9, #fffaf1 58%, #f2eef9);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .14;
  background-image: radial-gradient(#6f9186 1px, transparent 1px);
  background-size: 27px 27px;
  content: "";
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible { outline: 4px solid rgba(240, 185, 68, .78); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, p { margin-top: 0; }

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 50px;
}
.topbar, .brand, .topbar-actions, .section-heading, .study-heading,
.game-heading, .game-tools, .feedback-card, .result-actions {
  display: flex;
  align-items: center;
}
.topbar { min-height: 66px; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { min-width: 0; gap: 12px; padding: 0; text-align: left; background: none; border: 0; }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  color: white;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.04em;
  background: linear-gradient(145deg, #60aa7d, #357b5c);
  border: 4px solid #d7ead9;
  border-radius: 19px;
  box-shadow: 0 7px 16px rgba(67, 87, 78, .14);
  transform: rotate(-4deg);
}
.brand strong, .brand small { display: block; }
.brand strong { overflow: hidden; font-size: 23px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { flex: 0 0 auto; gap: 10px; }
.top-spark { color: var(--gold); font-size: 25px; }
.sound-button, .back-button {
  min-height: 49px;
  font-weight: 900;
  background: rgba(255, 253, 247, .94);
  border: 2px solid var(--line);
  border-radius: 17px;
}
.sound-button { display: flex; align-items: center; gap: 9px; padding: 0 17px; font-size: 12px; }
.back-button { width: 49px; padding: 0; font-size: 23px; }
.eyebrow {
  margin: 0 0 8px;
  color: #397b62;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 53px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 21px;
  font-weight: 900;
  border-radius: 17px;
}
.primary-button { color: white; background: var(--green-dark); border: 0; box-shadow: 0 8px 0 #286248; }
.primary-button.compact { min-height: 48px; padding: 0 17px; box-shadow: none; }
.secondary-button { background: white; border: 3px solid var(--line); }
.picture { display: grid; place-items: center; overflow: hidden; }
.picture img { width: 100%; height: 100%; object-fit: contain; }

.hero {
  display: grid;
  min-height: 515px;
  align-items: center;
  grid-template-columns: 1.04fr .96fr;
  gap: 48px;
  padding: clamp(42px, 6vw, 70px);
  overflow: hidden;
  background: rgba(255, 253, 247, .97);
  border: 3px solid var(--line);
  border-radius: 46px;
  box-shadow: var(--shadow);
}
.hero h1 {
  max-width: 620px;
  margin-bottom: 19px;
  font-size: clamp(49px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .98;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 550px;
  margin-bottom: 27px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.52;
}
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; }
.hero-facts span { color: var(--muted); font-size: 13px; font-weight: 900; }
.hero-facts strong { margin-right: 4px; color: var(--ink); font-size: 24px; }
.hero-book {
  position: relative;
  min-height: 390px;
  padding: 70px 26px 28px;
  background: linear-gradient(145deg, #eaf5e9, #fff2c9);
  border: 8px solid white;
  border-radius: 39px;
  box-shadow: 0 20px 42px rgba(55, 76, 68, .2);
  transform: rotate(1.5deg);
}
.hello-bubble {
  position: absolute;
  top: 22px;
  right: 26px;
  padding: 10px 16px;
  color: #67567f;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  background: white;
  border: 3px solid #c9badd;
  border-radius: 20px 20px 4px 20px;
}
.hero-pictures { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.hero-picture {
  width: 110px;
  height: 150px;
  padding: 7px;
  background: rgba(255, 255, 255, .78);
  border: 3px solid rgba(81, 123, 102, .22);
  border-radius: 23px;
}
.hero-picture:nth-child(2) { height: 126px; transform: translateY(13px); }
.hero-picture:nth-child(3) { height: 142px; transform: translateY(4px); }
.hero-word {
  display: flex;
  width: min(280px, 100%);
  align-items: center;
  gap: 12px;
  margin: 24px auto 0;
  padding: 11px 15px;
  background: white;
  border: 3px solid #d8d0af;
  border-radius: 19px;
  box-shadow: 0 8px 0 rgba(145, 129, 79, .14);
}
.hero-word button { width: 48px; height: 48px; padding: 0; font-size: 22px; background: #fff1bd; border: 0; border-radius: 15px; }
.hero-word strong, .hero-word small { display: block; }
.hero-word strong { font-size: 24px; }
.hero-word small { color: var(--muted); font-weight: 800; }

.how-section, .themes-section { margin-top: 44px; }
.section-heading { justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 47px); font-weight: 900; letter-spacing: -.035em; }
.section-heading > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.45; text-align: right; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps-grid article {
  display: flex;
  min-height: 120px;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 25px;
}
.steps-grid article > b {
  display: grid;
  flex: 0 0 51px;
  height: 51px;
  place-items: center;
  color: white;
  font-family: Georgia, serif;
  font-size: 25px;
  background: var(--green);
  border: 5px solid #d8efe0;
  border-radius: 50%;
}
.steps-grid article:nth-child(2) > b { background: #dca33e; border-color: #fff0bd; }
.steps-grid article:nth-child(3) > b { background: var(--purple); border-color: #e9e0f7; }
.steps-grid strong, .steps-grid small { display: block; }
.steps-grid strong { margin-bottom: 6px; font-size: 18px; }
.steps-grid small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.themes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.theme-card {
  display: flex;
  min-height: 390px;
  padding: 18px;
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 11px 0 color-mix(in srgb, var(--theme) 28%, #d9d3bf);
  flex-direction: column;
}
.theme-card:hover { border-color: var(--theme); transform: translateY(-2px); }
.theme-top, .theme-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theme-top > b { display: grid; width: 48px; height: 48px; place-items: center; font-size: 25px; background: color-mix(in srgb, var(--theme) 18%, white); border-radius: 15px; }
.theme-top small { color: var(--theme); font-size: 11px; font-weight: 900; text-align: right; }
.theme-preview { display: flex; height: 145px; align-items: flex-end; justify-content: center; gap: 4px; margin: 16px 0; padding: 10px; background: color-mix(in srgb, var(--theme) 10%, white); border-radius: 23px; }
.preview-picture { width: 31%; height: 116px; }
.theme-copy { flex: 1; }
.theme-copy > small, .theme-copy > strong, .theme-copy > i { display: block; }
.theme-copy > small { color: var(--theme); font-family: Georgia, serif; font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.theme-copy > strong { margin: 4px 0 7px; font-size: 25px; }
.theme-copy > i { color: var(--muted); font-size: 14px; font-weight: 800; font-style: normal; line-height: 1.4; }
.theme-footer { margin-top: 16px; padding-top: 13px; border-top: 2px dashed #ded8c4; }
.theme-footer em { color: var(--muted); font-size: 11px; font-weight: 900; font-style: normal; }
.theme-footer b { color: var(--theme); font-size: 13px; }
.adult-note {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 28px auto 0;
  padding: 17px 23px;
  background: #eaf4e8;
  border: 2px solid #bed5bb;
  border-radius: 25px;
}
.adult-note > span { font-size: 31px; }
.adult-note p { margin: 0; }
.adult-note strong, .adult-note small { display: block; }
.adult-note small { margin-top: 4px; color: var(--muted); font-weight: 800; line-height: 1.4; }

.study-shell, .game-shell, .result-card {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 42px;
  box-shadow: var(--shadow);
}
.study-shell { padding: clamp(23px, 4vw, 44px); }
.study-heading, .game-heading { justify-content: space-between; gap: 24px; }
.study-heading h1, .game-heading h1 { margin-bottom: 7px; font-size: clamp(38px, 5vw, 55px); font-weight: 900; letter-spacing: -.045em; }
.study-heading p:not(.eyebrow), .game-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-weight: 800; }
.study-count, .round-badge {
  display: grid;
  flex: 0 0 auto;
  width: 82px;
  height: 82px;
  place-items: center;
  align-content: center;
  color: white;
  font-family: Georgia, serif;
  background: var(--theme);
  border: 6px solid color-mix(in srgb, var(--theme) 24%, white);
  border-radius: 50%;
}
.study-count b, .round-badge b { font-size: 28px; line-height: 1; }
.study-count small, .round-badge small { margin-top: 3px; font-size: 10px; font-weight: 900; }
.study-focus {
  display: grid;
  align-items: center;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 15px;
  margin: 27px 0 13px;
}
.study-arrow {
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 25px;
  font-weight: 900;
  background: white;
  border: 3px solid var(--line);
  border-radius: 18px;
}
.study-arrow:disabled { opacity: .32; }
.focus-card {
  display: grid;
  min-height: 310px;
  align-items: center;
  grid-template-columns: minmax(220px, .9fr) minmax(220px, 1.1fr) auto;
  gap: 26px;
  padding: 25px 31px;
  background: color-mix(in srgb, var(--theme) 10%, white);
  border: 3px solid color-mix(in srgb, var(--theme) 38%, white);
  border-radius: 32px;
}
.focus-picture { width: 100%; height: 250px; padding: 8px; background: rgba(255, 255, 255, .72); border-radius: 24px; }
.focus-word p { margin-bottom: 4px; color: var(--theme); font-family: Georgia, serif; font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.focus-word h2 { margin: 0; font-size: clamp(45px, 6vw, 70px); letter-spacing: -.05em; line-height: 1; }
.focus-word span { display: block; margin-top: 10px; color: var(--muted); font-size: 18px; font-weight: 900; }
.listen-button {
  display: grid;
  min-width: 116px;
  min-height: 116px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: white;
  background: var(--theme);
  border: 0;
  border-radius: 27px;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--theme) 68%, #345b55);
}
.listen-button span { font-size: 34px; }
.listen-button b { font-size: 12px; }
.voice-status { min-height: 21px; margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 900; text-align: center; }
.word-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.word-strip > button {
  display: grid;
  min-width: 0;
  min-height: 136px;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px;
  background: #f4f2e8;
  border: 3px solid transparent;
  border-radius: 19px;
}
.word-strip > button.active { background: white; border-color: var(--theme); }
.word-strip > button.learned:not(.active) { background: #e8f3e7; }
.strip-picture { width: 82px; height: 78px; }
.word-strip strong { overflow: hidden; max-width: 100%; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.word-strip small { overflow: hidden; max-width: 100%; color: var(--muted); font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.study-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 23px; }

.game-shell { padding: clamp(23px, 4vw, 43px); }
.progress-track { height: 12px; margin: 22px 0; overflow: hidden; background: #e8e6db; border-radius: 20px; }
.progress-track span { display: block; height: 100%; background: var(--theme); border-radius: inherit; transition: width .25s ease; }
.question-card {
  width: min(650px, 100%);
  margin: 0 auto 22px;
  padding: 20px 26px;
  text-align: center;
  background: color-mix(in srgb, var(--theme) 10%, white);
  border: 3px solid color-mix(in srgb, var(--theme) 36%, white);
  border-radius: 29px;
}
.question-label { color: var(--theme); font-family: Georgia, serif; font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.question-word { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 3px; }
.question-word strong { font-size: clamp(48px, 7vw, 76px); letter-spacing: -.045em; line-height: 1; }
.question-word button {
  width: 54px;
  height: 54px;
  padding: 0;
  font-size: 24px;
  background: white;
  border: 3px solid color-mix(in srgb, var(--theme) 42%, white);
  border-radius: 17px;
}
.question-card > small { color: var(--muted); font-weight: 900; }
.picture-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.picture-option {
  position: relative;
  min-width: 0;
  min-height: 225px;
  padding: 13px;
  overflow: hidden;
  background: white;
  border: 3px solid #d9d5c2;
  border-radius: 27px;
  box-shadow: 0 8px 0 #d7d2be;
}
.picture-option:not(:disabled):hover { border-color: var(--theme); transform: translateY(-2px); }
.option-picture { width: 100%; height: 185px; }
.answer-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  min-width: 37px;
  height: 37px;
  place-items: center;
  color: white;
  font-size: 20px;
  font-weight: 900;
  border-radius: 50%;
}
.picture-option.wrong { background: #fff0ed; border-color: #e59f96; box-shadow: 0 8px 0 #dfb2aa; }
.picture-option.wrong .answer-mark { background: var(--coral); }
.picture-option.hinted { background: #fff9dc; border-color: #e2c36b; box-shadow: 0 8px 0 #d7bf76; }
.picture-option.hinted .answer-mark { color: #715a1c; background: var(--gold); }
.picture-option.correct { padding-bottom: 65px; background: #eaf6eb; border-color: #77bd8e; box-shadow: 0 8px 0 #a7ceb0; }
.picture-option.correct .answer-mark { background: var(--green); }
.answer-name { position: absolute; right: 8px; bottom: 7px; left: 8px; padding: 7px; text-align: center; background: rgba(255, 255, 255, .94); border-radius: 14px; }
.answer-name strong, .answer-name small { display: block; }
.answer-name strong { font-size: 18px; }
.answer-name small { color: var(--muted); font-size: 11px; font-weight: 900; }
.game-tools { justify-content: space-between; gap: 15px; margin-top: 20px; }
.game-tools > span { color: var(--muted); font-size: 12px; font-weight: 900; }
.hint-button { min-height: 49px; padding: 0 16px; font-weight: 900; background: #fff1bc; border: 3px solid #dec56d; border-radius: 16px; }
.feedback-card { gap: 13px; min-height: 82px; margin-top: 15px; padding: 14px 16px; background: #f5f7f3; border: 2px solid #d8dfd7; border-radius: 21px; }
.feedback-card > span { display: grid; flex: 0 0 48px; height: 48px; place-items: center; font-size: 24px; font-weight: 900; background: white; border-radius: 14px; }
.feedback-card p { flex: 1; margin: 0; }
.feedback-card strong, .feedback-card small { display: block; }
.feedback-card small { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 800; }
.feedback-card.wrong { background: #fff0ed; border-color: #e9aca3; }
.feedback-card.hint { background: #fff7dc; border-color: #e2c879; }
.feedback-card.success { background: #eaf7ed; border-color: #99cbaa; }

.result-card { max-width: 940px; margin: 20px auto; padding: clamp(31px, 5vw, 52px); text-align: center; }
.result-icon { display: grid; width: 92px; height: 92px; place-items: center; margin: 0 auto 17px; font-size: 47px; background: #fff1bd; border: 4px solid #dfc86f; border-radius: 29px; transform: rotate(-3deg); }
.result-card h1 { margin-bottom: 10px; font-size: clamp(43px, 6vw, 64px); letter-spacing: -.05em; }
.result-card > p:not(.eyebrow) { color: var(--muted); font-weight: 800; }
.result-words { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 25px 0; }
.result-words article {
  display: grid;
  min-width: 0;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px;
  background: #f2f6ed;
  border: 2px solid #d3dfcb;
  border-radius: 20px;
}
.result-picture { width: 105px; height: 100px; }
.result-words strong, .result-words small { display: block; }
.result-words strong { overflow: hidden; max-width: 130px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.result-words small { color: var(--muted); font-size: 10px; font-weight: 900; }
.result-words button { width: 44px; height: 44px; padding: 0; font-size: 19px; background: white; border: 2px solid var(--line); border-radius: 14px; }
.stars { margin: 17px 0; color: var(--gold); font-size: 42px; letter-spacing: 4px; text-shadow: 0 3px 0 #d4972b; }
.result-stats { display: flex; justify-content: center; gap: 10px; margin: 17px 0 25px; }
.result-stats span { min-width: 130px; padding: 12px 15px; background: #f3f2e9; border-radius: 16px; }
.result-stats strong, .result-stats small { display: block; }
.result-stats strong { font-family: Georgia, serif; font-size: 25px; }
.result-stats small { color: var(--muted); font-size: 11px; font-weight: 900; }
.result-actions { justify-content: center; gap: 12px; }
.fatal-card { display: grid; min-height: 430px; place-items: center; align-content: center; text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 42px; }
.fatal-card > span { font-size: 60px; }
.fatal-card strong, .fatal-card small { display: block; }
.fatal-card small { margin-top: 6px; color: var(--muted); }

@media (max-width: 950px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy > p, .hero h1 { margin-right: auto; margin-left: auto; }
  .hero-facts { justify-content: center; }
  .hero-book { width: min(570px, 100%); margin: auto; }
  .themes-grid { grid-template-columns: 1fr; }
  .theme-card { min-height: 245px; display: grid; grid-template-columns: 72px 210px 1fr; grid-template-rows: 1fr auto; gap: 12px 18px; }
  .theme-top { align-self: start; flex-direction: column; }
  .theme-preview { height: 170px; grid-row: 1 / span 2; grid-column: 2; margin: 0; }
  .theme-copy { align-self: center; }
  .theme-footer { grid-column: 3; }
  .focus-card { grid-template-columns: 230px 1fr; }
  .listen-button { grid-column: 1 / -1; width: 100%; min-height: 64px; grid-auto-flow: column; justify-content: center; }
  .listen-button span { font-size: 26px; }
  .picture-options { grid-template-columns: repeat(2, 1fr); }
  .result-words { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .app { width: auto; max-width: 1120px; margin-right: 10px; margin-left: 10px; padding-top: 11px; }
  .topbar { min-height: 53px; margin-bottom: 13px; }
  .brand { gap: 8px; }
  .brand-mark { width: 47px; height: 47px; font-size: 13px; border-radius: 15px; }
  .brand strong { font-size: 17px; }
  .brand small, .sound-button span:last-child, .top-spark { display: none; }
  .sound-button, .back-button { width: 47px; min-height: 47px; justify-content: center; padding: 0; }
  .hero { min-height: 0; gap: 28px; padding: 34px 20px; border-radius: 31px; }
  .hero h1 { font-size: 44px; }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .hero-book { min-height: 330px; padding: 64px 12px 22px; border-width: 6px; border-radius: 29px; }
  .hello-bubble { top: 18px; right: 16px; font-size: 18px; }
  .hero-picture { width: 31%; height: 125px; padding: 3px; }
  .hero-picture:nth-child(2) { height: 108px; }
  .hero-picture:nth-child(3) { height: 120px; }
  .how-section, .themes-section { margin-top: 31px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .steps-grid { grid-template-columns: 1fr; }
  .theme-card { display: flex; min-height: 360px; }
  .theme-top { flex-direction: row; }
  .theme-preview { width: 100%; height: 145px; margin: 15px 0; }
  .theme-footer { width: 100%; }
  .adult-note { align-items: flex-start; }
  .study-shell, .game-shell { padding: 20px 13px; border-radius: 29px; }
  .study-heading, .game-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .study-count, .round-badge { width: 66px; height: 66px; align-self: flex-end; margin-top: -76px; }
  .study-focus { grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 6px; }
  .study-arrow { width: 46px; height: 50px; border-radius: 15px; }
  .focus-card { min-height: 430px; grid-template-columns: 1fr; gap: 10px; padding: 18px; text-align: center; }
  .focus-picture { height: 215px; }
  .focus-word h2 { font-size: 48px; }
  .listen-button { min-height: 62px; }
  .word-strip { grid-template-columns: repeat(2, 1fr); }
  .word-strip > button { min-height: 125px; }
  .study-actions { flex-direction: column-reverse; }
  .study-actions button { width: 100%; }
  .question-card { padding: 18px 10px; }
  .question-word strong { overflow-wrap: anywhere; font-size: 48px; }
  .question-word button { flex: 0 0 50px; }
  .picture-options { grid-template-columns: 1fr; }
  .picture-option { min-height: 235px; }
  .option-picture { height: 205px; }
  .game-tools { align-items: stretch; flex-direction: column; }
  .game-tools > span { text-align: center; }
  .hint-button { width: 100%; }
  .feedback-card { align-items: flex-start; flex-wrap: wrap; }
  .feedback-card .primary-button { width: 100%; }
  .result-card { margin: 16px auto; padding: 30px 13px; border-radius: 30px; }
  .result-words { grid-template-columns: repeat(2, 1fr); }
  .result-stats { flex-direction: column; }
  .result-stats span { width: 100%; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions button { width: 100%; }
}

@media (max-width: 390px) {
  .brand strong { font-size: 0; }
  .brand strong::after { font-size: 16px; content: "English words"; }
  .word-strip { grid-template-columns: 1fr 1fr; }
}

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

.memory-mark {
  background: linear-gradient(145deg, #7767b4, #4f8e79);
  font-family: Georgia, serif;
  font-size: 22px;
}

.calm-memory-pill {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 2px solid #ded8c5;
  border-radius: 18px;
  background: rgba(255, 253, 248, .88);
  color: #526e67;
  font-size: 12px;
  font-weight: 850;
}

.memory-hero {
  background:
    radial-gradient(circle at 91% 18%, rgba(113, 101, 180, .13) 0 118px, transparent 119px),
    linear-gradient(135deg, #fffef8, #f7f7ec);
}

.memory-book {
  display: grid;
  min-height: 430px;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 46px;
  background:
    radial-gradient(circle at 50% 50%, rgba(99, 130, 169, .13), transparent 55%),
    #f4f5e9;
}

.hero-memory-card {
  display: flex;
  min-height: 135px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 3px solid #ddd8c8;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 7px 0 #d7d1bf;
}

.hero-memory-card.word span { color: #365851; font-size: 34px; font-weight: 950; }
.hero-memory-card small { color: #7c8983; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.hero-memory-card.closed { border-color: #7168ad; background: linear-gradient(145deg, #8278bd, #625a9e); box-shadow: 0 7px 0 #514983; color: #fff; }
.hero-memory-card.closed.alt { border-color: #5c967e; background: linear-gradient(145deg, #72aa91, #4f876f); box-shadow: 0 7px 0 #416f5d; }
.hero-memory-card.closed > span { font-family: Georgia, serif; font-size: 51px; font-weight: 900; }
.hero-memory-picture { width: 100%; height: 118px; }
.memory-book > p { grid-column: 1 / -1; margin: 6px 0 0; color: #6f7d77; font-size: 14px; font-weight: 750; text-align: center; }
.memory-book > p strong { color: #355851; }

.memory-settings { margin-top: 44px; }
.memory-theme-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.memory-theme-tabs button {
  display: grid;
  min-height: 105px;
  grid-template-columns: 50px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  gap: 0 12px;
  padding: 15px;
  border: 2px solid #ded8c5;
  border-radius: 23px;
  background: #fffefa;
  color: #385751;
  text-align: left;
}

.memory-theme-tabs button > span {
  display: grid;
  width: 50px;
  height: 50px;
  grid-row: 1 / -1;
  place-items: center;
  border-radius: 17px;
  background: color-mix(in srgb, var(--theme) 15%, #fff);
  font-size: 25px;
}

.memory-theme-tabs button strong { align-self: end; font-size: 17px; }
.memory-theme-tabs button small { align-self: start; color: #7b8782; font-size: 11px; font-weight: 750; }
.memory-theme-tabs button.active { border-color: var(--theme); box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme) 18%, transparent), 0 6px 0 color-mix(in srgb, var(--theme) 35%, #ded8c5); }

.selected-theme-preview {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
  padding: 17px 22px;
  border: 2px solid color-mix(in srgb, var(--theme) 35%, #ded8c5);
  border-radius: 24px;
  background: color-mix(in srgb, var(--theme) 6%, #fffefa);
}

.selected-theme-preview > span { display: flex; width: 230px; height: 84px; align-items: center; justify-content: center; }
.selected-theme-preview .preview-picture { width: 33.33%; height: 82px; }
.selected-theme-preview p { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.selected-theme-preview strong { color: #355750; font-family: Georgia, serif; font-size: 21px; }
.selected-theme-preview small { color: #74817b; font-size: 13px; font-weight: 700; }

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

.memory-mode-card {
  display: grid;
  min-height: 210px;
  grid-template-columns: 75px 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 27px;
  border: 2px solid color-mix(in srgb, var(--mode) 38%, #ded8c5);
  border-radius: 29px;
  background: color-mix(in srgb, var(--mode) 7%, #fffdfa);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--mode) 22%, #ded8c5);
  color: #355750;
  text-align: left;
}

.memory-mode-card:hover { transform: translateY(-3px); }
.memory-mode-icon { display: grid; width: 75px; height: 75px; place-items: center; border-radius: 23px; background: color-mix(in srgb, var(--mode) 17%, #fff); font-family: Georgia, serif; font-size: 28px; font-weight: 900; }
.memory-mode-card > span:nth-child(2) { display: flex; flex-direction: column; gap: 5px; }
.memory-mode-card small { color: var(--mode); font-size: 11px; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.memory-mode-card strong { font-family: Georgia, serif; font-size: 25px; }
.memory-mode-card i { color: #73817b; font-size: 13px; font-style: normal; font-weight: 700; }
.memory-mode-card > b { grid-column: 1 / -1; justify-self: end; color: var(--mode); font-size: 13px; }

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 25px;
}

.memory-card {
  position: relative;
  min-width: 0;
  min-height: 185px;
  padding: 11px;
  overflow: hidden;
  border: 3px solid #6962a4;
  border-radius: 24px;
  background: linear-gradient(145deg, #7e76b9, #5e5899);
  box-shadow: 0 7px 0 #4f487f;
  color: #fff;
}

.memory-card:hover:not(:disabled) { transform: translateY(-3px); }
.memory-card:disabled { opacity: 1; }
.memory-card .card-back,
.memory-card .card-face {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.memory-card .card-back b { font-family: Georgia, serif; font-size: 54px; }
.memory-card .card-back small { color: rgba(255,255,255,.76); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.memory-card .card-face { visibility: hidden; }
.memory-card.face-up { border-color: #d8d4c5; background: #fffefa; box-shadow: 0 7px 0 #d7d1bf; color: #355750; }
.memory-card.face-up .card-back { visibility: hidden; }
.memory-card.face-up .card-face { visibility: visible; }
.memory-card.matched { border-color: #66a47e; background: #f1faf3; box-shadow: 0 7px 0 #b8d4c1; }

.memory-card-picture { width: 100%; height: 145px; }
.memory-card-word { display: flex; max-width: 100%; align-items: center; flex-direction: column; gap: 7px; text-align: center; }
.memory-card-word strong { max-width: 100%; color: #33564f; font-size: clamp(18px, 2.4vw, 29px); overflow-wrap: anywhere; }
.memory-card-word.translation strong { font-family: Georgia, serif; font-size: clamp(16px, 2vw, 25px); }
.memory-card-word small { color: #7b8882; font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.pair-mark { position: absolute; top: 9px; right: 9px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #4e9268; color: #fff; font-size: 20px; font-weight: 950; }

.memory-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 24px 0 16px;
}

.memory-tools > span { color: #73807a; font-size: 13px; font-weight: 750; }
.memory-tools > span strong { color: #365750; }

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

.memory-review article {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 2px solid #dde2d6;
  border-radius: 22px;
  background: #f7f9f3;
}

.memory-review-picture { width: 85px; height: 105px; }
.memory-review article > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.memory-review article strong { color: #31564f; font-size: 18px; overflow-wrap: anywhere; }
.memory-review article small { color: #7a8781; font-size: 11px; font-weight: 750; }
.memory-result .result-icon { background: #eef0ff; border-color: #b9c0e8; }

@media (max-width: 900px) {
  .memory-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-card { min-height: 170px; }
}

@media (max-width: 700px) {
  .calm-memory-pill { width: 47px; min-height: 47px; justify-content: center; padding: 0; font-size: 0; }
  .calm-memory-pill span { font-size: 17px; }
  .memory-book { min-height: 390px; padding: 25px 18px; }
  .hero-memory-card { min-height: 125px; border-radius: 21px; }
  .memory-theme-tabs { grid-template-columns: 1fr; }
  .memory-theme-tabs button { min-height: 88px; }
  .selected-theme-preview { align-items: flex-start; flex-direction: column; gap: 9px; }
  .selected-theme-preview > span { width: 100%; }
  .memory-mode-grid { grid-template-columns: 1fr; }
  .memory-mode-card { min-height: 190px; padding: 22px; }
  .memory-game .round-badge { margin-top: 0; }
  .memory-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .memory-card { min-height: 150px; padding: 6px; border-width: 2px; border-radius: 18px; box-shadow: 0 5px 0 #4f487f; }
  .memory-card.face-up { box-shadow: 0 5px 0 #d7d1bf; }
  .memory-card.matched { box-shadow: 0 5px 0 #b8d4c1; }
  .memory-card .card-back, .memory-card .card-face { inset: 6px; }
  .memory-card .card-back b { font-size: 42px; }
  .memory-card-picture { height: 122px; }
  .memory-card-word strong { font-size: 17px; }
  .memory-card-word.translation strong { font-size: 15px; }
  .pair-mark { top: 5px; right: 5px; width: 29px; height: 29px; font-size: 17px; }
  .memory-tools { align-items: stretch; flex-direction: column; }
  .memory-tools button { width: 100%; }
  .memory-tools > span { text-align: center; }
  .memory-review { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-review article { min-height: 135px; align-items: center; flex-direction: column; gap: 4px; text-align: center; }
  .memory-review-picture { width: 75px; height: 80px; }
}

@media (max-width: 390px) {
  .brand strong::after { content: "English Memory"; }
}
