:root {
  --ink: #021C1E;
  --ink-2: #06292B;
  --ink-3: #004445;
  --white: #FFFFFF;
  --leaf: #2C7873;
  --leaf-dark: #236360;
  --sprout: #6FB98F;
  --bg: #F0F6F4;
  --card: #FFFFFF;
  --line: #DCE9E5;
  --text: #021C1E;
  --muted: #5D7A76;
  --soft: #E4F1EC;
  --danger: #B3402F;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(2, 28, 30, .04), 0 6px 20px rgba(2, 28, 30, .05);
  --ease: cubic-bezier(.3, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app { display: grid; grid-template-columns: 272px 1fr; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ink);
  color: #D3E8E1;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 10px 22px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 12px; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .2px; color: var(--white); line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: #7FA69B; }

.team {
  margin: 0 0 18px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--ink-2); display: flex; align-items: center; gap: 10px;
}
.team-ava { width: 30px; height: 30px; border-radius: 9px; background: var(--ink-3); color: var(--sprout); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.team-name { font-size: 13.5px; color: var(--white); font-weight: 600; line-height: 1.2; }
.team-role { font-size: 11.5px; color: #7FA69B; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: #5E877B; padding: 14px 12px 6px; }
.nav-label:first-child { padding-top: 0; }

.nav-item, .nav-group-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border-radius: var(--r-md);
  color: #B5D2C9; font-weight: 500; text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease);
  text-decoration: none; position: relative;
}
.nav-item:hover, .nav-group-head:hover { background: var(--ink-2); color: var(--white); }
.nav-item.active { background: var(--ink-3); color: var(--white); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sprout);
}
.nav-item.active svg.i { color: var(--sprout); }
.nav-group.has-active > .nav-group-head { color: var(--white); }
.nav-group.has-active > .nav-group-head svg.i:first-child { color: var(--sprout); }
.nav-group-head .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .25s var(--ease); opacity: .7; }
.nav-group.open > .nav-group-head .chev { transform: rotate(180deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease); }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { overflow: hidden; display: flex; flex-direction: column; gap: 2px; margin-left: 21px; padding-left: 14px; border-left: 1px solid var(--ink-3); }
.nav-group.open .nav-sub-inner { margin-top: 3px; margin-bottom: 4px; }
.nav-sub .nav-item { padding: 8px 12px; font-size: 13.5px; font-weight: 450; }
.nav-sub .nav-item.active::before { left: -15px; top: 9px; bottom: 9px; width: 3px; }

.me { margin-top: 14px; padding: 12px; border-radius: var(--r-md); background: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.me-ava { width: 32px; height: 32px; border-radius: 50%; background: var(--leaf); color: var(--white); display: grid; place-items: center; font-weight: 600; }
.me-name { color: var(--white); font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.me-mail { font-size: 11.5px; color: #7FA69B; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 68px; padding: 0 36px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(240, 246, 244, .85); backdrop-filter: blur(8px); flex: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs svg.i { width: 14px; height: 14px; opacity: .6; }
.topbar .spacer { flex: 1; }
.balance { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.balance span { color: var(--leaf); }

.content { flex: 1; overflow-y: auto; padding: 32px 36px 56px; }
.page { max-width: 1180px; margin: 0 auto; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }
.page-head .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: var(--r-md); font-weight: 600; white-space: nowrap;
  transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--leaf); color: var(--white); box-shadow: 0 4px 14px rgba(44, 120, 115, .28); }
.btn-primary:hover { background: var(--leaf-dark); }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { background: #D6EAE2; }
.btn-ghost { background: var(--card); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #C2D9D2; }
.btn-danger { color: var(--danger); background: #F8E9E5; }
.btn svg.i { width: 17px; height: 17px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-title { font-size: 15.5px; font-weight: 650; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { padding: 20px 22px; }
.stat-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); color: var(--leaf); display: grid; place-items: center; }
.stat-val { font-size: 30px; font-weight: 700; margin-top: 14px; letter-spacing: -.5px; }
.stat-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 18px; }
.funnel-step { background: var(--soft); border-radius: var(--r-md); padding: 14px; }
.funnel-step small { color: var(--muted); display: block; margin-bottom: 4px; }
.funnel-step b { font-size: 20px; }
.funnel-step i { display: block; margin-top: 10px; height: 5px; border-radius: 5px; background: #CFE3DB; position: relative; overflow: hidden; }

.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg); text-decoration: none; color: inherit; transition: background .18s; }
.step:hover { background: var(--soft); }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 650; color: var(--leaf); font-size: 13px; }
.step-t { font-weight: 600; }
.step-d { color: var(--muted); font-size: 12.5px; }
.step svg.i { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }

/* ---------- Toolbar & table ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 0 0 230px; }
.search svg.i { position: absolute; left: 13px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.input, .textarea {
  width: 100%; height: 40px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search .input { padding-left: 38px; }
.textarea { height: 96px; padding: 10px 14px; resize: vertical; }
.input:focus, .textarea:focus, .select.open .select-btn { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(44, 120, 115, .14); }
.input::placeholder, .textarea::placeholder { color: #98B3AC; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 22px; background: #F7FBF9; border-bottom: 1px solid var(--line); }
th:first-child { border-top-left-radius: 0; }
td { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
.empty { padding: 56px 24px 60px; text-align: center; }
.empty-ico { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; background: var(--soft); color: var(--leaf); display: grid; place-items: center; }
.empty-ico svg.i { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); margin: 4px auto 18px; max-width: 420px; }
.table-foot { display: flex; align-items: center; padding: 14px 22px; color: var(--muted); font-size: 13px; }
.table-foot .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: var(--r-md); margin-bottom: 20px; }
.tab { height: 34px; padding: 0 16px; border-radius: 9px; color: var(--muted); font-weight: 550; transition: all .18s var(--ease); }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(2, 28, 30, .1); }

/* ---------- Form blocks (accordion) ---------- */
.form { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.acc { overflow: hidden; margin-bottom: 14px; }
.acc-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 22px; text-align: left; }
.acc-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--soft); color: var(--leaf); display: grid; place-items: center; }
.acc-head .chev { margin-left: auto; transition: transform .25s var(--ease); color: var(--muted); }
.acc.open .acc-head .chev { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.acc-fields { padding: 4px 22px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12.5px; }

.preview { position: sticky; top: 0; padding: 18px; }
.phone { margin: 14px auto 0; width: 220px; height: 440px; border-radius: 34px; background: var(--ink); padding: 10px; }
.phone-screen { height: 100%; border-radius: 26px; background: linear-gradient(180deg, #004445, #021C1E); display: grid; place-items: center; color: #7FA69B; text-align: center; padding: 18px; font-size: 12.5px; }
.phone-screen b { display: block; color: var(--sprout); font-size: 14px; margin-top: 10px; }
.save-bar { display: flex; gap: 10px; margin-top: 6px; }

/* ---------- Custom select ---------- */
.select { position: relative; }
.select-btn { width: 100%; height: 40px; padding: 0 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; text-align: left; transition: border-color .18s, box-shadow .18s; }
.select-btn:hover { border-color: #C2D9D2; }
.select-btn .val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn .val.ph { color: #98B3AC; }
.select-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.select.open .select-btn .chev { transform: rotate(180deg); }
.select-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(2, 28, 30, .14); padding: 6px; display: none; max-height: 260px; overflow-y: auto; }
.select.open .select-menu { display: block; animation: rise .18s var(--ease); }
.opt { display: flex; align-items: center; padding: 9px 10px; border-radius: 8px; width: 100%; text-align: left; gap: 8px; }
.opt:hover { background: var(--soft); }
.opt.sel { background: var(--soft); font-weight: 600; }
.opt.sel::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); }

/* ---------- Toggle ---------- */
.switch { display: flex; align-items: center; gap: 12px; }
.sw { width: 42px; height: 24px; border-radius: 999px; background: #C9DCD6; position: relative; transition: background .2s var(--ease); flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.sw.on { background: var(--leaf); }
.sw.on::after { transform: translateX(18px); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding: 22px; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--ink); color: #D3E8E1; padding: 16px 18px; border-radius: var(--r-md); font-size: 12.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.code .k { color: var(--sprout); }

.toast { position: fixed; right: 28px; bottom: 28px; background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .25s var(--ease); }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) { .form, .two { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } .funnel { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Лендинги: список, формы, модалка ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { background: #DDF3E8; color: #1F7A4F; }
.badge.stopped { background: #F8E9E5; color: var(--danger); }
.chip { display: inline-block; padding: 2px 8px; margin-right: 4px; border-radius: 6px; background: var(--soft); font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--leaf); }
.row-name { font-weight: 600; color: var(--text); text-decoration: none; }
.row-name:hover { color: var(--leaf); }
.row-sub { color: var(--muted); font-size: 12.5px; }
tbody tr:hover td { background: #FAFDFC; }
tbody tr:last-child td { border-bottom: 0; }
.ibtn { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--muted); transition: background .15s, color .15s; }
.ibtn:hover { background: var(--soft); color: var(--text); }
.ibtn.danger:hover { background: #F8E9E5; color: var(--danger); }
.actions { text-align: right; white-space: nowrap; }
.chk { appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #B9D1CA; background: var(--card); cursor: pointer; display: grid; place-items: center; transition: all .15s; vertical-align: middle; }
.chk:checked { background: var(--leaf); border-color: var(--leaf); }
.chk:checked::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.bulk { display: none; align-items: center; gap: 10px; color: var(--muted); }
.bulk.show { display: flex; }

.lang-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 22px 4px; }
.lang-tab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--soft); font-weight: 600; font-size: 13px; transition: all .15s; }
.lang-tab.active { background: var(--leaf); color: #fff; }
.lang-tab .x { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; opacity: .7; }
.lang-tab .x:hover { opacity: 1; background: rgba(0,0,0,.15); }
.lang-tab .x svg.i { width: 11px; height: 11px; }
.lang-add { width: 200px; }
.lang-hint { padding: 6px 22px 0; color: var(--muted); font-size: 12.5px; }

.pv { height: 100%; border-radius: 26px; background: linear-gradient(180deg, #06292B, #021C1E); padding: 22px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; overflow: hidden; }
.pv-game { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sprout); }
.pv-title { font-size: 17px; font-weight: 700; margin-top: 10px; line-height: 1.25; word-break: break-word; }
.pv-sub { font-size: 12px; color: #A9CBC2; margin-top: 6px; word-break: break-word; }
.pv-art { flex: 1; width: 100%; margin: 14px 0; border-radius: 16px; border: 1.5px dashed #2C7873; display: grid; place-items: center; color: #5E877B; font-size: 12px; }
.pv-btn { width: 100%; height: 40px; border-radius: 12px; background: var(--sprout); color: #021C1E; font-weight: 700; display: grid; place-items: center; font-size: 14px; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.game { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.game-art { height: 120px; border-radius: var(--r-md); background: linear-gradient(135deg, #06292B, #004445); display: grid; place-items: center; color: var(--sprout); }
.game-art svg.i { width: 40px; height: 40px; stroke-width: 1.3; }
.game-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }

.overlay { position: fixed; inset: 0; background: rgba(2, 28, 30, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 400px; max-width: calc(100vw - 32px); background: var(--card); border-radius: var(--r-lg); padding: 26px; box-shadow: 0 24px 60px rgba(2, 28, 30, .35); animation: rise .2s var(--ease); }
.modal h3 { font-size: 17px; }
.modal p { color: var(--muted); margin: 8px 0 22px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.err { color: var(--danger); font-size: 12.5px; }

/* ---------- Телефон ---------- */
.preview { padding: 18px 10px 22px; }
.preview .card-title, .preview .card-sub { padding: 0 8px; }
.phone { margin: 16px auto 0; width: 290px; height: 600px; border-radius: 46px; background: #0b0f10; padding: 10px; box-shadow: 0 0 0 2px #2a3436, 0 24px 50px rgba(2,28,30,.35), inset 0 0 0 2px #1a2224; position: relative; }
.phone::before, .phone::after { content: ''; position: absolute; width: 3px; background: #2a3436; border-radius: 2px; }
.phone::before { left: -3px; top: 110px; height: 52px; }
.phone::after { right: -3px; top: 140px; height: 76px; }
.phone-screen { height: 100%; border-radius: 37px; overflow: hidden; background: #021C1E; display: block; padding: 0; position: relative; }
.pw { height: 100%; position: relative; display: flex; flex-direction: column; color: #fff; background: radial-gradient(120% 70% at 50% 0%, #0B5A58 0%, #06292B 55%, #021C1E 100%); user-select: none; }


.pw-icons { display: flex; align-items: center; gap: 4px; }
.pw-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 18px 22px; min-height: 0; }
.pw-title { font-size: 20px; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,.4); word-break: break-word; }
.pw-sub { font-size: 12.5px; color: #B5D9CF; margin-top: 6px; word-break: break-word; }
.pw-stage { flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; }
.pw-wheel { position: relative; width: 226px; height: 226px; border-radius: 50%; padding: 8px; background: conic-gradient(from 0deg, #6FB98F, #2C7873, #6FB98F, #2C7873, #6FB98F); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 40px rgba(111,185,143,.25); }
.pw-wheel-svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.pw-rot { width: 100%; height: 100%; }
.pw-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 24px solid #F2D16B; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); z-index: 2; }
.pw-tries { font-size: 12px; color: #B5D9CF; margin-bottom: 10px; }
.pw-tries b { color: #fff; }
.pw-btn { width: 100%; height: 48px; border-radius: 14px; font-weight: 800; font-size: 16px; color: #021C1E; background: linear-gradient(180deg, #9FE0BC, #6FB98F); box-shadow: 0 6px 0 #2C7873, 0 10px 18px rgba(0,0,0,.35); transition: transform .1s, box-shadow .1s; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-btn:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 2px 0 #2C7873, 0 4px 8px rgba(0,0,0,.35); }
.pw-btn[disabled] { opacity: .75; pointer-events: none; }
.pw-home { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 100px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.55); }
.pw-modal { position: absolute; inset: 0; background: rgba(2,28,30,.72); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 22px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.pw-modal.show { opacity: 1; pointer-events: auto; }
.pw-card { width: 100%; background: linear-gradient(180deg, #0B5A58, #06292B); border: 1.5px solid #6FB98F; border-radius: 22px; padding: 22px 16px 16px; text-align: center; transform: scale(.85); transition: transform .3s cubic-bezier(.3,1.5,.5,1); box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.pw-modal.show .pw-card { transform: none; }
.pw-gift { font-size: 44px; }
.pw-mt { font-size: 20px; font-weight: 800; margin-top: 6px; word-break: break-word; }
.pw-mx { color: #CFE8DF; margin: 8px 0 16px; font-size: 14px; word-break: break-word; }
.pw-slot { display: flex; gap: 8px; padding: 12px; border-radius: 16px; background: #021C1E; border: 2px solid #6FB98F; }
.pw-reel { width: 62px; height: 90px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 36px; }
.pw-plinko { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.pw-peg-row { display: flex; gap: 22px; }
.pw-peg-row i { width: 9px; height: 9px; border-radius: 50%; background: #B5D9CF; }
.pw-ball { position: absolute; top: -4px; left: calc(50% - 9px); width: 18px; height: 18px; border-radius: 50%; background: #F2D16B; box-shadow: 0 0 12px #F2D16B; }
.pw-ball.pw-pop { animation: drop 1.4s ease-in forwards; }
@keyframes drop { to { transform: translateY(165px); } }
.pw-bins { display: flex; gap: 4px; margin-top: 4px; }
.pw-bins b { width: 40px; padding: 6px 0; border-radius: 8px; background: #2C7873; font-size: 11px; }
.pw-tiles { display: grid; grid-template-columns: repeat(3, 70px); gap: 10px; }
.pw-tile { height: 70px; border-radius: 16px; background: linear-gradient(180deg, #2C7873, #1C5E5B); border: 1.5px solid #6FB98F; }
.pw-cap { margin-top: 12px; font-size: 12.5px; color: #B5D9CF; }
.pw-pop { animation: pop .5s ease; }
@keyframes pop { 50% { transform: scale(1.12); filter: brightness(1.3); } }
.pw .pw-tries b { display: inline; margin: 0; font-size: inherit; color: #fff; }
.pw .pw-bins b { display: block; margin: 0; color: #fff; text-align: center; }
.phone { padding: 8px; width: 288px; }
.phone-screen { border-radius: 38px; background: #021C1E; }
.pw { background: linear-gradient(180deg, #0B5A58 0%, #06292B 50%, #021C1E 100%); border-radius: 38px; width: 100%; }

.pw-status { display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center; height: 44px; padding: 8px 0 0; font-size: 13.5px; font-weight: 700; letter-spacing: -.2px; }
.pw-time { justify-self: center; }
.pw-notch { width: 96px; height: 26px; border-radius: 16px; background: #000; margin-top: 4px; }
.pw-icons { justify-self: center; display: flex; align-items: center; gap: 5px; }

/* ---------- Шаблоны ---------- */
.game-art { position: relative; }
.tag { position: absolute; bottom: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(111,185,143,.92); color: #021C1E; font-size: 10.5px; font-weight: 700; }
.tag-r { left: auto; right: 8px; background: #F8E9E5; color: var(--danger); }
.game.is-hidden { opacity: .6; }
.how { margin: 0 0 4px 18px; color: var(--text); line-height: 1.6; }
.how li { margin-bottom: 6px; }
.how a { color: var(--leaf); font-weight: 600; }
code { font-family: ui-monospace, Menlo, monospace; background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.modal .code { font-size: 12px; max-height: 190px; overflow: auto; }
.drop { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border: 1.5px dashed #B9D1CA; border-radius: var(--r-md); cursor: pointer; color: var(--muted); font-weight: 600; transition: all .15s; }
.drop:hover { border-color: var(--leaf); color: var(--leaf); background: var(--soft); }
.pw-ext { background: #000; }
.pw-ext .pw-status { position: absolute; top: 0; left: 0; right: 0; z-index: 3; width: 100%; }
.pw-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.pw-ext .pw-home { z-index: 3; }

.pw-frame { top: 46px !important; height: calc(100% - 46px) !important; }
.pw-ext .pw-status { background: #000; }
.game-art { height: 300px !important; border-radius: var(--r-md); }
.game-desc { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.games { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.pw-frame { top: 0 !important; height: 100% !important; }
.pw-ext .pw-status { background: transparent; }

/* превью внешних игр: без строки состояния и без «челки», игра на весь экран телефона */
.pw-ext .pw-status, .pw-ext .pw-home { display: none !important; }

/* ---------- шаблоны: загрузка, переводы, документация ---------- */
.tpl-modal { width: 640px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow: auto; }
.tpl-lead { margin-bottom: 12px; color: var(--muted); }
.tpl-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.drop.over { border-color: var(--sprout); background: #e6f3ee; }
.report { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: #fafdfc; }
.report ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.rp { display: grid; grid-template-columns: 20px 1fr; gap: 6px; font-size: 13px; line-height: 1.4; }
.rp code { font-size: 11.5px; background: #edf3f1; padding: 1px 5px; border-radius: 4px; color: #3a5f58; }
.rp-i { font-weight: 800; text-align: center; }
.rp.err { color: #b03a2a; } .rp.warn { color: #946200; } .rp.info { color: var(--muted); }
.rp-head { font-size: 13.5px; } .rp-sz { color: var(--muted); font-size: 12px; margin-left: 6px; }
.rp-ok { margin-top: 8px; color: #1f7a54; font-weight: 600; font-size: 13px; }
.rp-wait { margin-top: 12px; color: var(--muted); font-size: 13px; }
.tbadge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: #e4f1ec; color: #2a6a56; vertical-align: 1px; }
.tbadge.warn { background: #fbf0d8; color: #946200; }
.lcount { margin-left: 6px; font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: #f6ead0; color: #946200; }
.lcount.ok { background: #dff0e8; color: #2a6a56; }
.treset { margin-left: 6px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; vertical-align: -3px; }
.treset svg { width: 13px; height: 13px; } .treset:hover { color: var(--danger); }
.trow .hint { margin-top: 4px; }
.color-row { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.color { width: 44px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.pv-tools { margin: 10px 0 0; }
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 7px; border-radius: 999px; background: #e6eeeb; margin-right: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #e0a92a; } .bar i.ok { background: #3f9f7a; }
.doc { padding: 28px 34px; max-width: 920px; line-height: 1.6; }
.doc h2 { font-size: 24px; margin: 6px 0 12px; } .doc h3 { font-size: 18px; margin: 28px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.doc h4, .doc h5 { margin: 18px 0 6px; } .doc p { margin: 8px 0; } .doc ul, .doc ol { margin: 8px 0 8px 22px; } .doc li { margin: 3px 0; }
.doc code { background: #edf3f1; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.doc pre.code { background: #0e2a2b; color: #d9efe6; padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: 12.5px; line-height: 1.55; margin: 12px 0; }
.md-t { border-collapse: collapse; margin: 12px 0; font-size: 13.5px; width: 100%; }
.md-t th, .md-t td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; } .md-t th { background: #f0f6f4; }

/* ---------- пагинация ---------- */
.pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager .spacer { flex: 1; }
.pg-size { display: inline-flex; align-items: center; gap: 8px; }
.pg-size select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.pg-nav { display: flex; align-items: center; gap: 4px; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s; }
.pg-btn:hover:not([disabled]) { background: var(--soft); }
.pg-btn.cur { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.pg-btn[disabled] { opacity: .4; cursor: default; }
.pg-gap { padding: 0 4px; color: var(--muted); }
.pager-card { margin-top: 0; border-top: 0; }

/* окно загрузки шаблона: три ссылки одной ширины */
.tpl-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tpl-link { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--soft); color: var(--ink); text-decoration: none; transition: background .15s, border-color .15s; }
.tpl-link:hover { background: #D6EAE2; border-color: #B7D6CB; }
.tpl-link > svg { width: 22px; height: 22px; color: var(--leaf); }
.tpl-link b { display: block; font-size: 14px; margin-bottom: 3px; color: var(--ink); }
.tpl-link small { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.tpl-modal { width: 720px; }
@media (max-width: 720px) { .tpl-links { grid-template-columns: 1fr; } }

/* выбор размера страницы: свой значок вместо системной стрелки */
.pg-size select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 30px 0 12px; border-radius: 9px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b8a84' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.pg-size select:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(44,120,115,.14); }

/* ---------- карточки шаблонов ---------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.tcard { position: relative; display: flex; flex-direction: column; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(2,28,30,.04), 0 6px 18px rgba(2,28,30,.05); transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s, border-color .28s; will-change: transform; }
.tcard:hover { transform: translateY(-6px) scale(1.025); box-shadow: 0 14px 34px rgba(2,28,30,.18); border-color: #B9D8CC; z-index: 2; }
.tc-art { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #0c2a2b; }
.tc-img { position: absolute; inset: 0; display: grid; place-items: center; color: #6FB98F; background: #0c2a2b center top / cover no-repeat; }
.tc-img svg.i { width: 44px; height: 44px; stroke-width: 1.3; }
.tc-grad { position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(180deg, transparent, rgba(2,28,30,.55)); pointer-events: none; }
.tc-chip { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(2,28,30,.62); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; backdrop-filter: blur(6px); }
.tc-hid { left: auto; right: 12px; background: #F8E9E5; color: var(--danger); backdrop-filter: none; }
.tc-act { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; }
.tcard:hover .tc-act, .tcard:focus-within .tc-act { opacity: 1; transform: none; }
.tc-ib { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255,255,255,.94); color: var(--ink); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); transition: background .15s, color .15s; }
.tc-ib:hover { background: #fff; color: var(--leaf); } .tc-ib.danger:hover { color: var(--danger); }
.tc-ib svg { width: 17px; height: 17px; }
.tc-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.tc-name { font-size: 17px; line-height: 1.25; margin: 0; color: var(--ink); }
.tc-sub { font-size: 12.5px; color: var(--muted); }
.tc-desc { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: #4d6a64; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.tc-stats b { color: var(--ink); font-weight: 700; }
.tc-cta { margin-top: auto; width: 100%; justify-content: center; height: 42px; }
.tcard.is-hidden { opacity: .62; } .tcard.is-hidden:hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tcard, .tc-act { transition: none; } .tcard:hover { transform: none; } }

/* ---------- панель поиска и фильтров ---------- */
.toolbar .fsel { min-width: 180px; }
.freset { height: 40px; color: var(--muted); }
.freset:hover { color: var(--danger); }
.fcount { margin-left: auto; color: var(--muted); font-size: 13px; }

.multi { display: grid; gap: 6px; max-height: 160px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.multi-i { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }

/* ---------- страница входа ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 0%, #0B5A58 0%, #06292B 55%, #021C1E 100%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 22px; padding: 30px 28px 28px; box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand img { width: 48px; height: 48px; object-fit: contain; }
.login-brand b { display: block; font-size: 20px; color: var(--ink); } .login-brand span { font-size: 13px; color: var(--muted); }
.login-card .field { margin-bottom: 14px; } .login-card label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.login-btn { width: 100%; height: 46px; justify-content: center; margin-top: 6px; }
.login-card .err { min-height: 18px; color: var(--danger); font-size: 13px; margin: 2px 0 6px; }
.logout-btn { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; } .logout-btn:hover { color: var(--danger); background: rgba(255,255,255,.06); }
[hidden] { display: none !important; }
