/* RODNIE UNIVERSE UI 1.1 */
/* Дополнительный слой поверх universe.css */

/* Область действующего приложения */

body:has(.sidebar) {
  --universe-edge: rgba(179, 164, 255, .24);
}

/* Типографика */

body:has(.sidebar) .hero,
body:has(.sidebar) .hero h2,
body:has(.sidebar) .hero p {
  font-family: Rubik, Arial, sans-serif !important;
}

body:has(.sidebar) .hero h2 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.035em;
}

/* Более выразительные панели */

body:has(.sidebar) .card {
  border-radius: 23px;
  box-shadow:
    0 18px 48px rgba(1, 4, 22, .27),
    inset 0 1px rgba(255,255,255,.075);
}

body:has(.sidebar) .post {
  overflow: hidden;
}

body:has(.sidebar) .post::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(182,163,255,.32),
    transparent
  );
}

/* Баннер */

body:has(.sidebar) .hero {
  display: flex;
  align-items: center;
  min-height: 190px;
  overflow: hidden;
}

body:has(.sidebar) .hero > div {
  padding: 28px 32px;
}

body:has(.sidebar) .hero h2 {
  max-width: 390px;
  font-size: clamp(23px, 2.5vw, 35px);
}

body:has(.sidebar) .hero p {
  font-size: 14px;
}

/* Форма создания публикации */

body:has(.sidebar) .composer {
  overflow: hidden;
}

body:has(.sidebar) .composer textarea {
  min-height: 75px;
  resize: vertical;
  border-radius: 16px;
  background: rgba(6, 9, 29, .63);
  border: 1px solid rgba(179, 164, 255, .13);
  padding: 14px 16px;
}

body:has(.sidebar) .composer textarea:focus {
  outline: 2px solid rgba(157, 130, 255, .45);
  outline-offset: 1px;
}

body:has(.sidebar) .composer > .row:last-of-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

body:has(.sidebar) .composer > .row:last-of-type > * {
  min-width: 0;
}

/* Истории */

body:has(.sidebar) .story-row {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 4px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(164,139,255,.4) transparent;
}

body:has(.sidebar) .story-row > * {
  flex-shrink: 0;
}

/* Нижняя навигация по умолчанию скрыта */

#universe-mobile-nav {
  display: none;
}

/* МОБИЛЬНАЯ ВЕРСИЯ */

@media (max-width: 768px) {

  body:has(.sidebar) .topbar {
    min-height: 65px;
    padding: 9px 13px;
    gap: 10px;
  }

  body:has(.sidebar) .topbar form {
    min-width: 0;
    flex: 1;
  }

  body:has(.sidebar) .topbar form input {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    padding: 11px 12px;
  }

  body:has(.sidebar) .page {
    padding: 17px 13px 105px;
  }

  body:has(.sidebar) .page > h1 {
    margin-bottom: 5px;
    font-size: 28px;
  }

  body:has(.sidebar) .subtitle {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 13px;
  }

  /* Компактный космический баннер */

  body:has(.sidebar) .hero {
    height: auto !important;
    min-height: 152px !important;
    max-height: 190px;
    margin-bottom: 10px;
    border-radius: 21px;
  }

  body:has(.sidebar) .hero > div {
    max-width: 78%;
    padding: 20px;
  }

  body:has(.sidebar) .hero h2 {
    margin: 0 0 10px;
    font-size: clamp(19px, 5vw, 25px);
    line-height: 1.17;
  }

  body:has(.sidebar) .hero p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
  }

  body:has(.sidebar) .hero::before {
    width: 240px;
    height: 240px;
    right: -78px;
    top: -48px;
  }

  /* Компактная форма */

  body:has(.sidebar) .composer {
    padding: 15px !important;
    border-radius: 20px;
  }

  body:has(.sidebar) .composer > .row:first-child {
    align-items: flex-start;
    gap: 10px;
  }

  body:has(.sidebar) .composer > .row:first-child .avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }

  body:has(.sidebar) .composer textarea {
    min-width: 0;
    width: 100%;
    min-height: 65px;
    max-height: 180px;
    font-size: 13px;
    padding: 12px;
  }

  body:has(.sidebar) .composer > .row:last-of-type {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: stretch;
    margin-top: 12px;
  }

  body:has(.sidebar) .composer > .row:last-of-type > * {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    font-size: 12px;
  }

  body:has(.sidebar) .composer > .row:last-of-type > label {
    grid-column: 1;
    grid-row: 1;
  }

  body:has(.sidebar) .composer > .row:last-of-type > button[data-action="poll"] {
    grid-column: 2;
    grid-row: 1;
  }

  body:has(.sidebar) .composer select[name="visibility"] {
    grid-column: 1;
    grid-row: 2;
    padding: 10px;
    border-radius: 12px;
  }

  body:has(.sidebar) .composer > .row:last-of-type > button.primary {
    grid-column: 2;
    grid-row: 2;
    padding: 10px 13px;
    white-space: nowrap;
  }

  /* Лента */

  body:has(.sidebar) .card {
    border-radius: 19px;
  }

  body:has(.sidebar) .post {
    padding: 16px;
  }

  body:has(.sidebar) .tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    padding: 3px 1px 10px;
    scrollbar-width: none;
  }

  body:has(.sidebar) .tabs::-webkit-scrollbar {
    display: none;
  }

  body:has(.sidebar) .tabs > * {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
  }

  /* Нижняя панель */

  body:has(.sidebar) #universe-mobile-nav {
    position: fixed;
    left: 9px;
    right: 9px;
    bottom: max(9px, env(safe-area-inset-bottom));
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 3px;
    min-height: 65px;
    padding: 7px;
    border: 1px solid rgba(184,168,255,.29);
    border-radius: 23px;
    background: rgba(16, 19, 48, .94);
    box-shadow:
      0 15px 45px rgba(0,0,0,.48),
      inset 0 1px rgba(255,255,255,.10);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  #universe-mobile-nav a,
  #universe-mobile-nav button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 0;
    height: 53px;
    padding: 5px 2px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #bdb9d9;
    text-decoration: none;
    font: 500 10px Rubik, Arial, sans-serif;
    cursor: pointer;
  }

  #universe-mobile-nav svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #universe-mobile-nav .active {
    background: linear-gradient(
      135deg,
      rgba(140,107,255,.29),
      rgba(83,119,232,.17)
    );
    color: #fff;
  }

  #universe-mobile-nav .universe-create {
    color: #fff;
    background: linear-gradient(
      135deg,
      #9c76fa,
      #6479e8
    );
    box-shadow: 0 5px 20px rgba(117,91,239,.35);
  }
}

@media (max-width: 380px) {
  body:has(.sidebar) .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  body:has(.sidebar) .hero > div {
    padding: 15px;
  }

  body:has(.sidebar) .hero h2 {
    font-size: 19px;
  }

  body:has(.sidebar) .composer > .row:last-of-type > * {
    font-size: 11px;
  }

  #universe-mobile-nav a,
  #universe-mobile-nav button {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #universe-mobile-nav * {
    transition: none !important;
    animation: none !important;
  }
}
