/* =========================================================
   player/css/style.css
   Первый экран — «Моя музыка»
   ========================================================= */

:root {
    color-scheme: dark;

    --bg: #0b0c0f;
    --surface: #17191f;
    --surface-2: #1d2027;

    --text: #f5f5f7;
    --muted: #a3a6b0;
    --muted-2: #777c87;

    --line: #2b2e37;
    --accent: #ff9f24;
    --accent-soft: rgba(255, 159, 36, .12);
}

/* ---------------------------------------------------------
   Базовые
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;

    background: var(--bg);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------------------------------------------------------
   Основной контейнер
   --------------------------------------------------------- */

.app {
    width: min(100%, 760px);
    margin: 0 auto;

    padding:
        calc(14px + env(safe-area-inset-top))
        16px
        calc(240px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------
   Поиск
   --------------------------------------------------------- */

.search {
    width: 100%;
    min-height: 49px;

    margin-top: 15px;
    padding: 0 14px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: 1px solid var(--line);
    border-radius: 15px;

    background: var(--surface);
    color: var(--muted);

    transition:
        border-color .18s ease,
        background .18s ease;
}

.search:focus-within {
    border-color: rgba(255, 159, 36, .5);
    background: #191b21;
}

.search > span {
    flex: 0 0 auto;

    color: #9296a1;

    font-size: 22px;
    line-height: 1;
}

.search input {
    width: 100%;
    min-width: 0;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--text);

    font-size: 15px;
}

.search input::placeholder {
    color: #969aa5;
    opacity: 1;
}

/* ---------------------------------------------------------
   Заголовки секций
   --------------------------------------------------------- */

section {
    width: 100%;
}

.section-header {
    margin: 25px 2px 12px;

    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 10px;
}

.section-header h2 {
    margin: 0;

    color: var(--text);

    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.25px;
}

.text-button {
    padding: 4px 0 4px 8px;

    background: transparent;
    color: var(--accent);

    font-size: 13px;
    line-height: 1.2;

    white-space: nowrap;
}

.text-button:active {
    opacity: .7;
}

/* ---------------------------------------------------------
   Категории
   --------------------------------------------------------- */

.categories {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 11px;
}

.category {
    position: relative;

    min-width: 0;
    min-height: 126px;

    overflow: hidden;

    display: flex;
    align-items: flex-end;

    padding: 12px;

    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;

    background:
        var(--art);

    color: #fff;

    text-align: left;

    isolation: isolate;

    transition:
        transform .18s ease,
        border-color .18s ease;
}

.category::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, .02) 8%,
            rgba(0, 0, 0, .22) 42%,
            rgba(0, 0, 0, .88) 100%
        );
}

.category:active {
    transform: scale(.98);
}

.category:hover {
    border-color: rgba(255, 255, 255, .18);
}

.category > span {
    display: flex;
    flex-direction: column;
    gap: 4px;

    min-width: 0;

    position: relative;
    z-index: 1;
}

.category b {
    overflow: hidden;

    font-size: 16px;
    line-height: 1.15;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.category small {
    font-size: 12px;
    line-height: 1.2;

    color: rgba(255, 255, 255, .8);
}

/* ---------------------------------------------------------
   Фоны категорий
   --------------------------------------------------------- */

.category--rap {
    --art:
        radial-gradient(
            ellipse at 70% 24%,
            #ffad37 0,
            #8a3b13 27%,
            transparent 55%
        ),
        linear-gradient(
            135deg,
            #3b1d16,
            #12141c 72%
        );
}

.category--pop {
    --art:
        radial-gradient(
            ellipse at 72% 20%,
            #ff70c5 0,
            #6c29a8 32%,
            transparent 58%
        ),
        linear-gradient(
            130deg,
            #291644,
            #11131b 76%
        );
}

.category--dance {
    --art:
        radial-gradient(
            ellipse at 45% 28%,
            #49d5ff 0,
            #2254a8 32%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #12294a,
            #11131a 76%
        );
}

.category--work {
    --art:
        radial-gradient(
            ellipse at 75% 25%,
            #d5a66e 0,
            #65503a 32%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #3d3429,
            #15171c 76%
        );
}

.category--happy {
    --art:
        radial-gradient(
            ellipse at 72% 25%,
            #ffb45e 0,
            #bf4b6c 30%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #4c2348,
            #17151f 76%
        );
}

/* ---------------------------------------------------------
   Добавить категорию
   --------------------------------------------------------- */

.category--add {
    align-items: center;
    justify-content: center;

    gap: 10px;

    border: 1px dashed #555965;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .035),
            rgba(255, 255, 255, .015)
        );

    color: #d6d7dc;

    text-align: center;

    font-size: 13px;
    line-height: 1.3;
}

.category--add::after {
    display: none;
}

.category--add i {
    width: 35px;
    height: 35px;

    flex: 0 0 35px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background: #252831;
    color: var(--accent);

    font-size: 26px;
    font-style: normal;
    font-weight: 300;
}

.category--add:active {
    transform: scale(.98);
}

/* ---------------------------------------------------------
   Системные разделы
   --------------------------------------------------------- */

.system-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;
}

.system-card {
    min-width: 0;
    min-height: 82px;

    padding: 9px 4px 8px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    border: 1px solid var(--line);
    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            #1b1e25,
            #14161b
        );

    color: var(--text);

    text-align: center;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.system-card:active {
    transform: scale(.97);
}

.system-card:hover {
    border-color: #3b3e48;
    background:
        linear-gradient(
            145deg,
            #20232a,
            #16181e
        );
}

.system-card i {
    color: var(--accent);

    font-size: 21px;
    line-height: 1;

    font-style: normal;
}

.system-card b {
    overflow: hidden;

    max-width: 100%;

    font-size: 11px;
    line-height: 1.15;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-card small {
    color: var(--muted);

    font-size: 11px;
    line-height: 1.1;
}

/* ---------------------------------------------------------
   Мини-плеер
   --------------------------------------------------------- */

.player-dock {
    position: fixed;

    z-index: 20;

    left: 0;
    right: 0;

    bottom:
        calc(
            62px +
            env(safe-area-inset-bottom)
        );

    padding: 0 10px;

    background:
        linear-gradient(
            180deg,
            rgba(11, 12, 15, .88),
            #0b0c0f 35%
        );
}

.player {
    width: min(100%, 740px);

    margin: 0 auto;
    padding: 10px 11px 7px;

    border: 1px solid #343740;
    border-radius: 17px;

    background:
        linear-gradient(
            145deg,
            #1a1d24,
            #111318
        );

    box-shadow:
        0 8px 26px rgba(0, 0, 0, .38);
}

.player-top {
    display: flex;
    align-items: center;

    gap: 9px;
}

.cover {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border: 1px solid rgba(255, 159, 36, .35);
    border-radius: 9px;

    color: #ffe0a4;

    font-size: 23px;

    background:
        radial-gradient(
            circle at 70% 25%,
            #f5b64e 0,
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #613a25,
            #1b1d23 75%
        );
}

.track {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.track b {
    overflow: hidden;

    color: var(--text);

    font-size: 14px;
    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.track small {
    overflow: hidden;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-icon {
    width: 29px;
    height: 38px;

    flex: 0 0 29px;

    display: grid;
    place-items: center;

    padding: 0;

    background: transparent;
    color: #f0f1f4;

    font-size: 23px;
}

.progress-row {
    display: flex;
    align-items: center;

    gap: 7px;

    margin: 8px 0 4px;
}

.progress-row small {
    color: var(--muted);

    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.progress {
    height: 3px;

    flex: 1;

    overflow: hidden;

    border-radius: 8px;

    background: #3a3d46;
}

.progress span {
    display: block;

    width: 38%;
    height: 100%;

    border-radius: inherit;

    background: var(--accent);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 6px;
}

.controls button {
    min-width: 0;
    height: 39px;

    flex: 1;

    padding: 0;

    background: transparent;
    color: #f0f1f4;

    font-size: 20px;
}

.controls .mode {
    color: #9da1ac;
}

.controls .active {
    color: var(--accent);
}

.controls .play {
    width: 39px;
    height: 39px;

    flex: 0 0 39px;

    border-radius: 50%;

    background: var(--accent);
    color: #19130a;

    font-size: 17px;
    font-weight: 800;

    box-shadow:
        0 0 15px rgba(255, 159, 36, .22);
}

/* ---------------------------------------------------------
   Нижняя навигация
   --------------------------------------------------------- */

.bottom-nav {
    position: fixed;

    z-index: 21;

    left: 0;
    right: 0;
    bottom: 0;

    min-height:
        calc(
            62px +
            env(safe-area-inset-bottom)
        );

    padding:
        7px
        7px
        calc(
            6px +
            env(safe-area-inset-bottom)
        );

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    background: rgba(13, 14, 18, .98);

    border-top: 1px solid rgba(255, 255, 255, .06);
}

.bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    border: 0;

    background: transparent;
    color: #858995;

    font-size: 10px;
    line-height: 1.1;
}

.bottom-nav i {
    font-size: 19px;
    line-height: 1;

    font-style: normal;
}

.bottom-nav .active {
    color: var(--accent);
}

/* ---------------------------------------------------------
   Планшет / широкие экраны
   --------------------------------------------------------- */

@media (min-width: 560px) {

    .app {
        padding-left: 24px;
        padding-right: 24px;
    }

    .categories {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 14px;
    }

    .category {
        min-height: 145px;
    }

    .system-grid {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));

        gap: 10px;
    }

    .system-card {
        min-height: 94px;
    }

    .player-dock {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ---------------------------------------------------------
   Очень маленькие экраны
   --------------------------------------------------------- */

@media (max-width: 360px) {

    .app {
        padding-left: 12px;
        padding-right: 12px;
    }

    .categories {
        gap: 8px;
    }

    .category {
        min-height: 112px;

        border-radius: 14px;
    }

    .category b {
        font-size: 14px;
    }

    .category--add {
        font-size: 12px;
    }

    .system-grid {
        gap: 5px;
    }

    .system-card {
        min-height: 78px;
    }

    .system-card b {
        font-size: 10px;
    }

    .player-dock {
        padding-left: 7px;
        padding-right: 7px;
    }

    .player {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* ==========================================================
   СОВМЕСТИМОСТЬ С ТЕКУЩИМ HTML ГЛАВНОГО ЭКРАНА
   ========================================================== */

/* Сетка категорий */
.categories__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

/* Карточка категории */
.category-card {
    position: relative;
    min-width: 0;
    min-height: 126px;

    overflow: hidden;

    display: flex;
    align-items: flex-end;

    padding: 12px;

    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 16px;

    background: var(--art);

    color: #fff;

    text-align: left;

    appearance: none;
    -webkit-appearance: none;

    isolation: isolate;
}

.category-card::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -2;

    background: var(--art);

    background-size: cover;
    background-position: center;
}

.category-card::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, .02) 8%,
            rgba(0, 0, 0, .20) 42%,
            rgba(0, 0, 0, .88) 100%
        );
}

.category-card__info {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-card__name {
    font-size: 16px;
    line-height: 1.15;
    font-weight: 700;
}

.category-card__count {
    font-size: 12px;
    line-height: 1.2;
    color: rgba(255, 255, 255, .80);
}

/* Фоны категорий */

.category-card--rap {
    --art:
        radial-gradient(
            ellipse at 70% 24%,
            #ffad37 0,
            #8a3b13 27%,
            transparent 55%
        ),
        linear-gradient(
            135deg,
            #3b1d16,
            #12141c 72%
        );
}

.category-card--pop {
    --art:
        radial-gradient(
            ellipse at 72% 20%,
            #ff70c5 0,
            #6c29a8 32%,
            transparent 58%
        ),
        linear-gradient(
            130deg,
            #291644,
            #11131b 76%
        );
}

.category-card--dance {
    --art:
        radial-gradient(
            ellipse at 45% 28%,
            #49d5ff 0,
            #2254a8 32%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #12294a,
            #11131a 76%
        );
}

.category-card--work {
    --art:
        radial-gradient(
            ellipse at 75% 25%,
            #d5a66e 0,
            #65503a 32%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #3d3429,
            #15171c 76%
        );
}

.category-card--happy {
    --art:
        radial-gradient(
            ellipse at 72% 25%,
            #ffb45e 0,
            #bf4b6c 30%,
            transparent 60%
        ),
        linear-gradient(
            135deg,
            #4c2348,
            #17151f 76%
        );
}

/* Добавить категорию */

.category-card--add {
    align-items: center;
    justify-content: center;

    gap: 10px;

    border: 1px dashed #555965;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.015)
        );

    text-align: center;

    font-size: 13px;
    line-height: 1.3;
}

.category-card--add::before,
.category-card--add::after {
    display: none;
}

.category-card__add-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: #252831;

    color: var(--accent);

    font-size: 27px;
    font-weight: 300;
}

/* ==========================================================
   СИСТЕМНЫЕ РАЗДЕЛЫ
   ========================================================== */

.system__grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;
}

.system-card {
    min-width: 0;
    min-height: 82px;

    padding: 9px 5px 8px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    border: 1px solid var(--line);
    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            #1b1e25,
            #14161b
        );

    color: var(--text);

    text-align: center;

    appearance: none;
    -webkit-appearance: none;
}

.system-card__icon {
    color: var(--accent);
    font-size: 21px;
    line-height: 1;
}

.system-card__name {
    font-size: 11px;
    line-height: 1.15;
    font-weight: 650;
}

.system-card__count {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.1;
}

/* ==========================================================
   РАЗМЕРЫ ДЛЯ БОЛЬШИХ ЭКРАНОВ
   ========================================================== */

@media (min-width: 560px) {

    .categories__grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 14px;
    }

    .category-card {
        min-height: 145px;
    }

    .system__grid {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));

        gap: 10px;
    }

    .system-card {
        min-height: 94px;
    }
}

/* ==========================================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ
   ========================================================== */

@media (max-width: 360px) {

    .categories__grid {
        gap: 8px;
    }

    .category-card {
        min-height: 112px;
        border-radius: 14px;
    }

    .category-card__name {
        font-size: 14px;
    }

    .system__grid {
        gap: 5px;
    }

    .system-card {
        min-height: 78px;
    }

    .system-card__name {
        font-size: 10px;
    }
}

/* ==========================================================
   ИСПРАВЛЕНИЕ СЕКЦИИ КАТЕГОРИЙ
   ========================================================== */

/* .categories — это сама секция, а не сетка */
.categories {
    display: block;
    width: 100%;
}

/* Сетка находится внутри .categories__grid */
.categories__grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

@media (min-width: 560px) {
    .categories {
        display: block;
    }

    .categories__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

/* ==========================================================
   НИЖНЯЯ НАВИГАЦИЯ — SVG
   ========================================================== */

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    color: #858995;
}

.bottom-nav__item svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav__item span {
    font-size: 10px;
    line-height: 1.1;
}

.bottom-nav__item--active {
    color: var(--accent);
}