/* Каркас: фон-космос, шапка и навигация-«клавиши», мини-плеер, полноэкранный плеер, меню. */

.stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bg-art { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--ink); }
.bg-art::before, .bg-art::after { content: ''; position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .8s var(--ease); }
.bg-art::before { background-image: linear-gradient(180deg, rgba(13, 9, 6, .1) 0%, rgba(13, 9, 6, .5) 45%, #0d0906 92%), url(/img/hero-night.webp); background-position: center top; opacity: 0; }
.bg-art::after { background-image: linear-gradient(180deg, rgba(13, 9, 6, .55), rgba(13, 9, 6, .86)), url(/img/library-cosmos.webp); opacity: .9; }
body[data-route='home'] .bg-art::before { opacity: 1; }
body[data-route='home'] .bg-art::after { opacity: 0; }

/* шапка */
.top { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 0 24px;
  background: linear-gradient(180deg, rgba(13, 9, 6, .92), rgba(13, 9, 6, .72)); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--paper); }
.brand:hover { color: var(--paper); }
.b-lamp { position: relative; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 38% 32%, #fff0c8, #ffb347 48%, #b86d10 100%); box-shadow: 0 0 12px 2px rgba(255, 179, 71, .65), 0 0 28px 6px rgba(255, 150, 40, .28); }
body.on-air .b-lamp { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 6px 1px rgba(255, 179, 71, .4), 0 0 12px 2px rgba(255, 150, 40, .12); filter: brightness(.85); } }
.brand-name { font-size: 1.35rem; letter-spacing: .16em; color: var(--brass-hi); text-shadow: 0 0 18px rgba(255, 179, 71, .35); }
.brand-sub { font-size: .6875rem; color: var(--faint); padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.1; }
.nav { display: flex; gap: 4px; justify-content: center; min-width: 0; }
.key { display: inline-flex; align-items: center; gap: .55em; min-height: 40px; padding: 0 16px; border-radius: 11px; text-decoration: none; color: var(--mute); font-weight: 500; font-size: .9rem;
  border: 1px solid transparent; transition: color .2s, background .2s, border-color .2s, box-shadow .25s; }
.key:hover { color: var(--paper); background: rgba(200, 161, 90, .08); }
.key[aria-current='page'] { color: #1c1005; border-color: #ffd89a; font-weight: 600; background: linear-gradient(180deg, #ffd089, #ffb347 60%, #e79520); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 20px rgba(255, 179, 71, .4); }
.acct { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex: none; }
.acct .btn { flex: none; }
.acct-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 6px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: rgba(34, 23, 14, .7); color: var(--paper); }
.acct-btn:hover { border-color: var(--brass); }
.acct-ava { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 700 .8rem var(--f-display); color: #1c1005; background: radial-gradient(circle at 35% 30%, #ffe6b8, #ffb347 60%, #c8791b); }
.acct-name { max-width: 130px; padding-right: 8px; font-size: .875rem; }

.view { position: relative; z-index: 2; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px calc(var(--mini-h) + var(--tabbar-h) + var(--safe-b) + 56px); outline: none; }
.view > * { animation: enter .5s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .06s; } .view > *:nth-child(3) { animation-delay: .12s; } .view > *:nth-child(4) { animation-delay: .18s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* мини-плеер */
.minibar { position: fixed; z-index: 60; left: 50%; bottom: calc(14px + var(--tabbar-h) + var(--safe-b)); transform: translateX(-50%); width: min(1100px, calc(100% - 24px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 14px; padding: 8px 12px 8px 8px; border-radius: 20px; border: 1px solid var(--brass-lo);
  background: linear-gradient(180deg, rgba(44, 30, 16, .95), rgba(20, 13, 8, .97)); box-shadow: 0 18px 44px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 226, 160, .2), 0 0 0 1px rgba(0, 0, 0, .5);
  transition: transform .45s var(--spring), opacity .3s; backdrop-filter: blur(10px); overflow: hidden; }
.minibar[hidden] { display: none; }
.minibar.away { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.mini-open { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; border-radius: 14px; }
.mini-open .av, .mini-open .cv { width: 48px; height: 48px; border-radius: 12px; }
.mini-t { display: grid; gap: 1px; min-width: 0; }
.mini-t b { font-weight: 600; font-size: .95rem; }
.mini-t span { font: 400 .78rem var(--f-mono); color: var(--amber-hot); }
.mini-ctrl { display: flex; align-items: center; gap: 2px; }
.mini-play { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #1c1005; background: radial-gradient(circle at 35% 28%, #ffe6b8, #ffbd5a 45%, #e58f1b); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 4px 10px rgba(0, 0, 0, .5), 0 0 16px rgba(255, 179, 71, .35); position: relative; }
.mini-play.busy::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--amber-hot); animation: spin .9s linear infinite; }
.mini-play .i { width: 22px; height: 22px; }
.mini-vol { display: flex; align-items: center; gap: 6px; color: var(--mute); }
.mini-vol input { width: 96px; }
.mini-prog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255, 179, 71, .12); }
.mini-prog i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--amber-dim), var(--amber)); box-shadow: 0 0 8px var(--amber); transition: width .25s linear; }
input[type='range'] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--amber) var(--v, 50%), rgba(200, 161, 90, .25) var(--v, 50%)); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #fff1cc, #ffb347 60%, #b8730f); box-shadow: 0 0 10px rgba(255, 179, 71, .6), 0 2px 4px rgba(0, 0, 0, .6); }
input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(200, 161, 90, .25); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--amber); }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; border: 0; background: #ffb347; }
input[type='range']:focus-visible { outline-offset: 2px; }

/* полный экран плеера */
.sheet { position: fixed; inset: 0; z-index: 100; display: grid; align-content: start; justify-items: center; overflow-y: auto; padding: 18px 16px 32px; background: rgba(8, 5, 3, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sheet[hidden] { display: none; }
.sheet.open { animation: sheet-in .45s var(--ease); }
.sheet.closing { animation: sheet-out .28s var(--ease) forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(40px); } }
.sheet-in { width: min(1240px, 100%); display: grid; gap: 18px; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-bar h2 { font-size: 1rem; letter-spacing: .04em; color: var(--brass-hi); }

/* всплывающие меню */
.pop { position: fixed; z-index: 130; min-width: 210px; max-width: 320px; padding: 6px; border-radius: 16px; border: 1px solid var(--brass-lo); background: rgba(24, 16, 9, .98); box-shadow: 0 20px 50px rgba(0, 0, 0, .7); animation: pop .22s var(--spring); }
.pop-title { padding: 8px 12px 6px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pop hr { margin: 6px 8px; border: 0; border-top: 1px solid var(--line-soft); }
.pop-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 0; background: none; color: var(--paper); text-align: left; text-decoration: none; font-size: .9rem; }
.pop-i:hover, .pop-i:focus-visible { background: rgba(255, 179, 71, .12); color: var(--amber-hot); outline: none; }
.pop-i.on { color: var(--amber); }
.pop-i .i { color: var(--brass); }
.pop-i span { flex: 1; }

@media (max-width: 1240px) {
  .brand-sub { display: none; }
  .acct .reg { display: none; }
  .key { padding: 0 13px; }
}
@media (max-width: 960px) {
  .key span { display: none; }
  .key { padding: 0 12px; }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; --tabbar-h: 62px; }
  .top { grid-template-columns: 1fr auto; padding: 0 14px; gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(13, 9, 6, .94); }
  .acct-name { display: none; }
  .nav { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 6px calc(6px + var(--safe-b)); gap: 2px; justify-content: space-around;
    background: linear-gradient(180deg, rgba(23, 16, 10, .94), rgba(13, 9, 6, .98)); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .key { flex: 1; flex-direction: column; justify-content: center; gap: 3px; min-height: 48px; padding: 0 2px; border-radius: 12px; font-size: .68rem; }
  .key span { display: inline; }
  .key[aria-current='page'] { box-shadow: 0 0 14px rgba(255, 179, 71, .45); }
  .view { padding: 16px 14px calc(var(--mini-h) + var(--tabbar-h) + var(--safe-b) + 40px); }
  .minibar { width: calc(100% - 16px); bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); grid-template-columns: minmax(0, 1fr) auto; padding: 7px 8px 7px 7px; border-radius: 18px; }
  .mini-vol, .mini-ctrl .m-prev, .mini-ctrl .m-fav { display: none; }
  .mini-open .av, .mini-open .cv { width: 44px; height: 44px; }
  .toasts { bottom: calc(var(--mini-h) + var(--tabbar-h) + var(--safe-b) + 84px); }
  .sheet { padding: 10px 8px 28px; }
}

