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

html, body {
    height: 100%;
    overflow: hidden; /* Полностью отключаем скролл */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #cccccc;
    user-select: none;
    position: fixed; /* Фиксируем body */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.container {
    width: 320px; /* Фиксированная ширина */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Простое центрирование */
    padding: 20px;
}

/* Loading Indicator & Auth - оптимальные размеры */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    color: #ff5500;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 100;
}

.auth-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: #555555;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s ease;
    border-radius: 3px;
    -webkit-tap-highlight-color: transparent;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #888888;
}

.auth-btn.authenticated {
    color: #ff5500;
}

.auth-btn.authenticated:hover {
    background: rgba(255, 85, 0, 0.1);
}

/* Mode Switch - две кнопки */
.mode-switch {
    margin: 20px 0 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.mode-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 400;
    color: #555555;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #888888;
}

.mode-btn.active {
    color: #ffffff;
}

.mode-btn.active:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Track Name - центральный элемент */
.track-name {
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-align: center;
    line-height: 1.3;
    min-height: 18px;
    padding: 0 10px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: top;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
}

.track-name.copying {
    color: #ff5500;
}

/* NEW: Стили для иконок в track name */
.track-name i {
    margin-right: 6px;
    opacity: 0.8;
}

.track-name.error {
    color: #ff4444;
}

.track-name.error i {
    color: #ff4444;
}

/* Анимация для spinning refresh icon */
.track-name .fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(359deg);
    }
}

/* Player Controls - фиксированный layout */
.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 18px 0;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.control-btn {
    background: none;
    border: none;
    color: #cccccc;
    cursor: pointer;
    padding: 12px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.control-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.control-btn.disabled-nav {
    opacity: 0.15;
    cursor: not-allowed;
    color: #444444;
}

.control-btn.play-pause {
    color: #ff5500;
    padding: 16px;
    border-radius: 6px;
    width: 52px;
    height: 52px;
}

.control-btn.play-pause:hover:not(:disabled) {
    background: rgba(255, 85, 0, 0.12);
    color: #ff6519;
}

.control-btn.admin-only {
    visibility: hidden;
    pointer-events: none;
}

.control-btn.admin-only.authorized {
    visibility: visible;
    pointer-events: auto;
}

.control-btn.up-active,
.control-btn.up-active:hover {
    color: #ff5500;
}

.control-btn i {
    font-size: 14px;
}

.control-btn.play-pause i {
    font-size: 18px;
}

/* Progress Bar - интуитивный */
.progress-bar {
    width: 100%;
    height: 20px;
    cursor: pointer;
    position: relative;
    margin: 0 0 3px 0;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.progress-bar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #333333;
    top: 50%;
    transform: translateY(-50%);
}

.progress-fill {
    height: 2px;
    background: #ff5500;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
    z-index: 1;
}

/* Time & Position - компактно */
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888888;
    font-variant-numeric: tabular-nums;
    margin: 0 0 2px 0;
}

/* NEW Playlist Position with Actions - исправленный */
.playlist-position-new {
    text-align: center;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.playlist-position-new .position-text {
    color: #555555;
}

.playlist-position-new .separator {
    color: #555555;
    user-select: none;
}

.playlist-position-new .action-link {
    color: #555555;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 2px 4px;
    border-radius: 2px;
    user-select: none;
}

.playlist-position-new .action-link.active {
    color: #ff5500;
}

/* Auth Modal - чистый */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 6px;
    width: 100%;
    max-width: 280px;
    border: 1px solid #333333;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #ffffff;
    font-weight: 500;
    font-size: 15px;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #333333;
    border-radius: 3px;
    background: #0f0f0f;
    color: #ffffff;
    font-size: 14px;
    margin: 0 0 12px 0;
    transition: border-color 0.15s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #ff5500;
}

.modal-content button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px 0;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.modal-content button {
    background: #ff5500;
    color: #000000;
}

.modal-content button:hover {
    background: #ff6519;
}

.modal-content .cancel-btn {
    background: none;
    color: #cccccc;
    border: 1px solid #333333;
}

.modal-content .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555555;
    color: #ffffff;
}

.hidden {
    display: none;
}