:root {
	--rlba-bg: var(--wp--preset--color--nuit, #140930);
	--rlba-panel: var(--wp--preset--color--tertiary, #221060);
	--rlba-border: var(--wp--preset--color--border-light, #36228A);
	--rlba-accent: var(--wp--preset--color--primary-alt, #F83D08);
	--rlba-accent-hover: var(--wp--preset--color--primary-alt-accent, #C93006);
	--rlba-sky: var(--wp--preset--color--primary, #76BFEA);
	--rlba-pink: var(--wp--preset--color--rose, #F443CE);
	--rlba-text: #fff;
	--rlba-muted: var(--wp--preset--color--secondary, #B9B1DE);
	--rlba-bar-h: 76px;
}
body { padding-bottom: calc(var(--rlba-bar-h) + env(safe-area-inset-bottom, 0px)); }
body.rlba-popup-page { padding-bottom: 0; }

.rlba-ico { width: 24px; height: 24px; fill: currentColor; display: block; }
.rlba-player .rlba-ico--pause, .rlba-hero-player .rlba-ico--pause { display: none; }
.rlba-playing .rlba-ico--play, .rlba-loading .rlba-ico--play { display: none; }
.rlba-playing .rlba-ico--pause { display: block; }
.rlba-spinner { display: none; width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: rlba-spin .8s linear infinite; }
.rlba-loading .rlba-spinner { display: block; }
@keyframes rlba-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rlba-spinner { animation-duration: 2s; } }

/* Barre fixe */
.rlba-player--bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
	background: var(--rlba-bg); color: var(--rlba-text);
	border-top: 1px solid var(--rlba-border);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	font-family: var(--wp--preset--font-family--primary, sans-serif);
	box-shadow: 0 -6px 24px rgba(10, 4, 30, .45);
}
.rlba-player__inner {
	max-width: 1260px; margin: 0 auto; height: var(--rlba-bar-h);
	display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
.rlba-player__play, .rlba-hero-player__play {
	flex: none; display: grid; place-items: center; border: 0; cursor: pointer; border-radius: 50%;
	background: var(--rlba-accent); color: #fff; transition: background .2s, transform .1s;
}
.rlba-player__play { width: 52px; height: 52px; }
.rlba-player__play:hover, .rlba-hero-player__play:hover { background: var(--rlba-accent-hover); }
.rlba-player__play:active, .rlba-hero-player__play:active { transform: scale(.96); }
.rlba-player__play:focus-visible, .rlba-hero-player__play:focus-visible,
.rlba-player button:focus-visible, .rlba-player summary:focus-visible, .rlba-player input:focus-visible { outline: 2px solid var(--rlba-pink); outline-offset: 2px; }
.rlba-player__art { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex: none; background: var(--rlba-panel); }
.rlba-player__meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.rlba-player__live { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rlba-pink); }
.rlba-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rlba-pink); }
.rlba-playing .rlba-dot { animation: rlba-pulse 1.6s ease-in-out infinite; }
@keyframes rlba-pulse { 50% { opacity: .3; } }
.rlba-player__title { font-family: var(--wp--preset--font-family--heading, cursive); color: var(--rlba-sky); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rlba-player__artist { font-size: .9rem; color: var(--rlba-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rlba-player__tools { display: flex; align-items: center; gap: 10px; flex: none; }
.rlba-player__tools button, .rlba-player__history summary {
	background: transparent; color: var(--rlba-text); border: 1px solid var(--rlba-border); border-radius: 50px;
	min-height: 40px; min-width: 40px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .85rem; font-weight: 700;
}
.rlba-player__tools button:hover, .rlba-player__history summary:hover { border-color: var(--rlba-sky); color: var(--rlba-sky); }
.rlba-player__history { position: relative; }
.rlba-player__history summary { list-style: none; white-space: nowrap; }
.rlba-player__history summary::-webkit-details-marker { display: none; }
.rlba-player__history-panel {
	position: absolute; right: 0; bottom: calc(100% + 12px); width: min(360px, 90vw);
	background: var(--rlba-panel); border: 1px solid var(--rlba-border); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.rlba-player__history-panel ol { margin: 0 0 10px; padding: 0; list-style: none; font-size: .88rem; }
.rlba-player__history-panel li, .rlba-hero-player__history li { padding: 6px 0; border-bottom: 1px solid var(--rlba-border); }
.rlba-player__history-panel a { color: var(--rlba-sky); font-size: .85rem; }
.rlba-h-time { color: var(--rlba-muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.rlba-player__volume input { width: 96px; accent-color: var(--rlba-accent); }
.rlba-nav-loading body { cursor: progress; }
.rlba-nav-loading main { opacity: .6; transition: opacity .2s; }

@media (max-width: 781px) {
	:root { --rlba-bar-h: 68px; }
	.rlba-hide-sm { display: none !important; }
	.rlba-player__inner { gap: 10px; padding: 0 10px; }
	.rlba-player__art { width: 44px; height: 44px; }
	.rlba-player__play { width: 48px; height: 48px; }
	.rlba-player__history summary { padding: 0 10px; }
}

/* Carte d'écoute (page d'accueil, lecteur déporté) */
.rlba-hero-player {
	display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "play art meta" "hist hist hist";
	align-items: center; gap: 20px 24px; padding: clamp(20px, 4vw, 36px);
	background: var(--rlba-panel); border: 1px solid var(--rlba-border); border-radius: 24px; color: var(--rlba-text);
}
.rlba-hero-player__play { grid-area: play; width: 88px; height: 88px; }
.rlba-hero-player__play .rlba-ico { width: 40px; height: 40px; }
.rlba-hero-player__play .rlba-spinner { width: 36px; height: 36px; }
.rlba-hero-player__art { grid-area: art; width: 120px; height: 120px; border-radius: 14px; object-fit: cover; background: var(--rlba-bg); }
.rlba-hero-player__meta { grid-area: meta; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rlba-hero-player__title { font-family: var(--wp--preset--font-family--heading, cursive); color: var(--rlba-sky); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; }
.rlba-hero-player__artist { font-size: 1.1rem; }
.rlba-hero-player__history { grid-area: hist; border-top: 1px solid var(--rlba-border); padding-top: 16px; }
.rlba-hero-player__label { margin: 0 0 6px; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rlba-pink); }
.rlba-hero-player__history ol { margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.rlba-hero-player__history li:last-child { border-bottom: 0; }
@media (max-width: 600px) {
	.rlba-hero-player { grid-template-columns: auto 1fr; grid-template-areas: "art art" "play meta" "hist hist"; justify-items: start; }
	.rlba-hero-player__art { width: 100%; height: auto; aspect-ratio: 1; max-width: 220px; justify-self: center; }
}

/* Lecteur déporté */
.rlba-popup { max-width: 520px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.rlba-popup__logo { width: 240px; height: auto; }
.rlba-popup .rlba-hero-player { width: 100%; grid-template-columns: auto 1fr; grid-template-areas: "art art" "play meta" "hist hist"; }
.rlba-popup .rlba-hero-player__art { width: 100%; height: auto; aspect-ratio: 1; max-width: 260px; justify-self: center; }
.rlba-popup__back a { color: var(--rlba-sky); }

/* Votes */
.rlba-vote { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.rlba-vote[hidden] { display: none; }
.rlba-vote__btn {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
	background: transparent; color: var(--rlba-text); border: 1px solid var(--rlba-border); border-radius: 50px;
	font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.rlba-vote__btn .rlba-ico { width: 18px; height: 18px; }
.rlba-vote__btn:hover:not(:disabled) { border-color: var(--rlba-sky); color: var(--rlba-sky); }
.rlba-vote__btn:disabled { cursor: default; opacity: .55; }
.rlba-vote__btn.is-active { opacity: 1; border-color: var(--rlba-pink); color: var(--rlba-pink); background: rgba(244, 67, 206, .12); }
.rlba-vote__btn:focus-visible { outline: 2px solid var(--rlba-pink); outline-offset: 2px; }
.rlba-vote__msg { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .8rem; background: var(--rlba-panel); border: 1px solid var(--rlba-border); border-radius: 8px; padding: 4px 10px; pointer-events: none; }
.rlba-vote__msg:empty { display: none; }
.rlba-hero-player .rlba-vote { margin-top: 10px; }
.rlba-hero-player .rlba-vote__msg { left: 0; transform: none; bottom: auto; top: calc(100% + 6px); }
@media (max-width: 781px) {
	.rlba-player--bar .rlba-vote__btn { padding: 0 9px; }
	.rlba-player--bar .rlba-vote__btn span { display: none; }
}
/* ===== 1.3 : sélecteur de qualité segmenté ===== */
.rlba-quality { display: inline-flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid var(--rlba-border); border-radius: 50px; background: rgba(0,0,0,.2); flex: none; }
.rlba-player__tools .rlba-quality__opt, .rlba-quality__opt {
	min-height: 32px; min-width: 46px; width: 46px; padding: 0; justify-content: center; border: 0; border-radius: 50px;
	background: transparent; color: var(--rlba-muted); font-size: .78rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
	transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.rlba-player__tools .rlba-quality__opt:hover { color: #fff; border: 0; }
.rlba-player__tools .rlba-quality__opt.is-active, .rlba-quality__opt.is-active { background: var(--rlba-accent); color: #fff; box-shadow: 0 2px 8px rgba(248,61,8,.35); }
.rlba-quality__opt:focus-visible { outline: 2px solid var(--rlba-sky); outline-offset: 2px; }
@media (max-width: 781px) { .rlba-player__tools .rlba-quality__opt { min-width: 40px; width: 40px; font-size: .72rem; } }

/* Historique : ouverture animée */
.rlba-player__history[open] .rlba-player__history-panel { animation: rlba-pop .22s ease-out; transform-origin: bottom right; }
.rlba-player__history[open] summary { border-color: var(--rlba-sky); color: var(--rlba-sky); }
@keyframes rlba-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ===== Animations de navigation ===== */
.rlba-anim .rlba-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rlba-delay, 0s); }
.rlba-anim .rlba-reveal.is-visible { opacity: 1; transform: none; }
.rlba-page-enter { animation: rlba-page-in .45s ease-out both; }
@keyframes rlba-page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rlba-hero-player__play { transition: transform .2s ease, box-shadow .3s ease; }
.rlba-hero-player__play:hover { transform: scale(1.06); }
:root:not(.rlba-playing) .rlba-hero-player__play { animation: rlba-ring 2.6s ease-out infinite; }
@keyframes rlba-ring { 0% { box-shadow: 0 0 0 0 rgba(248,61,8,.55); } 70% { box-shadow: 0 0 0 18px rgba(248,61,8,0); } 100% { box-shadow: 0 0 0 0 rgba(248,61,8,0); } }

@media (prefers-reduced-motion: reduce) {
	.rlba-anim .rlba-reveal { opacity: 1; transform: none; transition: none; }
	.rlba-page-enter, .rlba-hero-player__play, .rlba-player__history[open] .rlba-player__history-panel { animation: none !important; }
}
/* Barre mobile compacte */
@media (max-width: 480px) {
	.rlba-player--bar .rlba-player__art { display: none; }
	.rlba-player--bar .rlba-player__inner { gap: 8px; }
	.rlba-player--bar .rlba-player__play { width: 44px; height: 44px; min-width: 44px; }
	.rlba-player--bar .rlba-player__tools { gap: 6px; }
	.rlba-player--bar .rlba-player__tools button, .rlba-player--bar .rlba-player__history summary { min-width: 36px; min-height: 36px; padding: 0 8px; }
	.rlba-player--bar .rlba-player__history summary { padding: 0; width: 36px; justify-content: center; }
	.rlba-player--bar .rlba-vote { gap: 4px; }
	.rlba-player--bar .rlba-vote__btn { padding: 0 8px; }
	.rlba-player--bar .rlba-quality { padding: 2px; }
	.rlba-player--bar .rlba-player__tools .rlba-quality__opt { min-width: 34px; width: 34px; min-height: 30px; font-size: .7rem; }
	.rlba-player--bar .rlba-player__meta { min-width: 0; flex: 1 1 auto; }
}
/* Historique : panneau plein largeur sur mobile */
@media (max-width: 781px) {
	.rlba-player--bar .rlba-player__history { position: static; }
	.rlba-player--bar .rlba-player__history-panel { position: fixed; left: 10px; right: 10px; width: auto; bottom: calc(var(--rlba-bar-h, 68px) + 10px); max-height: calc(100vh - var(--rlba-bar-h, 68px) - 40px); max-height: calc(100dvh - var(--rlba-bar-h, 68px) - 40px); overflow-y: auto; transform-origin: bottom center; }
	.rlba-player--bar .rlba-player__history-panel li { overflow-wrap: anywhere; }
}
/* Bouton cookies masqué tant que l'historique est ouvert */
html:has(.rlba-player__history[open]) .cky-btn-revisit-wrapper { opacity: 0; pointer-events: none; }

/* Carte d'écoute : s'adapte à la largeur réelle disponible */
.rlba-hero-wrap { container-type: inline-size; width: 100%; }
@container (max-width: 560px) {
	.rlba-hero-player { grid-template-columns: auto 1fr; grid-template-areas: "art art" "play meta" "hist hist"; justify-items: start; }
	.rlba-hero-player__art { width: 100%; height: auto; aspect-ratio: 1; max-width: 220px; justify-self: center; }
	.rlba-hero-player__play { width: 72px; height: 72px; }
}
/* Barre : écrans intermédiaires */
@media (min-width: 782px) and (max-width: 1100px) {
	.rlba-player__history summary .rlba-hide-sm { display: none; }
	.rlba-player__volume input { width: 80px; }
}
/* Bouton lecture/pause hors lecteur */
.rlba-when-on { display: none; }
.rlba-playing .rlba-when-on { display: inline; }
.rlba-playing .rlba-when-off { display: none; }

/* ===== Page 404 ===== */
.rlba-404-visual { display: flex; align-items: center; justify-content: center; gap: .08em; font-family: var(--wp--preset--font-family--heading, cursive); font-size: clamp(6rem, 24vw, 12rem); line-height: 1; color: var(--rlba-sky); margin-bottom: .1em; }
.rlba-404-digit { display: inline-block; text-shadow: 0 6px 0 var(--rlba-pink); animation: rlba-bob 3s ease-in-out infinite; }
.rlba-404-digit:last-child { animation-delay: -1.5s; }
.rlba-404-vinyl { position: relative; display: inline-block; width: .82em; height: .82em; border-radius: 50%; background: repeating-radial-gradient(circle at center, #0b0520 0 2px, #1c1044 2px 4px); box-shadow: 0 0 0 4px var(--rlba-border), 0 14px 40px rgba(0,0,0,.55); animation: rlba-vinyl 6s linear infinite; }
.rlba-404-vinyl::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 12%, rgba(255,255,255,.14) 16%, transparent 22% 62%, rgba(255,255,255,.1) 66%, transparent 72%); }
.rlba-404-label { position: absolute; inset: 32%; border-radius: 50%; background: radial-gradient(circle, var(--rlba-bg) 0 9%, var(--rlba-accent) 10% 62%, var(--rlba-pink) 63%); }
.rlba-playing .rlba-404-vinyl { animation-duration: 1.8s; }
@keyframes rlba-vinyl { to { transform: rotate(360deg); } }
@keyframes rlba-bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.rlba-eq { display: flex; justify-content: center; align-items: flex-end; gap: 5px; height: 34px; margin: 0 auto 1.5rem; }
.rlba-eq span { width: 6px; height: 20%; border-radius: 3px; background: var(--rlba-sky); opacity: .5; }
.rlba-playing .rlba-eq span { opacity: 1; background: var(--rlba-pink); animation: rlba-eq .9s ease-in-out infinite alternate; }
.rlba-eq span:nth-child(2) { animation-delay: -.3s; } .rlba-eq span:nth-child(3) { animation-delay: -.6s; } .rlba-eq span:nth-child(4) { animation-delay: -.15s; } .rlba-eq span:nth-child(5) { animation-delay: -.45s; } .rlba-eq span:nth-child(6) { animation-delay: -.75s; } .rlba-eq span:nth-child(7) { animation-delay: -.2s; }
@keyframes rlba-eq { 0% { height: 15%; } 100% { height: 100%; } }
.rlba-404-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 1.5rem; }
.rlba-404-play { cursor: pointer; border: 0; font: inherit; font-weight: 700; }
.rlba-facts { text-align: center; }
.rlba-facts__text { font-family: var(--wp--preset--font-family--heading, cursive); font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.35; color: var(--rlba-sky); min-height: 2.7em; margin: .25rem 0 1.25rem; }
.rlba-facts__text.is-in { animation: rlba-fact-in .45s ease-out; }
@keyframes rlba-fact-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.rlba-facts__next { background: transparent; color: #fff; border: 2px solid var(--rlba-pink); border-radius: 50px; padding: .6em 1.4em; font: inherit; font-weight: 700; cursor: pointer; transition: background-color .2s, transform .2s; }
.rlba-facts__next:hover { background: var(--rlba-pink); transform: translateY(-2px) rotate(-1deg); }
.rlba-facts__next:focus-visible { outline: 2px solid var(--rlba-sky); outline-offset: 3px; }
.rlba-404-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 1.5rem auto 2rem; max-width: 1100px; }
.rlba-404-link { display: flex; flex-direction: column; gap: 6px; padding: 1.1rem 1.2rem; border-radius: 16px; border: 1px solid var(--rlba-border); background: var(--wp--preset--color--primary-accent, #2A1478); color: #fff !important; text-decoration: none !important; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.rlba-404-link strong { font-family: var(--wp--preset--font-family--heading, cursive); font-weight: 400; font-size: 1.25rem; color: var(--rlba-sky); }
.rlba-404-link span { font-size: .92rem; color: var(--rlba-muted); }
.rlba-404-link:hover, .rlba-404-link:focus-visible { transform: translateY(-4px) rotate(-.5deg); border-color: var(--rlba-pink); box-shadow: 0 14px 30px rgba(5,2,20,.45); }
.rlba-404-link:nth-child(even):hover { transform: translateY(-4px) rotate(.5deg); }
.rlba-404-search { max-width: 640px; margin-inline: auto; }
@media (max-width: 781px) { .rlba-404-links { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .rlba-404-links { grid-template-columns: 1fr; } }

/* ===== Navigation entre articles ===== */
.rlba-post-nav { margin-top: var(--wp--preset--spacing--large, 2rem); }
.rlba-post-nav__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rlba-post-nav .post-navigation-link-previous { grid-column: 1; }
.rlba-post-nav .post-navigation-link-next { grid-column: 2; text-align: right; }
.rlba-post-nav .wp-block-post-navigation-link a { display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; padding: 1rem 1.25rem; border-radius: 16px; border: 1px solid var(--rlba-border); background: var(--wp--preset--color--primary-accent, #2A1478); text-decoration: none !important; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.rlba-post-nav .wp-block-post-navigation-link a:hover, .rlba-post-nav .wp-block-post-navigation-link a:focus-visible { transform: translateY(-3px); border-color: var(--rlba-sky); box-shadow: 0 12px 28px rgba(5,2,20,.45); }
.rlba-post-nav .post-navigation-link__label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rlba-pink); }
.rlba-post-nav .post-navigation-link-previous .post-navigation-link__label::before { content: "← "; }
.rlba-post-nav .post-navigation-link-next .post-navigation-link__label::after { content: " →"; }
.rlba-post-nav .post-navigation-link__title { font-family: var(--wp--preset--font-family--heading, cursive); color: var(--rlba-sky); font-size: 1.15rem; line-height: 1.3; }
@media (max-width: 600px) { .rlba-post-nav__grid { grid-template-columns: 1fr; } .rlba-post-nav .post-navigation-link-next { grid-column: 1; } }

@media (prefers-reduced-motion: reduce) {
	.rlba-404-vinyl, .rlba-404-digit, .rlba-playing .rlba-eq span, .rlba-facts__text.is-in { animation: none !important; }
}
.rlba-post-nav__grid > * { margin: 0 !important; }
.rlba-post-nav .wp-block-post-navigation-link { display: flex; }
.rlba-post-nav .wp-block-post-navigation-link a { flex: 1; }
