:root {
    color-scheme: dark; --background: #0b0712; --surface: rgba(23, 16, 34, 0.82); --accent: 
    #a56bff;
    --accent-light: #d58aff; --text: #f2ecfa; --muted: #9c8eaa; --safe-top: 
    env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent;
}
html { width: 100%; min-width: 320px; min-height: 100%; background: var(--background);
}
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; overflow: hidden; 
    background: var(--background); color: var(--text); font-family: "Manrope", sans-serif; 
    overscroll-behavior: none;
}
button, input { font: inherit;
}
button { color: inherit; touch-action: manipulation;
}
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-light); 
    outline-offset: 4px;
}
.experience { position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 
    480px; overflow: hidden; isolation: isolate; background:
        radial-gradient( ellipse at 50% 45%,
            #241336 0%, 110b1b 42%, 0b0712 80%
        );
}
/* Визуализация */
#visualizer {
    position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; 
    pointer-events: none;
}
.ambient { position: absolute; z-index: 1; width: 35vw; height: 35vw; border-radius: 50%; 
    filter: blur(100px); opacity: .13; pointer-events: none;
}
.ambient-one { background: #8639ff; top: 10%; left: 10%;
}
.ambient-two { background: #e052d4; bottom: 5%; right: 5%;
}
/* Верхняя панель */ .topbar { position: absolute; z-index: 3; top: 0; left: 0; width: 
    100%; padding:
        calc(28px + var(--safe-top)) 5% 20px; display: flex; align-items: center; 
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: 
    none; font-size: 19px; font-weight: 800; letter-spacing: -.7px;
}
.brand-symbol { display: grid; place-items: center; width: 34px; height: 34px; border: 1px 
    solid rgba(213, 138, 255, .6); border-radius: 11px; color: var(--accent-light); 
    background: rgba(165, 107, 255, .12);
}
.top-label, .eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 2.5px; 
    font-weight: 700;
}
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px 
    solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.04); 
    font-size: 22px; cursor: pointer; transition: background .2s, border-color .2s;
}
.icon-button:hover { background: rgba(165,107,255,.2); border-color: var(--accent);
}
/* Центральная область */ .center-content { position: absolute; z-index: 2; top: 44%; left: 
    50%; transform: translate(-50%, -50%); width: min(90%, 700px); text-align: center; 
    pointer-events: none;
}
.center-content button { pointer-events: auto;
}
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 10px; 
    font-size: 9px;
}
.status-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: 
    var(--accent-light); box-shadow: 0 0 14px var(--accent);
}
h1 { margin: 22px 0 10px; font-size: clamp(36px, 6vw, 72px); line-height: 1.12; 
    letter-spacing: -3px; font-weight: 800;
}
h1 span { color: var(--accent-light); text-shadow: 0 0 35px rgba(165,107,255,.35);
}
.subtitle { margin: 0 0 32px; color: var(--muted); font-size: 14px; letter-spacing: .5px;
}
.upload-button { min-height: 48px; border: 1px solid rgba(213,138,255,.45); border-radius: 
    14px; padding: 13px 23px; background:
        linear-gradient( 135deg, rgba(165,107,255,.24), rgba(213,138,255,.1) ); color: 
    var(--text); font-size: 13px; font-weight: 700; cursor: pointer; transition: .25s; 
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.upload-button:hover { transform: translateY(-2px); box-shadow: 0 8px 35px 
    rgba(165,107,255,.2);
}
.upload-button span { margin-right: 7px; color: var(--accent-light); font-size: 18px;
}
/* Настройки */ .settings-panel { position: absolute; z-index: 5; top: calc(90px + 
    var(--safe-top)); right: 5%; width: 270px; padding: 22px; border: 1px solid 
    rgba(255,255,255,.1); border-radius: 18px; background: rgba(18, 12, 27, .92); 
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 20px 
    70px rgba(0,0,0,.25); opacity: 0; visibility: hidden; pointer-events: none; transform: 
    translateY(-8px); transition:
        opacity .25s, transform .25s, visibility .25s;
}
.settings-panel.open { opacity: 1; visibility: visible; pointer-events: auto; transform: 
    translateY(0);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; 
    margin-bottom: 24px; color: var(--accent-light); font-size: 10px; letter-spacing: 2px; 
    font-weight: 800;
}
.panel-heading button { display: grid; place-items: center; width: 36px; height: 36px; 
    border: 0; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 24px; 
    cursor: pointer;
}
.settings-panel label { display: block; margin: 17px 0 9px; color: var(--muted); font-size: 
    12px;
}
.settings-panel input { width: 100%; accent-color: var(--accent); cursor: pointer;
}
.settings-panel input[type="color"] { height: 40px; padding: 3px; border: 1px solid 
    rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.04);
}
.settings-panel input[type="range"] { min-height: 28px;
}

.setting-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.setting-label-row label {
    margin-bottom: 9px;
}
.setting-label-row output {
    color: var(--accent-light);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.panel-note { margin: 22px 0 0; color: #8b7b99; font-size: 11px; line-height: 1.6;
}
/* Плеер */ .player { position: absolute; z-index: 3; left: 50%; bottom: calc(25px + 
    var(--safe-bottom)); transform: translateX(-50%); width: min(90%, 1050px); min-height: 
    88px; display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; gap: 
    28px; padding: 16px 23px; border: 1px solid rgba(255,255,255,.09); border-radius: 20px; 
    background: rgba(20, 14, 29, .78); backdrop-filter: blur(28px); -webkit-backdrop-filter: 
    blur(28px); box-shadow: 0 15px 70px rgba(0,0,0,.2);
}
.track-info, .playback, .volume { display: flex; align-items: center; gap: 13px;
}
.track-icon { width: 43px; height: 43px; display: grid; place-items: center; flex-shrink: 0; 
    border-radius: 13px; background: rgba(165,107,255,.15); color: var(--accent-light); 
    font-size: 22px;
}
.track-text { min-width: 0; display: flex; flex-direction: column; gap: 5px;
}
.track-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
    font-size: 12px;
}
.track-text span { color: var(--muted); font-size: 10px;
}
.playback { justify-content: center; min-width: 0;
}
.play-button { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 
    44px; border: 0; border-radius: 50%; background: var(--accent-light); color: #170d22; 
    cursor: pointer; font-size: 14px; transition: .2s;
}
.play-button:hover { transform: scale(1.07); box-shadow: 0 0 22px rgba(213,138,255,.35);
}
.timeline { width: 100%; min-width: 0; display: flex; align-items: center; gap: 9px; color: 
    var(--muted); font-size: 10px; font-variant-numeric: tabular-nums;
}
.timeline input, .volume input { width: 100%; min-width: 0; accent-color: 
    var(--accent-light); cursor: pointer;
}
.timeline input, .volume input, .settings-panel input[type="range"] { touch-action: pan-y;
}
.volume { justify-content: flex-end; color: var(--muted);
}
.volume input { max-width: 95px;
}
/* Планшеты и небольшие ноутбуки */ @media (max-width: 900px) { .player { width: 94%; gap: 
        15px; padding: 14px 17px;
    }
    .topbar { padding-left: 4%; padding-right: 4%;
    }
}
/* Смартфоны */ @media (max-width: 700px) { .experience { min-height: 440px;
    }
    .topbar { padding: calc(15px + var(--safe-top)) 5% 12px;
    }
    .brand { gap: 9px; font-size: 17px;
    }
    .brand-symbol { width: 32px; height: 32px; border-radius: 10px;
    }
    .top-label { display: none;
    }
    .icon-button { width: 42px; height: 42px;
    }
    .center-content { top: 42%; width: 92%;
    }
    h1 { margin-top: 18px; font-size: clamp(32px, 9vw, 48px); letter-spacing: -2px;
    }
    .subtitle { margin-bottom: 25px; font-size: 13px;
    }
    .eyebrow { font-size: 8px; letter-spacing: 1.8px;
    }
    .upload-button { min-height: 50px; padding: 13px 20px; font-size: 13px;
    }
    /* Мобильная панель настроек */ .settings-panel { top: auto; right: 3%; bottom: 
        calc(145px + var(--safe-bottom)); width: 94%; max-width: 380px; left: 50%; 
        transform: translate(-50%, 10px); padding: 19px; border-radius: 20px;
    }
    .settings-panel.open { transform: translate(-50%, 0);
    }
    .panel-heading { margin-bottom: 17px;
    }
    .settings-panel label { margin: 13px 0 7px; font-size: 12px;
    }
    .settings-panel input[type="color"] { height: 38px;
    }
    /* Мобильный плеер */ .player { left: 3%; bottom: calc(10px + var(--safe-bottom)); 
        transform: none; width: 94%; min-height: 112px; grid-template-columns: minmax(0, 
        1fr) auto; grid-template-rows: auto auto; gap: 10px 12px; padding: 12px; 
        border-radius: 17px;
    }
    .track-info { min-width: 0; gap: 10px;
    }
    .track-icon { width: 37px; height: 37px; border-radius: 11px; font-size: 19px;
    }
    .track-text { min-width: 0;
    }
    .track-text strong { font-size: 11px;
    }
    .track-text span { font-size: 9px;
    }
    .playback { display: contents;
    }
    .play-button { grid-column: 2; grid-row: 1; width: 42px; height: 42px;
    }
    .timeline { grid-column: 1 / -1; grid-row: 2; gap: 9px; font-size: 9px;
    }
    .timeline input { min-height: 28px;
    }
    .volume { display: none;
    }
    .ambient { width: 55vw; height: 55vw; filter: blur(75px);
    }
}
/* Очень маленькие экраны */ @media (max-width: 360px) { .center-content { top: 40%;
    }
    h1 { font-size: 31px;
    }
    .subtitle { font-size: 12px;
    }
    .player { padding: 10px;
    }
    .track-icon { width: 34px; height: 34px;
    }
}
/* Горизонтальная ориентация телефона */ @media (max-width: 900px) and (orientation: 
landscape) {
    .center-content { top: 42%;
    }
    h1 { margin: 10px 0 5px; font-size: clamp(27px, 5vw, 42px);
    }
    .subtitle { margin-bottom: 13px;
    }
    .upload-button { min-height: 40px; padding: 9px 18px;
    }
    .player { bottom: calc(7px + var(--safe-bottom)); min-height: 68px; padding: 8px 13px;
    }
    .settings-panel { top: calc(65px + var(--safe-top)); bottom: auto; max-height: 
        calc(100dvh - 90px - var(--safe-top)); overflow-y: auto;
    }
}
/* Снижение анимации по системному запросу */ @media (prefers-reduced-motion: reduce) { *, 
    *::before, *::after {
        scroll-behavior: auto !important; transition-duration: .01ms !important; 
        animation-duration: .01ms !important;
    }
}


/* Переключатель визуальных режимов */
.mode-switcher {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: calc(130px + var(--safe-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    max-width: min(94%, 520px);
    padding: 7px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    background: rgba(20,14,29,.62);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}
.mode-button {
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s, background .2s, border-color .2s;
}
.mode-button:hover {
    color: var(--text);
    background: rgba(165,107,255,.1);
}
.mode-button.active {
    color: var(--text);
    border-color: rgba(213,138,255,.3);
    background: rgba(165,107,255,.2);
    box-shadow: inset 0 0 18px rgba(165,107,255,.08);
}
@media (max-width: 700px) {
    .mode-switcher {
        bottom: calc(132px + var(--safe-bottom));
        width: max-content;
        max-width: 96%;
        gap: 3px;
        padding: 5px;
        border-radius: 13px;
    }
    .mode-button {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 10px;
    }
}
@media (max-width: 360px) {
    .mode-switcher { gap: 2px; padding: 4px; }
    .mode-button { padding: 6px 7px; font-size: 9px; }
}
@media (max-width: 900px) and (orientation: landscape) {
    .mode-switcher { bottom: calc(82px + var(--safe-bottom)); }
}

/* Общая музыкальная библиотека */
.library-panel {
    position: absolute;
    z-index: 6;
    top: calc(88px + var(--safe-top));
    right: 5%;
    width: min(430px, 90%);
    max-height: calc(100dvh - 120px - var(--safe-top));
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 20px;
    background: rgba(18,12,29,.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 20px 70px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-9px);
    transition: opacity .25s, transform .25s, visibility .25s;
}

.library-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.library-panel .panel-heading {
    flex-shrink: 0;
    margin: 0;
}

.library-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(255,255,255,.045);
    color: var(--accent-light);
    font-size: 20px;
}

.library-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.library-search input::placeholder,
.library-text-input::placeholder {
    color: #897b96;
}

.library-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

#library-count {
    color: var(--accent-light);
    letter-spacing: 0;
}

.library-list {
    min-height: 70px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(165,107,255,.4) transparent;
}

.library-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 9px;
    border-bottom: 1px solid rgba(255,255,255,.055);
    transition: background .2s;
}

.library-track:hover {
    background: rgba(165,107,255,.07);
}

.library-track-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.library-track-title {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-track-artist {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-play {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(213,138,255,.25);
    border-radius: 50%;
    background: rgba(165,107,255,.14);
    color: var(--accent-light);
    cursor: pointer;
    transition: .2s;
}

.library-play:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.06);
}

.library-message {
    padding: 18px 8px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.library-more {
    flex-shrink: 0;
    min-height: 34px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: var(--accent-light);
    font-size: 11px;
    cursor: pointer;
}

.library-more[hidden] {
    display: none;
}

.library-upload {
    flex-shrink: 0;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.09);
}

.library-upload-heading {
    margin-bottom: 12px;
    color: var(--accent-light);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

#library-upload-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.library-file-label {
    display: grid;
    place-items: center;
    min-height: 39px;
    border: 1px dashed rgba(213,138,255,.35);
    border-radius: 10px;
    background: rgba(165,107,255,.07);
    color: var(--accent-light);
    font-size: 11px;
    cursor: pointer;
}

.library-file-name {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-text-input {
    width: 100%;
    min-height: 39px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    outline: none;
    background: rgba(255,255,255,.045);
    color: var(--text);
    font: inherit;
    font-size: 11px;
}

.library-text-input:focus,
.library-search:focus-within {
    border-color: rgba(213,138,255,.55);
}

.library-rights {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
    cursor: pointer;
}

.library-rights input {
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent);
}

.library-submit {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(110deg, #9253e8, #bd72ed);
    color: white;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}

.library-submit:hover {
    transform: translateY(-1px);
}

.library-submit:disabled {
    opacity: .5;
    cursor: wait;
}

.library-upload-status {
    min-height: 14px;
    margin: 0;
    color: var(--accent-light);
    font-size: 10px;
    line-height: 1.4;
}

@media (max-width: 700px) {
    .library-panel {
        top: calc(65px + var(--safe-top));
        right: 3%;
        bottom: calc(165px + var(--safe-bottom));
        left: 3%;
        width: auto;
        max-height: none;
        padding: 17px;
        gap: 11px;
        border-radius: 18px;
        transform: translateY(-7px);
    }

    .library-panel.open {
        transform: translateY(0);
    }

    .library-list {
        min-height: 55px;
        max-height: none;
        flex: 1;
    }

    .library-upload {
        padding-top: 10px;
    }
}

@media (max-width: 360px) {
    .library-panel {
        padding: 13px;
        gap: 9px;
    }

    .library-track {
        padding: 8px 5px;
    }
}

/* Кнопки верхней панели */
.topbar .top-label {
    margin-left: auto;
}

.topbar #library-toggle {
    margin-left: 18px;
}

.topbar #settings-toggle {
    margin-left: 10px;
}

@media (max-width: 700px) {
    .topbar #library-toggle {
        margin-left: auto;
    }

    .topbar #settings-toggle {
        margin-left: 9px;
    }
}

/* Новое расположение центрального текста */
.center-content {
    top: 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.center-content .eyebrow,
.center-content .subtitle,
.center-content h1 {
    margin: 0;
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.4;
    letter-spacing: .5px;
    font-weight: 600;
}

.center-content .eyebrow {
    color: var(--muted);
}

.center-content .subtitle {
    color: var(--text);
}

.center-content h1 {
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: .5px;
    font-weight: 600;
}

.center-content h1 span {
    color: var(--accent-light);
}

@media (max-width: 700px) {
    .center-content {
        top: 62%;
        width: 94%;
        gap: 12px;
    }

    .center-content .eyebrow,
    .center-content .subtitle,
    .center-content h1 {
        font-size: 14px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .center-content {
        top: 60%;
        gap: 8px;
    }
}

/* Новое расположение центрального текста */
.center-content {
    top: 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.center-content .eyebrow,
.center-content .subtitle,
.center-content h1 {
    margin: 0;
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.4;
    letter-spacing: .5px;
    font-weight: 600;
}

.center-content .eyebrow {
    color: var(--muted);
}

.center-content .subtitle {
    color: var(--text);
}

.center-content h1 {
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: .5px;
    font-weight: 600;
}

.center-content h1 span {
    color: var(--accent-light);
}

@media (max-width: 700px) {
    .center-content {
        top: 62%;
        width: 94%;
        gap: 12px;
    }

    .center-content .eyebrow,
    .center-content .subtitle,
    .center-content h1 {
        font-size: 14px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .center-content {
        top: 60%;
        gap: 8px;
    }
}

/* Финальное расположение и размеры центрального текста */
.center-content {
    top: auto;
    bottom: calc(190px + var(--safe-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.center-content .eyebrow {
    margin: 0;
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: 1.8px;
}

.center-content .subtitle {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.35;
    letter-spacing: .3px;
}

.center-content h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -1px;
    font-weight: 800;
}

.center-content h1 span {
    color: var(--accent-light);
}

@media (max-width: 700px) {
    .center-content {
        bottom: calc(184px + var(--safe-bottom));
        width: 94%;
        gap: 7px;
    }

    .center-content .eyebrow {
        font-size: 9px;
    }

    .center-content .subtitle {
        font-size: clamp(17px, 4.5vw, 20px);
    }

    .center-content h1 {
        font-size: clamp(25px, 7vw, 30px);
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .center-content {
        bottom: calc(132px + var(--safe-bottom));
        gap: 5px;
    }

    .center-content .subtitle {
        font-size: 17px;
    }

    .center-content h1 {
        font-size: 25px;
    }
}
