/* ============================================================
   Умный Друг · Тёплый премиум
   Стеклянные карточки, мягкие градиенты, векторный маскот.
   Светлая/тёмная темы (prefers-color-scheme + ручной тумблер).
   ============================================================ */

:root {
  --bg: #faf3ea;
  --orb-a: rgba(255, 182, 110, 0.34);
  --orb-b: rgba(255, 122, 150, 0.26);
  --orb-c: rgba(64, 200, 190, 0.22);

  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-soft: rgba(255, 244, 235, 0.55);
  --line: rgba(140, 96, 70, 0.14);

  --fg: #3c2a35;
  --fg-soft: #9a7f90;
  --fg-faint: #b8a4ae;

  --primary: #ff6a52;
  --primary-2: #ff8a63;
  --coral-deep: #f4506c;
  --accent: #17b3a0;
  --teal-soft: #7fe0d3;
  --gold: #f6b33c;
  --violet: #8f6bff;

  --bubble-bot: rgba(250, 238, 255, 0.8);
  --bubble-user: linear-gradient(135deg, #ff8a63 0%, #f4506c 100%);

  --shadow-sm: 0 4px 14px rgba(150, 90, 60, 0.08);
  --shadow: 0 14px 34px rgba(150, 90, 60, 0.12);
  --shadow-lg: 0 26px 60px rgba(150, 90, 60, 0.18);

  --radius: 24px;
  --radius-sm: 14px;
  --blur: 16px;
}

html[data-theme="dark"] {
  --bg: #171220;
  --orb-a: rgba(255, 140, 90, 0.22);
  --orb-b: rgba(240, 90, 160, 0.18);
  --orb-c: rgba(60, 210, 195, 0.16);

  --glass: rgba(46, 36, 60, 0.66);
  --glass-strong: rgba(52, 41, 68, 0.9);
  --glass-soft: rgba(38, 29, 50, 0.6);
  --line: rgba(255, 255, 255, 0.09);

  --fg: #f6eef7;
  --fg-soft: #b3a2bd;
  --fg-faint: #8a7a96;

  --bubble-bot: rgba(64, 49, 82, 0.72);
  --bubble-user: linear-gradient(135deg, #ff8a63 0%, #f4506c 100%);

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #171220; --orb-a: rgba(255,140,90,.22); --orb-b: rgba(240,90,160,.18); --orb-c: rgba(60,210,195,.16);
    --glass: rgba(46,36,60,.66); --glass-strong: rgba(52,41,68,.9); --glass-soft: rgba(38,29,50,.6);
    --line: rgba(255,255,255,.09); --fg: #f6eef7; --fg-soft: #b3a2bd; --fg-faint: #8a7a96;
    --bubble-bot: rgba(64,49,82,.72);
    --shadow-sm: 0 4px 14px rgba(0,0,0,.25); --shadow: 0 14px 34px rgba(0,0,0,.32); --shadow-lg: 0 26px 60px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--fg);
  line-height: 1.55;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -12%, var(--orb-b) 0%, transparent 60%),
    radial-gradient(780px 500px at -8% 12%, var(--orb-a) 0%, transparent 58%),
    radial-gradient(820px 600px at 50% 118%, var(--orb-c) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ===== Общие элементы ===== */
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px 44px; }
.fox { width: 100%; height: 100%; display: block; }

.icon-btn {
  border: none; cursor: pointer;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur));
  color: var(--fg); font-size: 1.1rem;
  width: 44px; height: 44px; border-radius: 15px;
  display: grid; place-items: center; padding: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.icon-btn:active { transform: translateY(0) scale(0.96); }
.icon-btn--accent { background: linear-gradient(135deg, #ffb26b, #ff6a52); color: #fff; border: none; }
.icon-btn--muted { opacity: 0.45; filter: grayscale(0.7); cursor: not-allowed; }

.btn {
  border: none; cursor: pointer; font-family: inherit;
  font-weight: 800; font-size: 1rem; letter-spacing: 0.01em;
  border-radius: 999px; padding: 13px 24px; width: 100%;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  position: relative; overflow: hidden;
}
.btn:active { transform: translateY(0) scale(0.97); }
.btn--primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary-2), var(--primary) 55%, var(--coral-deep));
  box-shadow: 0 10px 22px rgba(244, 80, 108, 0.32);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform 0.5s ease;
}
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(244, 80, 108, 0.4); }
.btn--ghost {
  background: var(--glass-soft); color: var(--fg);
  border: 1px solid var(--line); backdrop-filter: blur(var(--blur));
}
.btn--ghost:hover { background: var(--glass-strong); transform: translateY(-1px); }
.btn--auto { width: auto; }
.btn--block { width: 100%; }
.btn--danger {
  color: #fff;
  background: linear-gradient(120deg, #e8453c, #d62c1f);
  box-shadow: 0 8px 18px rgba(214, 44, 31, 0.35);
}
.btn--danger:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(214, 44, 31, 0.45); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-weight: 800; font-size: 0.86rem; letter-spacing: 0.02em; }
.field input, .field select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--fg); border-radius: var(--radius-sm);
  padding: 12px 15px; font-size: 1rem; font-family: inherit;
  outline: none; width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select { background: rgba(255,255,255,0.06); }
.field input::placeholder { color: var(--fg-faint); }
.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.15);
}

/* Показ/скрытие пароля («глазик») */
.pass-wrap { position: relative; }
.pass-wrap input[type="password"], .pass-wrap input[type="text"] {
  width: 100%; padding-right: 48px; box-sizing: border-box;
}
.pass-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 6px; border-radius: 8px;
  color: var(--fg-soft); opacity: 0.75; transition: opacity 0.15s ease, background 0.15s ease;
}
.pass-toggle:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
html[data-theme="dark"] .pass-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.pass-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-error { color: #e5484d; font-size: 0.88rem; margin: 0 0 10px; font-weight: 700; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Юр. блок на форме регистрации (галочки + дисклеймер) */
.legal-box {
  margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(0, 0, 0, 0.02);
  display: flex; flex-direction: column; gap: 8px;
}
html[data-theme="dark"] .legal-box { background: rgba(255, 255, 255, 0.04); }
.legal-note { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--fg-soft); }
.legal-note a, .check a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; line-height: 1.4; cursor: pointer; }
.check input { width: auto; margin-top: 1px; accent-color: var(--primary); }
.check span { flex: 1; }

/* ===== Шапка ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 4px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand__mascot {
  width: 54px; height: 54px; padding: 9px; display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(150deg, #ffd88f, #ff8a63);
  box-shadow: 0 10px 22px rgba(255, 138, 99, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.brand__mascot .fox { filter: drop-shadow(0 2px 2px rgba(120, 40, 20, 0.18)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 900; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand__tagline { color: var(--fg-soft); font-size: 0.85rem; font-weight: 700; }

.topbar__right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.who {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 0.95rem;
}
.streak {
  display: flex; align-items: center; gap: 5px;
  background: var(--glass-strong); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm); font-size: 0.95rem;
}
.streak b { font-variant-numeric: tabular-nums; }
.coins-chip {
  display: flex; align-items: center; gap: 5px;
  background: linear-gradient(150deg, #fff0c9, #ffe3a3); border: 1px solid #f0d070;
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm); font-size: 0.95rem;
}
.coins-chip b { font-variant-numeric: tabular-nums; }
.level-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-strong); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px 6px 8px; box-shadow: var(--shadow-sm);
}
.level-chip > span {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: linear-gradient(150deg, #ffe3a3, #f6b33c);
  border-radius: 12px; font-size: 1.15rem;
}
.level-chip__meta b { display: block; font-size: 0.82rem; line-height: 1.15; }
.mini-bar { width: 108px; height: 7px; background: rgba(128, 128, 128, 0.18); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.mini-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--primary));
}

/* ===== Экран входа (премиум: герой + форма) ===== */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 26px 16px; }
.auth-shell {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px; width: 100%; max-width: 960px; align-items: stretch;
}
.auth-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #ff9a62 0%, #ff6a7c 55%, #c95fc4 100%);
  border-radius: 30px; padding: 42px 36px; color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(340px 220px at 90% 8%, rgba(255,255,255,0.25), transparent 60%),
    radial-gradient(300px 260px at 4% 96%, rgba(255,255,255,0.14), transparent 60%);
}
.auth-hero > * { position: relative; }
.auth-hero__logo {
  width: 104px; height: 104px; padding: 16px; margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  box-shadow: 0 18px 40px rgba(120, 30, 60, 0.28);
}
.auth-hero__logo .fox { filter: drop-shadow(0 4px 4px rgba(120, 30, 40, 0.25)); }
.auth-hero h2 { margin: 0 0 10px; font-size: 2rem; line-height: 1.18; letter-spacing: -0.02em; font-weight: 900; }
.auth-hero p { margin: 0 0 18px; font-size: 1rem; opacity: 0.95; max-width: 40ch; }
.auth-hero__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.auth-hero__points li { display: flex; gap: 11px; align-items: flex-start; font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; box-shadow: 0 0 0 4px rgba(255,255,255,0.18); }
.dot--coral { background: #ffd7c2; }
.dot--teal { background: #9df0e4; }
.dot--gold { background: #ffe08a; }

.auth-card {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line);
  border-radius: 30px; padding: 34px 30px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 {
  margin: 0 0 4px; font-size: 1.8rem; font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--primary), var(--coral-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-brand p { margin: 0; color: var(--fg-soft); font-size: 0.95rem; font-weight: 700; }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
  background: var(--glass-soft); border: 1px solid var(--line);
  padding: 5px; border-radius: 999px; margin-bottom: 22px;
}
.auth-tab {
  border: none; background: transparent; color: var(--fg-soft); font-weight: 800;
  padding: 10px; border-radius: 999px; cursor: pointer; font-size: 0.95rem; font-family: inherit;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.auth-tab.active { background: var(--glass-strong); color: var(--fg); box-shadow: var(--shadow-sm); }
.auth-note { color: var(--fg-soft); font-size: 0.82rem; text-align: center; margin: 16px 0 0; font-weight: 600; }

/* ===== Экран семьи ===== */
.family-view { min-height: 100vh; }
.family-main { max-width: 860px; margin: 10px auto 0; }
.family-main > h1 { margin: 8px 0 4px; font-size: 1.9rem; letter-spacing: -0.02em; }
.family-hint { color: var(--fg-soft); margin: 0 0 24px; font-weight: 600; }

.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-bottom: 22px; }
.child-card {
  position: relative;
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 18px 20px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.child-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,0.5), transparent 40%);
}
html[data-theme="dark"] .child-card::before { background: linear-gradient(160deg, rgba(255,255,255,0.08), transparent 40%); }
.child-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.child-card__ava {
  width: 92px; height: 92px; display: grid; place-items: center; font-size: 3rem;
  border-radius: 30px;
  background: linear-gradient(150deg, #ffd9c9, #ffb26b 60%, #ff8a63);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 10px 20px rgba(200, 100, 60, 0.22);
}
.child-card__name { font-weight: 900; font-size: 1.2rem; }
.child-card__meta { color: var(--fg-soft); font-size: 0.9rem; font-weight: 700; }
.child-card__actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 4px; }
.child-card .btn { width: 100%; }
.child-empty {
  grid-column: 1 / -1;
  background: var(--glass); border: 2px dashed var(--line);
  border-radius: var(--radius); padding: 40px 22px; text-align: center;
  color: var(--fg-soft); font-weight: 700; backdrop-filter: blur(6px);
}
.add-child-card { margin-bottom: 18px; }
.add-child-card > h2 { margin: 0 0 16px; font-size: 1.2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field--wide { grid-column: 1 / -1; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 9px; }.avatar-picker button {
  border: 2px solid var(--line); background: var(--glass-soft); font-size: 1.5rem;
  width: 50px; height: 50px; border-radius: 16px; cursor: pointer; font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.avatar-picker button:hover { transform: translateY(-2px); }
.avatar-picker button.selected {
  border-color: var(--primary); background: var(--glass-strong);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.18);
}

/* ===== Сетка главного детского экрана ===== */
.layout {
  display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 20px; margin-top: 16px; align-items: start;
}
.chat-col, .side-col { min-width: 0; }

.hello h1 { margin: 8px 0 2px; font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 900; }
.hello p { margin: 0; color: var(--fg-soft); font-weight: 600; }
.hello b { color: var(--primary); }

/* ===== Чат ===== */
.chat-card {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column; margin-top: 12px;
}
.chat__head {
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.chat__status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--accent); font-weight: 800; letter-spacing: 0.02em; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.pulse-dot { animation: pulse 1.8s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23, 179, 160, 0.45); }
  55% { box-shadow: 0 0 0 7px rgba(23, 179, 160, 0); }
}

.chat__body {
  padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 14px;
  min-height: 330px; max-height: 540px; overflow-y: auto;
  scroll-behavior: smooth;
}
.chat__body::-webkit-scrollbar { width: 8px; }
.chat__body::-webkit-scrollbar-thumb { background: rgba(140, 100, 120, 0.25); border-radius: 99px; }

.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 86%; animation: msgIn 0.25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg--user { align-self: flex-end; flex-direction: row-reverse; }
.msg__ava {
  flex: 0 0 auto; width: 36px; height: 36px; padding: 7px;
  border-radius: 50%;
  background: linear-gradient(150deg, #ffd88f, #ff8a63);
  box-shadow: 0 6px 14px rgba(255, 138, 99, 0.3);
  display: grid; place-items: center;
}
.msg--user .msg__ava {
  background: linear-gradient(150deg, #7fe0d3, #17b3a0);
  box-shadow: 0 6px 14px rgba(23, 179, 160, 0.3);
  font-size: 1.2rem; padding: 0;
}
.msg__bubble {
  background: var(--bubble-bot);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  border-radius: 18px 18px 18px 6px;
  padding: 11px 15px; font-size: 0.97rem; line-height: 1.55;
  box-shadow: var(--shadow-sm);
}
.msg--user .msg__bubble {
  color: #fff; background: var(--bubble-user); border: none;
  border-radius: 18px 18px 6px 18px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(244, 80, 108, 0.25);
}
.msg__bubble b { color: var(--coral-deep); }
.msg--user .msg__bubble b { color: #ffe3d6; }
.msg__bubble small { opacity: 0.8; }
.msg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }

.chip {
  border: none; cursor: pointer; font-family: inherit;
  font-size: 0.85rem; font-weight: 800;
  background: var(--glass-strong); color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chip:hover { background: linear-gradient(120deg, #ffe3a3, #ffc46b); color: #5b3a12; transform: translateY(-1px); }
.chip--coach { background: linear-gradient(120deg, #c9f2ff, #9adcff); color: #0a3d5c; }
.chip--coach:hover { background: linear-gradient(120deg, #a5e6ff, #6fc8f5); color: #082b42; }

/* Панель действий режима занятия (этап I6) */
.coach-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.coach-bar--active { border: 1px solid var(--line); background: var(--glass-soft); border-radius: 14px; padding: 10px 12px; }
.coach-bar__title { font-weight: 900; margin-right: 4px; }
.coach-bar .btn--mini:disabled { opacity: 0.5; cursor: wait; }

/* Режим бога (этап I13): готовые решения для родителя */
#gm-task { width: 100%; resize: vertical; font-family: inherit; font-size: 0.92rem; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-soft); color: var(--fg); outline: none; }
.gm-solution { background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; white-space: normal; line-height: 1.6; font-size: 0.95rem; }
.gm-solution b { color: var(--coral-deep); }

/* Архив занятий (этап I7): модалка со списком сессий */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 20, 40, 0.45); backdrop-filter: blur(4px);
  padding: 20px;
}
.modal {
  width: min(560px, 100%);
  max-height: min(80vh, 700px);
  display: flex; flex-direction: column;
  background: var(--bg-card, var(--bg));
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.modal--small { width: min(420px, 100%); }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { margin: 0; font-size: 1.05rem; }
.modal__body { padding: 14px 18px 18px; overflow-y: auto; }
.guard-wait { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--fg-soft); }
.guard-wait__spinner { font-size: 2rem; animation: spin 1.4s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.guard-form { display: flex; flex-direction: column; gap: 12px; }
.guard-form input[type="password"] {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass-soft); color: var(--fg); font-size: 1rem; outline: none;
}
.guard-form .row-btns { justify-content: flex-end; }
.session-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.session-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--glass-soft);
}
.session-row--active { border-color: var(--coral, #ff7a52); box-shadow: 0 0 0 1px var(--coral, #ff7a52) inset; }
.session-row__main { min-width: 0; }
.session-row__date { font-size: 0.8rem; font-weight: 800; color: var(--coral-deep, #c2451c); margin-bottom: 2px; }
.session-row__topic { font-weight: 700; overflow-wrap: anywhere; }
.session-row__meta { font-size: 0.78rem; color: var(--fg-soft); margin-top: 2px; }
.archive-chat { max-height: 46vh; border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; }
.archive-loading, .archive-empty, .archive-hint { color: var(--fg-soft); font-size: 0.9rem; }
.archive-hint { margin-top: 12px; }

.typing .msg__bubble { color: var(--fg-soft); font-weight: 800; }
.typing i { display: inline-block; animation: blink 1s infinite; font-style: normal; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.chat__input-row {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 14px; border-top: 1px solid var(--line);
}
.chat__input-row input[type="text"] {
  flex: 1; min-width: 0; border: none; outline: none;
  background: var(--glass-soft); color: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px; padding: 12px 18px; font-size: 0.98rem; font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat__input-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.15);
}
.send-btn {
  border: none; cursor: pointer; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(255, 106, 82, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.send-btn:hover { transform: scale(1.07); box-shadow: 0 10px 24px rgba(255, 106, 82, 0.45); }
.send-ico { width: 22px; height: 22px; }
.demo-note { margin: 0; padding: 0 18px 13px; font-size: 0.78rem; color: var(--fg-faint); text-align: center; font-weight: 600; }

/* ===== Правая колонка ===== */
.side-col { display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card__head h2 { margin: 0; font-size: 1.02rem; font-weight: 900; letter-spacing: 0.01em; }
.card__head h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  border-radius: 4px; margin-right: 9px; vertical-align: 1px;
}
.side-col .card:nth-child(1) .card__head h2::before { background: linear-gradient(135deg, #ff8a63, #f4506c); }
.side-col .card:nth-child(2) .card__head h2::before { background: linear-gradient(135deg, #ffc46b, #f6b33c); }
.side-col .card:nth-child(3) .card__head h2::before { background: linear-gradient(135deg, #7fe0d3, #17b3a0); }
.side-col .card:nth-child(4) .card__head h2::before { background: linear-gradient(135deg, #b9a4ff, #8f6bff); }
.card__sub { color: var(--fg-soft); font-size: 0.8rem; font-weight: 700; }

.session-hint { margin: 0 0 14px; color: var(--fg-soft); font-size: 0.9rem; min-height: 2.6em; font-weight: 600; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 900; font-size: 1.1rem;
  color: var(--coral-deep);
  background: linear-gradient(120deg, var(--primary-2), var(--coral-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.topics li { display: flex; align-items: center; gap: 12px; }
.topic-ico {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.3rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.topic-meta { flex: 1; min-width: 0; }
.topic-name { font-weight: 800; font-size: 0.95rem; display: flex; justify-content: space-between; gap: 8px; }
.topic-name span:last-child { color: var(--fg-soft); font-variant-numeric: tabular-nums; }
.topic-bar { height: 9px; border-radius: 99px; background: rgba(128, 128, 128, 0.16); overflow: hidden; margin-top: 6px; }
.topic-empty {
  display: block; color: var(--fg-soft); font-size: 0.9rem; font-weight: 700;
  background: var(--glass-soft); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: 14px 12px; text-align: center;
}
.topic-bar i {
  display: block; height: 100%; border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
}

.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  background: var(--glass-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 6px;
  text-align: center; font-size: 0.72rem; font-weight: 800; line-height: 1.25;
  display: flex; flex-direction: column; gap: 5px; align-items: center;
  transition: transform 0.16s ease;
}
.badge:hover { transform: translateY(-2px); }
.badge span { font-size: 1.55rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08)); }
.badge--locked { opacity: 0.42; filter: grayscale(0.9); }

/* ===== Тесты (квизы) ===== */
.quiz-hint { margin: 0 0 10px; color: var(--fg-soft); font-size: 0.86rem; font-weight: 600; }
.quiz-topic-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.quiz-topic-row input[type="text"] {
  flex: 1; min-width: 0; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55); color: var(--fg);
  border-radius: 999px; padding: 10px 14px; font-size: 0.92rem; font-family: inherit;
  outline: none; transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
html[data-theme="dark"] .quiz-topic-row input[type="text"] { background: rgba(255, 255, 255, 0.06); }
.quiz-topic-row input[type="text"]::placeholder { color: var(--fg-faint); }
.quiz-topic-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.15);
}

.quiz-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.quiz-history li { display: flex; align-items: center; gap: 11px; }
.quiz-h__mark {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px;
  background: var(--glass-soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.05rem;
}
.quiz-h__meta { flex: 1; min-width: 0; }
.quiz-h__name { font-weight: 800; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-h__sub { color: var(--fg-soft); font-size: 0.76rem; font-weight: 600; }
.quiz-empty {
  display: block; color: var(--fg-soft); font-size: 0.86rem; font-weight: 700;
  background: var(--glass-soft); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
}

.doc-icon { flex: 0 0 auto; font-size: 1.05rem; }
.doc-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-name small { color: var(--fg-soft); font-weight: 600; }
.doc-del {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--glass-soft);
  color: var(--fg-soft); cursor: pointer; width: 26px; height: 26px; border-radius: 8px;
}
.doc-del:hover { color: var(--danger, #e5484d); border-color: var(--danger, #e5484d); }

.doc-pick { flex: 0 0 auto; }
.doc-pick[data-selected="1"] {
  background: var(--accent-soft, rgba(255, 122, 82, 0.16));
  color: var(--accent, #ff7a52);
  border-color: var(--accent, #ff7a52);
}

.quiz-card {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 14px; margin: 2px 0 6px;
}
.quiz-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.quiz-card__title { font-weight: 900; font-size: 1.02rem; }
.quiz-card__score {
  font-variant-numeric: tabular-nums; font-weight: 900; font-size: 0.95rem;
  color: var(--accent);
}
.quiz-q { margin-top: 12px; }
.quiz-q__text { font-weight: 800; font-size: 0.96rem; line-height: 1.4; margin-bottom: 8px; }
.quiz-q__options { display: flex; flex-wrap: wrap; gap: 7px; }
.quiz-opt {
  border: 1px solid var(--line); background: var(--glass-strong);
  color: var(--fg); cursor: pointer; font-family: inherit;
  font-weight: 800; font-size: 0.88rem;
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.quiz-opt:hover:not(.used) { transform: translateY(-1px); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.ok {
  border-color: transparent;
  background: linear-gradient(120deg, #7fe0d3, #17b3a0);
  color: #fff; box-shadow: 0 6px 14px rgba(23, 179, 160, 0.28);
}
.quiz-opt.bad {
  border-color: transparent;
  background: linear-gradient(120deg, #ffb26b, #f4506c);
  color: #fff; box-shadow: 0 6px 14px rgba(244, 80, 108, 0.25);
}
.quiz-opt.used:not(.ok):not(.bad) { opacity: 0.55; }
.quiz-q__result {
  margin-top: 8px; border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 0.9rem; line-height: 1.45;
  background: var(--glass-soft); border: 1px solid var(--line);
}
.quiz-q__result small { color: var(--fg-soft); font-weight: 600; }
.quiz-q__result.res-ok { background: rgba(23, 179, 160, 0.12); border-color: rgba(23, 179, 160, 0.35); }
.quiz-q__result.res-bad { background: rgba(244, 80, 108, 0.1); border-color: rgba(244, 80, 108, 0.3); }
.quiz-q__result b { color: var(--accent); }

.foot { margin-top: 28px; color: var(--fg-soft); font-size: 0.85rem; text-align: center; font-weight: 600; }

/* ===== Переключатель предметов (репетиторов) ===== */
.subject-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.subject-pill {
  border: 1px solid var(--line); background: var(--glass-strong);
  color: var(--fg); cursor: pointer; font-family: inherit;
  font-weight: 800; font-size: 0.86rem;
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.subject-pill:hover { transform: translateY(-1px); }
.subject-pill.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(120deg, var(--primary-2), var(--coral-deep));
  box-shadow: 0 8px 18px rgba(244, 80, 108, 0.3);
}

/* ===== Напоминания «Повторим» (кривая забывания) ===== */
.remind-card {
  border: 1px solid rgba(255, 122, 82, 0.45);
  background: linear-gradient(150deg, rgba(255, 122, 82, 0.10), rgba(255, 94, 138, 0.10)), var(--glass-strong);
}
.remind-hint { margin: 0 0 10px; color: var(--fg-soft); font-size: 0.84rem; font-weight: 600; }
.reminds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.remind-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.remind-item__ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
  background: var(--glass-strong); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.15rem;
}
.remind-item__meta { flex: 1; min-width: 0; }
.remind-item__name { font-weight: 800; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remind-item__sub { color: var(--fg-soft); font-size: 0.75rem; font-weight: 600; }
.remind-item__btn {
  flex: 0 0 auto; border: none; cursor: pointer; font-family: inherit;
  color: #fff; font-weight: 800; font-size: 0.8rem;
  background: linear-gradient(120deg, var(--primary-2), var(--coral-deep));
  border-radius: 999px; padding: 8px 13px;
  box-shadow: 0 6px 14px rgba(244, 80, 108, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.remind-item__btn:hover { transform: translateY(-1px); }

/* ===== Telegram-отчёты родителя (этап E) ===== */
.tg-card { margin-top: 22px; max-width: 640px; }
.tg-status { margin: 0 0 14px; color: var(--fg); font-weight: 700; font-size: 0.95rem; }
.tg-hint { margin: 0 0 8px; color: var(--fg-soft); font-size: 0.88rem; font-weight: 600; }
.tg-code-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.tg-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 900; font-size: 1.15rem; letter-spacing: 0.14em;
  background: var(--glass-soft); border: 2px dashed var(--line);
  border-radius: 12px; padding: 10px 16px; color: var(--fg);
}

/* ===== Тариф free/pro (этап F) ===== */
.plan-features { list-style: none; margin: 6px 0 14px; padding: 0; }
.plan-feature {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 600; font-size: 0.9rem;
}
.plan-feature__dot { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; background: var(--glass-soft); border-radius: 50%; }

.session-limit {
  margin: 0 0 14px; color: var(--fg-soft); font-size: 0.85rem; font-weight: 600;
}

/* ===== Мультивыбор предметов при создании ребёнка ===== */
.subject-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-chips button {
  border: 2px solid var(--line); background: var(--glass-soft);
  color: var(--fg); font-family: inherit; cursor: pointer;
  font-weight: 800; font-size: 0.9rem;
  border-radius: 999px; padding: 8px 14px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.subject-chips button:hover { transform: translateY(-1px); }
.subject-chips button.selected {
  border-color: var(--primary); background: var(--glass-strong);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.16);
}

/* ===== Админ-панель (этап G) ===== */
.admin-main { max-width: 960px; margin: 10px auto 0; }
.admin-main > h1 { margin: 8px 0 4px; font-size: 1.8rem; letter-spacing: -0.02em; }
.admin-tabs { display: flex; gap: 8px; margin: 14px 0 18px; flex-wrap: wrap; }
.admin-tab {
  border: 1px solid var(--line); background: var(--glass-strong);
  color: var(--fg); cursor: pointer; font-family: inherit; font-weight: 800;
  border-radius: 999px; padding: 10px 18px; font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.admin-tab:hover { transform: translateY(-1px); }
.admin-tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(120deg, var(--primary-2), var(--coral-deep));
  box-shadow: 0 8px 18px rgba(244, 80, 108, 0.3);
}

.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.admin-stat {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 10px;
}
.admin-stat__emoji { font-size: 1.6rem; }
.admin-stat__meta { flex: 1; min-width: 0; }
.admin-stat__meta b { display: block; font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.admin-stat__meta span { color: var(--fg-soft); font-size: 0.78rem; font-weight: 700; }

.admin-limits-card { margin-top: 18px; max-width: 640px; }
.admin-limits-card p { margin: 0 0 8px; color: var(--fg); font-weight: 600; font-size: 0.92rem; }

/* ===== Монетизация в админке (этап I2–I3) ===== */
.monet-form { margin-top: 6px; }
.monet-block { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.monet-block h3 { margin: 0 0 8px; font-size: 0.95rem; }
.monet-block p { margin: 0 0 10px; color: var(--muted); font-size: 0.85rem; }
.monet-features { display: grid; gap: 8px; }
.monet-feature {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.monet-feature__emoji { font-size: 1.2rem; }
.monet-feature__meta { flex: 1; }
.monet-feature__meta b { display: block; font-size: 0.92rem; }
.monet-feature__meta span { color: var(--muted); font-size: 0.8rem; }
.monet-switch {
  position: relative; width: 46px; height: 26px; flex: none; cursor: pointer;
}
.monet-switch input { opacity: 0; width: 0; height: 0; }
.monet-switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(128,128,128,0.28); transition: 0.2s;
}
.monet-switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.monet-switch input:checked + .slider { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.monet-switch input:checked + .slider::before { transform: translateX(20px); }
.monet-field { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.92rem; }
.monet-field input[type="number"] {
  width: 90px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--fg);
  font: inherit;
}
.monet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.monet-status { color: #2e9e4f; font-weight: 700; font-size: 0.92rem; }

.admin-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.admin-search-row input[type="text"] {
  flex: 1; min-width: 0; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55); color: var(--fg);
  border-radius: 999px; padding: 11px 16px; font-size: 0.95rem; font-family: inherit;
  outline: none; transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
html[data-theme="dark"] .admin-search-row input[type="text"] { background: rgba(255, 255, 255, 0.06); }
.admin-search-row input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.15);
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left; color: var(--fg-soft); font-weight: 800;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.8rem;
}
.admin-table td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--glass-soft); }
.admin-cell-main { font-weight: 800; }
.admin-cell-sub { color: var(--fg-soft); font-size: 0.78rem; font-weight: 600; }
.plan-pill {
  font-size: 0.8rem; font-weight: 800; color: var(--fg-soft);
  background: var(--glass-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px;
}
.plan-pill--pro { color: #fff; background: linear-gradient(120deg, #ffe3a3, #f6b33c); border: none; }
.ban-pill {
  font-size: 0.78rem; font-weight: 800; color: var(--fg-soft);
  background: var(--glass-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px;
}
.ban-pill--on { color: #fff; background: linear-gradient(120deg, #ff8a63, #f4506c); border: none; }
.ban-pill--off { color: #6b7280; background: #eef0f4; border: 1px dashed #c7ccd6; }
.btn--mini { padding: 7px 12px; font-size: 0.82rem; }
.admin-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Дети семьи в админке (этап I14) */
.admin-kids-row td { background: var(--glass-soft); }
.admin-kids { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.admin-kid {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-card, var(--bg)); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.admin-kid__ava { font-size: 1.3rem; }
.admin-kid__meta { display: flex; flex-direction: column; min-width: 160px; flex: 1; }
.admin-kid .admin-row-actions { margin-left: auto; }

@media (max-width: 720px) {
  .admin-cards { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ===== Игровое окно (этап H) ===== */
.games-main { max-width: 860px; margin: 0 auto; }
.games-main > .card { margin-top: 18px; }

.map-card { max-width: 720px; }
.level-map { display: flex; align-items: flex-start; gap: 0; margin: 20px 6px 4px; }
.lvl-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 0 0 auto; width: 96px; text-align: center; opacity: 0.42;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lvl-node.is-reached { opacity: 1; }
.lvl-node__dot {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--glass-strong); border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.lvl-node.is-reached .lvl-node__dot {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-2), var(--coral-deep));
  box-shadow: 0 8px 20px rgba(244, 80, 108, 0.35);
}
.lvl-node__name { font-size: 0.78rem; font-weight: 800; color: var(--fg); line-height: 1.15; }
.lvl-node__xp { font-size: 0.68rem; font-weight: 700; color: var(--fg-soft); }
.lvl-seg {
  flex: 1; min-width: 18px; height: 5px; border-radius: 99px;
  background: var(--line); margin: 0 2px; margin-top: 24px; /* центр линии = центр точки 52px */
  transition: background 0.3s ease;
}
.lvl-seg.is-done { background: linear-gradient(90deg, var(--primary-2), var(--coral-deep)); }

.badges--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badges--grid .badge { margin: 0; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.game-card__top { display: flex; gap: 12px; align-items: flex-start; }
.game-card__emoji {
  font-size: 1.8rem; width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(255, 178, 107, 0.35), rgba(255, 106, 82, 0.25));
}
.game-card__title { font-weight: 900; font-size: 1.05rem; }
.game-card__desc { color: var(--fg-soft); font-size: 0.82rem; font-weight: 600; line-height: 1.4; }
.game-card__best { color: var(--fg-soft); font-size: 0.8rem; font-weight: 700; }

.game-stage {
  margin-top: 18px;
  background: var(--glass-strong); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.game-hud {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; color: var(--fg-soft); margin-bottom: 14px;
}
.game-timer { font-variant-numeric: tabular-nums; color: var(--coral-deep); }
.game-problem {
  font-size: 2rem; font-weight: 900; text-align: center;
  padding: 22px 10px; color: var(--fg);
}
.game-answer-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.game-input {
  width: 160px; padding: 12px 16px; font-size: 1.3rem; font-weight: 800; text-align: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.7); color: var(--fg); font-family: inherit;
  outline: none; transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
html[data-theme="dark"] .game-input { background: rgba(255, 255, 255, 0.08); }
.game-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 106, 82, 0.15); }
input.game-input::-webkit-outer-spin-button,
input.game-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.game-input[type=number] { -moz-appearance: textfield; }

.pairs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; max-width: 560px; margin: 0 auto; }
.pair-card {
  height: 64px; font-size: 1.15rem; font-weight: 900;
  border: 1px solid var(--line); border-radius: 16px; cursor: pointer;
  background: var(--glass-strong); color: var(--fg);
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, background 0.15s ease;
}
.pair-card:hover { transform: translateY(-2px); }
.pair-card.open { background: linear-gradient(135deg, #fff3e0, #ffe0d0); }
html[data-theme="dark"] .pair-card.open { background: linear-gradient(135deg, #5a3a52, #4a2f4a); }
.pair-card.done {
  background: linear-gradient(135deg, var(--accent), #7fe0d3);
  color: #fff; border-color: transparent; cursor: default;
  box-shadow: 0 8px 18px rgba(23, 179, 160, 0.3);
}
.pair-card.done:hover { transform: none; }

.row-btns--center { justify-content: center; margin-top: 10px; }
.game-result { text-align: center; padding: 10px 0; }
.game-result__emoji { font-size: 2.6rem; }
.game-result h3 { margin: 6px 0 4px; font-size: 1.3rem; }
.game-result p { margin: 4px 0; color: var(--fg-soft); font-weight: 700; }
.game-result__xp { font-size: 1.2rem; color: var(--coral-deep); font-weight: 900; }
.game-result__day { font-size: 0.82rem; }

@media (max-width: 520px) {
  .level-map { overflow-x: auto; padding-bottom: 8px; }
  .lvl-node { width: 84px; }
  .games-grid { grid-template-columns: 1fr; }
}

/* ===== Адаптивность ===== */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 480px; }
  .auth-hero { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .chat__body { max-height: none; }
}
@media (max-width: 520px) {
  .brand__mascot { width: 46px; height: 46px; padding: 8px; border-radius: 15px; }
  .level-chip { display: none; }
  .msg { max-width: 96%; }
  .hello h1 { font-size: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar__right { gap: 6px; }
  .auth-card { padding: 26px 20px; }
}
