/* ============================================================
   LAUNCHER UI DEMO — веб-копия интерфейса BLauncher после редизайна 2026-10.
   Токены = palette/presets.json лаунчера (violet / black / white),
   размеры и радиусы = DESIGN.md: контролы 8, карточки 10, панели 12, чипы 6;
   рейка 100px; Inter + JetBrains Mono. Фон — небо Энда со вспышками (ui/EndSky).
   ============================================================ */

@font-face { font-family: "BL Inter"; src: url("../fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BL Inter"; src: url("../fonts/Inter-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "BL Inter"; src: url("../fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "BL Mono"; src: url("../fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

.launcher-demo { padding: 30px 0 110px; }
.launcher-demo .container { max-width: 1240px; }

.demo-lead {
  text-align: center;
  max-width: 680px;
  margin: -28px auto 40px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Shell + themes ---------- */
.launcher-shell {
  --bg: #120F1D;
  --surface: #1A1626;
  --surface-2: #221D31;
  --line: #322A49;
  --line-strong: #443B62;
  --text: #F4F1FA;
  --muted: #A49DBB;
  --dim: #7A7390;
  --accent: #8D6BFA;
  --accent-hover: #A98EFF;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(141, 107, 250, 0.14);
  --accent-faint: rgba(141, 107, 250, 0.07);
  --accent-line: rgba(141, 107, 250, 0.55);
  --hover-veil: rgba(255, 255, 255, 0.045);
  --ok: #4CB782;
  --warn: #F2994A;
  --danger: #EB5757;
  --danger-text: #FF8F8F;
  --scrim: rgba(0, 0, 0, 0.62);
  --mark: linear-gradient(135deg, #2E2547, #17131F);
  --play: linear-gradient(to bottom, #9A7CFB, #7F5BF2);
  --panel-alpha: rgba(26, 22, 38, 0.86);
  --rail-alpha: rgba(18, 15, 29, 0.55);
  --sky: linear-gradient(160deg, #1A1430 0%, #1E1638 60%, #130F22 100%);
  --sky-tint: rgba(176, 110, 255, 0.16);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  display: flex;
  width: 100%;
  max-width: 1180px;
  height: 780px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-family: "BL Inter", "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  transition: background-color .65s var(--ease), border-color .65s var(--ease);
}

.launcher-shell.theme-black {
  --bg: #000000;
  --surface: #0A0A0A;
  --surface-2: #141414;
  --line: #1F1F1F;
  --line-strong: #333333;
  --text: #EDEDED;
  --muted: #A1A1A1;
  --dim: #7A7A7A;
  --accent: #EDEDED;
  --accent-hover: #FFFFFF;
  --on-accent: #000000;
  --accent-soft: rgba(237, 237, 237, 0.14);
  --accent-faint: rgba(237, 237, 237, 0.07);
  --accent-line: rgba(237, 237, 237, 0.55);
  --hover-veil: rgba(255, 255, 255, 0.05);
  --ok: #45C27A;
  --warn: #F5A524;
  --danger: #F25555;
  --scrim: rgba(0, 0, 0, 0.7);
  --mark: linear-gradient(135deg, #262626, #111111);
  --play: linear-gradient(to bottom, #FFFFFF, #E6E6E6);
  --panel-alpha: rgba(10, 10, 10, 0.9);
  --rail-alpha: rgba(0, 0, 0, 0.6);
  --sky: #000000;
  --sky-tint: rgba(255, 255, 255, 0.05);
}

.launcher-shell.theme-white {
  --bg: #E6EBF4;
  --surface: #F3F6FB;
  --surface-2: #E9EEF6;
  --line: #D3DAE7;
  --line-strong: #B5C0D3;
  --text: #131A28;
  --muted: #536079;
  --dim: #6C7890;
  --accent: #5B57E8;
  --accent-hover: #4743D6;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(91, 87, 232, 0.14);
  --accent-faint: rgba(91, 87, 232, 0.07);
  --accent-line: rgba(91, 87, 232, 0.55);
  --hover-veil: rgba(30, 50, 110, 0.05);
  --ok: #1E9E5A;
  --warn: #C26A09;
  --danger: #D93636;
  --danger-text: #C22F2F;
  --scrim: rgba(15, 15, 20, 0.4);
  --mark: linear-gradient(135deg, #E9E9EE, #D9D9E0);
  --play: linear-gradient(to bottom, #7564F2, #6352E8);
  --panel-alpha: rgba(243, 246, 251, 0.9);
  --rail-alpha: rgba(230, 235, 244, 0.55);
  --sky: linear-gradient(160deg, #DCE3F2 0%, #E3E2F5 60%, #D6DCEE 100%);
  --sky-tint: rgba(150, 120, 255, 0.10);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
}

.launcher-shell *,
.launcher-shell *::before,
.launcher-shell *::after { box-sizing: border-box; }
:where(.launcher-shell) :where(button, input, select) { font-family: inherit; font-size: inherit; line-height: inherit; color: inherit; }
:where(.launcher-shell) button { cursor: pointer; }
.launcher-shell svg.l-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.launcher-shell :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.launcher-shell [hidden] { display: none !important; }
.l-flex-spacer { flex: 1; }

/* ---------- End sky ---------- */
.l-sky, .l-sky-tint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.l-sky-tint { background: var(--sky-tint); opacity: 0; }

/* ---------- Rail ---------- */
.l-rail {
  flex: 0 0 100px;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 18px 6px;
  background: var(--rail-alpha);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.l-rail-brand {
  align-self: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 8px;
}
.l-rail-brand img { width: 100%; height: 100%; object-fit: contain; display: block; }
.l-rail-items { position: relative; display: flex; flex-direction: column; gap: 4px; }
.l-rail-marker {
  position: absolute;
  left: -6px;
  top: 0;
  width: 3px;
  height: 26px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(var(--marker-y, 14px));
  transition: transform .42s var(--ease);
}
.l-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  transition: background-color .2s, color .2s;
}
.l-rail-btn svg.l-ico { width: 20px; height: 20px; transition: transform .32s var(--ease), color .2s; }
.l-rail-btn:hover { background: var(--hover-veil); color: var(--text); }
.l-rail-btn:hover svg.l-ico { transform: scale(1.18); }
.l-rail-btn.active { background: var(--surface-2); color: var(--text); }
.l-rail-btn.active svg.l-ico { color: var(--accent); }
.l-rail-spacer { flex: 1; }
.l-rail-tg { align-self: center; width: 22px; height: 22px; display: block; }
.l-rail-tg svg { width: 100%; height: 100%; display: block; }
.l-rail-version { margin-top: 8px; text-align: center; font-size: 11px; color: var(--dim); }

/* ---------- Content / screens ---------- */
.l-content {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.l-content::-webkit-scrollbar { width: 8px; }
.l-content::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

.l-screen { display: none; padding: 28px 36px 32px; }
.l-screen.active { display: block; animation: l-screen-in .48s var(--ease); }
.l-screen.active > * { animation: l-block-in .48s var(--ease) backwards; }
.l-screen.active > *:nth-child(2) { animation-delay: .07s; }
.l-screen.active > *:nth-child(3) { animation-delay: .14s; }
.l-screen.active > *:nth-child(4) { animation-delay: .21s; }
.l-screen.active > *:nth-child(5) { animation-delay: .28s; }
.l-screen.active > *:nth-child(n+6) { animation-delay: .32s; }
@keyframes l-screen-in { from { opacity: 0; transform: translateY(var(--enter-y, 14px)); } to { opacity: 1; transform: none; } }
@keyframes l-block-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.launcher-shell.no-motion *, .launcher-shell.no-motion *::before, .launcher-shell.no-motion *::after { animation: none !important; transition: none !important; }

.l-home.active { display: flex; flex-direction: column; min-height: 100%; }
.l-home-fill { flex: 1; min-height: 8px; }

.l-page-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.l-page-head > div:first-child { flex: 1; min-width: 0; }
.l-page-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: var(--text); }
.l-page-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Panels ---------- */
.l-panel {
  background: var(--panel-alpha);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}
.l-panel > * + * { margin-top: 12px; }
.l-panel.l-raised { position: relative; z-index: 40; }
.l-panel-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.l-panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l-panel-head .l-hint-text { margin-top: 3px; }
.l-field-label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.l-panel > .l-field-label + * { margin-top: 6px; }
.l-row-label { font-size: 15px; font-weight: 500; color: var(--text); }
.l-hint-text { margin: 0; font-size: 13px; color: var(--muted); }
.l-panel > .l-row-label + .l-account-line,
.l-panel > .l-account-line + .l-hint-text { margin-top: 8px; }
.l-empty-state { margin: 0; padding: 14px 24px; font-size: 15px; color: var(--muted); }
.l-list-panel { padding: 8px; }
.l-list-panel > * + * { margin-top: 0; }

/* ---------- Buttons ---------- */
.l-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .2s, background-color .2s, transform .32s var(--ease);
}
.l-btn svg.l-ico { width: 15px; height: 15px; color: var(--muted); }
.l-btn:hover { border-color: var(--line-strong); background-image: linear-gradient(var(--hover-veil), var(--hover-veil)); }
.l-btn:active { transform: scale(0.95); background: var(--surface); }
.l-btn-icon { padding: 7px 12px; }
.l-btn-block { display: flex; width: 100%; }
.l-btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.l-btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.l-btn-danger { background: rgba(235, 87, 87, 0.12); border-color: rgba(235, 87, 87, 0.4); color: var(--danger-text); font-size: 15px; }
.l-btn-danger:disabled { opacity: .45; cursor: default; transform: none; }
.l-link { padding: 4px 6px; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 600; }
.l-link:hover { color: var(--text); }

.l-play-block { display: flex; flex-direction: column; gap: 8px; }
.l-play-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 14px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--play);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
  transition: transform .32s var(--ease), filter .2s;
}
.l-play-btn:hover { filter: brightness(1.08); }
.l-play-btn:active { transform: scale(0.97); }
.l-play-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: l-sheen 6s 1.2s infinite;
}
@keyframes l-sheen { 0% { transform: translateX(-120%); } 18%, 100% { transform: translateX(120%); } }
.l-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%) scale(0);
  animation: l-ring .85s var(--ease) forwards;
}
@keyframes l-ring { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.l-play-row { display: flex; align-items: center; gap: 12px; }
.l-play-hint { font-size: 14px; color: var(--muted); }

/* ---------- Inputs ---------- */
.l-input, .l-select, .l-combo-btn {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.l-input { width: 100%; min-width: 0; }
.l-input::placeholder { color: var(--dim); }
.l-input:hover, .l-select:hover, .l-combo-btn:hover { border-color: var(--line-strong); }
.l-input:focus, .l-select:focus, .l-combo.open .l-combo-btn { border-color: var(--accent); }
.l-input-mono { font-family: "BL Mono", "JetBrains Mono", Consolas, monospace; font-size: 13.5px; }
.l-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23948cab'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-weight: 500;
}
.l-select option { background: var(--surface); color: var(--text); }
.l-select-grow { flex: 1; min-width: 0; }
.l-account-line { display: flex; align-items: center; gap: 8px; }

.l-chips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.l-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
}
.l-chip svg.l-ico { width: 12px; height: 12px; }

.l-combo { position: relative; }
.l-combo-btn { display: inline-flex; align-items: center; gap: 10px; min-width: 150px; justify-content: space-between; background: var(--surface-2); font-weight: 500; }
.l-combo-btn svg.l-ico { width: 14px; height: 14px; color: var(--muted); transition: transform .25s var(--ease); }
.l-combo.open .l-combo-btn svg.l-ico { transform: rotate(180deg); }
.l-combo-popup {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.l-combo-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}
.l-combo-item:hover { background: var(--hover-veil); }
.l-combo-item.selected { background: var(--accent-soft); color: var(--text); }

/* ---------- Build cards ---------- */
.l-builds-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 18px; }
.l-builds-strip { flex: 1; min-width: 0; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.l-builds-strip::-webkit-scrollbar { display: none; }
.l-build-card {
  position: relative;
  flex: 0 0 176px;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alpha);
  text-align: left;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .32s var(--ease);
}
.l-build-card:hover { background: var(--surface-2); border-color: var(--line-strong); transform: translateY(-2px) scale(1.02); }
.l-build-card.selected { background: linear-gradient(var(--accent-faint), var(--accent-faint)), var(--surface); border-color: var(--accent-line); }
.l-build-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.l-build-icon-sm, .l-build-icon-lg {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--mark);
  color: var(--text);
  font-family: "BL Mono", "JetBrains Mono", Consolas, monospace;
  font-weight: 700;
}
.l-build-icon-sm { width: 32px; height: 32px; font-size: 12px; }
.l-build-icon-lg { width: 44px; height: 44px; font-size: 14px; }
.l-build-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-build-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-like-btn { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dim); }
.l-like-btn svg.l-ico { width: 15px; height: 15px; }
.l-like-btn:hover { color: var(--text); background: var(--hover-veil); }
.l-like-btn.liked { color: var(--danger); }
.l-like-btn.liked svg.l-ico { fill: currentColor; }
.l-add-build-card {
  flex: 0 0 176px;
  min-height: 110px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.l-add-build-card:hover { color: var(--text); border-color: var(--accent-line); }

.l-selected-row { display: flex; align-items: center; gap: 14px; }
.l-selected-info { flex: 1; min-width: 0; }
.l-selected-name { font-size: 17px; font-weight: 600; }
.l-selected-sub { font-size: 13.5px; color: var(--muted); }

.l-filters-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.l-builds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.l-builds-grid .l-build-card, .l-builds-grid .l-add-build-card { width: auto; flex: none; }

/* ---------- Lists: profiles, mods, friends, monitor ---------- */
.l-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background-color .2s;
  animation: l-row-in .42s var(--ease) backwards;
}
.l-list-row:hover { background: var(--hover-veil); }
.l-list-row.current { background: var(--accent-soft); border-color: var(--accent-line); }
@keyframes l-row-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
.l-row-main { flex: 1; min-width: 0; }
.l-row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-row-title a:hover { color: var(--accent-hover); }
.l-row-sub { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-row-meta { font-size: 12.5px; color: var(--dim); }
.l-row-mono { font-family: "BL Mono", "JetBrains Mono", Consolas, monospace; font-size: 13px; color: var(--muted); }
.l-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  image-rendering: pixelated;
}
.l-avatar img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.l-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); }
.l-icon-btn svg.l-ico { width: 15px; height: 15px; }
.l-icon-btn:hover { color: var(--text); border-color: var(--line); background: var(--surface-2); }
.l-badge { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.l-badge.ok { background: rgba(76, 183, 130, 0.18); color: var(--ok); }

.l-mods-search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.l-mods-search .l-search-input { flex: 1 1 260px; width: auto; }
.l-mods-search .l-select { flex: 0 1 150px; }
.l-mod-loading { padding: 18px 16px; color: var(--muted); }

.l-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.18); }
.l-dot.off { background: var(--dim); box-shadow: none; }
.l-dot.pending { background: var(--warn); animation: l-pulse 1s infinite alternate; }
@keyframes l-pulse { to { opacity: .35; } }
.l-monitor-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.l-monitor-stats b { color: var(--text); font-weight: 600; }
.l-server-status { font-size: 14px; color: var(--muted); }
.l-monitor-list, .l-friend-list { display: flex; flex-direction: column; gap: 2px; margin-left: -8px; margin-right: -8px; }

.l-code-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-faint); }
.l-code-box span { flex: 1; font-family: "BL Mono", "JetBrains Mono", Consolas, monospace; font-size: 18px; letter-spacing: .06em; }

/* ---------- Tools ---------- */
.l-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.l-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 154px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alpha);
  text-align: left;
  transition: background-color .2s, border-color .2s, transform .32s var(--ease);
}
.l-tool-card > svg.l-ico { width: 22px; height: 22px; margin-bottom: 8px; color: var(--accent); }
button.l-tool-card:hover { background: var(--surface-2); border-color: var(--line-strong); transform: translateY(-2px) scale(1.02); }
.l-tool-title { font-size: 15.5px; font-weight: 600; }
.l-tool-desc { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.l-tool-card.soon { opacity: .6; }
.l-tool-card.soon > svg.l-ico { color: var(--muted); }
.l-soon { position: absolute; top: 18px; right: 18px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; }

/* ---------- Skin / cape editor ---------- */
.l-editor-head { align-items: center; }
.l-editor-head .l-link { padding-left: 0; }
.l-editor { display: grid; grid-template-columns: 200px minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.l-editor .l-panel { margin-bottom: 0; }
.l-tool-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.l-skin-tool { display: grid; place-items: center; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); transition: transform .32s var(--ease); }
.l-skin-tool:hover { border-color: var(--line-strong); color: var(--text); }
.l-skin-tool:active { transform: scale(0.92); }
.l-skin-tool.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.theme-black .l-skin-tool.active { color: #000; }
.l-color-current { display: flex; align-items: center; gap: 10px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.l-color-current input { width: 30px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.l-color-current span { font-family: "BL Mono", "JetBrains Mono", Consolas, monospace; font-size: 13px; }
.l-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; max-width: 280px; }
.l-swatch { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 5px; }
.l-swatch:hover { transform: scale(1.12); }
.l-swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.l-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.l-check input { accent-color: var(--accent); width: 16px; height: 16px; }

.l-editor-view { padding: 10px; }
.l-model-stage {
  position: relative;
  height: 470px;
  border-radius: 8px;
  perspective: 1100px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 70%, var(--accent-faint), transparent 70%);
}
.l-model-stage.dragging { cursor: grabbing; }
.l-model { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.l-part, .l-limb { position: absolute; transform-style: preserve-3d; }
.l-face { position: absolute; left: 0; top: 0; image-rendering: pixelated; backface-visibility: hidden; cursor: crosshair; }
.l-model.walking .l-limb { animation: l-swing 1s ease-in-out infinite alternate; }
.l-model.walking .l-limb.b { animation-direction: alternate-reverse; }
@keyframes l-swing { from { transform: var(--pos) rotateX(28deg); } to { transform: var(--pos) rotateX(-28deg); } }
.l-editor-hint { margin: 8px 4px 2px; font-size: 12.5px; color: var(--dim); text-align: center; }
.l-texture {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
  background:
    conic-gradient(var(--surface-2) 25%, var(--surface) 0 50%, var(--surface-2) 0 75%, var(--surface) 0) 0 0 / 12.5% 12.5%;
}
.l-texture.cape { aspect-ratio: 2; }

/* ---------- Settings ---------- */
.l-ram-box {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 360px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.l-ram-box input[type=range] { flex: 1; accent-color: var(--accent); }
.l-ram-value { font-family: "BL Mono", "JetBrains Mono", Consolas, monospace; font-size: 13px; color: var(--accent); white-space: nowrap; }
.theme-black .l-ram-value { color: var(--text); }
.l-settings-list { padding-top: 6px; padding-bottom: 6px; }
.l-settings-list > * + * { margin-top: 0; }
.l-setting-row { display: flex; align-items: center; gap: 20px; padding: 13px 0; }
.l-setting-row + .l-setting-row { border-top: 1px solid var(--line); }
.l-setting-row > div:first-child { flex: 1; min-width: 0; }
.l-toggle-label { font-size: 15px; font-weight: 500; }
.l-toggle-sub { font-size: 13px; color: var(--muted); }

.l-switch { position: relative; flex: none; width: 40px; height: 22px; cursor: pointer; }
.l-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.l-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .25s; pointer-events: none; }
.l-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .32s var(--ease); }
.l-switch input:checked + span { background: var(--accent); }
.l-switch input:checked + span::after { transform: translateX(18px); background: var(--on-accent); }
.l-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.l-lang-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.l-lang-option { padding: 4px 14px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.l-lang-option.active { background: var(--surface); color: var(--text); }

.l-theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.l-theme-swatch { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.l-theme-swatch:hover { border-color: var(--line-strong); }
.l-theme-swatch.active { border-color: var(--accent); background: var(--accent-faint); color: var(--text); }
.l-theme-preview { display: block; height: 36px; border-radius: 6px; }
.l-theme-preview.violet { background: linear-gradient(to right, #1A1626 45%, #8D6BFA); }
.l-theme-preview.black { background: linear-gradient(to right, #000000 45%, #3A3A3A); }
.l-theme-preview.white { background: linear-gradient(to right, #F3F6FB 45%, #B9C6EE); }

/* ---------- Toasts ---------- */
.l-toasts { position: absolute; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.l-toast {
  max-width: 340px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: l-toast-in .42s var(--ease);
}
.l-toast.success { border-left: 3px solid var(--ok); }
.l-toast.error { border-left: 3px solid var(--danger); }
@keyframes l-toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---------- Modals ---------- */
.l-modal-scrim { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--scrim); animation: l-fade .3s; }
@keyframes l-fade { from { opacity: 0; } }
.l-modal-card { width: min(440px, 100%); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); animation: l-modal-in .42s var(--ease); }
@keyframes l-modal-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.l-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.l-modal-title { font-size: 17px; font-weight: 600; }
.l-modal-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.l-modal-close:hover { background: var(--hover-veil); color: var(--text); }
.l-modal-body { display: flex; flex-direction: column; gap: 12px; padding: 10px 18px 18px; }
.l-share-pane { display: flex; flex-direction: column; gap: 12px; }
.l-modal-tabs { display: flex; gap: 4px; margin: 6px 18px 0; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.l-share-tab { flex: 1; padding: 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.l-share-tab.active { background: var(--surface); color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .l-editor { grid-template-columns: 180px minmax(0, 1fr); }
  .l-editor-flat { grid-column: 1 / -1; }
  .l-editor-flat .l-texture { max-width: 320px; }
  .l-editor-flat .l-texture.cape { max-width: 420px; }
}

@media (max-width: 900px) {
  .l-screen { padding: 22px 20px 32px; }
  .l-rail { flex-basis: 80px; width: 80px; }
  .l-rail-btn { font-size: 10.5px; }
}

@media (max-width: 640px) {
  .launcher-demo { padding: 8px 0 60px; }
  .demo-lead { margin: -20px auto 20px; padding: 0 18px; font-size: 13px; }
  .launcher-demo .container { padding: 0; max-width: none; }

  /* Размер на телефоне — см. память blauncher-site-demo-scroll: сверху и снизу должна
     оставаться полоса страницы, за которую можно зацепиться пальцем. */
  .launcher-shell {
    flex-direction: column;
    height: min(620px, calc(100dvh - 150px));
    min-height: 460px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .l-content { order: 1; flex: 1; }

  /* Рейка становится нижней панелью; восемь вкладок листаются вбок. */
  .l-rail {
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--panel-alpha);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .l-rail::-webkit-scrollbar { display: none; }
  .l-rail-brand, .l-rail-spacer, .l-rail-tg, .l-rail-version, .l-rail-marker { display: none; }
  .l-rail-items { flex-direction: row; gap: 2px; flex: 1; }
  .l-rail-btn { flex: 1 0 64px; min-height: 56px; padding: 7px 2px; gap: 4px; font-size: 10px; }
  .l-rail-btn svg.l-ico { width: 20px; height: 20px; }

  .l-screen { padding: 14px 12px 20px; }
  .l-panel { padding: 14px; margin-bottom: 10px; }
  .l-page-head { flex-wrap: wrap; margin-bottom: 12px; }
  .l-page-head > div:first-child { flex: 1 1 100%; }
  .l-page-title { font-size: 20px; }
  .l-editor-head > .l-page-title { flex: 1 1 0; }

  .l-builds-row { flex-direction: column; }
  .l-builds-row .l-vanilla-card { width: auto; flex: none; }
  .l-builds-strip { flex: none; width: 100%; }
  .l-build-card, .l-add-build-card { flex-basis: 150px; width: 150px; }
  .l-builds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .l-mods-search .l-select { flex: 1 1 40%; }
  .l-account-line { flex-wrap: wrap; }
  .l-account-line .l-input, .l-account-line .l-select-grow { flex: 1 1 100%; }
  .l-monitor-stats { flex-direction: column; gap: 0; }
  .l-list-row { flex-wrap: wrap; }
  .l-mods-list .l-row-main { flex: 1 1 calc(100% - 60px); }
  .l-mods-list .l-list-row .l-btn { margin-left: 54px; }

  .l-tools-grid { grid-template-columns: 1fr; }
  .l-tool-card { min-height: 0; }
  .l-editor { grid-template-columns: minmax(0, 1fr); }
  .l-editor-head { flex-wrap: wrap; }
  .l-editor-head .l-flex-spacer { display: none; }
  .l-editor-head .l-btn { flex: 1 1 auto; padding: 7px 10px; }
  .l-tool-row { grid-template-columns: repeat(7, 1fr); }
  .l-model-stage { height: 320px; }
  .l-theme-row { grid-template-columns: 1fr; }
  .l-modal-scrim { padding: 12px; }
  .l-toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .launcher-shell *, .launcher-shell *::before, .launcher-shell *::after { animation: none !important; transition: none !important; }
}
