:root {
  --bg: #fff8ea;
  --bg-strong: #f6ead5;
  --surface: #fffdf7;
  --surface-warm: #fffaef;
  --text: #2e2924;
  --muted: #8b7d6b;
  --muted-2: #a79986;
  --primary: #6f9a6b;
  --primary-pressed: #4f7350;
  --primary-soft: #e7f0e2;
  --secondary: #f4c766;
  --secondary-soft: #fff0c8;
  --accent: #e98932;
  --soft-blue: #7db9be;
  --progress: #7db9be;
  --success: #6f9a6b;
  --warning: #f4c766;
  --error: #b76557;
  --border: #e9ddc8;
  --shadow: 0 18px 42px rgba(46, 41, 36, 0.11);
  --shadow-soft: 0 10px 26px rgba(46, 41, 36, 0.075);
  --card-bg: rgba(255, 252, 245, 0.86);
  --card-border: rgba(218, 200, 167, 0.65);
  --card-shadow: 0 18px 48px rgba(70, 45, 20, 0.07);
  --radius-xs: 12px;
  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-xl: 40px;
  --radius-media: 24px;
  --color-paper-warm: #f7efe0;
  --tap: 56px;
  --content-max: 1240px;
  --reading-max: 760px;
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: Nunito Sans, Nunito, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(225, 183, 101, 0.22), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(126, 183, 166, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg), #fffaf4 52%, var(--bg));
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root,
#app,
main,
section {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

img {
  height: auto;
  object-fit: cover;
}

body.is-reading {
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid rgba(111, 143, 106, .35);
  outline-offset: 3px;
}

.media-frame {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-media);
  background: var(--color-paper-warm);
  aspect-ratio: var(--media-ratio, 4 / 3);
  flex-shrink: 0;
}

.media-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--media-fit, cover);
  object-position: var(--media-position, center);
}

.media-frame--cover,
.media-frame--preview {
  aspect-ratio: 3 / 4;
  border-radius: 22px;
}

.media-frame--page {
  aspect-ratio: var(--media-ratio, 3 / 4);
  border-radius: 24px;
}

.media-frame--hero {
  aspect-ratio: 4 / 3;
}

.media-frame--empty {
  width: min(320px, 78vw);
  aspect-ratio: 4 / 3;
  margin: 0 auto 12px;
}

.media-frame--reward {
  width: min(230px, 72vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 28px;
  box-shadow: 0 16px 34px rgba(47, 42, 36, .16);
}

.media-frame--thumb {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

.app-shell {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  min-height: 100svh;
  padding: 0 40px calc(56px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 24px;
  transition: opacity .24s var(--ease), transform .24s var(--ease), height .24s var(--ease), padding .24s var(--ease);
}

body.is-reading .topbar {
  height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

.brand {
  min-height: 60px;
  border: 0;
  padding: 4px 8px 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--text);
  border-radius: 18px;
  text-align: left;
}

.brand__mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.brand__mark svg {
  width: 38px;
  height: 38px;
}

.brand__text {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.brand__text strong {
  font-size: 19px;
  letter-spacing: 0;
}

.brand__text small {
  color: var(--muted);
  font-size: 13px;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 60px;
  padding: 6px;
  border: 1px solid rgba(234, 223, 204, .9);
  border-radius: 999px;
  background: rgba(255, 253, 247, .78);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(47, 42, 36, .05);
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-pills::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex: 0 0 auto;
  min-width: 110px;
  height: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}

.nav-pill:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: rgba(231, 240, 226, .88);
}

.nav-pill.is-active {
  color: var(--text);
  background: var(--secondary-soft);
  box-shadow: 0 8px 18px rgba(70, 45, 20, .065);
}

.nav-pill--parent {
  color: #665d54;
}

.app {
  min-height: 68vh;
}

.app:focus {
  outline: none;
}

.screen {
  display: grid;
  gap: 28px;
  animation: riseIn .28s var(--ease) both;
}

.screen > .section-header,
.screen > .grid,
.screen > .hero,
.screen > .parent-grid,
.screen > .profile-top-grid,
.screen > .profile-children-panel,
.screen > .profile-account-card,
.screen > .profile-form,
.screen > .panel,
.screen > .empty-card,
.screen > .reward-card {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.screen > .home-grid {
  width: 100%;
  max-width: none;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

.hero {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 22px;
  align-items: stretch;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
  gap: 28px;
  align-items: stretch;
}

.hero-card,
.panel,
.book-card,
.level-card,
.stat-card,
.reward-card,
.empty-card {
  border: 1px solid rgba(233, 221, 200, .94);
  background: rgba(255, 253, 247, .88);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
}

.hero-card,
.panel,
.book-card,
.level-card,
.stat-card,
.reward-card,
.empty-card,
.auth-card,
.current-book-mini,
.child-card,
.dashboard-child {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(110deg, rgba(255, 253, 247, .98), rgba(255, 250, 239, .9));
}

.hero-card--dashboard {
  gap: 24px;
}

.hero-card::after {
  display: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.decorative-image-layer {
  position: absolute;
  inset: auto 0 0 auto;
  opacity: .14;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.decorative-image-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: right bottom;
}

.decorative-image {
  opacity: var(--decorative-opacity, .12);
  pointer-events: none;
}

.decorative-image img {
  width: 100%;
  height: 100%;
}

.hero-card__decor {
  right: 10px;
  bottom: -18px;
  width: min(34%, 220px);
  height: 260px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-pressed);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
  max-width: 620px;
}

.muted {
  color: var(--muted);
}

.hero__actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  min-height: var(--tap);
  border: 0;
  border-radius: 22px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text);
  font-size: 19px;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(.99);
}

.btn--primary {
  color: white;
  background: var(--primary);
  box-shadow: 0 10px 20px rgba(111, 143, 106, .18);
}

.btn--primary:hover {
  background: var(--primary-pressed);
}

.btn--secondary {
  color: var(--text);
  background: var(--secondary-soft);
  border: 1px solid rgba(225, 183, 101, .5);
}

.btn--ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(234, 223, 204, .92);
}

.btn--danger-secondary {
  color: #8b5148;
  background: rgba(255, 251, 245, .72);
  border: 1px solid rgba(183, 101, 87, .34);
  box-shadow: none;
}

.btn--danger-secondary:hover {
  color: #743d35;
  background: rgba(255, 241, 235, .86);
}

.btn--small {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 16px;
}

.btn--round {
  width: var(--tap);
  padding: 0;
  border-radius: 18px;
}

.btn[disabled] {
  opacity: .64;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.panel {
  padding: 32px;
}

.home-grid > .panel {
  min-height: 390px;
  display: flex;
  flex-direction: column;
}

.level-summary {
  display: grid;
  gap: 18px;
  flex: 1;
  align-content: space-between;
}

.level-summary .btn {
  align-self: end;
  width: 100%;
}

.panel--warm {
  background: rgba(255, 250, 242, .94);
}

.panel__header,
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section {
  margin-top: 28px;
}

.section:first-child {
  margin-top: 0;
}

.shelf-screen {
  align-content: start;
}

.shelf-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.shelf-header .lead {
  margin-bottom: 0;
}

.shelf-header .btn {
  min-width: 180px;
  min-height: 56px;
}

.current-book-mini {
  margin-top: 24px;
  min-height: 176px;
  padding: 20px;
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero-card--dashboard .hero__actions {
  gap: 14px;
}

.hero-card--dashboard .hero__actions .btn {
  min-height: 60px;
}

.current-book-mini > *:not(.book-card-decoration) {
  position: relative;
  z-index: 1;
}

.current-book-mini__cover {
  width: 112px;
  align-self: start;
  border-radius: 22px;
}

.current-book-mini__body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.current-book-mini__body > .muted {
  margin: 0;
}

.book-card-decoration {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 38%;
  height: 100%;
  opacity: .12;
  overflow: hidden;
  pointer-events: none;
}

.book-card-decoration img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: right bottom;
}

.cover {
  position: relative;
  min-height: 0;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  background: var(--secondary-soft);
  box-shadow: inset 8px 0 0 rgba(46, 41, 36, .08), inset 0 0 0 1px rgba(47, 42, 36, .06), 0 10px 20px rgba(47, 42, 36, .08);
}

.cover::before,
.cover::after {
  content: "";
  position: absolute;
}

.cover--image {
  background: #f4e7cc;
  box-shadow: inset 8px 0 0 rgba(46, 41, 36, .08), 0 12px 24px rgba(47, 42, 36, .12);
}

.cover--image::before,
.cover--image::after {
  display: none;
}

.cover--image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cover--image .cover__title {
  display: none;
}

.cover__title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  color: var(--text);
  font-size: 16px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.cover--cat {
  background: linear-gradient(160deg, #f9e2bc, #fff9eb 58%, #dfeee3);
}
.cover--cat::before {
  width: 52px; height: 48px; border-radius: 50% 50% 46% 46%; background: #d8896f; left: 24px; top: 26px;
  box-shadow: 9px -8px 0 -3px #d8896f, 34px 14px 0 -8px #e1b765;
}
.cover--cat::after {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(126, 183, 166, .75); right: 18px; top: 50px;
}

.cover--house {
  background: linear-gradient(160deg, #e4edde, #fffaf2 58%, #f8e2cf);
}
.cover--house::before {
  width: 66px; height: 52px; border-radius: 12px; background: #fff; left: 26px; top: 46px; box-shadow: inset 0 0 0 3px rgba(111,143,106,.2);
}
.cover--house::after {
  width: 70px; height: 70px; background: #d8896f; left: 24px; top: 18px; transform: rotate(45deg); border-radius: 12px;
}

.cover--sun {
  background: linear-gradient(160deg, #fff5d4, #fffdf7 54%, #e5f0ec);
}
.cover--sun::before {
  width: 68px; height: 68px; border-radius: 50%; background: #e1b765; right: 24px; top: 22px;
  box-shadow: 0 0 0 14px rgba(225,183,101,.18);
}
.cover--sun::after {
  width: 100px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.82); left: 16px; top: 58px;
}

.cover--fox {
  background: linear-gradient(160deg, #ffe7d8, #fff9ed 54%, #e5efdf);
}
.cover--fox::before {
  width: 70px; height: 56px; border-radius: 50% 50% 42% 42%; background: #d8896f; left: 28px; top: 34px;
  box-shadow: -16px -8px 0 -7px #d8896f, 16px -8px 0 -7px #d8896f;
}
.cover--fox::after {
  width: 86px; height: 16px; border-radius: 999px; background: rgba(111,143,106,.42); left: 18px; top: 92px;
}

.cover--water {
  background: linear-gradient(160deg, #e2f1ee, #fffaf2 58%, #f8e9d0);
}
.cover--water::before {
  width: 72px; height: 72px; border-radius: 50% 48% 56% 44%; background: rgba(126, 183, 166, .8); right: 22px; top: 28px;
}
.cover--water::after {
  width: 86px; height: 28px; border-radius: 999px; background: rgba(111,143,106,.34); left: 18px; top: 72px;
}

.cover--boat {
  background: linear-gradient(160deg, #e3f3f1, #fffaf2 54%, #f7dbb8);
}
.cover--boat::before {
  width: 80px; height: 44px; border-radius: 0 0 26px 26px; background: #e1b765; left: 22px; top: 66px;
}
.cover--boat::after {
  width: 0; height: 0; border-left: 34px solid transparent; border-right: 12px solid transparent; border-bottom: 58px solid #ffffff; left: 48px; top: 20px;
}

.cover--star {
  background: linear-gradient(160deg, #f6f1ff, #fffaf2 54%, #e7f1ec);
}
.cover--star::before {
  width: 78px; height: 78px; left: 36px; top: 26px; background: #e1b765; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 67% 56%, 78% 93%, 50% 70%, 22% 93%, 33% 56%, 2% 35%, 39% 35%);
}
.cover--star::after {
  width: 96px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.7); left: 14px; top: 74px;
}

.cover--berry {
  background: linear-gradient(160deg, #ffe6e0, #fffaf2 58%, #e4edde);
}
.cover--berry::before {
  width: 62px; height: 62px; border-radius: 48% 52% 55% 45%; background: #d8896f; right: 28px; top: 38px; box-shadow: -32px 18px 0 -16px #e1b765;
}
.cover--berry::after {
  width: 34px; height: 24px; border-radius: 50%; background: #79a66a; right: 42px; top: 24px; transform: rotate(-14deg);
}

.cover--sound {
  background: linear-gradient(160deg, #fff3d7, #eef6ec 54%, #dff1f3);
}
.cover--sound::before {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(126, 183, 190, .78);
  right: 22px;
  top: 28px;
  box-shadow: -52px 24px 0 -16px rgba(244, 199, 102, .86), -14px 72px 0 -24px rgba(111, 154, 107, .82);
}
.cover--sound::after {
  width: 74px;
  height: 54px;
  border: 7px solid #d8896f;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  left: 24px;
  top: 48px;
  transform: rotate(18deg);
}

.book-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 850;
  color: var(--primary-pressed);
  background: var(--primary-soft);
  white-space: nowrap;
}

.badge--warm {
  color: #7a531c;
  background: var(--secondary-soft);
}

.badge--done {
  color: #496f3e;
  background: #e7f1e2;
}

.badge--locked {
  color: #776c5f;
  background: #efe8dc;
}

.progress {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.progress__track {
  position: relative;
  height: 12px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e6d4;
  box-shadow: inset 0 1px 2px rgba(46, 41, 36, .08);
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  width: 0%;
  transition: width .5s var(--ease);
}

.book-card {
  position: relative;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(225, 183, 101, .54);
}

.book-card .cover {
  width: 100%;
}

.book-card--illustrated {
  grid-template-columns: 128px 1fr;
}

.book-card__subtitle {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 750;
}

.book-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px;
}

.book-card__body h3 {
  margin: 0;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.35;
}

.book-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
  gap: 20px;
  justify-content: start;
  align-items: start;
}

.shelf-book {
  border: 0;
  min-width: 0;
  padding: 0;
  text-align: left;
  border-radius: 24px;
  background: transparent;
  transition: transform .18s var(--ease);
}

.shelf-book:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.shelf-book .cover {
  width: 100%;
}

.shelf-book__cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
}

.shelf-book__status {
  min-height: 34px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.shelf-book__status .badge {
  justify-content: center;
}

.book-shelf-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  align-items: start;
  min-height: 340px;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 32px;
  background: rgba(255, 252, 245, .52);
  box-shadow: var(--card-shadow);
}

.book-shelf-card {
  min-width: 0;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 16px;
  display: grid;
  gap: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 252, 245, .86);
  box-shadow: var(--card-shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.book-shelf-card:hover {
  transform: translateY(-3px);
  border-color: rgba(225, 183, 101, .55);
  box-shadow: var(--shadow-soft);
}

.book-shelf-card__cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
}

.book-shelf-card__body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.book-shelf-card__top {
  display: grid;
  gap: 8px;
}

.book-shelf-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
}

.book-shelf-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.35;
}

.book-shelf-card .progress__meta {
  font-size: 13px;
}

.book-shelf-card .progress__track {
  height: 10px;
}

.levels-screen {
  align-content: start;
}

.levels-header .lead {
  max-width: 680px;
}

.levels-layout {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.levels-layout--single {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.levels-layout--single .levels-grid {
  grid-template-columns: minmax(0, 420px);
}

.levels-info-card {
  min-height: 420px;
  padding: 28px;
  border: 1px solid var(--card-border);
  border-radius: 32px;
  display: grid;
  align-content: space-between;
  gap: 20px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 252, 245, .86), rgba(255, 245, 224, .72));
  box-shadow: var(--card-shadow);
}

.levels-info-card h2 {
  margin-bottom: 0;
}

.levels-info-card__steps {
  display: flex;
  gap: 12px;
  align-items: end;
}

.levels-info-card__steps span {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--primary-pressed);
  background: rgba(228, 237, 222, .84);
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(70, 45, 20, .06);
}

.level-card {
  width: 100%;
  min-height: 420px;
  padding: 28px;
  border-radius: 32px;
  display: grid;
  gap: 18px;
  align-content: space-between;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255,253,247,.96), rgba(228,237,222,.9));
}

.level-card::after {
  display: none;
}

.level-card > * {
  position: relative;
  z-index: 1;
}

.level-card--current {
  background: linear-gradient(145deg, rgba(255,253,247,.96), rgba(231,240,226,.9));
  border-color: rgba(111, 143, 106, .38);
}

.level-card--completed {
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(231,241,226,.9));
}

.level-card--locked {
  background: rgba(255, 255, 255, .58);
  box-shadow: none;
}

.level-card__top {
  display: grid;
  gap: 14px;
  align-content: start;
}

.level-card__top .muted {
  margin: 0;
}

.level-card__status {
  width: fit-content;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  color: var(--primary-pressed);
  background: rgba(112, 159, 111, .14);
  font-size: 15px;
  font-weight: 850;
}

.level-card h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

.level-card__books {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.level-card__books::-webkit-scrollbar {
  display: none;
}

.level-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 75px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  background: var(--secondary-soft);
  border: 1px solid rgba(47,42,36,.06);
  box-shadow: 0 5px 12px rgba(47,42,36,.08);
  overflow: hidden;
  display: inline-block;
}

.level-card--locked .level-thumb {
  opacity: .45;
}

.level-card .btn {
  width: 100%;
  min-height: 56px;
}

.parent-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 18px;
}

.parent-dashboard-screen {
  align-content: start;
}

.parent-dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}

.parent-dashboard-header .lead {
  max-width: 720px;
}

.parent-dashboard-actions {
  justify-content: flex-end;
}

.parent-dashboard-actions .btn {
  min-height: 52px;
}

.parent-dashboard-grid {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.parent-dashboard-left,
.parent-dashboard-right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.summary-card {
  display: grid;
  gap: 18px;
}

.summary-card h2 {
  margin-bottom: 0;
}

.summary-card__stats {
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.next-step-card {
  padding: 18px;
  border-radius: 24px;
  color: var(--primary-pressed);
  background: rgba(228, 237, 222, .72);
}

.next-step-card p:last-child {
  margin-bottom: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.parent-tip-card {
  margin: 0;
  border: 1px solid rgba(225, 183, 101, .42);
  box-shadow: var(--card-shadow);
}

.active-child-card,
.children-dashboard-card {
  display: grid;
  gap: 18px;
}

.active-child-card .panel__header {
  margin-bottom: 0;
}

.active-book-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(234, 223, 204, .92);
  border-radius: 28px;
  background: rgba(255, 252, 245, .82);
}

.active-book-card__cover {
  width: 120px;
  border-radius: 22px;
}

.active-book-card__body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.active-book-card__body h3,
.active-book-card__body .muted {
  margin: 0;
}

.active-book-card__actions .btn {
  min-height: 46px;
}

.profile-screen {
  align-content: start;
}

.profile-header .lead {
  max-width: 720px;
}

.profile-top-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}

.profile-settings-card {
  max-width: 720px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.profile-settings-card .actions {
  gap: 14px;
}

.profile-settings-card .actions .btn {
  min-height: 56px;
}

.profile-settings-card .form-note {
  font-size: 14px;
  line-height: 1.45;
}

.profile-summary-card {
  display: grid;
  align-content: space-between;
  gap: 20px;
  background: linear-gradient(145deg, rgba(255, 252, 245, .88), rgba(228, 237, 222, .68));
}

.profile-summary-card h2 {
  margin-bottom: 8px;
}

.profile-children-panel {
  display: grid;
  gap: 18px;
}

.profile-children-panel > .section-header {
  margin-bottom: 0;
}

.child-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.child-chip {
  min-height: 48px;
  border: 1px solid rgba(234, 223, 204, .92);
  border-radius: 999px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .76);
  color: var(--text);
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}

.child-chip small {
  color: var(--muted);
  font-weight: 800;
}

.child-chip.is-active {
  background: var(--secondary-soft);
  border-color: rgba(225, 183, 101, .58);
}

.child-list,
.dashboard-list {
  display: grid;
  gap: 14px;
}

.child-card,
.dashboard-child {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(234, 223, 204, .92);
  border-radius: 28px;
  background: rgba(228, 237, 222, .42);
}

.child-card.is-active,
.dashboard-child.is-active {
  border-color: rgba(111, 143, 106, .42);
  background: rgba(228, 237, 222, .55);
}

.child-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.child-card__top h3 {
  margin-bottom: 6px;
}

.child-card__top .muted {
  margin: 0;
}

.child-card__actions .btn {
  min-height: 46px;
}

.stat-row.child-card__stats {
  grid-template-columns: repeat(3, minmax(120px, 180px));
  justify-content: start;
}

.child-add-form {
  max-width: 680px;
  display: flex;
  gap: 16px;
  align-items: end;
}

.child-add-form .field {
  flex: 1 1 420px;
  max-width: 420px;
}

.child-add-form .btn {
  flex: 0 0 auto;
  min-width: 220px;
  min-height: 56px;
}

.dashboard-child__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.stat-row--compact .stat-card {
  padding: 14px;
}

.stat-row--compact .stat-card strong {
  font-size: 26px;
}

.stat-card {
  padding: 18px;
  background: rgba(255, 250, 239, .86);
}

.stat-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.stat-card span {
  color: var(--muted);
  font-weight: 750;
}

.parent-note {
  padding: 18px;
  border-radius: 24px;
  background: var(--secondary-soft);
  color: #6f4f1f;
  line-height: 1.45;
}

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

.book-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--secondary-soft);
  color: #6f4f1f;
}

.book-preview strong,
.book-preview span {
  overflow-wrap: anywhere;
}

.book-preview strong {
  font-size: 13px;
}

.book-preview span {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
}

.book-detail-screen {
  align-content: start;
}

.book-detail-back {
  justify-self: start;
}

.book-detail-layout {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.book-info-card {
  position: sticky;
  top: 24px;
  height: fit-content;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.book-info-card__cover {
  width: min(220px, 100%);
  border-radius: 24px;
}

.book-info-card__body {
  width: 100%;
  display: grid;
  gap: 14px;
  justify-items: stretch;
}

.book-info-card__body h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 4vw, 46px);
}

.book-info-card__body .lead {
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.45;
}

.book-info-card__actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.book-info-card__actions .btn {
  width: 100%;
  min-height: 56px;
}

.pages-card {
  display: grid;
  gap: 20px;
}

.pages-card__header h2 {
  margin-bottom: 8px;
}

.pages-card__header .muted {
  margin: 0;
  max-width: 680px;
}

.pages-card .book-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.page-preview-card {
  gap: 0;
  padding: 0;
  border: 1px solid rgba(234, 223, 204, .92);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 246, 220, .78);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(70, 45, 20, .06);
}

.page-image-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  background: #f7efe0;
}

.book-preview__body {
  min-height: 72px;
  padding: 12px 14px 16px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.book-preview__body strong {
  color: var(--primary-pressed);
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
}

.book-preview__body span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 850;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-form,
.auth-form {
  max-width: 640px;
  display: grid;
  gap: 18px;
}

.profile-settings-card {
  max-width: 720px;
}

.auth-screen {
  min-height: calc(100svh - 80px);
  display: grid;
  align-items: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, .85fr);
  gap: 56px;
  align-items: center;
  min-height: calc(100svh - 80px);
  padding: 0;
  overflow: visible;
}

.auth-art {
  margin: 0;
  width: 100%;
  max-width: 620px;
  border-radius: 32px;
  box-shadow: 0 18px 48px rgba(70, 45, 20, .07);
}

.auth-art > .auth-art__scene-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.auth-art > .auth-art__character-layer {
  position: absolute;
  left: 5%;
  bottom: 0;
  z-index: 1;
  width: min(42%, 250px);
  height: 88%;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 16px 34px rgba(70, 45, 20, .12);
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(247, 239, 224, .08), rgba(247, 239, 224, 0) 42%, rgba(247, 239, 224, .14));
}

.auth-intro {
  display: grid;
  gap: 22px;
  align-content: center;
  max-width: 620px;
  min-width: 0;
}

.brand--auth {
  padding: 0;
  cursor: default;
}

.auth-copy {
  display: grid;
  gap: 10px;
}

.auth-copy .eyebrow {
  width: fit-content;
  margin-bottom: 0;
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(228, 237, 222, .88);
  color: var(--primary-pressed);
}

.auth-copy h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(52px, 5vw, 64px);
}

.auth-copy .lead {
  max-width: 560px;
  margin-bottom: 0;
  font-size: 22px;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.auth-points span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--primary-pressed);
  background: rgba(228, 237, 222, .86);
  font-size: 14px;
  font-weight: 850;
  max-width: 100%;
  white-space: normal;
}

.auth-card {
  display: grid;
  gap: 18px;
  justify-self: end;
  width: min(100%, 470px);
  min-width: 0;
  padding: 32px;
  border-radius: 32px;
  background: rgba(255, 250, 239, .94);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card, 0 8px 24px rgba(80, 60, 35, .06));
}

.auth-card__header h2 {
  margin-bottom: 8px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 56px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(234, 223, 204, .72);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  font-size: 17px;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(70, 45, 20, .08);
}

.auth-tab[disabled] {
  opacity: .48;
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-switch .btn {
  min-height: 52px;
  flex: 1 1 230px;
  font-size: 16px;
  white-space: nowrap;
  box-shadow: none;
}

.auth-switch .btn:not(:first-child) {
  flex: 0 0 auto;
  min-width: 120px;
}

.auth-form .actions .btn--primary {
  min-height: 64px;
  width: 100%;
  font-size: 20px;
  font-weight: 900;
}

.auth-form .actions {
  display: grid;
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 60px;
  border: 1px solid rgba(234, 223, 204, .92);
  border-radius: 18px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .84);
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
}

.field input:focus {
  border-color: rgba(111, 143, 106, .62);
  outline: 4px solid rgba(111, 143, 106, .18);
}

.form-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.reading-screen {
  min-height: calc(100svh - 42px);
  display: grid;
  align-items: center;
  max-width: var(--reading-max);
  margin: 0 auto;
  padding: 18px 0 24px;
}

.reader {
  min-height: min(760px, calc(100svh - 60px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  border: 1px solid rgba(234, 223, 204, .9);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,250,242,.98), rgba(255,255,255,.9));
  box-shadow: var(--shadow-soft);
  padding: clamp(18px, 4vw, 34px);
}

.reader--book {
  min-height: auto;
  max-width: 680px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,253,247,.98), rgba(255,248,234,.96));
}

.reader__top,
.reader__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reader__page {
  display: grid;
  align-content: center;
  gap: clamp(22px, 5vw, 40px);
  text-align: center;
}

.reader--book .reader__page {
  align-content: start;
  gap: 16px;
}

.reader__image {
  display: inline-block;
  width: auto;
  max-width: min(100%, 360px);
  height: min(44svh, 430px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #f4e7cc;
  box-shadow: 0 14px 32px rgba(47, 42, 36, .14);
  cursor: pointer;
  position: relative;
}

.reader__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.reader__scene.pulse img,
.reward-scene.pulse img {
  animation: softPulse 560ms ease;
}

.sparkle {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, #ffd85a 30% 58%, rgba(255, 216, 90, 0) 70%);
  animation: sparkle 700ms ease-out forwards;
  z-index: 4;
}

.fx {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.fx-wave {
  left: 49%;
  top: 34%;
  width: 86px;
  height: 86px;
  border: 4px solid rgba(255, 238, 139, 0.95);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform-origin: 15% 80%;
  animation: waveArc 900ms ease-out forwards;
}

.fx-wave::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.fx-footprint {
  width: 15px;
  height: 24px;
  border-radius: 50% 50% 44% 44%;
  background: rgba(116, 80, 45, 0.34);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.18) inset;
  animation: footAppear 1500ms ease-out forwards;
}

.fx-leaf {
  width: 22px;
  height: 13px;
  border-radius: 90% 0 90% 0;
  background: linear-gradient(135deg, #f6c95b, #77a55d);
  animation: leafFloat 1300ms ease-in-out forwards;
}

.fx-window-glow {
  left: 72%;
  top: 22%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 235, 132, 0.95) 0 18%, rgba(255, 193, 71, 0.42) 42%, rgba(255, 193, 71, 0) 70%);
  filter: blur(1px);
  animation: glowPulse 1100ms ease-out forwards;
}

.fx-sunbeam {
  left: 43%;
  top: -8%;
  width: 34%;
  height: 82%;
  transform: rotate(23deg);
  background: linear-gradient(180deg, rgba(255, 255, 232, 0.86), rgba(255, 217, 88, 0.35), rgba(255, 217, 88, 0));
  border-radius: 999px;
  filter: blur(4px);
  animation: beamShine 1200ms ease-out forwards;
}

.fx-nose-spark {
  left: 53%;
  top: 38%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0 11%, #ffe26a 18% 34%, rgba(255, 226, 106, 0) 62%);
  border-radius: 50%;
  animation: noseSpark 1000ms ease-out forwards;
}

.fx-star {
  width: 24px;
  height: 24px;
  background: #ffdf62;
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
  filter: drop-shadow(0 0 9px rgba(255, 216, 90, 0.8));
  animation: starPop 1050ms ease-out forwards;
}

.fx-book-open {
  left: 45%;
  top: 45%;
  width: 120px;
  height: 76px;
  transform: translate(-50%, -50%) rotate(-8deg);
  perspective: 240px;
  animation: bookGlow 1200ms ease-out forwards;
}

.fx-book-open::before,
.fx-book-open::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: rgba(255, 248, 214, 0.78);
  border: 2px solid rgba(119, 87, 45, 0.22);
  box-shadow: 0 0 18px rgba(255, 221, 107, 0.48);
}

.fx-book-open::before {
  left: 0;
  border-radius: 12px 4px 4px 12px;
  transform-origin: right center;
  animation: leftPage 950ms ease-out forwards;
}

.fx-book-open::after {
  right: 0;
  border-radius: 4px 12px 12px 4px;
  transform-origin: left center;
  animation: rightPage 950ms ease-out forwards;
}

.fx-reward-glow {
  left: 50%;
  top: 42%;
  width: 148px;
  height: 148px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.92) 0 12%, rgba(255,214,74,0.68) 28%, rgba(255,214,74,0) 68%);
  animation: rewardGlow 1200ms ease-out forwards;
}

.fx-bird-wing {
  left: 56%;
  top: 28%;
  width: 90px;
  height: 60px;
  transform: translate(-50%, -50%);
  animation: wingFlap 900ms ease-out forwards;
}

.fx-bird-wing::before,
.fx-bird-wing::after {
  content: "";
  position: absolute;
  top: 16px;
  width: 44px;
  height: 28px;
  border-radius: 80% 18% 80% 18%;
  background: rgba(176, 224, 226, 0.8);
  box-shadow: 0 0 12px rgba(255,255,255,0.72);
}

.fx-bird-wing::before {
  left: 0;
  transform-origin: right center;
}

.fx-bird-wing::after {
  right: 0;
  transform: scaleX(-1);
  transform-origin: left center;
}

.fx-flight-path {
  left: 18%;
  top: 18%;
  width: 64%;
  height: 34%;
  border-top: 5px dotted rgba(255, 224, 98, 0.9);
  border-radius: 50%;
  transform: rotate(-13deg);
  animation: flightPath 1200ms ease-out forwards;
}

.fx-friend-glow {
  left: 58%;
  top: 34%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0 12%, rgba(137,210,219,0.52) 34%, rgba(137,210,219,0) 70%);
  animation: friendGlow 1150ms ease-out forwards;
}

.fx-landing-ring {
  left: 58%;
  top: 29%;
  width: 96px;
  height: 36px;
  border: 4px solid rgba(255, 221, 98, 0.72);
  border-radius: 50%;
  animation: landingRing 1050ms ease-out forwards;
}

.fx-bookmark-slip {
  left: 51%;
  top: 37%;
  width: 38px;
  height: 92px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, rgba(117,198,211,0.94), rgba(68,145,169,0.92));
  clip-path: polygon(0 0, 100% 0, 100% 76%, 50% 100%, 0 76%);
  animation: bookmarkSlip 1200ms ease-out forwards;
  box-shadow: 0 0 16px rgba(255, 221, 98, 0.52);
}

.fx-read-glow {
  left: 50%;
  top: 44%;
  width: 190px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,232,0.86) 0 18%, rgba(255, 218, 88, 0.38) 45%, rgba(255,218,88,0) 72%);
  animation: readGlow 1300ms ease-out forwards;
}

.fx-top-quills {
  left: 52%;
  top: 43%;
  width: 122px;
  height: 72px;
  transform: translate(-50%, -50%);
  animation: topQuills 1000ms ease-out forwards;
}

.fx-top-quills::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 35% 35%;
  background: repeating-conic-gradient(from 0deg, rgba(126,82,43,0.78) 0 10deg, rgba(238,198,126,0.72) 10deg 18deg);
  clip-path: polygon(0 72%, 8% 30%, 17% 68%, 28% 22%, 39% 70%, 50% 16%, 61% 70%, 72% 24%, 83% 68%, 92% 30%, 100% 72%, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 8px rgba(255,221,98,0.45));
}

.fx-kap-drop {
  left: 56%;
  top: 35%;
  width: 46px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 54% 54% 58% 58%;
  background: radial-gradient(circle at 35% 28%, #ffffff 0 10%, #82d9ee 18%, #3aa7c5 72%);
  animation: kapHop 1050ms ease-out forwards;
}

.fx-water-ring {
  left: 56%;
  top: 50%;
  width: 34px;
  height: 14px;
  border: 3px solid rgba(95,190,215,0.76);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: waterRing 1200ms ease-out forwards;
}

.fx-leaf-lift {
  left: 48%;
  top: 48%;
  width: 90px;
  height: 48px;
  border-radius: 90% 0 90% 0;
  background: linear-gradient(135deg, rgba(153,188,91,0.92), rgba(238,205,83,0.86));
  transform: translate(-50%, -50%) rotate(-14deg);
  box-shadow: 0 0 16px rgba(255,221,98,0.45);
  animation: leafLift 1200ms ease-out forwards;
}

.fx-kap-leaf {
  left: 52%;
  top: 44%;
  width: 110px;
  height: 78px;
  transform: translate(-50%, -50%);
  animation: kapLeaf 1300ms ease-out forwards;
}

.fx-kap-leaf::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 28px;
  width: 96px;
  height: 42px;
  border-radius: 90% 0 90% 0;
  background: linear-gradient(135deg, rgba(153,188,91,0.88), rgba(238,205,83,0.78));
  transform: rotate(-14deg);
}

.fx-kap-leaf::after {
  content: "";
  position: absolute;
  left: 42px;
  top: 0;
  width: 34px;
  height: 44px;
  border-radius: 54% 54% 58% 58%;
  background: radial-gradient(circle at 35% 28%, #fff 0 10%, #82d9ee 18%, #3aa7c5 72%);
  filter: drop-shadow(0 0 10px rgba(95,190,215,0.78));
}

.fx-bunny-ears {
  left: 57%;
  top: 37%;
  width: 86px;
  height: 96px;
  transform: translate(-50%, -50%);
  animation: bunnyEars 1100ms ease-out forwards;
}

.fx-bunny-ears::before,
.fx-bunny-ears::after {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 76px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, rgba(235,235,219,0.96), rgba(177,180,157,0.84));
  box-shadow: inset 0 0 0 7px rgba(255,205,190,0.42), 0 0 12px rgba(255,255,255,0.7);
}

.fx-bunny-ears::before {
  left: 18px;
  transform: rotate(-13deg);
  transform-origin: bottom center;
}

.fx-bunny-ears::after {
  right: 18px;
  transform: rotate(13deg);
  transform-origin: bottom center;
}

.fx-bunny-hop {
  left: 55%;
  top: 52%;
  width: 76px;
  height: 70px;
  transform: translate(-50%, -50%);
  animation: bunnyHop 1150ms ease-out forwards;
}

.fx-bunny-hop::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 26px;
  width: 42px;
  height: 34px;
  border-radius: 50%;
  background: rgba(212,214,194,0.92);
  box-shadow: 0 0 12px rgba(255,255,255,0.7);
}

.fx-bunny-hop::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 0;
  width: 30px;
  height: 38px;
  border-radius: 50% 50% 42% 42%;
  border-left: 11px solid rgba(212,214,194,0.94);
  border-right: 11px solid rgba(212,214,194,0.94);
}

.fx-cloud-puff {
  left: 58%;
  top: 25%;
  width: 118px;
  height: 72px;
  transform: translate(-50%, -50%);
  border-radius: 50px;
  background: rgba(255,255,255,0.82);
  box-shadow: -26px 16px 0 -5px rgba(255,255,255,0.78), 24px 14px 0 -4px rgba(255,255,255,0.78), 0 0 22px rgba(255,224,128,0.42);
  animation: cloudPuff 1200ms ease-out forwards;
}

.fx-cloud-puff::before,
.fx-cloud-puff::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.84);
}

.fx-cloud-puff::before {
  left: 18px;
  top: -17px;
  width: 46px;
  height: 46px;
}

.fx-cloud-puff::after {
  right: 16px;
  top: -11px;
  width: 40px;
  height: 40px;
}

.fx-cloud-drift {
  left: 50%;
  top: 22%;
  width: 172px;
  height: 76px;
  transform: translate(-50%, -50%);
  border-radius: 70px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(224,242,236,0.42));
  box-shadow: -36px 20px 0 -10px rgba(255,255,255,0.7), 36px 18px 0 -8px rgba(255,255,255,0.68);
  animation: cloudDrift 1400ms ease-out forwards;
}

.fx-friend-call {
  left: 50%;
  top: 43%;
  width: 170px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,232,0.82) 0 18%, rgba(255,218,88,0.34) 42%, rgba(255,218,88,0) 72%);
  animation: friendCall 1300ms ease-out forwards;
}

.fx-group-glow {
  left: 50%;
  top: 46%;
  width: 220px;
  height: 150px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0 20%, rgba(139,196,173,0.34) 50%, rgba(139,196,173,0) 76%);
  animation: groupGlow 1300ms ease-out forwards;
}

@keyframes sparkle { from { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } to { opacity: 0; transform: translate(-50%, -90%) scale(1.8); } }
@keyframes softPulse { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.025); } }
@keyframes waveArc { 0% { opacity: 0; transform: rotate(-18deg) scale(0.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(28deg) scale(1.18); } }
@keyframes footAppear { 0% { opacity: 0; transform: translateY(10px) scale(0.6) rotate(var(--rot, 0deg)); } 22%, 76% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px) scale(1) rotate(var(--rot, 0deg)); } }
@keyframes leafFloat { 0% { opacity: 0; transform: translateY(-12px) rotate(0deg); } 22% { opacity: 1; } 100% { opacity: 0; transform: translateY(54px) rotate(105deg); } }
@keyframes glowPulse { 0% { opacity: 0; transform: scale(0.55); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes beamShine { 0% { opacity: 0; transform: rotate(23deg) translateY(-10px) scaleY(0.75); } 30% { opacity: 0.95; } 100% { opacity: 0; transform: rotate(23deg) translateY(8px) scaleY(1.05); } }
@keyframes noseSpark { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(0deg); } 36% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -68%) scale(1.65) rotate(120deg); } }
@keyframes starPop { 0% { opacity: 0; transform: scale(0.25) rotate(0deg); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px) scale(1.35) rotate(80deg); } }
@keyframes bookGlow { 0%, 100% { opacity: 0; } 18%, 78% { opacity: 1; } }
@keyframes leftPage { 0% { transform: rotateY(0deg); } 46%, 100% { transform: rotateY(-28deg); } }
@keyframes rightPage { 0% { transform: rotateY(0deg); } 46%, 100% { transform: rotateY(28deg); } }
@keyframes rewardGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45); } 32%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); } }
@keyframes wingFlap { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-10deg); } 25%, 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -76%) scale(1.08) rotate(8deg); } }
@keyframes flightPath { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 25% { opacity: 1; } 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes friendGlow { 0% { opacity: 0; transform: scale(0.45); } 35%, 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes landingRing { 0% { opacity: 0; transform: translateY(-18px) scale(0.45); } 35%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px) scale(1.25); } }
@keyframes bookmarkSlip { 0% { opacity: 0; transform: translateY(-42px) rotate(-9deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(22px) rotate(0deg); } }
@keyframes readGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); } 36%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
@keyframes topQuills { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.65) rotate(-4deg); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.1) rotate(6deg); } }
@keyframes kapHop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 35% { opacity: 1; transform: translate(-50%, -70%) scale(1.02); } 70% { opacity: 1; transform: translate(-50%, -45%) scale(0.96); } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.12); } }
@keyframes waterRing { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); } 35%, 68% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } }
@keyframes leafLift { 0% { opacity: 0; transform: translate(-50%, -30%) rotate(-14deg) scale(0.7); } 30%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -78%) rotate(8deg) scale(1.08); } }
@keyframes kapLeaf { 0% { opacity: 0; transform: translate(-50%, -40%) scale(0.7); } 35%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1.16); } }
@keyframes bunnyEars { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7) rotate(-3deg); } 28%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1.08) rotate(5deg); } }
@keyframes bunnyHop { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.62); } 30% { opacity: 1; transform: translate(-50%, -72%) scale(1); } 65% { opacity: 1; transform: translate(-50%, -44%) scale(0.96); } 100% { opacity: 0; transform: translate(-50%, -66%) scale(1.1); } }
@keyframes cloudPuff { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.48); filter: blur(1px); } 34%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1.34); filter: blur(4px); } }
@keyframes cloudDrift { 0% { opacity: 0; transform: translate(-70%, -50%) scale(0.72); } 28%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-28%, -58%) scale(1.1); } }
@keyframes friendCall { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45); } 35%, 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); } }
@keyframes groupGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); } 36%, 74% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.22); } }

.reader__text {
  margin: 0 auto;
  max-width: 680px;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 1.32;
  letter-spacing: .005em;
  font-weight: 780;
}

.reader--book .reader__text {
  max-width: 560px;
  font-size: clamp(30px, 6vw, 50px);
  line-height: 1.18;
  font-weight: 900;
}

.reader__hint {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.reader--book .reader__hint {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  font-weight: 750;
}

.reader__art {
  justify-self: center;
  width: min(300px, 72vw);
  height: min(230px, 48vw);
  border-radius: 42px;
  display: grid;
  place-items: center;
  background: var(--secondary-soft);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(47,42,36,.06);
}

.reader__art::before,
.reader__art::after,
.reader__art span::before,
.reader__art span::after {
  content: "";
  position: absolute;
}

.reader__art span {
  position: absolute;
  inset: 0;
}

.art-cat {
  background: linear-gradient(145deg, #fff8e9, #e5f0e7);
}
.art-cat::before {
  width: 112px; height: 100px; border-radius: 52% 52% 44% 44%; background: #d8896f; left: 74px; top: 66px;
  box-shadow: -26px -22px 0 -16px #d8896f, 26px -22px 0 -16px #d8896f;
}
.art-cat::after {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(126,183,166,.82); right: 58px; bottom: 42px;
}
.art-cat span::before,
.art-cat span::after {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text); top: 106px;
}
.art-cat span::before { left: 118px; }
.art-cat span::after { left: 154px; }

.art-house {
  background: linear-gradient(145deg, #fff8e9, #e4edde);
}
.art-house::before {
  width: 132px; height: 106px; border-radius: 18px; background: #fff; left: 88px; top: 94px; box-shadow: inset 0 0 0 4px rgba(111,143,106,.18);
}
.art-house::after {
  width: 116px; height: 116px; border-radius: 16px; background: #d8896f; left: 104px; top: 36px; transform: rotate(45deg);
}
.art-house span::before {
  width: 34px; height: 50px; border-radius: 12px 12px 0 0; background: var(--secondary); left: 140px; top: 150px;
}
.art-house span::after {
  width: 42px; height: 32px; border-radius: 10px; background: #e4edde; left: 184px; top: 128px;
}

.art-sun {
  background: linear-gradient(145deg, #fff8e3, #e6f0ec);
}
.art-sun::before {
  width: 118px; height: 118px; border-radius: 50%; background: var(--secondary); left: 82px; top: 44px; box-shadow: 0 0 0 22px rgba(225,183,101,.18);
}
.art-sun::after {
  width: 170px; height: 42px; border-radius: 999px; background: rgba(255,255,255,.82); right: 44px; top: 132px;
}
.art-sun span::before {
  width: 190px; height: 46px; border-radius: 999px; background: rgba(111,143,106,.18); left: 26px; bottom: 36px;
}

.art-fox {
  background: linear-gradient(145deg, #fff2e8, #e6f0e4);
}
.art-fox::before {
  width: 110px; height: 88px; border-radius: 54% 54% 42% 42%; background: #d8896f; left: 96px; top: 72px; box-shadow: -26px -18px 0 -13px #d8896f, 26px -18px 0 -13px #d8896f;
}
.art-fox::after {
  width: 138px; height: 24px; border-radius: 999px; background: rgba(111,143,106,.34); left: 74px; bottom: 54px;
}
.art-fox span::before {
  width: 38px; height: 26px; border-radius: 0 0 22px 22px; background: #fff; left: 136px; top: 126px;
}

.art-water {
  background: linear-gradient(145deg, #e2f1ee, #fff7ea);
}
.art-water::before {
  width: 112px; height: 112px; border-radius: 48% 52% 60% 40%; background: rgba(126,183,166,.86); right: 72px; top: 52px;
}
.art-water::after {
  width: 210px; height: 50px; border-radius: 999px; background: rgba(111,143,106,.2); left: 32px; bottom: 48px;
}
.art-water span::before {
  width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.75); left: 76px; top: 72px;
}

.art-boat {
  background: linear-gradient(145deg, #e3f3f1, #fff7ea);
}
.art-boat::before {
  width: 146px; height: 58px; border-radius: 0 0 36px 36px; background: var(--secondary); left: 78px; top: 130px;
}
.art-boat::after {
  width: 0; height: 0; border-left: 58px solid transparent; border-right: 20px solid transparent; border-bottom: 98px solid white; left: 126px; top: 32px;
}
.art-boat span::before {
  width: 210px; height: 42px; border-radius: 999px; background: rgba(126,183,166,.24); left: 34px; bottom: 28px;
}

.art-star {
  background: linear-gradient(145deg, #f6f1ff, #fff7ea);
}
.art-star::before {
  width: 128px; height: 128px; left: 86px; top: 48px; background: var(--secondary); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 67% 56%, 78% 93%, 50% 70%, 22% 93%, 33% 56%, 2% 35%, 39% 35%);
}
.art-star::after {
  width: 204px; height: 42px; border-radius: 999px; background: rgba(255,255,255,.7); left: 34px; bottom: 42px;
}

.art-berry {
  background: linear-gradient(145deg, #ffe6df, #fff7ea);
}
.art-berry::before {
  width: 108px; height: 108px; border-radius: 48% 52% 56% 44%; background: #d8896f; right: 74px; top: 72px; box-shadow: -54px 32px 0 -28px #e1b765;
}
.art-berry::after {
  width: 62px; height: 42px; border-radius: 50%; background: var(--success); right: 100px; top: 50px; transform: rotate(-14deg);
}
.art-berry span::before {
  width: 186px; height: 42px; border-radius: 999px; background: rgba(111,143,106,.16); left: 44px; bottom: 36px;
}

.reward-screen {
  min-height: calc(100svh - 140px);
  display: grid;
  align-items: center;
}

.reward-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  text-align: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(225,183,101,.26), transparent 28%),
    radial-gradient(circle at 88% 24%, rgba(126,183,166,.2), transparent 26%),
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,250,242,.9));
}

.reward-visual {
  width: min(280px, 70vw);
  height: 230px;
  margin: 0 auto 24px;
  position: relative;
}

.reward-visual .cover {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 132px;
  height: 176px;
  min-height: 176px;
  transform: translateX(-50%) rotate(-4deg);
}

.reward-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.reward-scene {
  position: relative;
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reward-visual::before,
.reward-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--secondary);
  opacity: .7;
}

.reward-visual::before { width: 28px; height: 28px; left: 28px; top: 44px; }
.reward-visual::after { width: 18px; height: 18px; right: 36px; bottom: 50px; }

.reward-card h1 {
  font-size: clamp(30px, 5vw, 46px);
}

.empty-card {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,253,247,.72);
}

.empty-card--shelf {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 48px;
  border-radius: 36px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
}

.empty-card--shelf .media-frame--empty {
  width: min(320px, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto 8px;
  border-radius: 24px;
}

.empty-card--shelf h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 36px);
  line-height: 1.1;
}

.empty-card--shelf .lead {
  margin: 0;
  max-width: 520px;
}

.empty-card__actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.empty-card__actions .btn {
  min-height: 56px;
  min-width: 180px;
}

.empty-card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.empty-card--compact {
  width: min(100%, 620px);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 0;
  padding: 20px;
}

.empty-card--compact .media-frame--empty {
  width: min(340px, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto 6px;
  border-radius: 24px;
}

.empty-card--compact .empty-card__image {
  margin-bottom: 0;
}

.empty-card--compact h3,
.empty-card--compact p {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  max-width: min(92vw, 520px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(47, 42, 36, .92);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  font-weight: 750;
  text-align: center;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(47, 42, 36, .28);
  backdrop-filter: blur(8px);
}

.confirm-dialog {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--card-border);
  border-radius: 32px;
  display: grid;
  gap: 22px;
  background: rgba(255, 252, 245, .96);
  box-shadow: var(--shadow);
}

.confirm-dialog h2 {
  margin-bottom: 8px;
}

.confirm-dialog__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.confirm-dialog__actions .btn {
  min-height: 52px;
}

@media (max-width: 920px) {
  .app-shell {
    padding: 0 24px calc(48px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding: 20px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav-pills {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .hero,
  .home-grid,
  .auth-layout,
  .parent-grid,
  .parent-dashboard-grid,
  .parent-dashboard-header,
  .profile-top-grid,
  .book-detail-layout,
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .book-info-card {
    position: static;
  }

  .parent-dashboard-actions {
    justify-content: flex-start;
  }

  .auth-layout {
    min-height: auto;
    align-items: start;
    gap: 22px;
    padding: 0;
  }

  .auth-intro {
    display: contents;
  }

  .brand--auth {
    order: 1;
  }

  .auth-copy {
    order: 2;
  }

  .auth-card {
    order: 3;
    justify-self: stretch;
    width: min(100%, 480px);
  }

  .auth-art {
    order: 4;
    width: min(100%, 520px);
  }

  .auth-points {
    order: 5;
  }

  .hero-card {
    min-height: 340px;
  }

  .hero-card,
  .panel,
  .level-card,
  .reward-card,
  .empty-card {
    padding: 28px;
  }

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

  .shelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 210px));
  }

  .book-shelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
  }

  .levels-layout--single {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .levels-grid,
  .levels-layout--single .levels-grid {
    width: 100%;
    max-width: 520px;
    grid-template-columns: 1fr;
  }

  .levels-info-card {
    width: 100%;
    max-width: 520px;
    min-height: 280px;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .summary-card__stats {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .summary-card__stats::-webkit-scrollbar {
    display: none;
  }

  .summary-card__stats .stat-card {
    flex: 0 0 140px;
  }

  .stat-row.child-card__stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .child-add-form {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  .child-add-form .field {
    max-width: none;
  }

  .child-add-form .btn {
    width: 100%;
  }

  .dashboard-child__top {
    grid-template-columns: 1fr;
  }

  .dashboard-child__top {
    display: grid;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav-pills {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .nav-pill {
    min-width: 106px;
    scroll-snap-align: start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 0 16px calc(32px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding: 16px 0;
  }

  .brand {
    min-height: 52px;
    gap: 10px;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .brand__mark svg {
    width: 32px;
    height: 32px;
  }

  .brand__text strong {
    font-size: 18px;
  }

  .brand__text small {
    display: block;
    font-size: 12px;
  }

  .brand--auth .brand__text small {
    display: block;
  }

  .nav-pill {
    min-width: 104px;
    padding: 0 16px;
    font-size: 16px;
  }

  .hero-card,
  .panel,
  .level-card,
  .empty-card,
  .reward-card,
  .reader {
    border-radius: 28px;
    padding: 20px;
  }

  .levels-info-card {
    min-height: 0;
    padding: 20px;
    border-radius: 28px;
  }

  .active-book-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .book-info-card__cover {
    width: min(160px, 58vw);
  }

  .pages-card .book-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .book-info-card__actions .btn {
    width: 100%;
  }

  .active-book-card__cover {
    width: 96px;
    border-radius: 18px;
  }

  .stat-row.child-card__stats {
    grid-template-columns: 1fr;
  }

  .active-book-card__actions .btn,
  .parent-dashboard-actions .btn,
  .confirm-dialog__actions .btn {
    width: 100%;
  }

  .confirm-dialog__actions {
    flex-direction: column;
  }

  .level-card {
    min-height: 0;
  }

  .level-card h3 {
    font-size: 26px;
  }

  .level-card__books {
    margin-right: 0;
    padding-right: 0;
  }

  .auth-layout {
    margin: 0;
    padding: 0;
  }

  .auth-copy h1 {
    font-size: clamp(36px, 10vw, 40px);
  }

  .auth-copy .lead {
    font-size: 17px;
  }

  .auth-art {
    display: none;
  }

  .auth-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-points span {
    min-height: 40px;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    padding: 7px 10px;
  }

  .auth-card {
    border-radius: 26px;
    padding: 20px;
    width: 100%;
  }

  .auth-switch .btn,
  .auth-switch .btn:not(:first-child) {
    flex: 1 1 100%;
    white-space: normal;
  }

  h1 {
    font-size: clamp(34px, 10vw, 40px);
    letter-spacing: 0;
  }

  h2,
  h3 {
    letter-spacing: 0;
  }

  .lead {
    font-size: 17px;
  }

  .hero-card__decor {
    width: 160px;
    height: 190px;
    opacity: .12;
  }

  .hero-card,
  .home-grid > .panel {
    min-height: 0;
  }

  .current-book-mini,
  .book-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }

  .current-book-mini {
    min-height: 146px;
    padding: 16px;
  }

  .current-book-mini__cover {
    width: 88px;
    border-radius: 18px;
  }

  .book-card-decoration {
    width: 30%;
    opacity: .1;
  }

  .book-card {
    padding: 16px;
  }

  .shelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }

  .btn {
    width: 100%;
  }

  .shelf-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .shelf-header .btn {
    width: 100%;
  }

  .book-shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-height: 0;
    padding: 14px;
    border-radius: 26px;
  }

  .book-shelf-card {
    padding: 12px;
    border-radius: 24px;
  }

  .book-shelf-card h3 {
    font-size: 17px;
  }

  .empty-card--shelf {
    margin-top: 24px;
    padding: 24px;
    border-radius: 28px;
  }

  .empty-card--shelf h2 {
    font-size: clamp(26px, 8vw, 30px);
  }

  .empty-card__actions,
  .empty-card__actions .btn {
    width: 100%;
  }

  .reader__bottom .btn {
    width: auto;
    min-width: 116px;
  }

  .reader__top .btn--round {
    width: var(--tap);
    flex: 0 0 var(--tap);
  }

  .reader__bottom .btn--primary {
    flex: 1;
  }

  .reader__image {
    height: min(40svh, 340px);
  }

  .reader__text {
    font-size: clamp(34px, 12vw, 44px);
  }

  .reader--book .reader__text {
    font-size: clamp(30px, 10vw, 40px);
  }
}

.reading-screen {
  width: 100%;
  max-width: none;
  min-height: calc(100svh - 42px);
  padding: 12px 0 24px;
  align-items: center;
}

.reader--focus {
  width: min(100%, 1080px);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 28px);
  gap: 18px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,253,247,.98), rgba(255,248,234,.96));
}

.reader--focus .reader__top,
.reader--focus .reader__bottom {
  width: min(100%, 980px);
  margin: 0 auto;
}

.reader--focus .reader__top .btn {
  min-height: 48px;
}

.reader__status {
  min-width: min(360px, 48vw);
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  text-align: right;
}

.reader__progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e6d4;
}

.reader__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.reader__spread {
  width: min(100%, 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 34px;
  background: rgba(255, 252, 245, .92);
  box-shadow: var(--card-shadow);
}

.reader__visual-page,
.reader__text-page {
  min-width: 0;
  min-height: min(62svh, 640px);
}

.reader__visual-page {
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(218, 200, 167, .55);
  background: #f7efe0;
}

.reader__text-page {
  padding: clamp(22px, 4vw, 44px);
  display: grid;
  align-content: center;
  gap: 22px;
  text-align: center;
}

.reader--focus .reader__image {
  width: 100%;
  max-width: 100%;
  height: min(62svh, 520px);
  aspect-ratio: 4 / 5;
  margin: 0;
  border-radius: 28px;
}

.reader--focus .reader__text {
  max-width: 480px;
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1.16;
  font-weight: 950;
}

.reader--focus .reader__hint {
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 240, 200, .62);
  font-size: 17px;
  font-weight: 800;
}

.reader--focus .reader__bottom .btn {
  min-width: 150px;
  min-height: 56px;
}

@media (max-width: 760px) {
  .reader__top {
    align-items: stretch;
    flex-direction: column;
  }

  .reader__status {
    width: 100%;
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .reading-screen {
    padding: 0 0 14px;
  }

  .reader--focus {
    padding: 14px;
    border-radius: 28px;
  }

  .reader__spread {
    grid-template-columns: 1fr;
    border-radius: 28px;
  }

  .reader__visual-page,
  .reader__text-page {
    min-height: 0;
  }

  .reader__visual-page {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(218, 200, 167, .55);
  }

  .reader--focus .reader__image {
    height: min(42svh, 360px);
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }

  .reader__text-page {
    padding: 22px 16px 24px;
  }

  .reader--focus .reader__text {
    font-size: clamp(34px, 11vw, 44px);
    line-height: 1.2;
  }

  .reader--focus .reader__bottom {
    display: grid;
    grid-template-columns: 1fr;
  }

  .reader--focus .reader__bottom .btn {
    width: 100%;
  }
}

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

@media (max-width: 389px) {
  .pages-card .book-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 390px) and (max-width: 560px) {
  .profile-summary-card .stat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-summary-card .stat-card,
  .profile-summary-card .stat-row--compact .stat-card {
    min-height: 0;
    max-height: 72px;
    padding: 14px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 4px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  :root {
    --tap: 56px;
    --radius-lg: 28px;
    --radius-xl: 28px;
    --content-max: 430px;
  }

  html,
  body,
  #root,
  #app,
  main,
  section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 16px;
  }

  .app-shell {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 0 calc(88px + env(safe-area-inset-bottom));
  }

  .app {
    padding: 0 16px;
  }

  .topbar {
    width: 100%;
    max-width: 100%;
    gap: 12px;
    margin-bottom: 22px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  }

  .brand {
    width: 100%;
    min-height: 44px;
    min-width: 0;
    padding-right: 0;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
  }

  .brand__text {
    min-width: 0;
  }

  .brand__text strong,
  .brand__text small {
    overflow-wrap: anywhere;
  }

  .brand__text strong {
    font-size: 21px;
  }

  .brand__text small {
    font-size: 13px;
    line-height: 1.2;
  }

  .nav-pills {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    overflow: hidden;
    border-radius: 28px;
    box-sizing: border-box;
  }

  .nav-pill {
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    border-radius: 22px;
    padding: 0 6px;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-pill--parent {
    display: none;
  }

  .screen {
    gap: 22px;
  }

  .section {
    margin-top: 22px;
  }

  .section-header,
  .panel__header {
    gap: 12px;
    margin-bottom: 12px;
  }

  h1 {
    font-size: clamp(34px, 9.5vw, 40px);
    line-height: 1.06;
  }

  h2 {
    font-size: clamp(24px, 7vw, 28px);
    line-height: 1.12;
  }

  h3 {
    font-size: clamp(18px, 5.5vw, 22px);
    line-height: 1.18;
  }

  p,
  .muted,
  .book-meta,
  .form-note {
    font-size: 15px;
    line-height: 1.4;
  }

  .lead {
    font-size: 16px;
    line-height: 1.42;
  }

  .eyebrow,
  .badge,
  .progress__meta,
  .field,
  .book-shelf-card__meta,
  .shelf-book__status {
    font-size: 13px;
  }

  .badge {
    max-width: 100%;
    min-height: 28px;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .btn,
  .btn--small,
  .auth-form .actions .btn--primary,
  .level-card .btn,
  .reader--focus .reader__bottom .btn {
    min-height: 56px;
    border-radius: 24px;
    padding: 0 16px;
    font-size: 18px;
  }

  .btn--round {
    width: 56px;
    min-width: 56px;
    padding: 0;
    border-radius: 20px;
  }

  .hero-card,
  .panel,
  .book-card,
  .level-card,
  .levels-info-card,
  .empty-card,
  .reward-card,
  .auth-card,
  .child-card,
  .dashboard-child,
  .active-book-card,
  .book-shelf-card,
  .confirm-dialog {
    max-width: 100%;
    border-radius: 26px;
    padding: 20px;
  }

  .home-grid,
  .hero,
  .auth-layout,
  .parent-dashboard-grid,
  .profile-top-grid,
  .book-detail-layout,
  .levels-layout,
  .levels-grid,
  .grid,
  .grid--2,
  .grid--3 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card,
  .home-grid > .panel,
  .levels-info-card,
  .level-card,
  .reward-screen,
  .auth-screen,
  .auth-layout {
    min-height: 0;
  }

  .hero-card--dashboard {
    gap: 20px;
    padding: 22px;
  }

  .hero-card--dashboard > div:first-child {
    display: grid;
    gap: 10px;
  }

  .hero-card--dashboard .eyebrow {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .hero-card--dashboard h1 {
    margin-bottom: 0;
    font-size: clamp(38px, 10vw, 42px);
    line-height: 1.06;
  }

  .hero-card--dashboard .lead {
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.38;
  }

  .current-book-mini,
  .current-book-mini[style],
  .book-card {
    width: 100%;
    min-width: 0;
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 14px;
    padding: 16px;
  }

  .current-book-mini {
    min-height: 0;
    margin-top: 0;
    align-items: start;
    border-radius: 24px;
  }

  .current-book-mini__cover,
  .active-book-card__cover {
    width: 92px;
    border-radius: 18px;
  }

  .book-card--illustrated {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .book-card__body,
  .current-book-mini__body,
  .active-book-card__body,
  .book-info-card__body,
  .book-shelf-card__body {
    min-width: 0;
  }

  .current-book-mini .book-card-decoration {
    display: none;
  }

  .current-book-mini__body {
    position: relative;
    gap: 8px;
    align-self: stretch;
    padding-top: 34px;
  }

  .book-title-line {
    display: block;
  }

  .current-book-mini .book-title-line h3 {
    margin: 0;
    font-size: clamp(22px, 6vw, 24px);
    line-height: 1.15;
  }

  .current-book-mini .badge {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 28px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .current-book-mini__body > .muted {
    font-size: 15px;
    line-height: 1.3;
  }

  .current-book-mini .progress {
    gap: 7px;
  }

  .current-book-mini .progress__meta {
    gap: 8px;
    font-size: 14px;
    line-height: 1.2;
  }

  .current-book-mini .progress__track {
    height: 8px;
  }

  .book-card__subtitle {
    font-size: 14px;
  }

  .hero-card--dashboard .hero__actions {
    gap: 10px;
  }

  .hero-card--dashboard .hero__actions .btn {
    width: 100%;
  }

  .hero-card--dashboard .hero__actions .btn--primary {
    min-height: 60px;
    font-size: 20px;
  }

  .hero-card--dashboard .hero__actions .btn--secondary {
    min-height: 56px;
    font-size: 18px;
  }

  .home-grid > .panel {
    width: 100%;
    max-width: 100%;
    margin-top: 20px;
    padding: 22px;
    border-radius: 26px;
    gap: 18px;
  }

  .home-grid > .panel .panel__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin-bottom: 0;
  }

  .home-grid > .panel .panel__header .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .home-grid > .panel .panel__header h2 {
    margin-bottom: 4px;
    font-size: clamp(28px, 8vw, 30px);
    line-height: 1.08;
  }

  .home-grid > .panel .panel__header .muted {
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
  }

  .home-grid > .panel .panel__header .badge {
    min-height: 0;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .home-grid > .panel .level-summary {
    gap: 16px;
    align-content: start;
  }

  .home-grid > .panel .level-summary > .muted {
    margin: 0;
    padding-top: 2px;
    font-size: 15px;
    line-height: 1.35;
  }

  .home-grid > .panel .progress {
    gap: 7px;
  }

  .home-grid > .panel .progress__meta {
    font-size: 15px;
    line-height: 1.2;
  }

  .home-grid > .panel .progress__track {
    height: 8px;
  }

  .home-grid > .panel .level-summary .btn {
    min-height: 56px;
    font-size: 19px;
  }

  .shelf-screen {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .shelf-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: start;
    margin-bottom: 0;
  }

  .shelf-header .eyebrow {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .shelf-header h1 {
    margin-bottom: 10px;
    font-size: clamp(38px, 10vw, 42px);
    line-height: 1.06;
  }

  .shelf-header .lead {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
  }

  .shelf-header .btn {
    width: 100%;
    min-height: 56px;
    margin-top: 20px;
    font-size: 19px;
  }

  .empty-card--shelf {
    width: 100%;
    max-width: 100%;
    margin-top: 24px;
    padding: 22px;
    border-radius: 26px;
    gap: 0;
  }

  .empty-card--shelf .media-frame--empty {
    width: 100%;
    max-height: 190px;
    margin: 0;
    border-radius: 20px;
    aspect-ratio: 16 / 9;
  }

  .empty-card--shelf .empty-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .empty-card--shelf h2 {
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: clamp(28px, 8vw, 30px);
    line-height: 1.1;
  }

  .empty-card--shelf .lead {
    max-width: 100%;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
  }

  .empty-card--shelf .empty-card__actions {
    width: 100%;
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .empty-card--shelf .empty-card__actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 56px;
    font-size: 18px;
  }

  .empty-card--shelf .empty-card__actions .btn--primary {
    min-height: 60px;
    font-size: 20px;
  }

  .levels-screen {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .levels-header {
    margin-bottom: 0;
  }

  .levels-header .eyebrow {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .levels-header h1 {
    margin-bottom: 10px;
    font-size: clamp(38px, 10vw, 42px);
    line-height: 1.06;
  }

  .levels-header .lead {
    margin: 0;
    max-width: 100%;
    font-size: 17px;
    line-height: 1.35;
  }

  .levels-layout,
  .levels-layout--single,
  .levels-grid,
  .levels-layout--single .levels-grid {
    width: 100%;
    max-width: 100%;
    justify-items: stretch;
    gap: 0;
  }

  .levels-grid {
    margin-top: 24px;
  }

  .level-card {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 22px;
    border-radius: 26px;
    gap: 16px;
    align-content: start;
  }

  .level-card__top {
    gap: 12px;
  }

  .level-card__top .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
  }

  .level-card h3 {
    margin-bottom: 4px;
    font-size: 30px;
    line-height: 1.08;
  }

  .level-card__top .muted {
    font-size: 16px;
    line-height: 1.25;
  }

  .level-card__status {
    min-height: 0;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.05;
  }

  .level-card > .muted {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .level-card .progress {
    gap: 7px;
  }

  .level-card .progress__meta {
    font-size: 15px;
    line-height: 1.2;
  }

  .level-card .progress__track {
    height: 8px;
  }

  .level-card__books {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .level-thumb {
    width: 100%;
    height: auto;
    min-width: 0;
    flex: initial;
    aspect-ratio: 1 / 1.15;
    border-radius: 14px;
  }

  .level-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .level-card .btn {
    min-height: 58px;
    font-size: 19px;
  }

  .shelf-grid,
  .book-shelf-grid,
  .pages-card .book-preview-grid,
  .book-preview-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .book-shelf-grid {
    padding: 14px;
    border-radius: 26px;
  }

  .book-shelf-card {
    padding: 12px;
  }

  .book-shelf-card h3 {
    font-size: 17px;
  }

  .level-card__books,
  .summary-card__stats {
    overflow: visible;
  }

  .level-card__books {
    flex-wrap: wrap;
    margin-right: 0;
    padding-right: 0;
  }

  .level-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 59px;
  }

  .stat-row,
  .summary-card__stats,
  .stat-row.child-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card,
  .stat-row--compact .stat-card {
    min-width: 0;
    padding: 12px 8px;
    text-align: center;
  }

  .stat-card strong,
  .stat-row--compact .stat-card strong {
    font-size: 24px;
  }

  .stat-card span {
    display: block;
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .child-add-form {
    gap: 14px;
  }

  .field {
    gap: 7px;
  }

  .field input {
    min-height: 56px;
    border-radius: 18px;
    font-size: 17px;
  }

  .auth-layout {
    margin: 0;
    gap: 14px;
  }

  .auth-screen {
    min-height: auto;
    align-items: start;
  }

  .auth-copy {
    gap: 8px;
    margin-bottom: 6px;
  }

  .auth-copy .eyebrow {
    padding: 6px 11px;
    font-size: 13px;
    line-height: 1.1;
  }

  .auth-copy h1 {
    max-width: 100%;
    font-size: clamp(34px, 9vw, 38px);
    line-height: 1.08;
    text-wrap: balance;
  }

  .auth-copy .lead {
    font-size: 16px;
    line-height: 1.35;
  }

  .auth-card {
    gap: 14px;
    margin-top: 0;
    padding: 20px;
    border-radius: 26px;
  }

  .auth-card__header {
    display: grid;
    gap: 6px;
  }

  .auth-card__header .eyebrow {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .auth-card__header h2 {
    margin-bottom: 0;
    font-size: clamp(26px, 7.5vw, 28px);
    line-height: 1.12;
  }

  .auth-card__header .muted {
    margin: 0;
    font-size: 15px;
    line-height: 1.38;
  }

  .auth-tabs {
    min-height: 54px;
    padding: 5px;
    border-radius: 22px;
  }

  .auth-tab {
    min-height: 44px;
    border-radius: 18px;
    font-size: 17px;
  }

  .auth-form {
    gap: 14px;
  }

  .auth-form .field {
    gap: 7px;
    font-size: 15px;
  }

  .auth-form .field input {
    min-height: 56px;
    border-radius: 20px;
    font-size: 16px;
  }

  .auth-form .actions .btn--primary {
    min-height: 60px;
    border-radius: 24px;
    font-size: 20px;
  }

  .auth-switch {
    gap: 8px;
  }

  .auth-switch .btn,
  .auth-switch .btn:not(:first-child) {
    min-height: 52px;
    border-radius: 22px;
    font-size: 17px;
  }

  .auth-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .auth-points span {
    min-height: 50px;
    max-height: 54px;
    padding: 7px 10px;
    justify-content: center;
    text-align: center;
    font-size: 15px;
    line-height: 1.15;
    overflow: hidden;
  }

  .profile-settings-card,
  .profile-summary-card,
  .profile-children-panel,
  .profile-account-card,
  .parent-dashboard-left,
  .parent-dashboard-right,
  .dashboard-list,
  .child-list {
    gap: 14px;
  }

  .active-book-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }

  .parent-dashboard-header,
  .shelf-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .parent-dashboard-actions,
  .hero__actions,
  .actions,
  .empty-card__actions,
  .confirm-dialog__actions {
    gap: 10px;
  }

  .book-info-card__cover {
    width: min(150px, 52vw);
  }

  .pages-card {
    gap: 16px;
  }

  .page-preview-card {
    border-radius: 22px;
  }

  .book-preview__body {
    min-height: 66px;
    padding: 10px 12px 12px;
  }

  .reward-visual {
    width: min(220px, 68vw);
    height: 188px;
    margin-bottom: 18px;
  }

  .empty-card--shelf {
    margin-top: 20px;
    padding: 22px;
    border-radius: 28px;
  }

  .media-frame,
  .cover,
  .app-image {
    max-width: 100%;
  }

  .reading-screen {
    width: 100%;
    max-width: 430px;
    min-height: auto;
    padding: 0 0 calc(88px + env(safe-area-inset-bottom));
  }

  .reader,
  .reader--focus {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    gap: 14px;
    padding: 16px;
    border-radius: 28px;
  }

  .reader__top,
  .reader__bottom {
    width: 100%;
    gap: 10px;
  }

  .reader__status {
    font-size: 14px;
  }

  .reader__spread {
    width: 100%;
    max-width: 100%;
    border-radius: 26px;
  }

  .reader__visual-page {
    padding: 12px;
  }

  .reader--focus .reader__image,
  .reader__image {
    width: 100%;
    max-width: 100%;
    height: min(38svh, 320px);
    border-radius: 22px;
  }

  .reader__text-page {
    padding: 20px 14px 22px;
    gap: 16px;
  }

  .reader__text,
  .reader--book .reader__text,
  .reader--focus .reader__text {
    max-width: 100%;
    font-size: clamp(34px, 10.5vw, 44px);
    line-height: 1.18;
  }

  .reader__hint,
  .reader--focus .reader__hint {
    max-width: 100%;
    font-size: 15px;
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .shelf-header {
    gap: 0;
  }

  .levels-screen .level-card__books {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .levels-screen .level-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.15;
    flex: initial;
    border-radius: 14px;
  }

  .profile-screen {
    gap: 20px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .profile-header {
    margin-bottom: 0;
  }

  .profile-header .eyebrow {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .profile-header h1 {
    margin-bottom: 10px;
    font-size: clamp(38px, 10vw, 42px);
    line-height: 1.06;
  }

  .profile-header .lead {
    max-width: 100%;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
  }

  .profile-top-grid {
    gap: 18px;
  }

  .profile-settings-card {
    width: 100%;
    max-width: 100%;
    margin-top: 24px;
    padding: 22px;
    border-radius: 26px;
    gap: 16px;
  }

  .profile-settings-card .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .profile-settings-card h2 {
    margin: 0;
    font-size: clamp(28px, 8vw, 30px);
    line-height: 1.1;
  }

  .profile-settings-card .field {
    gap: 7px;
    font-size: 15px;
  }

  .profile-settings-card .field input {
    min-height: 56px;
    border-radius: 20px;
    font-size: 18px;
  }

  .profile-settings-card .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .profile-settings-card .actions .btn {
    width: 100%;
    min-height: 56px;
    font-size: 19px;
  }

  .profile-settings-card .actions .btn--primary {
    min-height: 60px;
    font-size: 20px;
  }

  .profile-settings-card .form-note {
    font-size: 14px;
    line-height: 1.4;
  }

  .profile-summary-card,
  .profile-children-panel,
  .profile-account-card {
    padding: 22px;
    border-radius: 26px;
    gap: 14px;
  }

  .profile-summary-card {
    align-content: start;
  }

  .profile-summary-card .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .profile-summary-card h2,
  .profile-children-panel h2,
  .profile-account-card h2 {
    font-size: clamp(26px, 7vw, 30px);
  }

  .profile-summary-card h2 {
    margin-bottom: 8px;
    font-size: clamp(28px, 8vw, 30px);
    line-height: 1.15;
  }

  .profile-summary-card .muted {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .profile-summary-card .stat-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .profile-summary-card .stat-card,
  .profile-summary-card .stat-row--compact .stat-card {
    min-height: 0;
    max-height: 72px;
    padding: 14px 16px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .profile-summary-card .stat-card strong,
  .profile-summary-card .stat-row--compact .stat-card strong {
    margin: 0;
    font-size: 28px;
  }

  .profile-summary-card .stat-card span {
    font-size: 14px;
    line-height: 1.15;
  }

  .profile-summary-card .progress {
    gap: 7px;
  }

  .profile-summary-card .progress__meta {
    font-size: 15px;
    line-height: 1.2;
  }

  .profile-summary-card .progress__track {
    height: 8px;
  }

  .profile-screen .section {
    margin-top: 18px;
  }

  .profile-children-panel > .section-header {
    gap: 8px;
  }

  .profile-children-panel .section-header .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .profile-children-panel .section-header h2 {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.1;
  }

  .profile-children-panel .section-header .muted {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .child-list {
    gap: 12px;
  }

  .child-card {
    padding: 20px;
    border-radius: 24px;
    gap: 14px;
  }

  .child-card__top {
    gap: 10px;
  }

  .child-card__top h3 {
    margin-bottom: 4px;
    font-size: 26px;
    line-height: 1.1;
  }

  .child-card__top .muted {
    font-size: 15px;
    line-height: 1.25;
  }

  .child-card__top .badge {
    min-height: 0;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .stat-row.child-card__stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .child-card__stats .stat-card,
  .stat-row--compact.child-card__stats .stat-card {
    min-height: 64px;
    max-height: 70px;
    padding: 12px 16px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .child-card__stats .stat-card strong,
  .stat-row--compact.child-card__stats .stat-card strong {
    margin: 0;
    font-size: 27px;
  }

  .child-card__stats .stat-card span {
    font-size: 13px;
    line-height: 1.15;
  }

  .child-card .progress {
    gap: 7px;
  }

  .child-card .progress__meta {
    font-size: 14px;
    line-height: 1.2;
  }

  .child-card .progress__track {
    height: 8px;
  }

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

  .child-card__actions .btn {
    width: 100%;
    min-height: 50px;
    padding: 0 12px;
    font-size: 17px;
  }

  .child-card__actions .btn--secondary {
    min-height: 52px;
    font-size: 18px;
  }

  .child-card__actions .btn--ghost {
    min-height: 50px;
  }

  .child-add-form {
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    padding: 20px;
    border: 1px solid rgba(234, 223, 204, .92);
    border-radius: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    background: rgba(255, 252, 245, .72);
  }

  .child-add-form .field {
    flex: none;
    max-width: none;
    gap: 7px;
    font-size: 15px;
  }

  .child-add-form .field input {
    min-height: 56px;
    border-radius: 20px;
    font-size: 17px;
  }

  .child-add-form .btn {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    font-size: 19px;
  }

  .profile-account-card .section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .profile-account-card .eyebrow {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .profile-account-card h2 {
    margin-bottom: 8px;
    font-size: clamp(28px, 8vw, 30px);
    line-height: 1.15;
  }

  .profile-account-card .muted {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
  }

  .profile-account-card .btn {
    width: 100%;
    min-height: 52px;
    font-size: 17px;
  }

  .empty-card--shelf {
    margin-top: 24px;
    border-radius: 26px;
  }
}

@media (min-width: 390px) and (max-width: 560px) {
  .profile-summary-card .stat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-summary-card .stat-card,
  .profile-summary-card .stat-row--compact .stat-card {
    max-height: 72px;
    padding: 14px 10px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 4px;
    text-align: center;
  }

  .stat-row.child-card__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .child-card__stats .stat-card,
  .stat-row--compact.child-card__stats .stat-card {
    min-height: 64px;
    max-height: 70px;
    padding: 12px 8px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 3px;
    text-align: center;
  }
}
