/* Маячок — мини-приложение. Цвета как на картинках-карточках бота: индиго → фиолетовый, маяк красный, свет золотой. */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --indigo: #4f46e5;
  --violet: #7c3aed;
  --teal: #14b8a6;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --gold: #facc15;
  --lamp: #e63946;
  --hero: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --shadow: 0 6px 20px rgba(49, 46, 129, .08);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1020;
    --card: #1b1c33;
    --text: #eef0ff;
    --muted: #a3a8c3;
    --line: #2c2e4a;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Nunito", "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.4;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 8px; }

/* ---------- загрузка ---------- */
.boot { min-height: 80vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.boot-mascot { width: 140px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- шапка-герой ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; color: #fff; background: var(--hero);
  padding: 20px 20px 22px; min-height: 168px; box-shadow: 0 12px 30px rgba(79, 70, 229, .3);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.hero::before { width: 260px; height: 260px; right: -90px; top: -110px; }
.hero::after { width: 150px; height: 150px; right: 30px; bottom: -90px; }
.hero .kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; font-weight: 800; }
.hero h1 { font-size: 30px; line-height: 1.1; margin-top: 6px; font-weight: 900; max-width: 62%; }
.hero .sub { margin-top: 8px; opacity: .9; max-width: 60%; }
.hero .mascot { position: absolute; right: 6px; bottom: -6px; height: 168px; z-index: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.hero .mascot.big { height: 190px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 2; max-width: 64%; }
.hero .chip { background: rgba(255, 255, 255, .18); color: #fff; }
.demo-banner {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 14px; font-size: 14px;
  background: #fff7d6; color: #7a5b00; border: 1px solid #f6e3a1;
}

/* ---------- общие блоки ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-head h2 { font-size: 20px; font-weight: 900; }
.section-head .note { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.muted { color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--line); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.empty img { width: 92px; display: block; margin: 0 auto 8px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--card); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); text-align: left; min-width: 0; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat .value { font-size: 24px; font-weight: 900; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .icon { font-size: 18px; }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width .6s ease; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border-radius: 18px; font-weight: 800; font-size: 17px;
  background: var(--hero); color: #fff; box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
  transition: transform .12s ease;
}
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--card); color: var(--indigo); box-shadow: var(--shadow); }
.btn.small { width: auto; padding: 9px 14px; font-size: 15px; border-radius: 14px; }
.btn[disabled] { opacity: .5; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow);
}
.item .ico {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px;
  background: var(--line);
}
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.item .meta { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .go { color: var(--muted); font-size: 22px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------- предметы ---------- */
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.subject {
  text-align: left; border-radius: 22px; padding: 14px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-height: 132px; transition: transform .12s ease;
}
.subject:active { transform: scale(.97); }
.subject .ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; }
.subject .name { font-weight: 900; line-height: 1.15; }
.subject .lvl { color: var(--muted); font-size: 13px; margin-top: auto; }

/* ---------- неделя ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; margin-top: 6px; }
.week .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week .pillar { width: 100%; max-width: 30px; border-radius: 10px; background: var(--line); min-height: 8px; transition: height .6s ease; }
.week .pillar.on { background: linear-gradient(180deg, #7c3aed, #4f46e5); }
.week .col.today .d { color: var(--indigo); font-weight: 900; }
.week .n { font-size: 12px; font-weight: 800; color: var(--muted); min-height: 16px; }
.week .d { font-size: 13px; color: var(--muted); }

/* ---------- достижения ---------- */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge {
  background: var(--card); border-radius: 18px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow);
  font-size: 13px; font-weight: 800; display: grid; gap: 6px; justify-items: center;
}
.badge .big { font-size: 30px; }
.badge.locked { opacity: .45; filter: grayscale(1); }

/* ---------- оценки ---------- */
.mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; flex: none; }
.m5 { background: var(--green); } .m4 { background: var(--teal); } .m3 { background: var(--orange); } .m2 { background: var(--red); }

/* ---------- тренажёр ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; }
.quiz-top .bar { flex: 1; margin: 0; height: 12px; }
.quiz-top .count { font-weight: 900; color: var(--muted); }
.question {
  margin-top: 16px; background: var(--card); border-radius: 26px; padding: 22px 18px; box-shadow: var(--shadow);
  font-size: 20px; font-weight: 800; line-height: 1.35; position: relative; overflow: hidden;
}
.question .topic { font-size: 13px; color: var(--indigo); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.options { display: grid; gap: 10px; margin-top: 14px; }
.option {
  text-align: left; padding: 16px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
  font-size: 17px; font-weight: 700; border: 2px solid transparent; display: flex; gap: 12px; align-items: center;
  transition: transform .12s ease, border-color .2s, background .2s;
}
.option:active { transform: scale(.98); }
.option .num {
  flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--line); font-weight: 900;
}
.option.right { border-color: var(--green); background: rgba(34, 197, 94, .12); }
.option.right .num { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: rgba(239, 68, 68, .1); animation: shake .35s; }
.option.wrong .num { background: var(--red); color: #fff; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { margin-top: 14px; display: flex; gap: 12px; align-items: center; min-height: 72px; }
.feedback img { width: 64px; }
.feedback .say { background: var(--card); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 700; }

.loading { text-align: center; padding-top: 30px; }
.lighthouse { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.lighthouse img { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 200px; z-index: 1; }
.beam {
  position: absolute; left: 50%; top: 36px; width: 380px; height: 70px; margin-left: -190px;
  background: radial-gradient(ellipse at center, rgba(250, 204, 21, .55), rgba(250, 204, 21, 0) 70%);
  animation: sweep 2.4s ease-in-out infinite; transform-origin: center;
}
@keyframes sweep { 0%, 100% { transform: scaleX(.3); opacity: .4; } 50% { transform: scaleX(1); opacity: 1; } }
.loading h2 { margin-top: 16px; font-size: 22px; font-weight: 900; }
.loading p { margin-top: 6px; color: var(--muted); }

.result { text-align: center; }
.result > img { width: 150px; }
.feedback img { flex: none; }
.ring { width: 190px; height: 190px; margin: 6px auto 0; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.ring .center b { font-size: 40px; font-weight: 900; line-height: 1; }
.ring .center span { color: var(--muted); font-weight: 700; margin-top: 4px; }
.answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.answers i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 900; }

/* ---------- расписание ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; min-width: 52px; padding: 10px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-weight: 900; text-align: center;
}
.day small { display: block; font-weight: 700; color: var(--muted); font-size: 12px; }
.day.active { background: var(--hero); color: #fff; }
.day.active small { color: rgba(255, 255, 255, .8); }
.lesson-row { display: flex; align-items: center; gap: 10px; }
.lesson-row .n { width: 28px; color: var(--muted); font-weight: 900; text-align: center; }
.lesson-row .item { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--line); font-size: 18px; flex: none; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker .chip { background: var(--card); box-shadow: var(--shadow); padding: 9px 13px; }

/* ---------- лист снизу ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(15, 16, 32, .45); z-index: 30; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto;
  animation: up .25s ease; max-width: 560px; margin: 0 auto;
}
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; font-weight: 900; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- нижние вкладки ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--card);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .05);
}
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.tab .t-ico { font-size: 22px; filter: grayscale(1); opacity: .7; transition: transform .15s; }
.tab.active { color: var(--indigo); }
.tab.active .t-ico { filter: none; opacity: 1; transform: translateY(-2px) scale(1.1); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 18px; border-radius: 16px; z-index: 40; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center; animation: fade .2s;
}
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }


/* ---------- игры ---------- */
.lh-card {
  display: block; width: 100%; text-align: left; padding: 0; overflow: hidden; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.lh-scene { display: block; width: 100%; aspect-ratio: 1080 / 760; object-fit: cover; background: #bae6fd; }
.lh-card:not(.big) .lh-scene { aspect-ratio: 1080 / 520; object-position: center 70%; }
.lh-info { padding: 12px 16px 14px; }
.lh-title { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 18px; }
.lh-streak { color: var(--orange); }
.lh-next { color: var(--muted); font-size: 14px; margin-top: 4px; }
.lh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lh-chips .chip { font-size: 13px; padding: 5px 10px; }
.lh-note { font-size: 14px; margin-top: 8px; }
.item.dim { opacity: .55; }

.chest-banner {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.chest-banner .chest-ico { font-size: 34px; flex: none; }
.chest-banner .body { flex: 1; min-width: 0; }
.chest-banner .title { font-weight: 900; }
.chest-banner .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.chest-banner .bar { margin-top: 6px; height: 8px; }
.chest-banner .go { color: var(--muted); font-size: 22px; }
.chest-banner.ready {
  background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; box-shadow: 0 10px 24px rgba(234, 88, 12, .35);
  animation: glow 1.6s ease-in-out infinite;
}
.chest-banner.ready .meta, .chest-banner.ready .go { color: rgba(255, 255, 255, .9); }
.chest-banner.ready .chest-ico { animation: wiggle 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 10px 34px rgba(250, 204, 21, .65); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }

.game {
  display: block; width: 100%; text-align: left; margin-top: 12px; padding: 16px; border-radius: var(--radius);
  color: #fff; box-shadow: var(--shadow);
}
.game.zap { background: linear-gradient(135deg, #1e1b4b, #6d28d9); }
.game.cards { background: linear-gradient(135deg, #0d9488, #2563eb); }
.game.chest { background: linear-gradient(135deg, #f59e0b, #dc2626); }
.game-head { display: flex; align-items: center; gap: 12px; }
.game-head > div { flex: 1; min-width: 0; }
.game-ico { font-size: 38px; flex: none; }
.game-ico.shake { animation: wiggle 1.2s ease-in-out infinite; display: inline-block; }
.game-title { font-size: 20px; font-weight: 900; }
.game-sub { opacity: .9; font-size: 14px; margin-top: 2px; }
.game .go { font-size: 24px; opacity: .8; }
.btn.light { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.btn.light small { font-weight: 800; opacity: .9; }

.zap-big { font-size: 80px; animation: bob 1.2s ease-in-out infinite; }
.countdown { min-height: 70vh; display: grid; place-items: center; align-content: center; text-align: center; }
.countdown span { font-size: 120px; font-weight: 900; color: var(--violet); animation: pop .6s ease; }
.countdown p { color: var(--muted); font-weight: 800; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.zap-top { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 20px; margin-top: 4px; }
.zap-score { color: var(--violet); }
.zap-sec { min-width: 40px; text-align: right; color: var(--text); }
.zap-bar { height: 12px; margin-top: 10px; }
.zap-bar i { background: linear-gradient(90deg, #22c55e, #84cc16); transition: none; }
.zap-bar i.hurry { background: linear-gradient(90deg, #ef4444, #f97316); }
.zap-q {
  margin-top: 22px; background: var(--card); border-radius: 26px; box-shadow: var(--shadow); padding: 30px 16px;
  text-align: center; font-size: 34px; font-weight: 900; line-height: 1.2; word-break: break-word;
}
.zap-q.good { animation: flashg .35s ease; }
.zap-q.bad { animation: flashr .45s ease; }
@keyframes flashg { from { box-shadow: 0 0 0 6px rgba(34, 197, 94, .6); } }
@keyframes flashr { from { box-shadow: 0 0 0 6px rgba(239, 68, 68, .6); } }
.zap-options { display: grid; gap: 10px; margin-top: 16px; grid-template-columns: 1fr; }
.zap-options.four { grid-template-columns: 1fr 1fr; }
.zap-opt {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 20px 10px; font-size: 22px; font-weight: 900;
  border: 3px solid transparent; transition: transform .08s ease; word-break: break-word;
}
.zap-opt:active { transform: scale(.95); }
.zap-opt.right { border-color: var(--green); background: rgba(34, 197, 94, .15); }
.zap-opt.wrong { border-color: var(--red); background: rgba(239, 68, 68, .12); animation: shake .35s; }
.zap-result { padding-top: 20px; }
.zap-score-big {
  font-size: 110px; font-weight: 900; line-height: 1; margin-top: 8px;
  background: linear-gradient(135deg, #7c3aed, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.record { display: inline-block; margin-top: 12px; padding: 8px 18px; border-radius: 999px; background: var(--gold); color: #4c1d95; font-weight: 900; animation: pop .5s ease; }

.chest-open { min-height: 70vh; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; }
.chest-box { font-size: 120px; }
.chest-box.shake { animation: wiggle .5s ease-in-out infinite; }
.prize {
  margin-top: 8px; border-radius: 30px; padding: 26px 18px 22px; text-align: center; color: #fff; animation: pop .5s ease;
  background: linear-gradient(135deg, #14b8a6, #0e7490); box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}
.prize.r-rare { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.prize.r-legendary { background: linear-gradient(135deg, #facc15, #ea580c); }
.prize.r-fact { background: linear-gradient(135deg, #4f46e5, #2563eb); }
.prize.r-title { background: linear-gradient(135deg, #f59e0b, #dc2626); }
.prize.r-bonus { background: linear-gradient(135deg, #22c55e, #15803d); }
.prize-label { display: inline-block; background: #fff; color: #111827; border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.prize-emoji { font-size: 110px; line-height: 1.2; margin-top: 10px; animation: bob 1.6s ease-in-out infinite; }
.prize-name { font-size: 28px; font-weight: 900; margin-top: 4px; }
.prize-name.fact { font-size: 19px; line-height: 1.4; }
.prize-note { margin-top: 10px; opacity: .92; font-weight: 700; }

.album { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sticker {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 4px; display: grid; justify-items: center; gap: 2px;
  border: 2px solid transparent;
}
.sticker.r-rare { border-color: #a78bfa; }
.sticker.r-legendary { border-color: var(--gold); }
.sticker .s-emoji { font-size: 34px; }
.sticker .s-name { font-size: 10px; font-weight: 800; color: var(--muted); text-align: center; line-height: 1.15; overflow: hidden; max-height: 24px; }
.sticker.missing { opacity: .4; filter: grayscale(1); }
.chip.gold { background: var(--gold); color: #4c1d95; }

.flip { perspective: 1200px; margin-top: 18px; cursor: pointer; }
.flip-in { position: relative; min-height: 260px; transition: transform .55s ease; transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 28px; padding: 22px 18px; box-shadow: var(--shadow); backface-visibility: hidden;
  display: flex; flex-direction: column; justify-content: center; text-align: center; background: var(--card);
}
.face.back { transform: rotateY(180deg); background: linear-gradient(135deg, #0d9488, #2563eb); color: #fff; }
.face .topic { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo); position: absolute; top: 16px; left: 0; right: 0; }
.face.back .topic { color: rgba(255, 255, 255, .85); }
.face .q { font-size: 22px; font-weight: 900; line-height: 1.35; }
.face .hint { position: absolute; bottom: 14px; left: 0; right: 0; color: var(--muted); font-size: 13px; }
.input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  color: var(--text); font: inherit;
}


/* ---------- знакомство, настройки, учитель ---------- */
.role {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); transition: transform .12s ease;
}
.role:active { transform: scale(.98); }
.role-ico { font-size: 38px; flex: none; }
.role > div { flex: 1; }
.role-title { font-size: 19px; font-weight: 900; }
.role-sub { color: var(--muted); font-size: 14px; }
.role .go { color: var(--muted); font-size: 24px; }
.gear {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 14px;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 20px; display: grid; place-items: center;
}
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.grades.small { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.grade {
  background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 16px 0; font-size: 22px; font-weight: 900;
  border: 2px solid transparent;
}
.grades.small .grade { padding: 10px 0; font-size: 17px; border-radius: 14px; }
.grade.active { background: var(--hero); color: #fff; }
.input.big { width: 100%; font-size: 20px; padding: 16px; border-radius: 18px; }
.label-s { font-weight: 800; color: var(--muted); font-size: 14px; margin: 0 2px 6px; }
.code {
  display: block; margin: 12px auto 6px; padding: 12px 20px; border-radius: 16px; background: var(--line);
  font-family: ui-monospace, Menlo, monospace; font-size: 30px; font-weight: 900; letter-spacing: .18em; text-align: center; width: fit-content;
}
.code.small { margin: 0; font-size: 16px; padding: 8px 12px; letter-spacing: .1em; }
.item.flat { box-shadow: none; padding: 8px 0; background: transparent; }
.btn.danger { color: var(--red); }
.btn.danger:not(.secondary) { background: var(--red); color: #fff; box-shadow: none; }
.class-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 4px; }
.class-head h2 { font-size: 26px; font-weight: 900; }
.segs { display: flex; gap: 6px; margin-top: 16px; background: var(--line); padding: 4px; border-radius: 16px; }
.seg { flex: 1; padding: 10px 4px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--muted); }
.seg.active { background: var(--card); color: var(--indigo); box-shadow: var(--shadow); }
.photo { width: 100%; border-radius: 18px; display: block; background: var(--line); min-height: 120px; }


/* ---------- чат с Маячком ---------- */
.talk { display: flex; flex-direction: column; gap: 10px; padding-bottom: 86px; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: 20px; white-space: pre-line; line-height: 1.45; word-break: break-word; font-size: 16px; }
.bubble.bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--hero); color: #fff; border-bottom-right-radius: 6px; }
.bubble-img { display: block; max-width: 100%; border-radius: 14px; margin-top: 6px; }
.bubble-btns { display: grid; gap: 6px; margin-top: 10px; white-space: normal; }
.bubble-btns.old { opacity: .55; }
.bubble-row { display: flex; gap: 6px; }
.bubble-btn {
  flex: 1; padding: 10px 8px; border-radius: 14px; background: var(--bg); color: var(--indigo); font-weight: 800; font-size: 14px;
  border: 1px solid var(--line);
}
.bubble-btn:active { transform: scale(.97); }
.bubble.typing { display: flex; gap: 5px; padding: 16px; }
.bubble.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .2s; } .bubble.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.talk-bar {
  position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 19; display: flex; gap: 8px;
  align-items: flex-end; padding: 8px 12px; background: var(--bg); max-width: 560px; margin: 0 auto;
}
.talk-input {
  flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 11px 14px; border-radius: 18px; border: 2px solid var(--line);
  background: var(--card); color: var(--text); font: inherit;
}
.icon-btn.send { background: var(--hero); color: #fff; }

@media (max-width: 360px) {
  .hero h1 { font-size: 26px; }
  .stat .value { font-size: 20px; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- ❓ гайд «Как пользоваться» ---------- */
.help {
  position: absolute; top: 14px; right: 62px; z-index: 3; width: 40px; height: 40px; border-radius: 14px;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 19px; display: grid; place-items: center;
}
.help.solo { right: 14px; }
body.no-scroll { overflow: hidden; }
.guide {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; animation: fade .2s;
}
.guide-top { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.guide-count { color: var(--muted); font-weight: 800; font-size: 14px; }
.guide-skip { color: var(--indigo); font-weight: 800; padding: 6px 4px; }
.guide-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px; animation: guide-in .25s ease; }
@keyframes guide-in { from { opacity: 0; transform: translateX(24px); } }
.guide-body h2 { font-size: 26px; font-weight: 900; margin-top: 10px; }
.guide-ico {
  width: 96px; height: 96px; border-radius: 30px; background: var(--hero); display: grid; place-items: center;
  font-size: 50px; box-shadow: 0 12px 30px rgba(79, 70, 229, .3); margin-top: 8px;
}
.guide-mascot { height: 150px; margin-top: 4px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15)); }
.guide-text { color: var(--muted); margin-top: 8px; font-size: 17px; }
.guide-points { list-style: none; padding: 0; margin: 16px 0 0; width: 100%; text-align: left; display: grid; gap: 8px; }
.guide-points li { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 15px; }
.guide-where { width: 100%; margin-top: 16px; }
.guide-tabs { display: flex; gap: 4px; background: var(--card); border-radius: 18px; padding: 6px; box-shadow: var(--shadow); margin-top: 6px; }
.guide-tab { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 800; color: var(--muted); padding: 6px 2px; border-radius: 12px; min-width: 0; }
.guide-tab b { font-size: 18px; }
.guide-tab.on { background: var(--indigo); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }
.guide-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.guide-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s; }
.guide-dots i.on { width: 22px; background: var(--indigo); }
.guide-nav { margin-top: 10px; }
