* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 500px;
    background: linear-gradient(180deg, #333, #111);
}

/* Левая часть – текст */
.lyrics {
    position: relative;
    padding: 2rem;
    color: #ddd;
    font-weight: 400;
    text-shadow: 2px 2px 4px #000;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
}

.lyrics-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
}

/* Контейнер для текста – с прокруткой */
.lyrics-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1rem;
    font-size: 1.5rem;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Обычный текст – центрируем блок, добавляем отступы */
.lyrics-content:not(.karaoke-mode .lyrics-content) {
    padding-left: 40%;
    padding-right: 10%;
    text-align: left;
}

/* Караоке-режим */
.karaoke-mode .lyrics-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: hidden;
    padding-left: 1rem;
    padding-right: 1rem;
}

.prev-line,
.current-line,
.next-line {
    width: 100%;
    transition: all 0.3s ease;
}

.prev-line {
    font-size: 2rem;
    color: #aaa;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.current-line {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px cyan;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.next-line {
    font-size: 2rem;
    color: #aaa;
    opacity: 0.8;
}

/* Обычный текст – каждая строка */
.lyrics-line {
    width: 100%;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Правая часть – плеер */
.container {
    background: #111;
    box-shadow: -10px 0 20px rgba(0,0,0,0.5), 0 0 0 2px rgba(255,255,255,0.05);
    border-radius: 24px 0 0 24px;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 2;
}

.container.shifted {
    transform: translateX(-320px);
}

header {
    width: 100%;
    height: 2.5rem;
    line-height: 2.5rem;
    font-size: 1.4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.playlist {
    float: left;
    cursor: pointer;
    transition: color 0.2s;
}

.setting {
    float: right;
    cursor: pointer;
    transition: color 0.2s;
}

.playlist:hover, .setting:hover {
    color: cyan;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.album-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0,255,255,0.5);
}

.album-art {
    padding: 0.7rem;
    background: #000;
    border-radius: 16px;
}

.album-art img {
    width: 240px;
    height: 240px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

.player {
    position: relative;
    width: 240px;
    height: 240px;
    background: linear-gradient(0deg, #222, #111);
    border-radius: 50%;
    border: solid 3px #000;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 6px 4px rgba(0,0,0,0.3);
}

.player .fa {
    font-size: 1.3rem;
    position: absolute;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s ease;
}

.player .fa:hover {
    color: cyan;
    text-shadow: 0 0 6px cyan;
}

.player .fa-play,
.player .fa-pause {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border: solid 3px #000;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 0 12px rgba(0,0,0,0.8);
    border-radius: 50%;
    line-height: 110px;
    text-align: center;
    background: linear-gradient(0deg, #111, #222);
    font-size: 2.5rem;
}

.fa-repeat {
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
}

.fa-fast-backward {
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
}

.fa-fast-forward {
    top: 50%;
    left: 82%;
    transform: translateY(-50%);
}

.fa-random {
    top: 82%;
    left: 50%;
    transform: translateX(-50%);
}

footer {
    color: #999;
    text-shadow: 2px 2px #111;
    width: 100%;
    margin-top: 1rem;
}

.title {
    text-align: center;
    padding-bottom: 0.8rem;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-tracker {
    border-top: solid 2px #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    padding-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer {
    flex: 1;
    height: 2rem;
    cursor: pointer;
    position: relative;
}

.bg {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    height: 0.6rem;
    border-top: solid 2px #000;
    border-radius: 10px;
    background: none;
    box-shadow: inset 0 -1px 2px rgba(255,255,255,0.2);
    overflow: hidden;
}

.bg::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 0.2rem;
    border-radius: 10px;
    width: 0%;
    background: cyan;
    box-shadow: 0 0 4px 3px cyan;
    transition: width 0.1s linear;
}

.time {
    font-size: 0.9rem;
    color: #aaa;
    min-width: 75px;
    text-align: right;
}

/* Плейлист */
.playlist-panel {
    position: absolute;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    transition: right 0.3s ease;
    z-index: 10;
    padding: 2rem 1.5rem;
    color: #fff;
    overflow-y: auto;
}

.playlist-panel.open {
    right: 0;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
}

.playlist-header h3 {
    font-weight: 400;
}

#playlist {
    list-style: none;
}

#playlist li {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-left: 4px solid transparent;
}

#playlist li:hover {
    background: rgba(255,255,255,0.15);
}

#playlist li.active {
    background: rgba(0,255,255,0.2);
    border-left-color: cyan;
}

#playlist img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin-right: 15px;
    object-fit: cover;
}

#playlist span {
    font-size: 1rem;
    color: #eee;
}

/* ========== Адаптация для мобильных ========== */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .lyrics {
        height: 50vh;
        padding: 1rem;
    }

    .container {
        height: 50vh;
        border-radius: 0;
        padding: 1rem;
    }

    .container.shifted {
        transform: none;
    }

    .album-title {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }

    .album-art img {
        width: 150px;
        height: 150px;
    }

    .player {
        width: 150px;
        height: 150px;
    }

    .player .fa-play,
    .player .fa-pause {
        width: 70px;
        height: 70px;
        line-height: 70px;
        font-size: 1.8rem;
    }

    .player .fa {
        font-size: 1rem;
    }

    .prev-line {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .current-line {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .next-line {
        font-size: 1.2rem;
    }

    .lyrics-content {
        max-height: 40vh;
        font-size: 1.2rem;
        padding-left: 5%;
        padding-right: 5%;
    }

    .playlist-panel {
        width: 80%;
        right: -80%;
    }

    .playlist-panel.open {
        right: 0;
    }
}