/* ============================================================
   Suno Music — общие стили (app.css)
   ============================================================ */

:root {
    --h-top: 54px;
    --h-player: 64px;
    --w-side: 240px;
    --h-mnav: 62px;

    /* мобильные размеры плеера/навигации */
    --h-player-m: 78px;
    --h-mnav-m: 68px;

    --accent: #f5c518;
    --accent2: #ff8a00;
    --line: #26262f;
    --panel: #16161f;
    --panel2: #1e1e2a;
    --bg: #0b0b12;
    --bg2: #0d0d14;
    --fg: #eceef5;
    --sub: #8b8d9c;
    --ok: #34d399;
    --danger: #f87171;
}

@media (min-width: 760px) {
    :root {
        --h-top: 60px;
        --h-player: 80px;
    }
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, rgba(245, 197, 24, .09), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(255, 138, 0, .08), transparent 55%),
    #0b0b12;
    color: #eceef5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

/* ---------- каркас ---------- */
.app-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--h-top);
    z-index: 60;
}

.app-side {
    position: fixed;
    top: var(--h-top);
    bottom: var(--h-player);
    left: 0;
    width: var(--w-side);
    z-index: 40;
}

.app-main {
    margin-left: 0;
    padding-top: var(--h-top);
    padding-bottom: calc(var(--h-player) + var(--h-mnav) + 16px);
}

.app-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--h-player) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 70;
    background: linear-gradient(180deg, #16161f, #0d0d14);
    border-top: 1px solid #26262f;
    box-shadow: 0 -14px 44px -18px rgba(0, 0, 0, .8);
}

.app-mnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--h-player) + env(safe-area-inset-bottom, 0px));
    height: var(--h-mnav);
    display: flex;
    z-index: 55;
}

@media (min-width: 760px) {
    .app-main {
        margin-left: var(--w-side);
        padding-bottom: calc(var(--h-player) + 24px);
    }
    .app-mnav {
        display: none;
    }
}

/* ---------- нижний плеер ---------- */
.pl-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    display: flex;
    align-items: center;
}

.pl-seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #25252f;
    outline: none;
    cursor: pointer;
}
.pl-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(245, 197, 24, .85);
    transition: transform .15s;
}
.pl-seek::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.pl-seek::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(245, 197, 24, .85);
}
.pl-seek::-moz-range-track {
    height: 3px;
    background: #25252f;
}

.pl-row {
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}
@media (min-width: 640px) {
    .pl-row {
        gap: 14px;
        padding: 0 14px;
    }
}

.pl-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.pl-now {
    min-width: 0;
    max-width: 150px;
}
.pl-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}
.pl-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.pl-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 0 24px -8px #f5c518;
    transition: transform .15s;
}
.pl-play:hover {
    transform: scale(1.06);
}
.pl-time {
    color: #8b8d9c;
    font-size: 11px;
    min-width: 34px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ПЛЕЕРА
   ============================================================ */
@media (max-width: 759px) {
    :root {
        --h-player: var(--h-player-m);
        --h-mnav: var(--h-mnav-m);
    }
    .pl-row {
        top: 18px;
        gap: 8px;
        padding: 0 8px;
    }
    .pl-seek {
        height: 4px;
    }
    .pl-seek::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    .pl-play {
        width: 54px;
        height: 54px;
        font-size: 24px;
    }
    .pl-time {
        font-size: 12px;
        min-width: 38px;
    }
    .pl-now {
        max-width: 130px;
    }
    .pl-left {
        gap: 10px;
    }
    .pl-center {
        gap: 8px;
    }
    .pl-right {
        gap: 4px;
    }
}

/* На очень узких экранах — прячем кнопки prev/next, оставляем play */
@media (max-width: 560px) {
    .pl-now {
        max-width: 105px;
    }
    .pl-time-tot {
        display: none;
    }
    .pl-right {
        gap: 4px;
    }
    .pl-center button:not(#btnPlay) {
        display: none;
    }
    .pl-left {
        gap: 8px;
    }
}

/* ---------- скроллбар ---------- */
.scroll-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.scroll-thin::-webkit-scrollbar-thumb {
    background: #26262f;
    border-radius: 3px;
}
.scroll-thin::-webkit-scrollbar-track {
    background: transparent;
}

/* плавный инерционный скролл на iOS в прокручиваемых блоках */
#pickModal .scroll-thin,
#npModal,
#eqModal .scroll-thin {
    -webkit-overflow-scrolling: touch;
}

/* ---------- слайдеры (общие) ---------- */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 5px;
    background: #26262f;
    outline: none;
    cursor: pointer;
    transition: background .2s;
}
input[type=range]:hover {
    background: #33334a;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(245, 197, 24, .75);
    transition: transform .15s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(245, 197, 24, .75);
}

/* ---------- обложка-«колонка» ---------- */
.p-eq {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58%;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0 6px;
    background: linear-gradient(to top, rgba(10, 10, 16, .85), transparent);
}
.p-eq-bar {
    flex: 1;
    border-radius: 2px;
    min-height: 6%;
    background: linear-gradient(to top, #f5c518, #ff8a00);
    transition: height .08s linear;
}

.eq-ico {
    width: 16px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    justify-content: center;
    height: 16px;
}
.eq-ico span {
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    height: 30%;
}
.eq-ico.play span {
    animation: eqb 1s ease-in-out infinite;
}
.eq-ico.play span:nth-child(2) {
    animation-delay: .2s;
}
.eq-ico.play span:nth-child(3) {
    animation-delay: .4s;
}
@keyframes eqb {
    0%, 100% {
        height: 30%
    }
    50% {
        height: 100%
    }
}

/* ---------- переключатель ---------- */
.switch input {
    display: none;
}
.switch .knob {
    width: 42px;
    height: 23px;
    border-radius: 999px;
    background: #1e1e2a;
    border: 1px solid #26262f;
    position: relative;
    transition: .25s;
}
.switch .knob::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    transition: .25s cubic-bezier(.2, .9, .25, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.switch input:checked + .knob {
    background: linear-gradient(135deg, #f5c518, #ff8a00);
    border-color: transparent;
}
.switch input:checked + .knob::after {
    left: 21px;
}

/* ---------- подсветка поиска ---------- */
mark.hl {
    background: rgba(245, 197, 24, .32);
    color: #fff;
    border-radius: 3px;
    padding: 0 1px;
}

/* ---------- строки жанров ---------- */
.g-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

@media (min-width: 900px) {
    .g-list {
        grid-template-columns: 1fr 1fr;
        gap: 2px 10px;
    }
}

@media (min-width: 1440px) {
    .g-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.g-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 12px;
    border-radius: 12px;
    min-width: 0;
    cursor: pointer;
    transition: background .15s, transform .1s;
    animation: fadeUp .2s ease;
}
.g-row:hover {
    background: #16161f;
}
.g-row:active {
    transform: scale(.995);
}
.g-row.active {
    background: linear-gradient(90deg, rgba(245, 197, 24, .16), rgba(255, 138, 0, .09));
}
.g-main {
    flex: 1;
    min-width: 0;
}
.g-name {
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.g-sub {
    font-size: 11.5px;
    color: var(--sub);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.g-chev {
    flex: none;
    color: var(--sub);
    font-size: 16px;
    line-height: 1;
}
.g-row.zero .g-name,
.g-row.zero .g-sub,
.g-row.zero .g-chev {
    opacity: .5;
}
.g-dot {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex: none;
    background: linear-gradient(135deg, var(--c, #f5c518), rgba(245, 197, 24, .45));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- чипы ---------- */
.chip {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    background: #1e1e2a;
    border: 1px solid #26262f;
    color: #eceef5;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.chip:hover {
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}
.chip.active {
    background: linear-gradient(135deg, #f5c518, #ff8a00);
    color: #fff;
    border-color: transparent;
}

/* ---------- пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
}
.pager-info {
    color: #8b8d9c;
    font-size: 12px;
    padding: 0 6px;
}
@media (min-width: 640px) {
    .pager {
        gap: 6px;
    }
    /* «1–50 из 939» — своей строкой, иначе прилипает к кнопке » */
    .pager-info {
        width: 100%;
        text-align: center;
        padding: 6px 0 0;
    }
}
.pager-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    background: #1e1e2a;
    border: 1px solid #26262f;
    color: #eceef5;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .15s;
    cursor: pointer;
}
.pager-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}
.pager-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.pager-btn.active {
    background: linear-gradient(135deg, #f5c518, #ff8a00);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px -8px #ff8a00;
}
.pager-dots {
    color: #8b8d9c;
    padding: 0 4px;
    user-select: none;
}

/* ---------- обложка плейлиста ---------- */
.pl-cov {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ff8a00, #f5c518);
}
.pl-cov::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .25), transparent 60%);
}
.pl-cov img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- навигация ---------- */
.nav.active {
    background: linear-gradient(135deg, rgba(245, 197, 24, .18), rgba(255, 138, 0, .12));
    color: #fff;
    font-weight: 600;
}

.mnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8b8d9c;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s;
    padding-bottom: 4px;
    background: transparent;
    border: none;
}
.mnav-item::before {
    font-size: 24px;
    line-height: 1;
    content: attr(data-ic);
}
.mnav-item:hover {
    color: #eceef5;
}
.mnav-item.active {
    color: #f5c518;
}
.mnav-item.active::before {
    filter: drop-shadow(0 0 10px rgba(245, 197, 24, .55));
}

/* ---------- играющий трек ---------- */
.track.playing {
    background: linear-gradient(90deg, rgba(245, 197, 24, .16), rgba(255, 138, 0, .08));
}
.track.playing .t-title {
    color: #f5c518;
}

/* ---------- заблокированное действие ---------- */
.act-disabled {
    opacity: .35;
    pointer-events: none;
}

/* ---------- полноэкранный «Сейчас играет» ---------- */
body.np-open {
    overflow: hidden;
}
.np-play {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    font-size: 30px;
    color: #0b0b12;
    background: linear-gradient(135deg, #f5c518, #ff8a00);
    box-shadow: 0 0 30px rgba(245, 197, 24, .35), 0 10px 30px -12px rgba(0, 0, 0, .8);
    display: grid;
    place-items: center;
    transition: transform .15s, box-shadow .2s;
}
.np-play:hover {
    transform: scale(1.05);
}
.np-play:active {
    transform: scale(.97);
}
.np-cov img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.np-glow {
    animation: npPulse 2.6s ease-in-out infinite;
}
@keyframes npPulse {
    0%, 100% {
        box-shadow: 0 0 34px -8px rgba(245, 197, 24, .45);
    }
    50% {
        box-shadow: 0 0 60px -6px rgba(245, 197, 24, .65);
    }
}

/* ---------- эквалайзер ---------- */
.eq-preset {
    transition: transform .15s, border-color .15s, background .15s;
}
.eq-preset:hover {
    transform: translateY(-1px);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (крупные кнопки, удобные тач-цели)
   ============================================================ */
@media (max-width: 759px) {
    .track {
        gap: 12px;
        padding: 12px 12px;
        border-radius: 14px;
    }
    .track .eq-ico {
        width: 20px;
        height: 20px;
    }
    .track .cvr {
        width: 50px;
        height: 50px;
    }
    .track .t-title {
        font-size: 14px;
    }
    .pager-btn {
        min-width: 42px;
        height: 42px;
        font-size: 14px;
    }
    .pager {
        gap: 8px;
    }
    .pager-info {
        width: 100%;
        text-align: center;
    }
    .g-list {
        gap: 2px;
    }
    .g-row {
        padding: 10px 12px;
        gap: 12px;
    }
    .g-row .g-dot {
        width: 42px;
        height: 42px;
        font-size: 16px;
        border-radius: 12px;
    }
    .g-name {
        font-size: 15px;
    }
    .g-sub {
        font-size: 12.5px;
    }
    .chip {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 42px;
    }

    /* нижнее меню — крупнее иконки и текст */
    .app-mnav {
        background: rgba(13, 13, 20, .95);
    }
    .mnav-item {
        font-size: 12.5px;
        gap: 4px;
    }
    .mnav-item::before {
        font-size: 26px;
    }

    /* модалки — почти full-screen */
    #pickModal > div,
    #authModal > div,
    #nameModal > div,
    #eqModal > div {
        width: 100% !important;
        max-height: 92vh;
        border-radius: 22px 22px 0 0 !important;
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* поля ввода — 16px, чтобы iOS не зумил */
    #authModal input,
    #nameModal input {
        font-size: 16px !important;
        padding: 14px 14px !important;
    }

    /* кнопки в модалках — на всю ширину */
    #authLoginBtn,
    #authRegBtn,
    #authVerifyBtn,
    #authResendBtn,
    #nameOk {
        width: 100% !important;
        padding: 14px !important;
        font-size: 14.5px !important;
    }

    /* страница трека/плейлиста — кнопки действий крупнее */
    #view-pl .flex.gap-2.mt-3 button {
        flex: 1 1 46%;
        padding: 12px 10px;
        font-size: 13.5px;
    }
    #view-pl .flex.gap-2.mt-3 #plPlayAll {
        flex: 1 1 100%;
    }

    /* hero-поиск на /search */
    .search-hero {
        padding: 16px 14px;
        border-radius: 18px;
    }
    .search-hero input {
        font-size: 19px;
    }
    #btnLoadMore {
        width: 100%;
        padding: 14px;
        font-size: 14px;
    }
}

/* ---------- тач-устройства: минимум 44×44 ---------- */
@media (hover: none) and (pointer: coarse) {
    button, a, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    /* исключения — иконки в трек-строках */
    .track button, .track a {
        min-height: 42px;
        min-width: 42px;
    }
    input[type="range"] {
        height: 30px;
    }
    input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    input[type="range"]::-moz-range-thumb {
        width: 22px;
        height: 22px;
    }
    .pl-seek {
        height: 4px;
    }
    .pl-seek::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
}

/* ---------- очень узкие экраны: чуть уменьшаем отступы ---------- */
@media (max-width: 380px) {
    .app-top {
        padding-left: 8px;
        padding-right: 8px;
    }
    .mnav-item {
        font-size: 11.5px;
    }
    .mnav-item::before {
        font-size: 23px;
    }
}

