/* === GLOBAL PLAYER BAR === */

.global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: var(--border-width) solid var(--border);
    border-bottom: var(--border-width) solid var(--border);
    z-index: 1000;
    display: none;
    height: 64px;
}

.global-player.active {
    display: block;
}

.player-main {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 calc(var(--unit) * 3);
    gap: calc(var(--unit) * 4);
}

.player-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: calc(var(--unit) * 3);
    min-width: 0;
}

.player-track-info {
    width: 220px;
    flex-shrink: 0;
    min-width: 0;
}

.player-track-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.player-track-artist {
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.player-controls-row {
    display: flex;
    align-items: center;
    gap: calc(var(--unit) * 2);
    flex: 1;
}

.player-btn {
    background: transparent;
    border: var(--border-width) solid var(--border);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--fg);
    padding: 0;
    font-family: var(--font-mono);
    transition: background 0.15s, color 0.15s;
}

.player-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.player-btn-play {
    width: 40px;
    height: 40px;
}

.player-progress-container {
    display: flex;
    align-items: center;
    gap: calc(var(--unit));
    flex: 1;
}

.player-time {
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.player-progress {
    flex: 1;
    height: 6px;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
}

.player-progress:hover {
    height: 8px;
}

.player-progress-fill {
    height: 100%;
    background: var(--fg);
    width: 0%;
    pointer-events: none;
}

.player-right {
    display: flex;
    align-items: center;
    gap: calc(var(--unit) * 2);
    flex-shrink: 0;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: calc(var(--unit));
}

.player-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 1px solid var(--border);
    outline: none;
    cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--fg);
    cursor: pointer;
}

.player-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--fg);
    border: none;
    cursor: pointer;
}

/* === TRACK LIST === */

.track-name {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* === SHEET TITLE === */

.sheet-title-block {
    width: 100%;
    border-bottom: var(--border-width) solid var(--border);
}

.sheet-title-line {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(20px, 6.5vw, 56px);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    line-height: 1.05;
    padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
    border-bottom: var(--border-width) solid var(--border);
    overflow-wrap: break-word;
    word-break: break-word;
}

.sheet-title-line:last-child {
    border-bottom: none;
}

.sheet-title-line:nth-child(even) {
    text-align: right;
    background: var(--fg);
    color: var(--bg);
}

/* === BOTTOM SHEET === */

.player-sheet {
    position: fixed;
    bottom: 64px;
    left: 0;
    right: 0;
    height: calc(100dvh - 64px);
    background: var(--bg);
    border-top: var(--border-width) solid var(--border);
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.player-sheet.open {
    transform: translateY(0);
}

.player-sheet-close {
    position: sticky;
    top: 0;
    display: block;
    margin-left: auto;
    background: var(--bg);
    border: none;
    border-bottom: var(--border-width) solid var(--border);
    width: 100%;
    padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
    text-align: right;
    font-family: var(--font-mono);
    font-size: 15px;
    letter-spacing: 0.08em;
    color: var(--muted);
    cursor: pointer;
    text-transform: uppercase;
    z-index: 1;
}

.player-sheet-close:hover {
    color: var(--fg);
}

body.sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* === SHEET MAIN === */

.sheet-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--unit) * 4) calc(var(--unit) * 3);
    min-height: 0;
}

.sheet-cover-img {
    width: min(calc(100vw - 48px), calc(100dvh - 220px));
    height: min(calc(100vw - 48px), calc(100dvh - 220px));
    object-fit: cover;
    border: var(--border-width) solid var(--border);
    display: block;
}

.sheet-cover-title {
    width: min(calc(100vw - 48px), calc(100dvh - 220px));
    height: min(calc(100vw - 48px), calc(100dvh - 220px));
    border: var(--border-width) solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sheet-cover-title .sheet-title-line {
    font-size: clamp(10px, calc(83vw / var(--cover-lines, 1) - 17px), 52px);
    padding: calc(var(--unit)) calc(var(--unit) * 2);
}

.sheet-title-display {
    font-family: var(--font-mono);
    font-size: clamp(18px, 5.5vw, 28px);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.4;
}

/* === SHEET SEEK FOOTER === */

.sheet-seek-footer {
    margin-top: auto;
    width: 100%;
    background: var(--bg);
    border-top: var(--border-width) solid var(--border);
    padding: calc(var(--unit) * 3);
}

.sheet-seek-bar {
    --pct: 0%;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    border: none;
    background: linear-gradient(to right, var(--fg) var(--pct), var(--hover-bg) var(--pct));
    margin-bottom: calc(var(--unit) * 2);
    display: block;
}

.sheet-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--fg);
    cursor: pointer;
    border: none;
}

.sheet-seek-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--fg);
    border: none;
    cursor: pointer;
}

.sheet-time-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .player-track-info {
        width: 140px;
    }

    .player-volume {
        display: none;
    }

    .player-time {
        display: none;
    }

    .player-progress-container {
        display: none;
    }

    .player-track-title {
        cursor: pointer;
    }
}
