/* Егэтик · тёплый стиль. Brand layer; learning/mascot behavior stays in app.js. */
:root {
  --font-head: 'Nunito', system-ui, sans-serif;
  --font-body: 'Golos Text', system-ui, sans-serif;
  --bg-base: #211b18;
  --surface: #2c241f;
  --surface-2: #352c26;
  --surface-3: #493a31;
  --fg: #fff5e8;
  --fg-muted: #cfbcab;
  --fg-dim: #beaa99;
  --border: #574638;
  --border-strong: #91735c;
  --success: #91b67d;
  --success-text: #b6d6a5;
  --success-soft: #263622;
  --danger-soft: #482727;
  --gold: #ffd17c;
  --gold-soft: #483521;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --lift: 0 3px 14px #100b0712;
  --lift-lg: 0 6px 24px #100b0720;
  --depth: 3px;
  --depth-surface: #100b0730;
  --glow-strength: .15;
  --brand-orange: #f57616;
  --brand-ink: #fff2df;
}
[data-theme='light'] {
  --bg-base: #fff8ef;
  --surface: #fffdf9;
  --surface-2: #fcf1e3;
  --surface-3: #eadfD2;
  --fg: #352116;
  --fg-muted: #745e4d;
  --fg-dim: #79614d;
  --border: #ecddcc;
  --border-strong: #bda48d;
  --success: #5d803f;
  --success-text: #44632d;
  --success-soft: #eaf1df;
  --danger: #c7353c;
  --danger-text: #b62b32;
  --danger-soft: #fcebea;
  --gold: #92600a;
  --gold-soft: #fff0cf;
  --depth-surface: #e8d8c4;
  --brand-ink: #57301f;
  --lift: 0 3px 14px #8c4e1706;
  --lift-lg: 0 6px 24px #8c4e170c;
}
[data-accent='orange'] {
  --accent: #ce490a;
  --accent-hi: #b93e05;
  --accent-text: #ffac6d;
  --accent-soft: #493020;
  --on-accent: #fff;
  --depth-accent: #8f3007;
}
[data-theme='light'][data-accent='orange'] {
  --accent-text: #ae3c08;
  --accent-soft: #fff0df;
}
body { -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--font-body); }
h1, h2, h3 { letter-spacing: -.025em; }
.logo, .profile-brand { display: inline-flex; align-items: center; gap: 1px; line-height: 1; color: var(--brand-ink); }
.logo { font-family: 'Nunito', system-ui, sans-serif; font-size: 32px; font-weight: 900; letter-spacing: -.065em; }
.brand-word > span { color: var(--brand-orange); }
.brand-tail { width: 36px; height: 32px; object-fit: contain; margin-left: 2px; }
.logo-sub { font-size: 12px; margin-top: 7px; }
.app-head { margin-bottom: 24px; }
.screen-title { font-size: 30px; font-weight: 900; }
.section-title { font-size: 20px; color: var(--fg); text-transform: none; letter-spacing: -.035em; font-weight: 700; }
.eyebrow { color: var(--fg-muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.flame-card { position: relative; display: block; min-height: 224px; margin: 12px 0 0; padding: 12px 0 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.flame-info { position: relative; display: flex; flex-direction: column; min-height: 212px; width: 55%; z-index: 1; }
.home-greeting { font-family: var(--font-head); font-size: clamp(30px, 8.5vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -.045em; overflow-wrap: anywhere; margin-bottom: 12px; }
.home-message { font-size: 14px; line-height: 1.5; color: var(--fg-muted); max-width: 175px; }
.flame-badge { position: absolute; right: -4px; bottom: 0; width: 50%; height: 218px; display: block; overflow: hidden; }
.flame-badge::before { display: none; }
.flame-ico { display: block; width: 100%; height: auto; }
.home-fox-illustration { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.flame-badge.has-equipped-look .wardrobe-canvas { width: 136%; transform: translateX(-13.24%); }
.flame-badge.has-equipped-look .flame-ico { width: 100%; }
.flame-info .chip-row { margin-top: auto; padding-top: 12px; white-space: nowrap; }
.streak-chip { padding: 10px 12px; margin-top: 0; min-height: 44px; background: var(--surface); box-shadow: var(--lift); color: var(--accent-text); font-weight: 800; gap: 5px; font-size: 18px; }
.streak-chip .ico { width: 23px; height: 23px; color: #f5630a; }
.streak-chip__lbl { font-size: 12px; color: var(--accent-text); font-weight: 700; }
.daily-card { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 0; padding: 16px; min-height: 102px; border: 0; box-shadow: 0 4px 20px #9f65120a; border-radius: 24px; }
.daily-card__icon { display: grid; place-items: center; flex: none; width: 58px; height: 58px; color: #ef620c; background: var(--accent-soft); border-radius: 50%; }
.daily-card__icon .ico { width: 36px; height: 36px; stroke-width: 2.5; }
.daily-card__content { flex: 1; min-width: 0; }
.daily-card__head { display: block; margin-bottom: 6px; }
.daily-card__title { display: block; font-size: 14px; font-weight: 700; }
.daily-card__count { display: block; font-size: 17px; font-weight: 600; line-height: 1.4; }
.daily-card__count b { font-size: 28px; font-weight: 800; }
.daily-unit { font-size: 13px; font-weight: 500; }
.daily-card .bar { height: 10px; }
.daily-card__hint { font-size: 12px; line-height: 1.5; }
.flame-name { font-size: 17px; font-weight: 700; color: var(--fg) !important; }
.flame-xp { font-size: 14px; margin-top: 6px; }
.flame-next { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }
.progress-details { margin-top: 24px; color: var(--fg-muted); font-size: 13px; }
.progress-details summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.progress-details__body { padding: 16px; background: var(--surface); border-radius: 18px; }
.progress-details__body .daily-card__hint { margin-top: 12px; }
.tier-list { margin-top: 12px; gap: 4px; }
.tier { padding: 7px 9px; border-radius: 12px; font-size: 11px; }
.tier__goal, .tier__xp { font-size: 11px; }
.btn--primary { font-family: var(--font-head); font-weight: 700; }
[data-accent="orange"] .btn--primary.btn--lg { background: #fa6505; color: #fff; box-shadow: 0 4px 0 #dc4c00; font-size: 20px; font-weight: 700; }
[data-accent="orange"] .bar__fill { background: #ff7416; }
.btn--lg { min-height: 56px; border-radius: 19px; font-size: 18px; }
#btn-quick { margin-top: 16px; }
.mode-list { margin-top: 24px; gap: 10px; }
.mode { border-radius: 18px; box-shadow: none; padding: 14px; }
.mode__ico { border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.mode__title { font-size: 15px; }
.mode__sub { font-size: 12px; line-height: 1.5; margin-top: 3px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; margin-bottom: 8px; }
.section-heading .section-title { margin: 0; }
.text-link { display: inline-flex; align-items: center; gap: 0; color: var(--accent-text); font-size: 12px; min-height: 44px; }
.text-link .ico { width: 16px; }
.home-subjects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.home-subjects .subject { flex-wrap: nowrap; gap: 9px; padding: 12px; align-items: center; min-width: 0; box-shadow: none; border-radius: 18px; min-height: 86px; }
.home-subjects .subject__body { flex: 1; min-width: 0; }
.home-subjects .subject__ico { width: 36px; height: 44px; }
.home-subjects .subject__ico .ico { width: 25px; height: 25px; }
.home-subjects .subject__title { font-size: 12px; overflow-wrap: anywhere; }
.home-subjects .subject__sub { font-size: 10px; line-height: 1.5; }
.home-subjects .ico-chevron { display: none; }
.subject { box-shadow: none; }
.subject__ico { box-shadow: none; border-radius: 14px; }
.profile-brand { font-family: var(--font-head); font-size: 24px; font-weight: 900; letter-spacing: -.065em; margin-bottom: 20px; }
.profile-brand .brand-tail { width: 28px; height: 25px; }
.profile-card { border-radius: 24px; box-shadow: none; }
.profile-name { overflow-wrap: anywhere; }
.profile-companion { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; margin: 16px 0; }
.profile-companion__copy { min-width: 0; flex: 1; }
.profile-companion h2 { font-size: 25px; font-weight: 900; line-height: 1.15; }
.profile-companion .screen-sub { font-size: 12px; line-height: 1.6; margin: 8px 0 14px; }
.profile-fox { display: block; width: 104px; }
.metric { box-shadow: none; }
.tabbar { grid-template-columns: repeat(4,1fr); border-radius: 24px 24px 0 0; box-shadow: 0 -3px 16px #7f431708; padding-inline: 8px; }
.tab { min-width: 0; font-size: 11px; min-height: 64px; color: var(--fg-muted); }
.tab.is-active { color: var(--accent-text); }
.tab::after { display: none; }
.tab.is-active::before { content: ''; position: absolute; width: 48px; height: 32px; border-radius: 12px; background: var(--accent-soft); top: 6px; z-index: -1; }
.overlay { padding-top: calc(var(--safe-t) + 16px); }
.quiz-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; padding-inline: 4px; }
.quiz-subject { font-family: var(--font-head); font-size: 20px; font-weight: 900; }
.quiz-position { color: var(--fg-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.quiz-head { gap: 10px; margin-bottom: 16px; min-height: 64px; }
.quiz-mascot { order: 0; flex: none; width: 64px; height: 64px; }
.mascot--quiz { width: 64px; height: 64px; margin: 0; }
.quiz-head .pips { order: 1; }
.quiz-head .quiz-score { order: 2; min-width: 20px; }
.quiz-head #btn-quit { order: 3; }
.pip { height: 8px; }
.quiz-body { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; flex: initial; margin-bottom: 16px; }
.q-meta { flex-wrap: wrap; min-height: 0; margin-bottom: 20px; gap: 8px; }
.q-meta .q-topic { flex-basis: 100%; white-space: normal; overflow: visible; font-size: 12px; line-height: 1.5; }
.badge { font-size: 11px; }
.q-stem { font-size: 21px; font-weight: 800; line-height: 1.45; margin-bottom: 24px; overflow-wrap: anywhere; }
.options { gap: 10px; }
.option { box-shadow: none; border: 1px solid var(--border-strong); border-radius: 16px; min-height: 58px; padding: 12px; background: var(--surface); }
.option__key { border-radius: 50%; background: var(--surface-2); color: var(--fg-muted); }
.option__body { font-size: 16px; }
.explain { border-radius: 24px 24px 0 0; }
.shop-preview { box-shadow: none; border-radius: 24px; }
.shop-item { box-shadow: none; border-radius: 20px; }
.shop-item.is-preview { outline-offset: 0; }
.shop-tabs { gap: 6px; }
.shop-tab { font-size: 12px; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
@media (min-width: 600px) { .overlay { padding-inline: max(24px, calc((100vw - 512px) / 2)); } }
@media (max-width: 370px) {
  #app { padding-inline: 14px; }
  .flame-badge { width: 50%; }
  .home-greeting { font-size: 30px; }
  .home-message { font-size: 12px; }
  .daily-card { padding: 14px; gap: 10px; }
  .daily-card__icon { width: 48px; height: 48px; }
  .tier { padding: 6px; }
  .quiz-body { padding: 14px; }
  .profile-companion { padding: 16px; }
  .profile-fox { width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.daily-rewards { margin-top: 10px; font-size: 12px; color: var(--fg-muted); }
.daily-rewards summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 8px; list-style: none; }
.daily-rewards summary::before { content: '+'; color: var(--accent-text); font-size: 18px; }
.daily-rewards[open] summary::before { content: '−'; }
#screen-home .app-head { margin-bottom: 16px; }
/* Crop the equipped full-body sprite to the face; glasses remain in the same canvas. */
/* Portrait views source x112..912/y0..800: padding for ears and equipped headwear. */
.mascot--quiz.is-portrait .wardrobe-canvas { width: 128%; transform: translate(-10.9375%, 0); }
.mascot--quiz:not(.is-portrait) { overflow: hidden; }
.mascot--quiz:not(.is-portrait) .wardrobe-canvas { width: 112%; transform: translate(-5.36%, -2%); }
.daily-rewards summary { min-height: 44px; }

#screen-home .app-head { margin-bottom: 4px; }
.training-heading { margin-top: 28px; }
.training-heading + .mode-list { margin-top: 12px; }
@media (max-width: 370px) { .streak-chip { padding-inline: 9px; } .streak-chip__lbl { font-size: 11px; } .home-subjects .subject { padding: 10px; gap: 6px; } }

/* Profile follows the same unboxed hero and compact wardrobe composition. */
.profile-hero { position: relative; min-height: 270px; margin-top: 28px; padding-bottom: 16px; }
.profile-hero .profile-card { width: 56%; display: block; padding: 0; margin: 0; background: transparent; border: 0; }
.profile-hero .avatar { width: 34px; height: 34px; font-size: 12px; margin-bottom: 14px; }
.profile-hero .profile-name { font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -.04em; }
.profile-hero .profile-name-row { gap: 0; }
.profile-hero #btn-edit-name { width: 44px; min-width: 44px; height: 44px; }
.profile-hero #btn-edit-name .ico { width: 16px; }
.profile-hero .profile-rank { font-size: 11px; margin-top: 8px; }
.profile-hero .profile-companion { display: block; padding: 0; margin: 14px 0 0; border: 0; background: transparent; box-shadow: none; }
.profile-hero .profile-companion__copy { width: 53%; }
.profile-hero .profile-companion h2 { font-size: 18px; font-weight: 600; }
.profile-hero .profile-stagebar { margin-top: 10px; height: 10px; }
.profile-hero .profile-companion .screen-sub { font-size: 11px; margin: 8px 0 16px; }
.profile-hero #profile-fox { position: absolute; right: -5px; top: 8px; width: 47%; }
.profile-hero .profile-fox { width: 100%; }
.profile-hero .coin-pill { padding: 10px 12px; min-height: 44px; font-size: 18px; background: var(--surface); border: 0; box-shadow: var(--lift); color: var(--fg); }
.profile-hero .coin-pill .ico { color: #dc8105; width: 24px; height: 24px; }
.profile-wardrobe-head { margin-top: 12px; }
.wardrobe-categories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.wardrobe-category { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; min-width: 0; }
.wardrobe-category__art { position: relative; overflow: hidden; display: block; width: 100%; height: 100px; }
.wardrobe-category__art img { display: block; width: 96px; margin-inline: auto; }
.wardrobe-category__art--glasses { display: grid; place-items: center; }
.wardrobe-category__art--glasses img { width: 110px; }
.wardrobe-category__name { font-size: 15px; font-weight: 700; }
.wardrobe-category__action { width: 100%; min-height: 36px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--accent-text); border-radius: 12px; font-size: 13px; }
.wardrobe-category:active { background: var(--accent-soft); }
.home-subjects .subject__title { font-size: 11px; }
.home-subjects .subject:nth-child(1) .subject__ico { background: #fff0de; color: #c44909; }
.home-subjects .subject:nth-child(2) .subject__ico { background: #e6eedc; color: #496b34; }
[data-theme='dark'] .home-subjects .subject:nth-child(1) .subject__ico { background: #493020; color: #ffac6d; }
[data-theme='dark'] .home-subjects .subject:nth-child(2) .subject__ico { background: #263622; color: #b6d6a5; }

@media (max-height: 700px) {
  #screen-home .flame-card { min-height: 200px; }
  #screen-home .flame-info { min-height: 188px; }
  #screen-home .flame-badge { height: 196px; }
  #screen-home .daily-card { min-height: 94px; padding-block: 12px; }
  #screen-home .section-heading .text-link { min-height: 32px; }
  #screen-home .home-subjects .subject { min-height: 76px; padding-block: 10px; }
}
/* Modular wardrobe: one registered 2:3 canvas, all items share its coordinate frame. */
.modular-figure .wardrobe-canvas { position: relative; aspect-ratio: 2 / 3; }
.modular-figure .wardrobe-base { position: absolute; inset: 0; width: 100%; height: 100%; }
.modular-layer { position: absolute; pointer-events: none; max-width: none; }
.modular-figure .wardrobe-eyewear { z-index: 1; }
.flame-card { min-height: 254px; }
.flame-info { min-height: 242px; }
.flame-badge { width: 44%; height: auto; right: 0; overflow: visible; }
.flame-badge .wardrobe-canvas { width: 100% !important; transform: none !important; }
.flame-badge .flame-ico { width: 100%; }
.result-art.modular-figure { width: 120px; height: 180px; margin-inline: auto; }
.intro__mascot.modular-figure { width: 140px; height: 210px; }
.shop-tabs { overflow-x: auto; padding: 3px 1px 8px; flex-wrap: nowrap; }
.shop-tab { flex: 0 0 auto; padding-inline: 14px; }
.shop-piece-art { width: 112px; height: 116px; overflow: hidden; }
.shop-item__hint { min-height: 32px; }
#shop-preview-name { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-height:700px) { #screen-home .flame-card { min-height: 212px; } #screen-home .flame-info { min-height: 200px; } #screen-home .flame-badge { height: auto; width: 41%; } }

.modular-face { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 0 56% 0); pointer-events: none; }
#profile-clothes-art { display: grid; place-items: center; }
#profile-clothes-art svg { width: 110px; height: 90px; }
#profile-clothes-art > .ico { width: 64px; height: 64px; color: var(--accent-text); }
.shop-tabs { position: sticky; top: 0; background: var(--bg-base); z-index: 2; }

/* One outlined wordmark: the tail joins the lower-right stroke of к. */
.logo .brand-mark { display:block; width:166px; height:auto; overflow:visible; }

/* Clear typography and explicit breathing room across compact mobile layouts. */
h1, h2, h3 { font-family:var(--font-head); letter-spacing:0; }
.home-greeting { font-weight:800; letter-spacing:0; line-height:1.16; }
.section-title { font-family:var(--font-head); font-weight:800; letter-spacing:0; }
.btn--primary { font-weight:800; letter-spacing:.005em; }
.profile-hero .profile-name { font-family:var(--font-head); font-size:30px; font-weight:750; letter-spacing:.015em; line-height:1.25; font-kerning:normal; font-variant-ligatures:none; }
.profile-hero .profile-name-row { gap:8px; align-items:center; }
.premium-name, .nick-preview { letter-spacing:.015em; }
#screen-home .daily-card { margin-top:20px; margin-bottom:20px; }
#screen-home #btn-quick { margin-top:0; }
#screen-home .section-heading { margin-top:28px; margin-bottom:12px; }
#screen-home .training-heading { margin-top:28px; margin-bottom:16px; }
#screen-home .mode-list { margin-top:0; gap:14px; }
.mode { gap:16px; padding:16px; }
.mode__title { font-family:var(--font-head); font-weight:800; font-size:16px; line-height:1.3; }
.mode__sub { line-height:1.5; }
.logo { line-height:1; letter-spacing:0; }
.logo .brand-image { display:block; width:184px; max-width:100%; height:40px; object-fit:contain; }
.logo .brand-image--dark { display:none; }
[data-theme='dark'] .logo .brand-image--light { display:none; }
[data-theme='dark'] .logo .brand-image--dark { display:block; }

/* Decorative SVG/image bounds must never intercept adjacent shop controls. */
.shop-item__art, .shop-item__art * { pointer-events: none; }
