/* SrepPortal — телефоны: удобный плеер, круглые обложки, компактная шапка, кнопка «Создать пост».
   Подключается последним. Скрипт полноэкранного плеера: /assets/js/mobile-app.js */

@media (max-width: 860px) {

  /* Анимация появления страницы без transform: иначе всё «fixed» внутри страницы (кнопки, панели)
     привязывается к странице, а не к экрану, и «уплывает» вниз. */
  .container { animation: spPageFade .3s var(--ease, ease) both; }

  /* ---------- Меню профиля: «Скачать приложение» на телефоне не нужно ---------- */
  #pwa-install-btn, .user-menu-list button[onclick*="installPwaApp"] { display: none !important; }

  /* ---------- Шапка: компактнее, больше места под поиск ---------- */
  .topbar-theme-form, .topbar-user-name, .topbar-user-chevron { display: none !important; }
  .topbar-user { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; min-width: 44px; min-height: 44px; justify-content: center; }
  .topbar-avatar { width: 38px !important; height: 38px !important; }
  .topbar .icon-btn, .topbar-icon-btn { width: 42px; height: 42px; }

  /* ---------- Кнопка «Создать пост» — круглая, плавает над нижним меню ---------- */
  .page-index .feed-create-bar { position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 60; margin: 0; padding: 0; width: auto; background: none; border: 0; box-shadow: none; }
  .page-index .feed-create-btn { width: 58px; height: 58px; min-height: 0; padding: 0; border-radius: 50%; font-size: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
  .page-index .feed-create-btn svg { width: 28px; height: 28px; stroke-width: 2.6; color: #fff; stroke: #fff; }

  /* ---------- Лента: карточки на всю ширину, крупные кнопки ---------- */
  .page-index .post-card { border-radius: 0 !important; margin-left: -12px !important; margin-right: -12px !important; border-left: 0; border-right: 0; padding: 14px 14px 8px; }
  .page-index .post-media { margin: 10px -14px 0; }
  .page-index .post-media img, .page-index .post-media video { width: 100%; border-radius: 0; }
  .page-index .post-content { font-size: 16px; line-height: 1.5; }
  .post-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
  .pa-btn { min-height: 46px; padding: 0 12px; border-radius: 14px; }
  .pa-btn:active, .btn-ok:active, .btn-outline:active, .mobile-bottom-nav a:active { transform: scale(.96); }
  .post-save-link span { display: none; }
  .post-save-link { margin-left: auto; }

  /* ---------- Плеер: ровная нижняя плашка ---------- */
  .spm-bar {
    background: color-mix(in srgb, var(--card, #151a2e) 94%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 26px rgba(0, 0, 0, .28);
  }
  /* тонкая линия прогресса сверху; перематывать удобнее в полноэкранном плеере */
  .spm-progress { position: absolute; top: 0; left: 18px; right: 18px; height: 3px; margin: 0; pointer-events: none; }
  .spm-seek { height: 3px; }
  .spm-seek::-webkit-slider-runnable-track { height: 3px; }
  .spm-seek::-webkit-slider-thumb { opacity: 0; width: 1px; height: 3px; margin-top: 0; }
  .spm-row { padding: 10px 12px 8px; min-height: 62px; gap: 10px; }
  .spm-track { cursor: pointer; }
  .spm-title { font-size: 15px; font-weight: 700; }
  .spm-artist { font-size: 13px; }
  .spm-controls [data-a="prev"] { display: none; }
  .spm-controls .spm-btn { width: 42px; height: 42px; }
  .spm-play { width: 46px; height: 46px; }
  /* лайк, текст, очередь — в полноэкранном плеере; тут остаётся только «скрыть» */
  .spm-right .spm-btn:not(.spm-hide-btn) { display: none !important; }
  .spm-hide-btn { width: 40px; height: 40px; }

  /* ---------- Круглые обложки в плеере ---------- */
  html body .spm-cover, html body .spm-chip-cover, html body .spm-ly-cover, html body .spm-queue-item img,
  html body .mu-mini-cover, html body .mu-now img, html body .pf-music-now img,
  html body .mu-track-cover, html body .mu-track-cover img { border-radius: 50% !important; }
  .spm-cover { width: 46px; height: 46px; animation: spmSpin 18s linear infinite; animation-play-state: paused; }
  .spm-bar.is-playing .spm-cover { animation-play-state: running; }
  .mu-track-cover { box-shadow: 0 16px 40px rgba(0, 0, 0, .32); }

  .spm-lyrics { bottom: var(--sp-player-h, 72px); }
}
@keyframes spmSpin { to { transform: rotate(360deg); } }
@keyframes spPageFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .spm-cover, .spf-cover { animation: none !important; } }

/* ================= Полноэкранный плеер ================= */
.spf { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; overflow: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 24px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: #0b1020; color: #fff; visibility: hidden; transform: translateY(100%); transition: transform .34s cubic-bezier(.22, 1, .36, 1), visibility 0s .34s; }
.spf.is-open { visibility: visible; transform: none; transition: transform .34s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
.spf-bg { position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(56px) saturate(1.5) brightness(.5); opacity: .85; z-index: 0; pointer-events: none; }
.spf > *:not(.spf-bg) { position: relative; z-index: 1; }
.spf button { -webkit-appearance: none; appearance: none; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; min-height: 0 !important; box-shadow: none !important; transform: none; }
.spf button::before { display: none !important; }
.spf-top { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; }
.spf-close { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.spf-close:active { background: rgba(255, 255, 255, .14); }
.spf-top-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.spf-top-gap { width: 48px; }
.spf-cover-wrap { position: relative; margin: 14px 0 22px; width: min(74vw, 330px); aspect-ratio: 1; flex: none; }
.spf-cover { width: 100%; height: 100%; border-radius: 50% !important; object-fit: cover; background: #1c2240; display: block;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 10px rgba(255, 255, 255, .07); animation: spmSpin 24s linear infinite; animation-play-state: paused; }
.spf.is-playing .spf-cover { animation-play-state: running; }
.spf-meta { text-align: center; width: 100%; min-height: 62px; }
.spf-title { display: block; font-size: 22px; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spf-artist { display: block; margin-top: 4px; font-size: 15px; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spf .spf-page { display: inline-block; margin-top: 8px; padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-size: 13px; }
.spf-seek { width: 100%; margin-top: 18px; }
.spf .spf-range { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 0 !important; --p: 0%; touch-action: none; }
.spf-range::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .25) var(--p)); }
.spf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.spf-range::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .25); }
.spf-range::-moz-range-progress { height: 6px; border-radius: 6px; background: #fff; }
.spf-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; }
.spf-times { display: flex; justify-content: space-between; margin-top: -2px; font-size: 13px; opacity: .72; font-variant-numeric: tabular-nums; }
.spf-ctrl { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 14px; }
.spf-btn { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.spf-btn:active { background: rgba(255, 255, 255, .16); }
.spf-btn.sm { width: 46px; height: 46px; opacity: .8; }
.spf-btn.on { color: var(--accent, #ff6a1a); opacity: 1; }
.spf-btn.spf-play { width: 78px; height: 78px; background: var(--accent, #ff6a1a) !important; color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .4) !important; }
.spf-btn svg { width: 28px; height: 28px; } .spf-btn.sm svg { width: 22px; height: 22px; } .spf-btn.spf-play svg { width: 34px; height: 34px; }
.spf-one { position: absolute; font-size: 9px; font-weight: 800; margin: 14px 0 0 16px; display: none; } .spf-btn.one .spf-one { display: block; }
.spf-extra { display: flex; justify-content: space-around; width: 100%; margin-top: auto; padding-top: 18px; }
.spf .spf-ex { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; min-height: 64px; padding: 4px 0; overflow: visible; white-space: nowrap; font-size: 12px; border-radius: 16px; opacity: .9; }
.spf-ex:active { background: rgba(255, 255, 255, .12); }
.spf-ex svg { width: 26px; height: 26px; }
.spf-ex.on { color: #ff4d6d; } .spf-ex.on svg { fill: #ff4d6d; }
@media (max-height: 700px) { .spf-cover-wrap { width: min(58vw, 250px); margin: 6px 0 14px; } .spf-title { font-size: 19px; } }
html.spf-open, html.spf-open body { overflow: hidden; }
@media (min-width: 861px) { .spf { display: none !important; } }
