/*
 * Интерфейс выбора — по образцу ClassDojo Web: белый сайдбар с цветными векторными иконками,
 * шапка с крупным заголовком и вкладками, серо-сиреневый фон, белые карточки
 * с мягкой нижней тенью, фиолетовые кнопки-таблетки, поля с серо-фиолетовой рамкой.
 */
:root {
  --bg: #f2f3f7;
  --surface: #fff;
  --text: #2c2a50;
  --text-strong: #1d1b3a;
  --muted: #6c6a90;
  --faint: #a6a4c0;
  --line: #e4e4ec;
  --field: #c4c1dc;
  --hover: #f3f3f8;
  --active: #e7e7f0;

  --primary: #7d40ff;
  --primary-hover: #6a2df0;
  --primary-soft: #efe7ff;

  --violet: #7d40ff; --violet-soft: #efe7ff;
  --blue: #1f8fff; --blue-soft: #e3f0ff;
  --green: #15a34a; --green-soft: #e0f6e8;
  --orange: #ff7417; --orange-soft: #ffeedf;
  --pink: #f03c88; --pink-soft: #ffe4ef;
  --yellow: #e0a100; --yellow-soft: #fff4cc;
  --red: #e5484d; --red-soft: #fdeaea;
  --badge: #128a3e;

  --radius: 16px;
  --shadow: 0 0 0 1px #e6e6ee, 0 1px 2px rgba(44, 42, 80, .05);
  --shadow-lg: 0 0 0 1px #dedeea, 0 8px 22px -10px rgba(44, 42, 80, .22);
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side: 288px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
p { margin: 0; }
.icon { display: inline-block; vertical-align: middle; flex: none; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon.filled { fill: currentColor; }

/* цветовые темы */
.c-violet { --c: var(--violet); --cs: var(--violet-soft); }
.c-blue { --c: var(--blue); --cs: var(--blue-soft); }
.c-green { --c: var(--green); --cs: var(--green-soft); }
.c-orange { --c: var(--orange); --cs: var(--orange-soft); }
.c-pink { --c: var(--pink); --cs: var(--pink-soft); }
.c-yellow { --c: var(--yellow); --cs: var(--yellow-soft); }
.c-gray { --c: var(--muted); --cs: var(--active); }

/* ───────── каркас */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 10px 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 22px; font-weight: 700; font-size: 24px; color: var(--text-strong); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
.brand-symbol { display: block; flex: none; object-fit: contain; }
.brand-name { font-weight: 700; letter-spacing: -.6px; line-height: 1; }
.brand:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: 12px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 40px; padding: 8px 12px; border-radius: 9px; border: 0; background: none;
  font: 500 16px/1.25 var(--font); color: var(--text); text-align: left; cursor: pointer;
}
.side-link:hover { background: var(--hover); }
.side-link.is-active { background: var(--active); font-weight: 700; }
.side-link .count { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--faint); }
.side-ico { width: 24px; height: 24px; display: grid; place-items: center; color: var(--c, var(--text)); flex: none; }
.side-dot { width: 22px; height: 22px; display: grid; place-items: center; color: var(--c, var(--text)); flex: none; }
.side-plus { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.side-link.is-add { color: var(--text); }
.side-group { margin-top: 14px; }
.side-group > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 6px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--muted);
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { color: var(--text); }
.side-group > summary .icon { transition: transform .2s; opacity: .7; }
.side-group:not([open]) > summary .icon { transform: rotate(-90deg); }
.round-btn.menu-btn { display: none; }
.side-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 28px; }
.top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-title h1 { font-size: 24px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-back { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); flex: none; }
.top-back:hover { background: var(--active); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); border: 0; cursor: pointer; color: var(--text); }
.round-btn:hover { background: var(--active); }
.account-trigger { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; }
.account-trigger:hover, .account-menu.is-open .account-trigger { background: var(--hover); border-color: var(--field); }
.account-trigger .monster { border-radius: 50%; background: var(--primary-soft); }
.account-trigger-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger > .icon { color: var(--muted); }
.account-menu.is-open .account-trigger > .icon { transform: rotate(180deg); }
.account-trigger:focus-visible, .account-dropdown a:focus-visible, .account-dropdown button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* вкладки под заголовком — как Classroom / Class Story */
.tabs { display: flex; gap: 28px; padding: 0 28px; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; padding: 4px 0 12px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-on { color: var(--primary); }
.tabs a.is-on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tabs .n { color: var(--faint); font-weight: 600; margin-left: 4px; }

.subtabs { display: flex; justify-content: center; gap: 24px; margin: -8px 0 24px; border-bottom: 1px solid var(--line); }
.subtabs a { position: relative; padding: 6px 2px 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.subtabs a.is-on { color: var(--primary); }
.subtabs a.is-on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }

.content { padding: 26px 28px 72px; width: 100%; max-width: 1180px; margin: 0 auto; }

.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; font-weight: 700; color: var(--muted); }
.section-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ───────── кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #e4d8ff; }
.btn-white { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-white:hover { background: var(--hover); }
.btn-text { background: none; color: var(--primary); padding: 0 12px; }
.btn-text:hover { background: var(--primary-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbd9da; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.btn-icon:hover { background: var(--hover); color: var(--text); }
.btn-close { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--hover); color: var(--text-strong); }
.btn-close:hover { background: var(--active); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ───────── поля */
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px;
  background: #fff; border: 2px solid var(--field); border-radius: 12px;
  font-weight: 500; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 110px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5.5L11 1z' fill='%235b5786' stroke='%235b5786' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder, .textarea::placeholder { color: #8d8ab0; font-weight: 500; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.field-error { color: var(--red); font-size: 13px; font-weight: 600; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.search .input { padding-left: 42px; border-radius: 999px; border-width: 1.5px; border-color: var(--line); height: 42px; }
.search .input:focus { border-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 600; font-size: 14px; color: var(--text); cursor: pointer; border: 0;
}
.chip:hover { background: var(--hover); }
.chip.is-on { background: var(--primary); color: #fff; box-shadow: none; }
.chip .n { color: var(--faint); font-weight: 600; }
.chip.is-on .n { color: #d9c8ff; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
.toolbar .select { height: 42px; border-width: 1.5px; border-color: var(--line); border-radius: 999px; padding-left: 16px; }

/* сегменты и переключатели */
.seg { display: inline-flex; background: var(--hover); border-radius: 999px; padding: 3px; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: #fff; color: var(--text-strong); box-shadow: 0 1px 3px rgba(44, 42, 80, .16); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d3d2e2; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--hover); border-radius: 999px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(44, 42, 80, .15); color: var(--text); }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper output { min-width: 32px; padding: 0 6px; text-align: center; font-weight: 700; font-size: 16px; white-space: nowrap; }

/* ───────── карточки */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 18px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* карточка-ресурс: картинка на цветном фоне + подпись на светлом тоне того же цвета */
.gcard {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.gcard:hover { box-shadow: var(--shadow-lg); }
.gcard-cover { aspect-ratio: 16 / 10; background: var(--hover); overflow: hidden; border-bottom: 1px solid var(--line); }
.gcard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard-body { padding: 12px 14px 14px; background: #fff; flex: 1; display: grid; gap: 2px; align-content: start; }
.gcard-title { font-weight: 600; font-size: 15px; color: var(--text-strong); }
.gcard-sub { font-size: 13px; color: var(--muted); font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gcard-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
/* подписи под заголовком — обычный серый текст через «·», без цветных плашек */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.tag + .tag::before { content: '·'; margin-right: 6px; color: var(--faint); }
.tag .icon { color: var(--faint); }

/* плитки «Мои классы» */
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 148px; padding: 18px 14px; text-align: center;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .18s; cursor: pointer; border: 0; width: 100%;
}
.tile:hover { box-shadow: var(--shadow-lg); }
.tile.is-on { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow); }
.tile-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--hover); color: var(--c); margin-bottom: 4px; }
.tile-title { font-weight: 600; font-size: 15px; color: var(--text-strong); }
.tile-sub { font-size: 13px; color: var(--muted); font-weight: 400; display: inline-flex; align-items: center; gap: 4px; }
.tile-add .tile-ico { border-radius: 50%; background: var(--primary); color: #fff; width: 44px; height: 44px; }
.tile-add .tile-title { color: var(--primary); font-weight: 600; }
.tile-corner { position: absolute; top: 8px; right: 8px; color: var(--muted); }
.grid-tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }

/* строка списка */
.row-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.row-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--c); flex: none; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-title { font-weight: 600; font-size: 16px; color: var(--text-strong); }
.row-title a:hover { color: var(--primary); }
.row-desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.row-actions { display: flex; gap: 8px; }
.list { display: grid; gap: 10px; }

/* ───────── меню «⋯» */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(44, 42, 80, .18); padding: 6px;
  display: none;
}
.dropdown.is-open .dropdown-menu { display: block; animation: drop .14s ease-out; }
.dropdown-menu button, .dropdown-menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 0; background: none; font-weight: 500; font-size: 14px; text-align: left; cursor: pointer; color: var(--text);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--hover); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.account-dropdown { width: 280px; min-width: 0; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.account-identity { display: flex; align-items: center; gap: 12px; padding: 10px 8px 16px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.account-identity > div { min-width: 0; }
.account-identity strong { display: block; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.account-identity span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-dropdown a, .account-dropdown button { min-height: 44px; font-weight: 600; }
.account-dropdown a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.account-dropdown .icon { color: var(--muted); }
.account-dropdown .danger .icon { color: inherit; }
.account-dropdown .danger:hover { background: var(--red-soft); }
@media (prefers-reduced-motion: reduce) { .account-menu.is-open .dropdown-menu { animation: none; } }
.locale-btn { gap: 6px; padding: 0 12px; font-weight: 600; }
.locale-switch .dropdown-menu { min-width: 170px; }
.locale-switch .dropdown-menu button { justify-content: space-between; }
.locale-switch .dropdown-menu .is-on { font-weight: 700; color: var(--primary); }

/* ───────── модальные окна: шапка с чертой, круглая кнопка закрытия, подвал с чертой */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(46, 42, 82, .62); animation: fade .15s; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(30, 27, 60, .3); padding: 0 24px; animation: rise .2s ease-out; }
.modal-wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; margin: 0 -24px 20px; padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 20px; color: var(--text-strong); }
.modal-head .btn-icon { margin-left: auto; width: 40px; height: 40px; background: var(--hover); color: var(--text-strong); }
.modal-head .btn-icon:hover { background: var(--active); }
.modal-body { display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 24px -24px 0; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .btn-soft { background: none; color: var(--primary); }
.modal-foot .btn-soft:hover { background: var(--primary-soft); }
.modal > :last-child:not(.modal-foot) { margin-bottom: 24px; }
.color-pick { display: flex; gap: 10px; }
.color-pick label { position: relative; }
.color-pick input { position: absolute; opacity: 0; }
.color-pick i { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 3px #fff, 0 0 0 4px transparent; }
.color-pick input:checked + i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }

/* ───────── уведомления справа */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 16px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(44, 42, 80, .2); font-weight: 600; animation: slide .25s ease-out; }
.toast .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; font-size: 13px; }
.toast.is-error .dot { background: var(--red-soft); color: var(--red); }
.toast.out { animation: slide .25s reverse forwards; }

/* ───────── пустые состояния */
.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; text-align: center; }
.empty-ico { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--hover); color: var(--c); margin-bottom: 8px; }
.empty h3 { font-size: 18px; color: var(--text-strong); }
.empty .btn { margin-top: 10px; }

/* ───────── подсказка «?» */
.hint { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--active); color: var(--muted); font-size: 12px; font-weight: 700; cursor: help; }
.hint:hover::after, .hint:focus::after {
  content: attr(data-hint); position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0;
  width: max-content; max-width: 260px; padding: 8px 12px; border-radius: 10px;
  background: var(--text-strong); color: #fff; font-size: 13px; font-weight: 500; line-height: 1.4; z-index: 50;
}

/* ───────── настройка игры */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.setup-hero { overflow: hidden; }
.setup-hero .cover { aspect-ratio: 16 / 8; background: var(--cs); }
.setup-hero .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px 20px 20px; }
.how-step { display: grid; gap: 8px; align-content: start; }
.how-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--badge); color: #fff; font-weight: 700; font-size: 14px; }
.how-step p { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.panel { padding: 18px 20px; }
.panel + .panel { border-top: 1px solid var(--line); }
.panel h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--text-strong); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; }
.opt + .opt { border-top: 1px solid var(--hover); }
.opt-label { font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-strong); }
.opt .select { height: 38px; border-width: 1.5px; }
.teams { display: grid; gap: 8px; margin-top: 10px; }
.team-input { display: flex; align-items: center; gap: 10px; }
.team-input i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.team-input .input { height: 40px; border-width: 1.5px; }
.picked-set { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--hover); }
.picked-set .row-ico { width: 42px; height: 42px; border-radius: 12px; }
.picked-set b { display: block; font-weight: 700; color: var(--text-strong); }
.playbar {
  position: sticky; bottom: 0; z-index: 20; margin-top: 20px;
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  padding: 12px 16px; background: #fff; border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px -12px rgba(44, 42, 80, .25);
}
.playbar .spacer { flex: 1; }
.set-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.set-option:hover { background: var(--hover); }
.set-option .row-ico { width: 40px; height: 40px; border-radius: 11px; }
.set-option b { font-weight: 700; color: var(--text-strong); }
.set-option small { display: block; color: var(--muted); font-size: 13px; }
.set-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin-top: 12px; }

/* ───────── материалы */
.file { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.file-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--c); flex: none; }
.file-main { flex: 1; min-width: 0; }
.file-main b { display: block; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-main small { color: var(--muted); font-size: 13px; }
.viewer { width: 100%; height: 78vh; border: 0; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
/* материал: слева описание и файлы, справа просмотр выбранного файла */
.mat-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 26px; }
.mat-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.mat-info { display: grid; gap: 10px; padding: 18px; }
.mat-info h2 { font-size: 19px; line-height: 1.3; color: var(--text-strong); }
.mat-info p { font-size: 14px; }
.mat-files { display: grid; gap: 6px; }
.mat-files h3 { font-size: 15px; font-weight: 700; color: var(--text-strong); padding: 0 4px 4px; }
.mat-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: box-shadow .15s; }
.mat-file:hover { box-shadow: 0 0 0 1.5px var(--field), var(--shadow); }
.mat-file.is-on { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.mat-file .file-ico { width: 38px; height: 38px; border-radius: 10px; }
.mat-file .file-main b { font-size: 14px; }
.mat-file .file-main small { font-size: 12px; }
.mat-view { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100vh - 150px); min-height: 520px; }
.mat-view-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.mat-view-head b { flex: 1; min-width: 0; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-view-body { flex: 1; min-height: 0; display: grid; background: #f7f7fb; }
.mat-view-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.mat-view-body img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; padding: 16px; }
.mat-pages { overflow-y: auto; display: grid; align-content: start; justify-items: center; gap: 16px; padding: 18px; }
.mat-pages img { width: min(100%, 980px); height: auto; max-height: none; padding: 0; margin: 0; background: #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(44, 42, 80, .1); }
.mat-view-empty { margin: auto; display: grid; justify-items: center; gap: 10px; padding: 40px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .mat-split { grid-template-columns: 1fr; }
  .mat-side { position: static; }
  .mat-view { height: 75vh; min-height: 420px; }
  .mat-view-head .btn { padding: 0 12px; }
}
.mat-hero { display: flex; gap: 20px; align-items: flex-start; padding: 22px; margin-bottom: 22px; }
.mat-hero h2 { font-size: 22px; line-height: 1.3; color: var(--text-strong); }
.mat-thumb { width: 300px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); flex: none; }

/* ───────── мой класс: плитки учеников как в ClassDojo */
.students { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 30px 16px; padding-top: 34px; }
.student { position: relative; display: grid; justify-items: center; align-content: end; gap: 4px; min-height: 104px; padding: 46px 8px 12px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); border: 0; }
.student .monster { position: absolute; top: -34px; left: 50%; translate: -50% 0; filter: drop-shadow(0 3px 2px rgba(44, 42, 80, .12)); cursor: pointer; }
.student b { font-weight: 600; font-size: 15px; color: var(--text-strong); text-align: center; line-height: 1.2; }
.student .pts { position: absolute; top: -12px; right: 10px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--badge); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 0 0 3px #fff; }
.student .pts.neg { background: var(--red); }
.student.bump .pts { animation: bump .4s; }
.student-actions { display: flex; gap: 6px; margin-top: 4px; }
.student-actions button { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.student-actions .up { background: var(--green-soft); color: var(--green); }
.student-actions .down { background: var(--red-soft); color: var(--red); }
.student .dropdown { position: absolute; top: 4px; left: 4px; }

/* нижняя панель класса — как Toolkit / Attendance / Random / Timer */
.dock { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 24px; padding: 12px 20px; background: #fff; border-top: 1px solid var(--line); }
.content:has(.dock) { padding-bottom: 110px; }
.dock a { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--text); padding: 6px 4px; border-radius: 8px; }
.dock a:hover { color: var(--primary); }
.dock .icon { color: var(--muted); }
.dock a:hover .icon { color: var(--primary); }

/* ───────── авторизация */
.auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-locale { position: absolute; top: 18px; right: 18px; }
.auth-card { width: min(420px, 100%); padding: 30px 28px; }
.auth-card .brand { justify-content: center; padding-bottom: 6px; font-size: 26px; }
.auth-card h1 { text-align: center; font-size: 20px; margin-bottom: 22px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-note { text-align: center; color: var(--muted); margin: 0 0 18px; }
.auth-card form .btn-soft { width: 100%; }
.auth-foot a { color: var(--primary); font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

/* ───────── редактор набора */
.q-row { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) 36px; gap: 10px; align-items: center; }
.q-row .n { font-weight: 700; color: var(--faint); text-align: center; }
.q-row .input { height: 42px; border-width: 1.5px; }
.q-head { font-size: 13px; font-weight: 600; color: var(--muted); }
.q-list { display: grid; gap: 8px; }
.qs-table { width: 100%; border-collapse: collapse; }
.qs-table td, .qs-table th { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.qs-table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.qs-table tr:last-child td { border-bottom: 0; }
.qs-table .ans { color: var(--green); font-weight: 700; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; background: #fff; box-shadow: var(--shadow); }
.pager .is-on { background: var(--primary); color: #fff; }

/* рабочие листы: выбор вида */
.ws-type { position: relative; display: block; }
.ws-type input { position: absolute; opacity: 0; }
.ws-type .tile { width: 100%; }
.ws-type input:checked + .tile { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow); }
.ws-type input:focus-visible + .tile { outline: 2px solid var(--primary); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
@keyframes bump { 40% { transform: scale(1.25); } }

/* ───────── адаптив */
@media (max-width: 1080px) {
  .setup { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 90; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(44, 42, 80, .25); }
  .side.is-open { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(46, 42, 82, .45); }
  .side.is-open + .side-scrim { display: block; }
  .round-btn.menu-btn { display: grid; }
  .top-row { padding: 10px 16px; min-height: 60px; }
  .tabs { padding: 0 16px; gap: 22px; }
  .content { padding: 20px 16px 64px; }
  .dock { left: 0; gap: 2px 14px; padding: 8px 10px; }
  .dock a { font-size: 13px; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .account-trigger { min-height: 40px; gap: 4px; padding: 3px 7px 3px 3px; }
  .account-trigger-name { display: none; }
  .top-title h1 { font-size: 19px; }
  .top-title { flex: 1; }
  /* на телефоне кнопки шапки — только иконки (подпись остаётся в разметке для экранного диктора), язык — коротким кодом */
  .top-actions { gap: 6px; flex: none; }
  .top-actions .btn-sm:not(.locale-btn) { width: 36px; padding: 0; gap: 0; justify-content: center; font-size: 0; }
  .locale-btn { padding: 0 10px; }
  .locale-btn svg { display: none; }
  .row-card { flex-wrap: wrap; }
  .row-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
  .grid-tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .q-row { grid-template-columns: 1fr 1fr 36px; }
  .q-row .n, .q-head { display: none; }
  .q-row .dis { grid-column: 1 / 3; }
  .playbar { flex-wrap: wrap; }
  .playbar .spacer { display: none; }
  .playbar .btn { flex: 1; }
  .mat-hero { flex-direction: column; }
  .students { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ───────── настройка инструмента */
.tool-setup { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tool-setup.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
.tool-head { display: flex; gap: 18px; align-items: center; padding: 16px; }
.tool-head img { width: 200px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; flex: none; }
.tool-head h2 { font-size: 22px; color: var(--text-strong); }
.tool-head p { color: var(--muted); margin-top: 4px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.variant { position: relative; display: block; cursor: pointer; }
.variant input { position: absolute; opacity: 0; }
.variant-card { display: block; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: var(--shadow); transition: box-shadow .15s; }
.variant-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--line); }
.variant-card span { display: block; padding: 10px 12px 12px; }
.variant-card b { display: block; font-weight: 600; color: var(--text-strong); }
.variant-card small { color: var(--muted); font-size: 13px; }
.variant input:checked + .variant-card { box-shadow: 0 0 0 2.5px var(--primary), 0 8px 20px -10px rgba(125, 64, 255, .45); }
.variant input:checked + .variant-card b::after { content: ' ✓'; color: var(--primary); }
.variant input:focus-visible + .variant-card { outline: 2px solid var(--primary); outline-offset: 2px; }
.class-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.class-pick label { position: relative; }
.class-pick input { position: absolute; opacity: 0; }
.class-pick span { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); cursor: pointer; font-weight: 600; color: var(--text-strong); }
.class-pick span small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.class-pick span .icon { color: var(--c); }
.class-pick input:checked + span { box-shadow: 0 0 0 2px var(--primary); }
.class-pick button { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1.5px dashed var(--field); background: none; cursor: pointer; font-weight: 600; color: var(--primary); }
.setup-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.boards { display: grid; gap: 0; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.board-row:first-child { border-top: 0; }
.board-row .main { flex: 1; min-width: 0; }
.board-row b { display: block; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row small { color: var(--muted); font-size: 13px; }
.side-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 140px; }
.side-card h3 { font-size: 17px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); color: var(--text-strong); }
.side-card .empty-line { padding: 18px 16px; color: var(--muted); font-size: 14px; }
.time-row { display: flex; align-items: center; gap: 8px; }
.time-row .input { width: 90px; text-align: center; font-size: 18px; font-weight: 600; }
.colors-row { display: flex; gap: 10px; flex-wrap: wrap; }
.colors-row input[type=color] { width: 44px; height: 44px; padding: 0; border: 2px solid var(--line); border-radius: 12px; background: none; cursor: pointer; }
@media (max-width: 1080px) {
  .tool-setup { grid-template-columns: 1fr; }
  .side-card { position: static; }
}
@media (max-width: 640px) {
  .tool-head { flex-direction: column; align-items: stretch; }
  .tool-head img { width: 100%; }
}

/* ───────── готовые материалы: фильтры слева, карточки справа */
.filter-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { position: sticky; top: 96px; display: grid; gap: 14px; }
.filter-block { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 10px; }
.filter-block h4 { margin: 0 6px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filter-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text); }
.filter-item:hover { background: var(--hover); }
.filter-item.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.filter-item span { margin-left: auto; color: var(--faint); font-size: 13px; }
.filter-item .icon { color: var(--muted); }
.filter-item.is-on .icon, .filter-item.is-on span { color: var(--primary); }
.grade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 4px; }
.grade-grid a { height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--hover); font-weight: 600; font-size: 14px; color: var(--text); }
.grade-grid a:hover { background: var(--active); }
.grade-grid a.is-on { background: var(--primary); color: #fff; }
.grade-grid a.wide { grid-column: span 4; }
.mgrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mcard { display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .18s; }
.mcard:hover { box-shadow: var(--shadow-lg); }
.mcard-img { position: relative; aspect-ratio: 4 / 3; background: var(--hover); overflow: hidden; border-bottom: 1px solid var(--line); }
.mcard-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.mcard-ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.badge { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--c); font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(44, 42, 80, .15); }
.mcard-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.mcard-title { font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-sm { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; }
@media (max-width: 900px) {
  .filter-layout { grid-template-columns: 1fr; }
  .filters { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ───────── каталог игр: карточка набора и окно «игра → настройки» */
.set-card { position: relative; cursor: pointer; }
.set-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.play-fab { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(125, 64, 255, .45); opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.set-card:hover .play-fab, .set-card:focus-visible .play-fab { opacity: 1; transform: none; }
.set-menu { position: absolute; top: 8px; right: 8px; }
.set-menu > .btn-icon { background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: 0 2px 8px rgba(44, 42, 80, .15); }
.modal-play { width: min(920px, 100%); }
.modal-play .modal-head small { display: block; font-size: 13px; }
.pm-back { margin-left: 0 !important; }
.pm-groups { position: sticky; top: -1px; z-index: 2; margin: -4px 0 14px; padding: 4px 0 10px; background: #fff; }
.pm-groups .chip[hidden] { display: none; }
@media (max-width: 760px) {
  .pm-groups { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
  .pm-groups .chip { flex: none; }
}
.pm-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-bottom: 24px; }
.pm-game { display: grid; gap: 2px; padding: 0 0 12px; border: 0; border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: left; cursor: pointer; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.pm-game:hover { box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg); transform: translateY(-2px); }
.pm-game img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; margin-bottom: 8px; }
.pm-game b { padding: 0 12px; font-weight: 600; color: var(--text-strong); }
.pm-game small { padding: 0 12px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.pm-settings { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.pm-hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; display: block; }
.pm-hero ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.pm-fields .opt { padding: 10px 0; }
.pm-more { margin-top: 6px; border-top: 1px solid var(--line); }
.pm-more > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 12px 0; cursor: pointer; font-weight: 600; color: var(--primary); }
.pm-more > summary::-webkit-details-marker { display: none; }
.pm-more[open] > summary .icon { transform: rotate(180deg); }
.pm-more .teams { margin: 0 0 8px; }
.pm-students { padding: 10px 0 4px; border-top: 1px solid var(--hover); }
@media (max-width: 860px) {
  .pm-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-settings { grid-template-columns: 1fr; }
  .pm-hero { display: none; }
}
.grade-mark { position: absolute; right: 10px; bottom: 10px; min-width: 64px; padding: 6px 12px; border-radius: 14px; background: var(--primary); color: #fff; font-size: 26px; font-weight: 700; line-height: 1; text-align: center; box-shadow: 0 6px 16px rgba(125, 64, 255, .4); }
.grade-mark small { display: block; font-size: 11px; font-weight: 600; opacity: .85; margin-top: 2px; }

/* ───────── админка: таблицы игр и наборов, форма игры */
.adm-table td { vertical-align: middle; }
.adm-table tr.is-off td { opacity: .55; }
.adm-table small { display: block; font-size: 12px; }
.adm-cover { width: 72px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; display: block; background: var(--hover); }
.adm-title { font-weight: 600; color: var(--text-strong); }
.adm-title:hover { color: var(--primary); }
.adm-actions { white-space: nowrap; text-align: right; }
.adm-actions form { display: inline; }
.adm-form { display: grid; gap: 18px; }
.adm-card { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 22px; }
.adm-stack { grid-template-columns: 1fr; }
.adm-cover-edit { display: grid; gap: 12px; align-content: start; }
.adm-cover-edit img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: var(--hover); }
.adm-fields { display: grid; gap: 16px; }
.adm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.adm-check { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--hover); font-weight: 600; cursor: pointer; }
.adm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; min-height: 160px; }
@media (max-width: 760px) {
  .adm-card { grid-template-columns: 1fr; }
}

/* ───────── админка «Курсы»: предупреждения, слова урока */
.adm-warn { color: #c2410c; font-weight: 600; }
.adm-notes p { margin: 0; }
.adm-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--hover); display: block; }
.adm-cmd { display: block; padding: 12px 14px; border-radius: 12px; background: var(--hover); font-size: 13px; overflow-x: auto; white-space: nowrap; }
.adm-arrow { font-weight: 700; font-size: 16px; line-height: 1; }
.adm-actions .btn-icon:disabled { opacity: .3; cursor: default; }
.adm-words td { padding: 6px 8px; }
.adm-words .input { height: 38px; min-width: 110px; border-width: 1.5px; border-radius: 10px; }

/* галочка «Опубликовано» в таблицах админки */
.adm-publish label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.adm-publish input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.adm-publish input:not(:checked) + span { color: var(--muted); }

/* своя игра в каталоге: галочка «Опубликовано» */
.set-publish { margin-top: 8px; }
.set-publish label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.set-publish input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.set-publish input:checked + span { color: var(--green); }

/* страница класса: «Использовать класс» и список учеников (без баллов) */
.class-use { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.class-use-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; color: var(--text-strong); transition: box-shadow .15s, transform .15s; }
.class-use-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.class-list { padding: 6px 0; }
.class-row { display: flex; align-items: center; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.class-row:last-child { border-bottom: 0; }
.class-row b { font-weight: 600; color: var(--text-strong); }
.class-row .spacer { flex: 1; }
.class-row form { display: inline; }
.class-num { width: 24px; text-align: right; font-size: 13px; }

/* окно выбора: строка «Буква» у упражнений уроков на любых словах */
.pm-letters { flex-wrap: wrap; border-radius: 18px; }

/* админка «Пользователи»: только что выданный пароль */
.us-new { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.us-new dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 6px; }
.us-new dt { color: var(--muted); font-weight: 600; }
.us-new dd { margin: 0; font-weight: 700; color: var(--text-strong); }
.us-new .us-pass { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .08em; }
.us-role .select-sm { height: 34px; padding: 0 30px 0 10px; border-radius: 10px; font-size: 14px; background-position: right 10px center; }
.us-phone { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.us-phone .btn-icon { width: 30px; height: 30px; color: var(--muted); }

/* «Карточки»: обложка темы 3:2 — целиком, без обрезки */
.cd-themes .mcard-img { aspect-ratio: 3 / 2; }
.cd-cover img { object-position: center; }
