﻿:root {
	--bg: #f8fafc;
	--panel: #ffffff;
	--text: #111827;
	--muted: #6b7280;
	--accent: #0ea5e9;
	--accent-ghost: #0ea5e933;
	--border: #e5e7eb;
	--radius: 16px;
	--aside: 320px;
	--gap: 16px;
	--break: 936px;
}

* {
	box-sizing: border-box
}



.player {
	width: min(900px, 100%);
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media (min-width: 900px) {
	.player {
		grid-template-columns: minmax(400px, 1fr) 400px;
		/* pas besoin de min-width ici : la 1re colonne ne descend jamais sous 400px,
       donc le total ne descend pas sous 736px tant qu'on reste en 2 colonnes */
	}
}

/* Pour que la colonne 1 puisse rétrécir sans overflow du contenu */
.player > * {
	min-width: 0;
}



.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: 0 10px 30px #0001;
}

/* Zone des contrôles */
.controls {
	display: grid;
	gap: 14px;
	grid-template-rows: auto auto auto;
}

.title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
}

.meta {
	color: var(--muted);
	font-size: .9rem
}

.buttons {
	display: flex;
	align-items: center;
	gap: 10px;
}

button.icon {
	appearance: none;
	background: #f9fafb;
	color: var(--text);
	border: 1px solid var(--border);
	border-color: var(--border);
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: transform .06s ease, background .2s ease, border-color .2s ease;
	justify-content: center;
	align-content: center;
}


	button.icon:hover {
		background: #f3f4f6;
		border-color: #d1d5db;
	}

	button.icon:active {
		transform: scale(.96)
	}

.play {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--accent);
	color: #00272d;
	font-weight: 800
}

	.play[aria-pressed="true"] {
		background: #10b3ce
	}

/* Barre de progression */
.row {
	display: flex;
	align-items: center;
	gap: 8px
}

.totalTime {
	width: 100%;
	text-align: right;
	color: var(--muted);
	font-size: .85rem;
}

input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg,var(--accent) var(--val,0%), var(--accent-ghost) var(--val,0%));
	outline: none;
}

	input[type="range"]::-webkit-slider-thumb {
		-webkit-appearance: none;
		appearance: none;
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: var(--accent);
		border: 2px solid #072226;
		margin-top: -5px;
		cursor: pointer;
	}

	input[type="range"]::-moz-range-thumb {
		width: 16px;
		height: 16px;
		border-radius: 50%;
		background: var(--accent);
		border: 2px solid #072226;
		cursor: pointer;
	}

/* Volume */
.volume {
	display: flex;
	align-items: center;
	gap: 10px
}

.vol-label {
	width: 26px;
	text-align: center
}

/* Playlist */
.playlist {
	padding: 0;
	margin: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: min(60vh,540px);
	overflow: auto
}

.track {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	cursor: pointer;
	border: 1px solid var(--border);
	background: #0b122320;
	transition: background .2s ease, border-color .2s ease, transform .06s ease;
}

	.track:hover {
		background: #0b122340;
		border-color: #2b3647
	}

	.track:active {
		transform: scale(.995)
	}

	.track .i {
		width: 28px;
		height: 28px;
		border-radius: 8px;
		background: #0b122360;
		display: grid;
		place-items: center;
		font-size: .8rem;
		color: var(--muted)
	}

	.track .t {
		flex: 1 1 auto;
		min-width: 0
	}

		.track .t .name {
			font-weight: 600;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap
		}

		.track .t .small {
			color: var(--muted);
			font-size: .85rem;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap
		}

	.track .dur {
		font-variant-tabular-nums: tabular-nums;
		color: var(--muted);
		margin-left: 8px
	}

	.track.active {
		background: #03242b;
		border-color: #073b45
	}

		.track.active .i {
			background: var(--accent-ghost);
			color: var(--accent)
		}

/* Aide clavier */
.kbd {
	border: 1px solid var(--border);
	padding: .2em .45em;
	border-radius: 8px;
	background: #0b122340;
	font-size: .8em;
	color: black;
}

.help {
	color: black;
	font-size: .85rem
}


.play {
	background: var(--accent);
	color: #fff
}

	.play[aria-pressed="true"] {
		background: var(--accent-ghost);
	}

/* Playlist */
.track {
	background: #f9fafb;
	border-color: var(--border);
}

	.track:hover {
		background: #f3f4f6;
		border-color: #d1d5db
	}

	.track .i {
		background: #eef2f7;
		color: var(--muted)
	}

	.track.active {
		background: #e0f2fe;
		border-color: #bae6fd
	}

	.track:focus,
	.track:focus-visible {
		outline: none;
	}

/* ===== Alignement parfait du slider (seek) ===== */
:root {
	--track-h: 6px; /* hauteur de la barre */
	--thumb-d: 16px; /* diamètre du “rond” */
	--thumb-b: 2px; /* épaisseur de bordure du “rond” */
	--nudge: 0px; /* micro-ajustement: +1px descend, -1px monte */
}

/* Piste principale */
#seek {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: var(--track-h);
	border-radius: 999px;
	/* Remets ici ton background existant si besoin (avec --val) */
	/* background: linear-gradient(90deg, var(--accent) var(--val,0%), var(--accent-ghost) var(--val,0%)); */
}

	/* Chrome / Edge / Safari */
	#seek::-webkit-slider-runnable-track {
		height: var(--track-h);
		border-radius: 999px;
	}

	#seek::-webkit-slider-thumb {
		-webkit-appearance: none;
		width: var(--thumb-d);
		height: var(--thumb-d);
		box-sizing: border-box; /* la bordure compte dans le diamètre */
		border: var(--thumb-b) solid #072226; /* adapte la couleur à ton thème */
		border-radius: 50%;
		/* Centre verticalement le pouce par rapport à la piste */
		margin-top: calc((var(--thumb-d) - var(--track-h)) / -2 + var(--nudge));
		cursor: pointer;
	}

	/* Firefox */
	#seek::-moz-range-track {
		height: var(--track-h);
		border-radius: 999px;
	}

	#seek::-moz-range-progress {
		height: var(--track-h);
		border-radius: 999px;
	}

	#seek::-moz-range-thumb {
		width: var(--thumb-d);
		height: var(--thumb-d);
		box-sizing: border-box;
		border: var(--thumb-b) solid #072226;
		border-radius: 50%;
		/* Firefox centre déjà si la track a la bonne hauteur */
		cursor: pointer;
	}

/* ==== Alignement parfait du slider VOLUME ==== */
#volume {
	--track-h: 6px; /* hauteur de la barre volume */
	--thumb-d: 16px; /* diamètre du “rond” volume */
	--thumb-b: 2px; /* épaisseur de bordure */
	--nudge: 0px; /* micro-ajustement: +1px descend, -1px monte */
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: var(--track-h);
	border-radius: 999px;
	/* Laisse ton background existant (avec --val) si tu en as un */
}

	/* Chrome / Edge / Safari */
	#volume::-webkit-slider-runnable-track {
		height: var(--track-h);
		border-radius: 999px;
	}

	#volume::-webkit-slider-thumb {
		-webkit-appearance: none;
		width: var(--thumb-d);
		height: var(--thumb-d);
		box-sizing: border-box;
		border: var(--thumb-b) solid #072226; /* adapte la couleur au thème */
		border-radius: 50%;
		/* Centre verticalement le pouce sur la piste */
		margin-top: calc((var(--thumb-d) - var(--track-h)) / -2 + var(--nudge));
		cursor: pointer;
	}

	/* Firefox */
	#volume::-moz-range-track {
		height: var(--track-h);
		border-radius: 999px;
	}

	#volume::-moz-range-progress {
		height: var(--track-h);
		border-radius: 999px;
	}

	#volume::-moz-range-thumb {
		width: var(--thumb-d);
		height: var(--thumb-d);
		box-sizing: border-box;
		border: var(--thumb-b) solid #072226;
		border-radius: 50%;
		cursor: pointer;
	}


