:root {
    color-scheme: dark;
    --bg: #09090b;
    --panel: #131316;
    --panel-light: #1a1a1e;
    --accent: #ff5e1a;
    --text: #f2f2f2;
    --text-dim: #8a8a8f;
    --border: rgba(255, 94, 26, 0.18);
    --danger: #e23b3b;
  }

  * {
    margin: 0; padding: 0; box-sizing: border-box;
    scrollbar-width: none !important; -ms-overflow-style: none;
  }
  /* Полностью убираем нативный скроллбар вместе с белыми кнопками-стрелками.
     Прокрутка колёсиком, касанием и клавиатурой сохраняется. */
  *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; background: transparent !important; }
  *::-webkit-scrollbar-button,
  *::-webkit-scrollbar-button:single-button { display: none !important; width: 0 !important; height: 0 !important; }
  html, body { scrollbar-width: none !important; -ms-overflow-style: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  [hidden] { display: none !important; }
  html, body { overflow-x: hidden; width: 100%; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  a { color: inherit; text-decoration: none; }

  /* Не показываем исходную homeView, пока router не восстановил текущий адрес. */
  .boot-screen {
    display: none; position: fixed; inset: 0; z-index: 10000;
    align-items: center; justify-content: center; padding: 24px;
    background: var(--bg); color: var(--text); text-align: center;
  }
  html[data-boot="loading"] .boot-screen,
  html[data-boot="error"] .boot-screen { display: flex; }
  .boot-card { display: flex; flex-direction: column; align-items: center; gap: 18px; }
  .boot-logo { font-family: Oswald, sans-serif; font-size: 30px; font-weight: 700; letter-spacing: 3px; }
  #bootMessage { max-width: 520px; color: var(--text-dim); line-height: 1.6; }
  .boot-retry {
    padding: 12px 20px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--panel); color: var(--text); font: 600 14px Inter, sans-serif; cursor: pointer;
  }
  .boot-retry:hover { border-color: var(--accent); }

  /* ===== HEADER ===== */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    padding: 18px clamp(20px, 4vw, 48px);
  }

  .logo {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text);
  }

  nav ul {
    display: flex;
    gap: 34px;
    list-style: none;
  }

  nav a, nav button {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
  }

  nav a:hover, nav button:hover { color: var(--text); }
  nav button.nav-active { color: var(--accent); }

  .brand { display: flex; align-items: center; gap: 14px; }

  /* ---------- переключатель языка ---------- */
  .lang-switch { position: relative; display: flex; align-items: center; }
  .lang-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 9px 0 8px;
    border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
    background: var(--panel); color: var(--text-dim);
    font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.4px;
    cursor: pointer; transition: all 0.2s var(--ease);
  }
  .lang-btn > svg:first-child { width: 15px; height: 15px; }
  .lang-btn .lang-caret { width: 11px; height: 11px; opacity: 0.6; transition: transform 0.2s var(--ease); }
  .lang-btn:hover { color: var(--text); border-color: var(--accent); }
  .lang-btn.active .lang-caret { transform: rotate(180deg); }

  .lang-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 156px; padding: 6px;
    background: rgba(15,15,18,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px; box-shadow: 0 20px 44px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px); z-index: 140;
    animation: vcSetIn 0.16s var(--ease) both;
  }
  .lang-menu[hidden] { display: none; }
  .lang-opt {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 8px 10px; border: none; border-radius: 7px;
    background: none; color: rgba(255,255,255,0.78);
    font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
  }
  .lang-opt::after { content: ''; color: var(--accent); font-size: 12px; opacity: 0; }
  .lang-opt:hover { background: rgba(255,255,255,0.08); color: #fff; }
  .lang-opt.active { color: var(--accent); font-weight: 600; }
  .lang-opt.active::after { content: '✓'; opacity: 1; }

  .header-actions { display: flex; align-items: center; gap: 14px; }

  .text-btn {
    padding: 9px 16px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
  }
  .text-btn:hover { border-color: var(--accent); color: var(--text); }

  /* ===== ВЫПАДАЮЩИЕ МЕНЮ В ШАПКЕ ===== */
  .nav-dropdown { position: relative; }

  .nav-dropdown:hover .nav-direct { color: var(--text); }
  .nav-link.nav-current { color: var(--accent); }

  .mega-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    width: min(660px, 90vw);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    z-index: 120;
  }
  .mega-menu[hidden] { display: none; }

  .mega-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 14px;
  }

  .mega-title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.6px;
  }

  .mega-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
  }
  .mega-all:hover { text-decoration: underline; }

  .mega-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 9px;
  }

  .mega-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
    max-height: 190px;
    overflow-y: auto;
  }

  .mega-chip {
    padding: 6px 11px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--panel-light);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.18s ease;
  }
  .mega-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,94,26,0.1);
  }

  .mega-titles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mega-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 0;
  }
  .mega-item:hover { background: var(--panel-light); border-color: var(--border); }

  .mega-item img {
    width: 34px; height: 50px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: var(--panel-light);
  }

  .mega-item span { min-width: 0; }

  .mega-item b {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
  }

  .mega-item em {
    display: block;
    font-style: normal;
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
