* { box-sizing: border-box; }

body {
    margin: 0; min-height: 100vh; display: flex;
    justify-content: center; align-items: center;
    background: #14151a; color: #eee;
    font-family: system-ui, sans-serif;
}

/* плеер: не фиксированная ширина, а с запасом на телефоны */
.player {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    background: #1e2027;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    margin: 16px;
}

h1 {
    font-size: 1.4em;
    text-align: center;
    margin: 0 0 8px;
}

/* шапка: заголовок слева, переключатель языков справа */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 {
    font-size: 1.4em;
    margin: 0;
}

/* переключатель RU / EN */
.lang-switch {
    display: flex;
    gap: 4px;
    background: #2a2d37;
    border-radius: 20px;
    padding: 3px;
}
.lang-switch button {
    background: none;
    border: none;
    color: #8a8f9c;
    font-size: .8em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
}
.lang-switch button.active {
    background: #4f6ef7;
    color: #fff;
}


.now-playing { display: flex; gap: 16px; align-items: center; margin: 16px 0; }

/* ключевой фикс: разрешаем текстовому блоку сжиматься,
   иначе длинные названия вылезают за плеер */
.now-playing > div {
    min-width: 0;
    flex: 1;
}

.now-playing img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.now-playing img:not([src]) { display: none; }

/* название трека: обрезается многоточием */
#track-title {
    font-size: 1.1em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time { color: #888; font-size: .85em; margin-top: 4px; }

.controls { display: flex; gap: 12px; justify-content: center; align-items: center; }
.controls button {
    background: none; border: none; color: #eee;
    font-size: 1.2em; cursor: pointer; padding: 8px;
}

/* большая кнопка Play: иконка центрируется точно по кругу */
.controls .big {
    width: 64px; height: 64px; border-radius: 50%;
    background: #4f6ef7; color: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 0; border: none; cursor: pointer;
}
.controls .big .icon {
    width: 28px; height: 28px; fill: currentColor;
    display: block;
}
.controls .active { color: #4f6ef7; }

/* переключение иконки Play/Pause */
.icon-pause { display: none; }
.big.is-playing .icon-play  { display: none; }
.big.is-playing .icon-pause { display: block; }

input[type=range] { width: 100%; margin: 12px 0; accent-color: #4f6ef7; }

h2 {
    font-size: 1em;
    margin: 20px 0 8px;
    color: #aaa;
}

#playlist { list-style: none; padding: 0; max-height: 260px; overflow-y: auto; }
#playlist li {
    padding: 10px 12px; border-radius: 8px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#playlist li:hover { background: #2a2d37; }
#playlist li.current { background: #4f6ef7; color: #fff; }

/* подпись про лицензии */
.license {
    font-size: .75em;
    color: #8a8f9c;
    line-height: 1.5;
    text-align: center;
    border-top: 1px solid #2a2d37;
    padding-top: 12px;
    margin: 16px 0 0;
}
