:root {
	/* Font */
	--font-base: "Baskerville", "Georgia", "Times New Roman", serif;

	/* Background */
	--bg-color: rgb(17, 24, 39);
	--bg-image: url("/background.jpg");

	/* Text color */
	--text-color: rgb(255, 255, 255);

	/* Language */
	--language-color: rgba(255, 255, 255, 0.8);
	--language-color-hover: rgba(255, 255, 255, 1);

	/* Popup colors */
	--popup-bg-color: rgb(255, 255, 255);
	--popup-text-color: rgb(0, 0, 0);

	--btn-accept-bg-color: rgb(0, 166, 61);
	--btn-accept-bg-darker-color: rgb(0, 130, 54);
	--btn-accept-text-color: rgb(255, 255, 255);

	--btn-refuse-bg-color: rgb(208, 213, 219);
	--btn-refuse-bg-darker-color: rgb(153, 161, 175);
	--btn-refuse-text-color: rgb(0, 0, 0);

	--btn-acknowledge-bg-color: rgb(23, 93, 252);
	--btn-acknowledge-bg-darker-color: rgb(19, 71, 230);
	--btn-acknowledge-text-color: rgb(255, 255, 255);


	/* Corners */
	--corner-icon-size: 2.5rem;

	--icon-infos-bg-color: rgba(250, 44, 55, 0.2);
	--icon-infos-bg-color-hover: rgba(250, 44, 55, 0.5);
	--icon-infos-color: rgb(255, 255, 255);

	--icon-about-bg-color: rgba(0, 188, 255, 0.2);
	--icon-about-bg-color-hover: rgba(0, 188, 255, 0.5);
	--icon-about-color: rgb(255, 255, 255);

	--corner-close-bg-color: rgb(220, 38, 38);
	--corner-close-bg-color-hover: rgb(185, 28, 28);
	--corner-close-color: rgb(255, 255, 255);


	/* Playlist */
	--no-zone-bg-color: transparent;
	--outer-zone-bg-color: rgb(59, 130, 246);
	--inner-zone-bg-color: rgb(34, 197, 94);
	--center-zone-bg-color: rgb(239, 68, 68);

	--unseen-text-color: rgb(255, 255, 255);
	--seen-text-color: rgb(180, 180, 180);
}


/* ------------------------ Container full-screen ------------------------ */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	background-color: var(--bg-color);
	font-family: var(--font-base);
}

.app-container {
	position: relative;
	width: 100%;
	height: 100dvh;
	overflow: hidden;
	text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
	color: var(--text-color);
	isolation: isolate;
}

.app-container::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background: var(--bg-image), var(--bg-color);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}


/* ------------------------ Language ------------------------ */
.language-toggle {
	position: fixed;
	top: max(0.5rem, env(safe-area-inset-top));
	left: max(0.5rem, env(safe-area-inset-left));
	z-index: 500;
}
.language-toggle > button {
	background: none;
	border: none;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	color: var(--language-color);
	padding: 0.5rem 1rem;
	transition: background 0.2s ease;
}
.language-toggle > button:hover {
	color: var(--language-color-hover);
}


/* ------------------------ Popup ------------------------ */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	border: 1px solid transparent;
	border-radius: 0.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition:
		background-color 0.2s ease,
		box-shadow 0.2s ease;
	cursor: pointer;
}

.popup-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 50;
	padding: 1.5rem;
}
.popup {
	background-color: var(--popup-bg-color);
	border-radius: 0.5rem;
	padding: 1.5rem;
	text-align: center;
	max-width: 34rem;
	margin-left: auto;
	margin-right: auto;
}
.popup p {
	font-size: 1rem;
	line-height: 1.5;
	color: var(--popup-text-color);
	text-shadow: none;
	margin-bottom: 1rem;
}
.popup .btn-group {
	display: flex;
	justify-content: center;
}
.popup .btn-group > * + * {
	margin-left: 1rem;
}

.btn-explain {
	background-color: var(--btn-acknowledge-bg-color);
	color: var(--btn-acknowledge-text-color);
}
.btn-explain:hover {
	background-color: var(--btn-acknowledge-bg-darker-color);
}


/* ------------------------ Geolocalisation ------------------------ */
.btn-accept {
	background-color: var(--btn-accept-bg-color);
	color: var(--btn-accept-text-color);
}
.btn-accept:hover {
	background-color: var(--btn-accept-bg-darker-color);
}

.btn-refuse {
	background-color: var(--btn-refuse-bg-color);
	color: var(--btn-refuse-text-color);
}
.btn-refuse:hover {
	background-color: var(--btn-refuse-bg-darker-color);
}

.loading-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 400;
}

.spinner {
	width: 3rem;
	height: 3rem;
	border: 6px solid rgb(209, 213, 219);
	border-top-color: rgb(31, 41, 55);
	border-radius: 9999px;
	animation: spin 1s linear infinite;
	z-index: 1000;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}


/* ------------------------ Background video ------------------------ */
.bg-video {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}


/* ------------------------ Slide panels ------------------------ */
.panel-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	background-color: transparent;
	border: none;
	border-radius: 0;
}

.panel-section {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 25;
	overflow: hidden;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
				0 10px 10px -5px rgba(0, 0, 0, 0.04);
	background-color: transparent;
	color: var(--text-color);
}


/* ------------------------ Corner icons ------------------------ */
.corner-icon {
	position: absolute;
	z-index: 30;
	width: calc(var(--corner-icon-size) * 2.6);
	height: calc(var(--corner-icon-size) * 2.6);
	transition: background-color 200ms ease-in-out;
}
.corner-icon > .icon {
	position: absolute;
	font-size: var(--corner-icon-size);
	width: 1em;
	height: 1em;
}
.corner-icon > .icon svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

/* Infos */
.corner-icon.icon-info {
	bottom: -2px;
	left: -2px;
	clip-path: polygon(0 100%, 0 0, 100% 100%);
	background-color: var(--icon-infos-bg-color);
}
.corner-icon.icon-info:hover {
	background-color: var(--icon-infos-bg-color-hover);
}
.corner-icon.icon-info > .icon {
	bottom: 0.25em;
	left: 0.25em;
	color:  var(--icon-infos-color);
}

/* About */
.corner-icon.icon-about {
	top: -2px;
	right: -2px;
	clip-path: polygon(100% 0, 0 0, 100% 100%);
	background-color: var(--icon-about-bg-color);
}
.corner-icon.icon-about:hover {
	background-color: var(--icon-about-bg-color-hover);
}
.corner-icon.icon-about > .icon {
	top: 0.25em;
	right: 0.25em;
	color:  var(--icon-about-color);
}

/* Close */
.corner-icon.close {
	background-color: var(--corner-close-bg-color);
}
.corner-icon.close:hover {
	background-color: var(--corner-close-bg-color-hover);
}
.corner-icon.close > .icon {
	color: var(--corner-close-color);
}


/* ------------------------ Views ------------------------ */
.view-container {
	position: relative;
	z-index: 10;
	max-width: 100%;
	margin: 0 auto;
	text-align: center;
	padding: 1.5rem;
}
.view-container > * + * {
	margin-top: 1rem;
}

.playlist-container {
	position: relative;
	z-index: 10;
	max-width: 100%;
	text-align: center;
}

.playlist-container > * + * {
	margin-top: 1rem;
}


/* ------------------------ Blur + Gradient ------------------------ */
.fx {
	position: fixed;
	inset: 0;
	z-index: 9;
	pointer-events: none;
}

.fx-blur,
.fx-grad { position: absolute; inset: 0; }

.fx-blur {
	background-color: rgba(0, 0, 0, 0.001);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	mask-image: linear-gradient( 
		to bottom, 
		rgba(0, 0, 0, 1) 0%, 
		rgba(0, 0, 0, 0) 100% 
	); 
	-webkit-mask-image: linear-gradient( 
		to bottom, 
		rgba(0, 0, 0, 1) 0%, 
		rgba(0, 0, 0, 0) 100% 
	);
}

.fx-grad {
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.3) 0%,
		rgba(0, 0, 0, 0.5) 20%,
		rgba(0, 0, 0, 0.2) 60%,
		rgba(0, 0, 0, 0.0) 100%
	);
}


/* ------------------------ Welcome ------------------------ */
.welcome-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin-top: 1rem;
	font-style: italic;
}

.welcome-subtitle {
	font-size: 1.5rem;
	font-weight: 700;
	margin-top: 0.5rem;
	margin-bottom: 2rem;
	font-style: italic;
}

.welcome-description {
	font-size: 1rem;
	line-height: 1.5;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	overflow-wrap: break-word;
}

.welcome-title,
.welcome-subtitle,
.welcome-description {
	position: relative;
	z-index: 11;
}


/* ------------------------ Playlist ------------------------ */
.zone-list-wrapper {
	position: relative;
	max-height: 100dvh;
}

.playlist-description {
	width: 80%;
	margin: 0 auto;
	font-size: 1rem;
	line-height: 1.5;
}

/* All items */
.playlist-item {
	display: flex;
	align-items: center;
	padding: calc(0.15rem * var(--scale)) 1rem;
	margin-bottom: calc(0.5rem * var(--scale));
	gap: 1rem;
	color: var(--unseen-text-color);
	opacity: var(--scale);
	transition: 
		color 0.2s ease,
		background-color 0.2s ease,
		opacity 0.5s ease, 
		padding 0.5s ease, 
		margin-bottom 0.5s ease;
}

.zone-name {
	font-size: calc(1.125rem * var(--scale));
	line-height: 1.75;
	flex: 1;
	text-align: left;
}

.zone-distance {
	font-size: calc(1.125rem * var(--scale));
	line-height: 1.75;
	flex: 1;
	text-align: right;
}
.dir-icon {
	display: inline-block;
	text-decoration: none;
	font-size: 0.8em;
	margin-left: 0.25em;
	color: hsl(var(--arrow-hue, 60), 100%, 40%);
	transition: color 0.5s ease;
}

/* Speaker button */
.playlist-speaker {
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgb(255, 255, 255);
	background-color: transparent;
	border: none;
	border-radius: 0;
}
.playlist-speaker:hover {
	color: rgba(255, 255, 255, 0.9);
}
.playlist-speaker svg {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Backgrounds */
.playlist-item.no-zone {
	background-color: var(--no-zone-bg-color);
}
.playlist-item.outer-zone {
	background-color: var(--outer-zone-bg-color);
}
.playlist-item.inner-zone {
	background-color: var(--inner-zone-bg-color);
}
.playlist-item.center-zone {
	background-color: var(--center-zone-bg-color);
}

/* Video */
.center-zone-fullscreen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 210;
	pointer-events: auto;
}
.center-zone-fullscreen .zone-video {
	position: absolute;
	pointer-events: none;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: none;
	border-radius: 0;
	z-index: 0;
}

.center-zone-fullscreen .center-close-btn{
	position: fixed;
	top: -2px;
	right: -2px;
	z-index: 230;
	width: calc(var(--corner-icon-size) * 2.6);
	height: calc(var(--corner-icon-size) * 2.6);
	clip-path: polygon(100% 0, 0 0, 100% 100%);
	background-color: rgba(0, 0, 0, 0.5);
	border: none;
	border-radius: 0;
	background-image: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	cursor: pointer;
	transition: background-color 200ms ease-in-out;
}
.center-zone-fullscreen .center-close-btn:hover{
	background-color: rgba(0, 0, 0, 0.8);
}

.center-zone-fullscreen .center-close-btn .icon{
	position: absolute;
	top: 0.25em;
	right: 0.25em;
	width: var(--corner-icon-size);
	height: var(--corner-icon-size);
	line-height:0;
}
.center-zone-fullscreen .center-close-btn .icon svg{
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

/* Cookies */
.playlist-item.seen {
	position: relative;
	opacity: 0.8;
	color: var(--seen-text-color);
	text-decoration: line-through;
}

/* Scroll bar */
.scroll-wrapper-enabled {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	overflow-y: auto;
	z-index: 10;
}
.scroll-wrapper-enabled::-webkit-scrollbar {
	width: 0px;
}


/* ------------------------ Infos ------------------------ */
.infos-title {
	margin-top: 1rem;
	font-size: 1.7rem;
	font-weight: 700;
	margin-bottom: 2rem;
}

.infos-description {
	font-size: 1rem;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	overflow-wrap: break-word;
}


/* ------------------------ About ------------------------ */
.about-title {
	margin-top: 1rem;
	font-size: 1.7rem;
	font-weight: 700;
}

.about-site-name {
	font-size: 1.6rem;
	font-weight: 700;
	margin-top: 1rem;
	font-style: italic;
}
.about-site-subtitle {
	font-size: 1.4rem;
	font-weight: 700;
	margin-top: 0.25rem;
	margin-bottom: 1.5rem;
	font-style: italic;
}

.about-description {
	font-size: 1rem;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	overflow-wrap: break-word;
}


/* ------------------------ Links ------------------------ */
a,
a:visited {
	color: var(--text-color);
	text-decoration: underline;
	text-decoration-color: var(--text-color);
}

a:hover,
a:focus {
	color: var(--text-color);
	text-decoration: underline;
	text-decoration-color: var(--text-color);
}

.popup a,
.popup a:visited,
.popup a:hover,
.popup a:focus {
	color: var(--popup-text-color);
	text-decoration-color: var(--popup-text-color);
}


/* ------------------------ Debug ------------------------ */

/* Debug CSV */
.popup h2 {
	color: var(--popup-text-color);
	text-shadow: none;
}
.popup li {
	font-size: 1rem;
	line-height: 1;
	text-align: left;
	color: var(--popup-text-color);
	text-shadow: none;
	margin: 1rem;
}
.popup ul {
	margin-bottom: 1.5rem;
}

.override-off,
.override-on {
	margin: 1rem 0 0.5rem 0;
	color: rgb(255, 255, 255);
}

/* Debug button states */
.debug-off {
	background-color: rgb(0, 166, 61);
}
.debug-off:hover {
	background-color: rgb(0, 130, 54);
}

.debug-on {
	background-color: rgb(231, 0, 10);
}
.debug-on:hover {
	background-color: rgb(193, 0, 7);
}

/* Override button states */
.override-off {
	background-color: rgb(37, 99, 235);
}
.override-off:hover {
	background-color: rgb(29, 78, 216);
}
.override-on {
	background-color: rgb(245, 74, 0);
}
.override-on:hover {
	background-color: rgb(202, 53, 0);
}

/* Map */
.playlist-container .map-container {
	position: sticky;
	z-index: 100;
	top: 0;
	flex: 0 0 300px;
}
.playlist-container .map-container > #map {
	max-width: 60%;
	height: 12rem;
	margin: 0 auto;
}

/* Map only */
.map-fullscreen{
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--bg-color);
}

.map-fullscreen :global(.map-container){
	position: static !important;
	top: auto !important;
	flex: none !important;
	width: 100% !important;
	height: 100dvh !important;
	max-width: none !important;
}
.map-fullscreen :global(.map-container > #map),
.map-fullscreen :global(#map),
.map-fullscreen :global(.leaflet-container){
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
}

.map-fullscreen .map-close-btn{
	position: fixed;
	top: max(-2px, env(safe-area-inset-top) - 2px);
	right: max(-2px, env(safe-area-inset-right) - 2px);
	z-index: 100000;
	width: calc(var(--corner-icon-size, 20px) * 2.6);
	height: calc(var(--corner-icon-size, 20px) * 2.6);
	clip-path: polygon(100% 0, 0 0, 100% 100%);
	background-color: rgba(0,0,0,0.5);
	border: none;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 200ms ease-in-out;
}
.map-fullscreen .map-close-btn .icon{
	position: absolute;
	top: 0.25em;
	right: 0.25em;
	width: var(--corner-icon-size, 20px);
	height: var(--corner-icon-size, 20px);
}
.map-fullscreen .map-close-btn .icon svg{
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.map-fullscreen-inner{
	position: absolute;
	inset: 0;
}
.map-fullscreen-inner > *{
	width: 100%;
	height: 100dvh;
	display: block;
}