/* Game OS — оболочка */
[hidden] { display: none !important; }

:root {
  --icon: 62px;
  --label: 12px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --ink: #1d1640;
  --ink-2: #5b5480;
  --muted: #8a84a8;
  --line: #ece8f8;
  --soft: #f3f0ff;
  --accent: #6a4cff;
  --accent-ink: #4a33c9;
  --danger: #d6264a;
  --glass: rgba(255,255,255,.18);
  --glass-strong: rgba(255,255,255,.26);
  --radius: 14px;
  --ease: cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 600px) and (min-height: 500px) { :root { --icon: 76px; --label: 13px; } }
@media (min-width: 1000px) and (min-height: 700px) { :root { --icon: 88px; --label: 14px; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: #2a1d6e; color: #fff;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input { -webkit-user-select: text; user-select: text; }
:focus-visible { outline: 3px solid rgba(255,255,255,.7); outline-offset: 2px; }
.sheet :focus-visible, .lock-card :focus-visible, .icon-menu :focus-visible { outline-color: rgba(106,76,255,.55); }

/* иконки интерфейса */
.i { width: 1.25em; height: 1.25em; flex: none; display: block; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* ================= рабочий стол ================= */
.os {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--st) + 8px) var(--sr) calc(var(--sb) + 10px) var(--sl);
  background:
    radial-gradient(60vmax 60vmax at 8% -5%, #ff7ac8 0%, transparent 60%),
    radial-gradient(55vmax 55vmax at 105% 30%, #5ec8ff 0%, transparent 60%),
    radial-gradient(70vmax 50vmax at 50% 115%, #ffcf5c 0%, transparent 62%),
    linear-gradient(165deg, #5a3fd1, #24185f);
}

/* шапка: профиль | название экрана | установка, настройки */
.topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
  height: 44px; padding: 0 14px;
}
.side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.side.right { justify-content: flex-end; }
.page-title { font-weight: 800; font-size: 15px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; text-align: center; }

.round {
  width: 40px; height: 40px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; background: var(--glass); color: #fff;
  transition: background .15s, transform .15s;
}
.round .i { width: 20px; height: 20px; }
@media (hover: hover) { .round:hover, .pill:hover, .profile-btn:hover { background: var(--glass-strong); } }
.round:active { transform: scale(.94); }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 20px; background: var(--glass);
  font-size: 14px; font-weight: 700; white-space: nowrap; transition: background .15s;
}
.pill .i { width: 18px; height: 18px; }
/* «Установить»: на телефоне — круглая кнопка-иконка, на широком экране — с подписью */
.install-btn { padding: 0; width: 40px; }
.install-btn .wide { display: none; }
@media (min-width: 640px) { .install-btn { width: auto; padding: 0 16px 0 12px; } .install-btn .wide { display: inline; } }

.profile-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; max-width: 100%;
  padding: 0 14px 0 2px; border-radius: 20px; background: var(--glass); transition: background .15s;
}
.profile-btn .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; flex: none; }
.profile-btn .pname { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 359px) { .profile-btn { padding-right: 2px; } .profile-btn .pname { display: none; } }

/* кнопки «удерживай» (настройки, выход из игры) */
.holdable { touch-action: none; }
.hold-ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); pointer-events: none; }
.hold-ring circle { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 107; stroke-dashoffset: 107; stroke-linecap: round; }
.holdable.holding .hold-ring circle { transition: stroke-dashoffset var(--hold) linear; stroke-dashoffset: 0; }
.holdable.holding { transform: scale(1.08); transition: transform var(--hold); }
.holdable::after {
  content: attr(data-hint); position: absolute; top: calc(100% + 10px); right: 0; z-index: 5;
  padding: 7px 11px; border-radius: 10px; background: rgba(20,12,50,.85); color: #fff;
  font-size: 13px; font-weight: 700; white-space: nowrap; opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.home-btn.holdable::after { left: 0; right: auto; }
.holdable.hint::after { opacity: 1; transform: none; }

.empty-home { margin: auto; text-align: center; padding: 20px; max-width: 320px; }
.empty-home p { opacity: .85; margin: 6px 0 0; }
.empty-hero, .picker-hero, .lock-hero { display: flex; justify-content: center; }
.picker-hero { margin-bottom: 4px; }
.lock-hero { margin-top: -8px; }

/* страницы */
.pages {
  flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pages::-webkit-scrollbar { display: none; }
.pages.dragging { scroll-snap-type: none; cursor: grabbing; }
.page { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; overflow-x: hidden; padding: 18px 16px 8px; display: flex; justify-content: center; }
.grid {
  width: min(100%, 980px); display: grid; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--icon) + 18px), 1fr));
  gap: 22px 6px;
}

/* иконка игры */
.app { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding-top: 4px; }
.tile {
  width: var(--icon); height: var(--icon); border-radius: 24%; flex: none;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 6px 14px rgba(20,10,60,.28), inset 0 -4px 0 rgba(0,0,0,.1), inset 0 3px 0 rgba(255,255,255,.25);
  transition: transform .18s cubic-bezier(.3,1.6,.5,1);
}
.tile .glyph { font-size: calc(var(--icon) * .52); line-height: 1; max-width: 86%; overflow: hidden; white-space: nowrap; text-align: center; }
.tile img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; pointer-events: none; display: block; }
.app.pressed .tile { transform: scale(.9); }
.app:focus-visible { outline: none; }
.app:focus-visible .tile { outline: 3px solid #fff; outline-offset: 3px; }
@media (hover: hover) { .app:hover .tile { transform: translateY(-3px); } }
.label { font-size: var(--label); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* избранное — звёздочка в углу */
.fav-badge {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center; background: #ffd23f; color: #8a5200;
  box-shadow: 0 2px 6px rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.9);
}
.fav-badge .i { width: 14px; height: 14px; }
.app.fav .fav-badge { display: grid; }
.dock .fav-badge { display: none !important; }

/* новая игра — пульсирующая точка, понятна и тем, кто не читает */
.app.new .tile::before {
  content: ""; position: absolute; top: -5px; left: -5px; z-index: 1; width: 16px; height: 16px; border-radius: 50%;
  background: #ff3b7a; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.3); animation: newPulse 1.8s ease-in-out infinite;
}
@keyframes newPulse { 50% { transform: scale(1.25); } }

/* папка */
.folder-tile { background: rgba(255,255,255,.28) !important; display: grid; grid-template-columns: 1fr 1fr; gap: 8%; padding: 13%; place-items: stretch; }
.folder-tile .mini { border-radius: 28%; display: grid; place-items: center; overflow: hidden; font-size: calc(var(--icon) * .18); line-height: 1; background-size: cover; background-position: center; }

/* низ: точки, поиск, док */
.home-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 12px 0; }
.dots { display: flex; gap: 8px; min-height: 8px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.4); transition: width .2s, background .2s; }
.dot.on { background: #fff; width: 22px; }
.search-pill { height: 36px; padding: 0 16px 0 12px; font-size: 14px; }
.search-pill .i { width: 16px; height: 16px; }
.dock {
  display: flex; gap: 18px; align-items: center; justify-content: center;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
  min-height: calc(var(--icon) + 24px); padding: 12px 20px; border-radius: 30px;
  background: rgba(255,255,255,.2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.dock::-webkit-scrollbar { display: none; }
.dock .app { padding-top: 0; }
.dock .label { display: none; }
.dock-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .9; text-align: left; max-width: 300px; }
.dock-hint .i { width: 18px; height: 18px; color: #ffd23f; }

/* ================= окно игры ================= */
.game { position: fixed; inset: 0; z-index: 10; background: #000; overflow: hidden; }
.game iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.splash { position: absolute; inset: 0; display: grid; place-items: center; background: #24185f; transition: opacity .35s; }
.splash.gone { opacity: 0; pointer-events: none; }
.splash .tile { --icon: 120px; animation: breathe 1.2s ease-in-out infinite; }
.home-btn {
  position: absolute; z-index: 2; top: calc(var(--st) + 12px); left: calc(var(--sl) + 12px);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.32); color: #fff; opacity: .75;
}
.home-btn .i { width: 22px; height: 22px; }

/* ================= перерыв для глаз ================= */
.eyebreak {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4vmin; padding: 20px; background: rgba(14,10,46,.92); animation: fadeIn .6s;
}
.eb-head { display: flex; align-items: center; justify-content: center; gap: 2vmin; }
.eb-hero { width: min(18vmin, 96px); flex: none; }
.eb-hero svg { width: 100%; height: auto; }
.eb-title { font-size: clamp(22px, 5vmin, 40px); font-weight: 900; text-align: center; }
.eyes { display: flex; gap: 6vmin; --x: 0; --y: 0; }
.eye {
  width: min(30vmin, 200px); aspect-ratio: 1; border-radius: 50%; background: #fff; position: relative; overflow: hidden;
  box-shadow: 0 0 0 6px rgba(255,255,255,.15), 0 10px 40px rgba(0,0,0,.4);
}
.pupil {
  position: absolute; width: 44%; height: 44%; left: 28%; top: 28%; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 10%, transparent 11%), radial-gradient(circle, #1a1030 0 40%, #3a7bff 42% 100%);
  transform: translate(calc(var(--x) * 58%), calc(var(--y) * 58%));
  transition: transform .45s cubic-bezier(.4,1.4,.6,1);
}
.lid { position: absolute; inset: -2px; background: #7b5cff; transform-origin: 50% 0; transform: scaleY(0); animation: blink 4s infinite; }
.eyes.blinking .lid { animation: blinkFast .45s infinite; }
.eyes.closed .lid { animation: none; transform: scaleY(1); transition: transform .5s; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(0); } 96% { transform: scaleY(1); } }
@keyframes blinkFast { 0%, 100% { transform: scaleY(0); } 50% { transform: scaleY(1); } }
.eb-hint { font-size: clamp(18px, 4.2vmin, 32px); font-weight: 800; color: #ffd23f; min-height: 1.4em; text-align: center; }
.eb-timer { position: relative; width: 84px; height: 84px; }
.eb-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.eb-timer circle { fill: none; stroke-width: 8; }
.eb-timer .track { stroke: rgba(255,255,255,.15); }
.eb-timer .bar { stroke: #7ae582; stroke-linecap: round; stroke-dasharray: 276.5; transition: stroke-dashoffset .25s linear; }
.eb-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 900; }

/* 3-2-1 */
.countdown { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.35); }
.countdown span { font-size: min(40vmin, 260px); font-weight: 900; text-shadow: 0 8px 30px rgba(0,0,0,.45); animation: pop 1s ease-out both; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.12); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }

/* ================= шторки (белые карточки) ================= */
.scrim { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(10,6,30,.5); animation: fadeIn .2s; }
.sheet {
  width: min(100%, 520px); max-height: 92%; overflow: auto; background: #fff; color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(var(--sb) + 20px); animation: up .3s var(--ease);
}
@media (min-width: 600px) and (min-height: 500px) { .scrim { align-items: center; padding: 20px; } .sheet { border-radius: 24px; } }
.sheet h2 { margin: 4px 0 6px; font-size: 21px; line-height: 1.25; }
.sheet p { margin: 6px 0; color: var(--ink-2); }
.sheet-icon { display: flex; justify-content: center; margin-bottom: 10px; }
.sheet-icon .tile { --icon: 72px; }
.steps { margin: 14px 0 6px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.steps li::before { content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-weight: 900; }
.steps .i { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; color: #0a84ff; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 800; margin-top: 10px; padding: 0 16px;
  transition: filter .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
@media (hover: hover) { .btn:hover { filter: brightness(1.06); } }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--soft); color: var(--accent-ink); }
.btn.danger-text { background: #ffe8ec; color: var(--danger); }
.btn .i { width: 18px; height: 18px; }
.link { color: var(--accent); font-weight: 700; padding: 10px; display: inline-flex; align-items: center; gap: 6px; }
.link .i { width: 16px; height: 16px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row > span { flex: 1; min-width: 0; }
.row b { font-weight: 700; color: var(--accent-ink); text-align: right; overflow-wrap: anywhere; max-width: 62%; }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
select { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid #dcd6ee; background: #fff; color: var(--ink); max-width: 55%; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.field { width: 100%; height: 46px; border: 1px solid #dcd6ee; border-radius: 12px; padding: 0 14px; background: #fff; color: var(--ink); font-size: 16px; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106,76,255,.15); }
.note { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.err { color: var(--danger) !important; }

/* ================= поиск ================= */
.search {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  padding: calc(var(--st) + 12px) 16px 0;
  background: rgba(24,14,70,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fadeIn .2s;
}
.search-bar { display: flex; align-items: center; gap: 12px; width: min(100%, 980px); margin: 0 auto; flex: none; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; opacity: .7; pointer-events: none; }
.search-field input {
  width: 100%; height: 46px; border: 0; border-radius: 14px; padding: 0 14px 0 42px;
  background: rgba(255,255,255,.16); color: #fff; font-size: 17px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field input:focus { background: rgba(255,255,255,.22); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.search-field input::placeholder { color: rgba(255,255,255,.6); }
.search-done { height: 46px; padding: 0 6px; font-weight: 700; font-size: 16px; color: #fff; flex: none; }
.search-results { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -16px; padding: 16px 16px calc(var(--sb) + 20px); }
.search-results .grid { margin: 0 auto; }
.search .empty { grid-column: 1 / -1; text-align: center; opacity: .75; margin-top: 32px; }

/* меню игры (долгое нажатие) */
.menu-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(10,6,30,.3); animation: fadeIn .15s; }
.icon-menu {
  position: fixed; width: 240px; overflow: hidden; border-radius: 16px; color: var(--ink);
  background: rgba(255,255,255,.98); box-shadow: 0 14px 40px rgba(0,0,0,.35); animation: up .18s var(--ease);
}
.icon-menu .mt { padding: 12px 16px 10px; font-weight: 800; color: var(--ink-2); font-size: 13px; }
.icon-menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 16px; border-top: 1px solid var(--line); font-weight: 700; }
.icon-menu button .i { width: 20px; height: 20px; color: var(--accent); }
@media (hover: hover) { .icon-menu button:hover { background: var(--soft); } }

/* папка открыта */
.folder-scrim { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(20,12,60,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fadeIn .2s; }
.folder-panel { width: min(100%, 520px); max-height: 100%; overflow-y: auto; padding: 20px 16px 24px; border-radius: 30px; background: rgba(255,255,255,.2); animation: up .25s var(--ease); }
.folder-title { text-align: center; font-size: 22px; font-weight: 900; margin-bottom: 18px; }
.folder-panel .grid { width: 100%; }

/* тост */
.toast {
  position: fixed; z-index: 45; left: 50%; top: calc(var(--st) + 60px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 16px; background: #fff; color: var(--ink);
  font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast .i { width: 20px; height: 20px; color: #ff3b7a; }
.toast.show { animation: toastIn .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes toastIn { from { transform: translate(-50%, -30px) scale(.8); opacity: 0; } }

/* «Кто играет?» */
.picker-scrim { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: rgba(24,14,70,.94); animation: fadeIn .2s; }
.picker { text-align: center; width: min(100%, 720px); }
.picker h1 { font-size: clamp(26px, 6vmin, 40px); margin: 0 0 28px; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-bottom: 32px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 10px; width: clamp(96px, 24vmin, 140px); }
.who-av { display: grid; place-items: center; border-radius: 50%; width: clamp(84px, 22vmin, 130px); height: clamp(84px, 22vmin, 130px); font-size: clamp(46px, 12vmin, 72px); box-shadow: 0 8px 24px rgba(0,0,0,.3); transition: transform .15s; }
.who.cur .who-av { box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(0,0,0,.3); }
.who:active .who-av { transform: scale(.92); }
.who-name { font-weight: 800; font-size: 17px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-who { margin: 0 auto; }

/* ================= PIN ================= */
.pin { text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); transition: background .1s; }
.pin-dots i.on { background: var(--accent); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-6px); } }
.pin-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; margin-bottom: 8px; }
.pin-keys button { height: 72px; border-radius: 50%; background: var(--soft); color: var(--ink); font-size: 26px; font-weight: 700; display: grid; place-items: center; }
.pin-keys button .i { width: 26px; height: 26px; }
.pin-keys button:active { background: #ddd3ff; }
.math { font-size: 30px; font-weight: 900; text-align: center; color: var(--ink) !important; }

/* ================= режим родителя ================= */
.admin-scrim { align-items: stretch; }
.sheet.admin { width: min(100%, 640px); max-height: none; height: 100%; border-radius: 0; padding-top: calc(var(--st) + 16px); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 600px) and (min-height: 500px) { .admin-scrim { align-items: center; } .sheet.admin { height: min(92%, 860px); border-radius: 24px; } }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-head h2 { margin: 0; }
.admin-head .pill { height: 36px; }
.pill.dark { background: var(--ink); color: #fff; }
.pill.light { background: var(--soft); color: var(--accent-ink); height: 34px; padding: 0 14px; font-size: 13px; }
.pill.light.danger { background: #ffe8ec; color: var(--danger); }
.tabs { display: flex; gap: 4px; margin: 14px 0 6px; padding: 4px; background: var(--soft); border-radius: 14px; flex: none; }
.tabs button { flex: 1; min-width: 0; height: 38px; border-radius: 10px; font-weight: 700; color: #6b6390; font-size: clamp(12px, 3.6vw, 15px); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(60,40,140,.15); }
.admin-body { flex: 1; overflow-y: auto; padding: 4px 8px 24px 2px; margin-right: -8px; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.admin-body h3 { margin: 24px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.note.top { margin: 8px 0 12px; }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: #d9d4ea; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }

.plist { display: flex; flex-direction: column; gap: 12px; }
.pcard { display: grid; grid-template-columns: 56px 1fr; gap: 10px 12px; align-items: center; padding: 12px; border-radius: 18px; background: #f7f5ff; }
.pav { width: 56px; height: 56px; border-radius: 50%; font-size: 32px; grid-row: span 2; display: grid; place-items: center; }
.pbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.avatars { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.avatars [data-av] { width: 44px; height: 44px; font-size: 26px; border-radius: 12px; background: #fff; }
.colors { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }

.acc-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.acc-head b { display: block; font-size: 18px; }
.acc-head span:not(.pav) { color: var(--muted); font-size: 13px; }
.pav.sm { width: 44px; height: 44px; font-size: 24px; grid-row: auto; flex: none; }
.acc-actions { margin: 10px 0; }
.acc-group { border-radius: 16px; background: #f7f5ff; padding: 6px 12px; margin-bottom: 10px; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.acc-children { padding-left: 22px; border-left: 2px solid #e4def9; margin-left: 11px; transition: opacity .2s; }
.acc-children.off { opacity: .35; pointer-events: none; }
.acc-ic { width: 26px; height: 26px; display: grid; place-items: center; font-size: 20px; flex: none; color: var(--accent); }
.acc-ic img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.acc-ic .i { width: 20px; height: 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.chip { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--soft); color: var(--accent-ink); font-weight: 700; }
.chip.on { background: var(--accent); color: #fff; }
.big-total { font-size: 34px; font-weight: 900; margin: 18px 0 6px; }
.big-total small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.days { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: 6px; }
.day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.day i { width: 100%; max-width: 32px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.day span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar-row { display: grid; grid-template-columns: 26px minmax(60px, 110px) 1fr auto; align-items: center; gap: 10px; padding: 8px 0; }
.bar-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #8f5cff, #ff5d8f); }
.bar-row b { font-size: 13px; color: var(--accent-ink); white-space: nowrap; }

/* ================= лицензия ================= */
.lock { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: calc(var(--st) + 20px) 20px calc(var(--sb) + 20px); overflow-y: auto;
  background: radial-gradient(60vmax 60vmax at 10% 0%, #ff7ac8 0%, transparent 60%), radial-gradient(55vmax 55vmax at 100% 40%, #5ec8ff 0%, transparent 60%), linear-gradient(165deg, #5a3fd1, #24185f); }
.lock-card { width: min(100%, 420px); background: #fff; color: var(--ink); border-radius: 26px; padding: 28px 22px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: up .35s var(--ease); }
.lock-card h1 { font-size: 24px; margin: 14px 0 6px; }
.lock-card p { color: var(--ink-2); margin: 0 0 14px; }
.lock-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.lock-form .tabs { margin: 4px 0 6px; }
.lock-form .btn { margin-top: 4px; }
.lock-err { color: var(--danger) !important; font-weight: 700; min-height: 1.2em; margin: 10px 0 0 !important; }
.devs .row small { color: var(--muted); font-weight: 500; }
code { font-size: 12px; background: var(--soft); padding: 2px 5px; border-radius: 6px; word-break: break-all; }

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