/*
 * Media Store — Full Player View (expanded, dark, glassmorphism).
 */

.mst-fp {
	position: fixed; inset: 0; z-index: 9700;
	color: #fff;
	opacity: 0;
	transform: translateY(2%);
	transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}
.mst-fp.is-open { opacity: 1; transform: translateY(0); }

/* Blurred artwork backdrop */
.mst-fp__bg { position: absolute; inset: -10%; z-index: 0; }
.mst-fp__bg img {
	width: 100%; height: 100%; object-fit: cover;
	filter: blur(60px) saturate(1.7) brightness(0.5);
	transform: scale(1.2);
}
.mst-fp::before {
	content: ''; position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(180deg, rgba(10,10,14,0.55), rgba(10,10,14,0.86));
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

.mst-fp__close {
	position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
	z-index: 3;
	display: flex; align-items: center; justify-content: center;
	width: 44px; height: 32px;
	background: rgba(255,255,255,0.1); border: 0; border-radius: 999px;
	color: #fff; cursor: pointer;
	transition: background 0.15s;
}
.mst-fp__close:hover { background: rgba(255,255,255,0.2); }

.mst-fp__inner {
	position: relative; z-index: 2;
	height: 100%;
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 48px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 72px 40px 48px;
	align-items: center;
}

/* ── Stage (artwork + transport) ─────────────────────────────────────────── */
.mst-fp__stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.mst-fp__art-wrap {
	width: min(42vh, 420px); aspect-ratio: 1;
	border-radius: 18px; overflow: hidden;
	box-shadow: 0 30px 80px rgba(0,0,0,0.6);
	background: rgba(255,255,255,0.05);
}
.mst-fp__art {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.22,1,0.36,1);
}
.mst-fp__art.is-swapping { opacity: 0; transform: scale(0.96); }

.mst-fp__meta { text-align: center; margin: 22px 0 16px; max-width: 100%; }
.mst-fp__title { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.mst-fp__artist { font-size: 1rem; color: rgba(255,255,255,0.7); text-decoration: none; }
.mst-fp__artist:hover { color: #fff; text-decoration: underline; }
.mst-fp__album { font-size: 0.8125rem; color: rgba(255,255,255,0.45); margin: 4px 0 0; }

/* Faux waveform */
.mst-fp__wave {
	--p: 0%;
	width: min(100%, 460px); height: 48px;
	display: flex; align-items: center; gap: 2px;
	cursor: pointer; outline: none;
	position: relative;
}
.mst-fp__wave-bars { display: flex; align-items: center; gap: 2px; width: 100%; height: 100%; }
.mst-fp__bar {
	flex: 1; border-radius: 2px; min-width: 2px;
	background: rgba(255,255,255,0.22);
}
/* Played portion: clip a colored overlay using the --p custom property. */
.mst-fp__wave::after {
	content: ''; position: absolute; inset: 0;
	width: var(--p);
	background: linear-gradient(90deg, var(--mst-accent, #5c6ef4), #fff);
	-webkit-mask: inherit; mask: inherit;
	mix-blend-mode: overlay;
	pointer-events: none;
	transition: width 0.1s linear;
	opacity: 0.9;
}
.mst-fp__wave:focus-visible { outline: 2px solid var(--mst-accent); outline-offset: 6px; border-radius: 6px; }

.mst-fp__times {
	display: flex; justify-content: space-between;
	width: min(100%, 460px); margin-top: 6px;
	font-size: 0.6875rem; color: rgba(255,255,255,0.5);
	font-variant-numeric: tabular-nums;
}

.mst-fp__controls { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.mst-fp__ctl {
	display: flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; border-radius: 50%;
	background: none; border: 0; color: #fff; cursor: pointer;
	transition: background 0.15s, transform 0.12s, color 0.15s;
}
.mst-fp__ctl:hover { background: rgba(255,255,255,0.1); }
.mst-fp__ctl:active { transform: scale(0.92); }
.mst-fp__ctl--mode { color: rgba(255,255,255,0.55); position: relative; }
.mst-fp__ctl--mode.is-active { color: var(--mst-accent); }
.mst-fp__ctl--play { width: 64px; height: 64px; background: #fff; color: #111; }
.mst-fp__ctl--play:hover { background: #fff; transform: scale(1.05); }
.mst-fp__repeat-one { position: absolute; top: 4px; right: 8px; font-size: 9px; font-weight: 700; display: none; }
.mst-fp__ctl--mode.is-one .mst-fp__repeat-one { display: block; }

/* ── Side tabs ───────────────────────────────────────────────────────────── */
.mst-fp__side {
	display: flex; flex-direction: column;
	height: min(70vh, 560px);
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 16px;
	overflow: hidden;
}
.mst-fp__tabs { display: flex; padding: 6px; gap: 4px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mst-fp__tab {
	flex: 1; padding: 9px 8px;
	background: none; border: 0; border-radius: 9px;
	color: rgba(255,255,255,0.55); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
	transition: background 0.14s, color 0.14s;
}
.mst-fp__tab:hover { color: #fff; }
.mst-fp__tab.is-active { background: rgba(255,255,255,0.12); color: #fff; }

.mst-fp__panes { flex: 1; overflow: hidden; position: relative; }
.mst-fp__pane { height: 100%; overflow-y: auto; padding: 12px; }
.mst-fp__pane:not(.is-active) { display: none; }
.mst-fp__empty { color: rgba(255,255,255,0.45); font-size: 0.8125rem; text-align: center; padding: 28px 12px; }

/* Up Next list */
.mst-fp__next-list { list-style: none; margin: 0; padding: 0; }
.mst-fp__next-item {
	display: flex; align-items: center; gap: 10px;
	padding: 7px 8px; border-radius: 10px; cursor: pointer;
	transition: background 0.12s;
}
.mst-fp__next-item:hover { background: rgba(255,255,255,0.08); }
.mst-fp__next-cover { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.mst-fp__next-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mst-fp__next-title { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mst-fp__next-artist { font-size: 0.6875rem; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mst-fp__next-dur { font-size: 0.6875rem; color: rgba(255,255,255,0.5); flex-shrink: 0; }

/* Lyrics */
.mst-fp__lyrics { font-size: 0.95rem; line-height: 1.9; text-align: center; color: rgba(255,255,255,0.85); }
.mst-fp__lyric-line { margin: 0; }
.mst-fp__lyrics-loading { text-align: center; color: rgba(255,255,255,0.4); }

/* Details */
.mst-fp__details { margin: 0; }
.mst-fp__detail { display: flex; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.mst-fp__detail dt { color: rgba(255,255,255,0.5); font-size: 0.8125rem; margin: 0; text-transform: capitalize; }
.mst-fp__detail dd { margin: 0; font-size: 0.8125rem; font-weight: 600; text-align: right; }
.mst-fp__detail-link { display: inline-block; margin-top: 14px; color: var(--mst-accent); text-decoration: none; font-size: 0.8125rem; }
.mst-fp__detail-link:hover { text-decoration: underline; }

/* ── Streaming settings: crossfade + sleep (Phase 6) ─────────────────────── */
.mst-fp__extras { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.mst-fp__setting { position: relative; }
.mst-fp__setting-btn {
	display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
	background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
	border-radius: 999px; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 0.8125rem;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mst-fp__setting-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.mst-fp__setting-btn.is-active { border-color: var(--mst-accent); color: #fff; }
.mst-fp__setting-btn.is-active svg { color: var(--mst-accent); }
.mst-fp__setting-val { font-weight: 600; color: #fff; }

.mst-fp__setting-menu {
	position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	min-width: 168px; padding: 6px; z-index: 5;
	background: #1c1c22; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 2px;
}
.mst-fp__setting-opt {
	display: block; width: 100%; text-align: left; padding: 9px 12px;
	background: none; border: 0; border-radius: 8px; color: rgba(255,255,255,0.82);
	cursor: pointer; font-size: 0.85rem;
}
.mst-fp__setting-opt:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mst-fp__setting-opt.is-active { background: var(--mst-accent); color: #fff; }
.mst-fp__setting-opt:disabled { opacity: 0.4; cursor: not-allowed; }
.mst-fp__setting-opt--off { margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.1); border-radius: 0 0 8px 8px; color: #ff6b6b; }
.mst-fp__setting-note { margin: 6px 4px 2px; font-size: 0.72rem; color: rgba(255,255,255,0.5); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
	.mst-fp__inner { grid-template-columns: 1fr; gap: 24px; padding: 64px 20px 28px; align-content: start; overflow-y: auto; }
	.mst-fp__art-wrap { width: min(54vw, 280px); }
	.mst-fp__side { height: 320px; }
}
/* iPhone safe-area inside the full-screen player. */
@supports (padding: max(0px)) {
	.mst-fp__inner { padding-bottom: calc( 28px + env( safe-area-inset-bottom, 0px ) ); }
	.mst-fp__close { top: calc( 16px + env( safe-area-inset-top, 0px ) ); }
}
@media (hover: none) and (pointer: coarse) {
	.mst-fp__ctl { min-width: 48px; min-height: 48px; }
	.mst-fp__wave { padding-block: 8px; }
	.mst-fp__setting-btn { padding: 10px 16px; }
	.mst-fp__setting-opt { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.mst-fp, .mst-fp__art { transition: none; }
}
