/* ==========================================================================
   Navadra 2.0 — styles des nouveautés (quêtes du jour, série, cadre légendaire)
   et petites améliorations visuelles communes à tous les écrans.
   ========================================================================== */

:root {
	--nv-parchemin: #fde6c4;
	--nv-parchemin-fonce: #e9cc9f;
	--nv-encre: #3b2412;
	--nv-bordeaux: #6e0204;
	--nv-bordeaux-clair: #a3080b;
	--nv-or: #f3b51b;
	--nv-or-clair: #ffe08a;
	--nv-vert: #2f8a2f;
}

/* Rendu des textes et images un peu plus net sur les écrans récents */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Les boutons-images réagissent au survol (retour visuel pour les élèves) */
#indicatorQuests,
#indicatorChallenges,
#indicatorFights,
.icones_sorts_combat,
.learnableSpells,
#closeIndexPopUp,
#closeWindow {
	transition: transform .15s ease, filter .15s ease;
}
#indicatorQuests:hover,
.icones_sorts_combat:hover,
.learnableSpells:hover,
#closeIndexPopUp:hover,
#closeWindow:hover {
	transform: scale(1.07);
	filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 210, 90, .55));
}

/* Navigation au clavier visible (accessibilité) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
	outline: 3px solid var(--nv-or);
	outline-offset: 2px;
}

/* ---------- Bouton « Quêtes du jour » sur l'île ---------- */
#indicatorQuests {
	position: absolute;
	top: 11%;
	right: 9.6%;
	width: 3.5%;
	min-width: 38px;
	cursor: pointer;
	z-index: 20;
}
#questsBadge {
	position: absolute;
	top: 10.2%;
	right: 9.4%;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--nv-or);
	color: var(--nv-bordeaux);
	font: bold 12px/18px Arial, sans-serif;
	text-align: center;
	box-shadow: 0 0 0 2px var(--nv-bordeaux), 0 2px 6px rgba(0, 0, 0, .4);
	z-index: 21;
	pointer-events: none;
	animation: nv-pulse 1.6s ease-in-out infinite;
}
#questsBadge.vide { display: none; }
@keyframes nv-pulse { 50% { transform: scale(1.18); } }

/* ---------- Panneau des quêtes ---------- */
#questsPanel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(.96);
	width: min(520px, 92vw);
	max-height: 86vh;
	overflow: auto;
	background: var(--nv-parchemin);
	color: var(--nv-encre);
	border: 4px solid var(--nv-parchemin-fonce);
	border-radius: 14px;
	box-shadow: 0 0 0 3px var(--nv-bordeaux), 0 18px 50px rgba(0, 0, 0, .55);
	z-index: 1000;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	font-family: Arial, Helvetica, sans-serif;
}
#questsPanel.ouvert {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, -50%) scale(1);
}
#questsOverlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 10, 30, .55);
	z-index: 999;
	display: none;
}
#questsOverlay.ouvert { display: block; }

#questsPanel .nv-entete {
	background: var(--nv-parchemin-fonce);
	text-align: center;
	padding: 14px 48px 10px;
	font-family: "Trajan", Georgia, serif;
	font-weight: bold;
	font-size: 24px;
	letter-spacing: .5px;
	position: relative;
}
#questsPanel .nv-entete small {
	display: block;
	font-family: Arial, sans-serif;
	font-weight: normal;
	font-style: italic;
	font-size: 13px;
	margin-top: 2px;
}
#questsPanel .nv-fermer {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: var(--nv-bordeaux) url('/webroot/img/icones/refuser.png') center/cover no-repeat;
	cursor: pointer;
}

/* Série de jours */
.nv-serie {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 14px 16px 6px;
	padding: 10px 14px;
	border-radius: 10px;
	background: linear-gradient(90deg, var(--nv-bordeaux), var(--nv-bordeaux-clair));
	color: #fff;
}
.nv-serie .nv-flamme {
	font-size: 30px;
	line-height: 1;
	filter: drop-shadow(0 0 6px rgba(255, 170, 0, .8));
}
.nv-serie b { font-size: 20px; color: var(--nv-or-clair); }
.nv-serie span.nv-record { margin-left: auto; font-size: 12px; opacity: .85; text-align: right; }

/* Liste des quêtes */
.nv-quetes { list-style: none; margin: 8px 16px 6px; padding: 0; }
.nv-quete {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 6px;
	border-bottom: 1px dashed rgba(59, 36, 18, .25);
}
.nv-quete:last-child { border-bottom: 0; }
.nv-quete img { width: 40px; height: 40px; object-fit: contain; }
.nv-quete .nv-titre { font-weight: bold; font-size: 15px; }
.nv-barre {
	height: 10px;
	margin-top: 6px;
	border-radius: 5px;
	background: rgba(59, 36, 18, .18);
	overflow: hidden;
}
.nv-barre i {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 5px;
	background: linear-gradient(90deg, #f7c843, #f29a0e);
	transition: width .6s ease;
}
.nv-quete.terminee .nv-barre i { background: linear-gradient(90deg, #6fcf4a, var(--nv-vert)); }
.nv-quete .nv-compteur { font-size: 12px; opacity: .75; margin-top: 3px; }

.nv-bouton {
	border: 0;
	border-radius: 18px;
	padding: 8px 14px;
	font: bold 13px Arial, sans-serif;
	cursor: pointer;
	color: #fff;
	background: var(--nv-bordeaux);
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
	white-space: nowrap;
}
.nv-bouton:hover { background: var(--nv-bordeaux-clair); }
.nv-bouton.pret {
	color: var(--nv-bordeaux);
	background: linear-gradient(180deg, var(--nv-or-clair), var(--nv-or));
	animation: nv-pulse 1.4s ease-in-out infinite;
}
.nv-bouton:disabled { cursor: default; opacity: .55; animation: none; }
.nv-fait { color: var(--nv-vert); font-weight: bold; font-size: 13px; white-space: nowrap; }

.nv-pied {
	margin: 4px 16px 16px;
	font-size: 12.5px;
	text-align: center;
	opacity: .85;
}

/* Récompense qui s'envole */
.nv-gain {
	position: fixed;
	z-index: 1100;
	font: bold 20px Arial, sans-serif;
	color: var(--nv-or-clair);
	text-shadow: 0 2px 0 var(--nv-bordeaux), 0 0 10px rgba(0, 0, 0, .6);
	pointer-events: none;
	animation: nv-envol 1.4s ease-out forwards;
}
@keyframes nv-envol {
	from { opacity: 1; transform: translate(-50%, 0) scale(1); }
	to { opacity: 0; transform: translate(-50%, -70px) scale(1.25); }
}

@media (max-width: 768px) {
	#indicatorQuests { top: 9%; right: 23%; width: 10%; }
	#questsBadge { top: 8.4%; right: 22%; }
}
@media (prefers-reduced-motion: reduce) {
	#questsBadge, .nv-bouton.pret, .nv-gain { animation: none; }
}

/* ---------- Interface professeur : nouveaux boutons ---------- */
.nv-outils-prof {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 10px 0;
}
.nv-mdp-resultat {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 6px;
	background: #fff6d6;
	border: 1px solid var(--nv-or);
	font-family: "Courier New", monospace;
	font-weight: bold;
}

/* ---------- Temps de jeu restant (élèves) ---------- */
.nv-temps {
	position: fixed;
	left: 50%;
	bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 900;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 8px;
	border-radius: 20px;
	background: rgba(74, 0, 1, .92);
	color: #fff;
	font: 600 14px "Dosis", Arial, sans-serif;
	box-shadow: 0 0 0 2px var(--nv-or), 0 4px 12px rgba(0, 0, 0, .4);
	pointer-events: none;
}
.nv-temps img { width: 22px; height: 22px; }
.nv-temps.bientot { background: #a3080b; }
.nv-temps.secoue { animation: nv-pulse 1.2s ease-in-out 3; }

/* ---------- Lien vers le panneau d'administration ---------- */
.nv-lien-admin {
	position: fixed;
	top: calc(46px + env(safe-area-inset-top, 0px));
	right: calc(12px + env(safe-area-inset-right, 0px));
	z-index: 950;
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	background: var(--nv-bordeaux);
	color: #fff !important;
	font: bold 13px Arial, sans-serif;
	text-decoration: none;
	box-shadow: 0 0 0 2px var(--nv-or);
	vertical-align: middle;
}
.nv-lien-admin:hover { background: var(--nv-bordeaux-clair); }

/* ---------- Message de l'administrateur sur l'île ---------- */
.nv-message-site {
	position: absolute;
	top: 15%;
	left: 50%;
	transform: translateX(-50%);
	max-width: min(560px, 80%);
	z-index: 30;
	padding: 6px 16px;
	border-radius: 18px;
	background: linear-gradient(180deg, var(--nv-or-clair), var(--nv-or));
	color: var(--nv-bordeaux);
	font: bold 15px Arial, sans-serif;
	text-align: center;
	box-shadow: 0 0 0 2px var(--nv-bordeaux), 0 6px 16px rgba(0, 0, 0, .4);
}
