@import url('https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400;0,700;1,400&family=Carter+One&family=Chela+One&family=IM+Fell+English:ital@0;1&family=Cinzel:wght@700;900&display=swap');

body{
	/* fons fosc i càlid, com de nit a la llum d'un llum d'oli */
	background: radial-gradient(ellipse at 50% 45%, #3b2716 0%, #1c1209 55%, #080503 100%) fixed;
	min-height: 100vh;
	overflow-x: hidden;
	padding:0;
	margin:0;
}

#titol-aventura{
	grid-area: titol;
	font-family: 'Chela One', serif;
	text-align: center;
	line-height:15vh;
	font-size: 8vmin;
	/* El pergamí s'allarga segons el text: els rotlles dels extrems no es deformen
	   i només s'estira el tros del mig (border-image) */
	width: fit-content;
	min-width: 40vh;
	max-width: 100%;
	box-sizing: border-box;
	justify-self: center;
	white-space: nowrap;
	padding: 0 10vh;
	border-style: solid;
	border-width: 0;
	border-image-source: url('../img/general/fonsMissio.png');
	border-image-slice: 40 115 40 115 fill;
	border-image-width: 3.5vh 10vh 3.5vh 10vh;
	border-image-repeat: stretch;
	z-index:2;
	text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff,
               1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
}

#titol-aventura img{
	width:100%;
}

#text-aventura{
	display: none;          /* la presentació de cada lloc ara surt en una finestra */
	position:relative;
	grid-area: text;
	background-color: rgba(255, 255, 255, 0.5);
	border-radius:10px;
	padding:10px 15px;
	font-family: 'Archivo Narrow', sans-serif;
	font-size: 1.1rem;
	text-align: justify;
	height:100%;
	width:90%;
}

#imatge-aventura{
	grid-area: imatge;
	width: 100%;
	text-align: center;
}

#imatge-aventura img{
	width: auto;
	max-width: 96%;
	max-height: 76vh;
	vertical-align: middle;
	border:5px solid white;
	border-radius:10px;
}

#inventori{
	grid-area: inventori;
}

#container{
  display: grid;
  justify-items: center;
  align-items: center;
  height:90vh;
  width: 100vw;
  grid-template-columns: 10vw 22vw 24vw 34vw 10vw;
  grid-template-rows: 15vh 78vh 5vh;
  grid-template-areas: 
    "musica titol titol titol user-info"
    "imatge imatge imatge imatge imatge"
    "inventori inventori inventori inventori inventori";
}

#map{
	position: absolute;
	display: inline-block;
	display: flex;
	justify-content: center;
	top:-340px;
}

#map img{
	height:auto;
	width:auto;
  	display: block;
  	filter: drop-shadow(7px 7px 7px #222);
}

#map .title{
  font-family: 'IM Fell English', serif;
  font-size: 34px;
  font-weight: bolder;
  position: absolute;
  top: 6.3%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  color: #000; 
  text-align: center;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff,
               1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
}

.localitzacio{
  position: absolute;
  width: 20px; 
  height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background-color: rgba(255,255,255,0.2);
  border:3px solid yellow;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor:pointer;
  animation: anim-glow 2s ease infinite;
  margin: -32px 0 0 -13px;      /* la punta de l'agulla cau just sobre el lloc */
}

#loc_1{
	top:42%;
	left:47%;
}

#loc_2{
	top:38%;
	left:25%;
}

#loc_3{
	top:33%;
	left:14.5%;
}

#loc_4{
	top:67%;
	left:26.5%;
}

#loc_5{
	top:80%;
	left:41.5%;
}

#loc_6{
	top:82.5%;    /* a l'illeta del llac (Tombatossals) */
	left:57%;
}

#loc_7{
	top:14%;
	left:30.5%;
}

#loc_8{
	top:17%;
	left:66%;
}

#loc_9{
	top:17%;
	left:10%;
}

#loc_10{
	top:43%;
	left:84.5%;
}

#loc_12{          /* la cambra del drac, al cràter del volcà */
	top:21%;
	left:88.5%;
}

#loc_13{          /* la Bassa de la Quarantamaula (secreta), lluny de tot */
	top:25%;
	left:45%;
}

#loc_11{          /* el port, davant de l'illa */
	top:45%;
	left:16%;
}

@keyframes anim-glow {
	0% {
		box-shadow: 0 0 rgba(97,239,97, 1);
	}
	100% {
		box-shadow: 0 0 10px 8px transparent;
		border-width: 3px;
	}
}

.localitzacio .textLoc{
  visibility: hidden;
  padding: 0.125em 0.25em;
  background-color: rgba(255,255,255,0.25);
  color: #922B21;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff,
               1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
  font-weight: bold;
  text-align: center;
  border-radius: 0.25em;
  white-space: nowrap;
  font-style:italic;
  
  /* Position the tooltip */
  position: absolute;
  z-index: 1;
  top: 100%;
  left: 100%;
  transition-property: visibility;
  transition-delay: 0s;
}

.localitzacio:hover{
	width:1.4vw;
	height:1.4vw;
	background-color:yellow;
	animation: none;
}

.localitzacio:hover .textLoc{
	visibility: visible;
  	transform: rotate(45deg);
  	font-family: 'IM Fell English', serif;
  	font-size:1.5vw;
}


/*Inventori*/
#inventori #motxilla{
	position:fixed;
	bottom:10px;
	right:10px;
	width:7vw;
	cursor:pointer;
	z-index:1;
	filter: drop-shadow(2px 2px 0 white)
        drop-shadow(-2px 2px 0 white)
        drop-shadow(2px -2px 0 white)
        drop-shadow(-2px -2px 0 white);
}

#inventori #mapa-icona{
	position:fixed;
	bottom:15px;
	left:10px;
	width:7vw;
	cursor:pointer;
	z-index:1;
	filter: drop-shadow(2px 2px 0 white)
        drop-shadow(-2px 2px 0 white)
        drop-shadow(2px -2px 0 white)
        drop-shadow(-2px -2px 0 white);
}

#motxilla-content{
	display:inline-flex;
	flex-direction: row;
	flex-wrap:nowrap;
	gap:5px;
	list-style:none;
	background-color:rgba(255,255,255,0.4);
	visibility: hidden;
  	padding: 0.25em 0.9em;
  	justify-content: start;
  	align-items: center;
  	border-radius: 0.25em;
  	white-space: nowrap;
  	max-width:100%;
  	height:5vw;
  	/* Position the tooltip */
  	position: fixed;
  	right:calc(5vw + 5vmin);
  	bottom:0.5vh;
  	transition-property: visibility;
  	transition-delay: 0.1s;
  	overflow-x:auto;
  	overflow-y:hidden;
  	scrollbar-gutter: stable;
}

#motxilla:hover + #motxilla-content{
/*	visibility: visible;*/
}

#motxilla-content li img{
	cursor:pointer;
	height:4vw;
	filter: drop-shadow(1px 1px 0 white)
        drop-shadow(-1px 1px 0 white)
        drop-shadow(1px -1px 0 white)
        drop-shadow(-1px -1px 0 white);
}

#motxilla-content li img:hover{
	transform:scale(1.2);
}

#motxilla-content::-webkit-scrollbar {
/*  display: none;*/
}

*::-webkit-scrollbar{
	width:0.5vw;
	height:0.5vw;
}

*::-webkit-scrollbar-track {
  background: orange;
}

*::-webkit-scrollbar-thumb {
  background-color: blue;
  border-radius: 20px;
  border: 3px solid orange;
}

@keyframes wipe-enter {
	0% {
		transform: scale(0, .025);
	}
	50% {
		transform: scale(1, .025);
	}
}

/*User-info*/

.user-info{
    grid-area: user-info;
    background-color: rgba(255,255,255,0);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
	filter: drop-shadow(7px 7px 7px #222);
	position: relative;
	z-index: 5;          /* el cor i el botó d'Eixir sempre per damunt del mapa de l'illa */
}

.ocult {
   display: none;
}
.vides{
  background-image: url('../img/general/vides.png');
  background-size: cover;
  text-align: center;
  position:relative;
  font-size: 4vmin;
  font-family:'Carter One',cursive;
  color: white;
  -webkit-text-stroke-width: 2px;
  -webkit-text-stroke-color: black;
  line-height: 10.5vmin;
  width: 10vmin;
  height:9vmin;
}

button.bTancar {
  background-image: url('../img/general/TancarSessio.png');
  background-size: cover;
  background-color: rgba(0,0,0,0);
  font-family: 'Carter One', cursive;
  font-size: 3vmin;
  width:15vmin;
  outline: none;
  cursor: pointer;
  border: none;
  position: relative;
}

button.bTancar:hover{
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: white;
}

div.temporitzador{
  font-family: 'Archivo Narrow', sans-serif;
  background-color:#FFE385;
  color:#A04000;
  position:relative;
  padding:0 2px;
  font-size:2vmin;
  border-radius:5px;
  font-style:italic;
}

#musica{
  cursor: pointer;
  grid-area:musica;
}

#musica img{
	width:5vmin;
}

/*Elements dels diferents episodis*/

#codi{
	display:flex;
	gap:5px;
	justify-content: center;
	margin-top:10px;
}

#codi input{
	width:50px;
	height:50px;
	font-size:45px;
	text-align: center;
	background-size: cover;
	font-family: 'Carter One', cursive;
}

#xifra1{
	background-image:url('../img/general/terra.png');
	color:rgba(102,51,0,0.8);
}

#xifra2{
	background-image:url('../img/general/aigua.png');
	color:rgba(0,0,153,0.8);
}

#xifra3{
	background-image:url('../img/general/vent.png');
	color:rgba(0,153,0,0.8);
}

#xifra4{
	background-image:url('../img/general/foc.png');
	color:rgba(153,0,0,0.8);
}

/*Treure fletxes de la capsa de text numèrica*/
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

.titol-popup{
	text-transform: capitalize;
	text-shadow: 2px 0 #922B21, -2px 0 #922B21, 0 2px #922B21, 0 -2px #922B21,
               1px 1px #922B21, -1px -1px #922B21, 1px -1px #922B21, -1px 1px #922B21;
	font-family: 'IM Fell English', serif;
	color:#F1C40F;
}

.content-popup{
	color:white;
	font-family: 'IM Fell English', serif;
	font-size:20px;
	font-weight: bold;
	text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000,
               1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
}

.boto-popup{
	font-family: 'IM Fell English', serif;
	font-weight: bold;
}
/* =========================================================
   Motor d'aventura: motxilla, mapa i reptes
   ========================================================= */

#motxilla-content.visible{
	visibility: visible;
}

#motxilla.nou{
	animation: bot-motxilla 0.6s ease 2;
}

@keyframes bot-motxilla{
	0%, 100% { transform: translateY(0); }
	40%      { transform: translateY(-1.5vw) scale(1.1); }
}

.localitzacio.actual{
	/* on ets ara: una marca roja que bota, amb el rètol «Ets aquí» */
	border-color: #fff;
	background-color: #c0392b;
	width: 26px; height: 26px;
	animation: aqui-bota 1.1s ease-in-out infinite;
	box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.35), 0 0 14px 4px rgba(255, 255, 255, 0.6);
	z-index: 3;
}
@keyframes aqui-bota{
	0%, 100% { transform: rotate(-45deg) translate(0, 0); }
	50%      { transform: rotate(-45deg) translate(5px, -5px); }
}
.marca-aqui{
	position: absolute; left: 50%; top: 50%;
	transform: rotate(45deg) translate(-50%, -2.6em);
	transform-origin: 0 0;
	white-space: nowrap; pointer-events: none;
	font-family: 'IM Fell English', serif; font-size: 15px; font-weight: bold;
	color: #fff; background: #c0392b; border: 2px solid #fff; border-radius: 8px; padding: 1px 8px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
#cami-viatge{ position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.puntet-viatge{
	position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
	background: #922B21; border: 2px solid #fff3d6;
	box-shadow: 0 0 6px rgba(0,0,0,0.6);
	animation: puntet-apareix 0.25s ease-out;
}
@keyframes puntet-apareix{ from { transform: scale(0); } to { transform: scale(1); } }
.localitzacio.desti{
	background-color: #FFD750; border-color: #fff;
	box-shadow: 0 0 18px 8px rgba(255, 215, 80, 0.9);
}

/* Reptes de programació */
.enunciat-repte{
	text-align: left;
	font-size: 18px;
	line-height: 1.4;
}

.enunciat-repte code,
.enunciat-repte pre{
	font-family: Consolas, 'Courier New', monospace;
	color: #F1C40F;
	text-shadow: none;
	background-color: rgba(0,0,0,0.45);
	border-radius: 4px;
	padding: 0 4px;
}

.enunciat-repte pre{
	display: block;
	width: fit-content;
	padding: 8px 14px;
	margin: 10px auto;
	font-size: 16px;
}

.fitxer-repte img{
	width: 60px;
	margin-top: 10px;
	filter: drop-shadow(2px 2px 2px #000);
	transition: transform 0.2s;
}

.fitxer-repte img:hover{
	transform: scale(1.15);
}

.pregunta-repte{
	margin: 10px 0;
}

#resp{
	width: 220px;
	font-size: 28px;
	text-align: center;
	font-family: 'Carter One', cursive;
	border-radius: 6px;
	border: 2px solid #922B21;
}

.img-repte{
	float: right;
	width: 260px;
	margin: -30px 0 -10px 5px;   /* la imatge té marge transparent al voltant */
	filter: drop-shadow(4px 4px 6px #000);
}

.enunciat-repte::after{
	content: "";
	display: block;
	clear: both;
}

.content-popup code{
	font-family: Consolas, 'Courier New', monospace;
	color: #F1C40F;
	text-shadow: none;
	background-color: rgba(0,0,0,0.45);
	border-radius: 4px;
	padding: 0 4px;
}

.fitxer-repte{
	display: block;
	width: fit-content;
	margin: 0 auto;
}

/* Arrossegar objectes de la motxilla */
#motxilla-content li img{
	touch-action: none;      /* perquè es puga arrossegar amb el dit */
	user-select: none;
	-webkit-user-drag: none;
}

body.arrossegant,
body.arrossegant *{
	cursor: grabbing !important;
	user-select: none;
}

.objecte-arrossegat{
	position: fixed;
	z-index: 2000;
	height: 4vw;             /* la mateixa mida que a la motxilla */
	width: auto;
	transform: translate(-50%, -50%);
	pointer-events: none;    /* així es pot saber què hi ha davall */
	opacity: 0.9;
	filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.6));
	transition: filter 0.15s, transform 0.15s;
}

.objecte-arrossegat.pot-interactuar{
	opacity: 1;
	filter: drop-shadow(0 0 5px #FFD750) drop-shadow(0 0 12px #FFB000) drop-shadow(0 0 22px #FF9800);
	animation: brilla-objecte 0.6s ease-in-out infinite alternate;
}

@keyframes brilla-objecte{
	from { filter: drop-shadow(0 0 3px #FFD750) drop-shadow(0 0 8px #FFB000); }
	to   { filter: drop-shadow(0 0 7px #FFF3B0) drop-shadow(0 0 16px #FFB000) drop-shadow(0 0 28px #FF9800); }
}

#motxilla-content li img.origen-arrossegat{
	opacity: 0.35;
}

/* Pistes */
.pista{
	margin-top: 14px;
	padding: 8px 12px;
	border: 2px dashed #F1C40F;
	border-radius: 8px;
	background-color: rgba(0,0,0,0.35);
	font-size: 17px;
	color: #FFF3C4;
}

.pista b{
	color: #F1C40F;
}

/* Localitzacions noves al mapa */
.localitzacio.nova{
	border-color: #FF9800;
	background-color: rgba(255, 200, 60, 0.7);
	animation: loc-nova 0.8s ease-in-out infinite alternate;
}

@keyframes loc-nova{
	from { box-shadow: 0 0 4px 2px rgba(255, 200, 60, 0.8); transform: rotate(-45deg) scale(1); }
	to   { box-shadow: 0 0 18px 10px rgba(255, 152, 0, 0.9); transform: rotate(-45deg) scale(1.35); }
}

.loc-nova{
	margin-top: 12px;
	padding: 6px 10px;
	border-radius: 8px;
	background-color: rgba(70, 160, 70, 0.55);
	font-size: 17px;
}

/* Imatge dels popups: que no ocupe tota la finestra */
.swal2-image{
	max-height: 35vh;
	width: auto !important;
	max-width: 90%;
	object-fit: contain;
}

/* Vides */
.vides.perd{ animation: vides-perd 0.6s ease 2; }
.vides.guanya{ animation: vides-guanya 0.6s ease 2; }

@keyframes vides-perd{
	0%, 100% { transform: scale(1); }
	30%      { transform: scale(1.3) rotate(-8deg); filter: hue-rotate(-30deg) brightness(0.7); }
	60%      { transform: scale(0.9) rotate(8deg); }
}

@keyframes vides-guanya{
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.35); filter: brightness(1.4) drop-shadow(0 0 8px #61ef61); }
}

.vida-perduda,
.vida-guanyada{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 14px;
	font-size: 22px;
}

.vida-perduda{ color: #ff8a80; }
.vida-guanyada{ color: #b9f6ca; font-size: 28px; }

.vida-perduda img{
	width: 60px;
}

/* L'illa de l'Encantada (mapa dibuixat) */
#illa{
	position: relative;
	max-width: 96%;
	display: inline-block;
}

#illa-mapa{
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 76vh;
	border: 5px solid white;
	border-radius: 10px;
	box-sizing: border-box;
	cursor: pointer;
}

#illa-boira{
	position: absolute;
	left: 5px; top: 5px;
	width: calc(100% - 10px);
	pointer-events: none;
	transition: opacity 3s ease;
}

#illa-boira.esvaida{
	opacity: 0;
}

/* Resposta amb ordres (A, S, D, E) */
.resp-ordres{
	width: 90%;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 18px;
	letter-spacing: 2px;
	border-radius: 6px;
	border: 2px solid #922B21;
	padding: 6px;
	resize: vertical;
	text-transform: uppercase;
}

.exemple-mapa{
	display: block;
	width: fit-content;
	margin: 8px auto;
	padding: 6px 12px;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 16px;
	line-height: 1.15;
	color: #F1C40F;
	text-shadow: none;
	background-color: rgba(0,0,0,0.45);
	border-radius: 6px;
	text-align: left;
}

/* Mapa d'Areus: quan el tens, va a la cantonada i la motxilla es desplaça a l'esquerra
   Ordre (de dreta a esquerra): mapa · motxilla · contingut de la motxilla */
#inventori #mapa-icona{
	display: none;
	left: auto;
	right: 10px;
	bottom: 10px;
	width: 7vw;            /* la mateixa mida que la motxilla */
	transition: transform 0.2s ease, filter 0.2s ease;
}

body.te-mapa #inventori #mapa-icona{
	display: block;
}

body.te-mapa #inventori #motxilla{
	right: calc(7vw + 20px);
}

body.te-mapa #motxilla-content{
	right: calc(12vw + 5vmin + 10px);
}

#inventori #mapa-icona.nou{
	animation: bot-motxilla 0.6s ease 3;
}

/* Efecte en passar el ratolí per damunt de la motxilla i del mapa */
#inventori #motxilla{
	transition: transform 0.2s ease, filter 0.2s ease;
	transform-origin: 50% 90%;
}

#inventori #motxilla:hover{
	transform: scale(1.1) rotate(-5deg);
	filter: drop-shadow(2px 2px 0 white) drop-shadow(-2px 2px 0 white)
	        drop-shadow(2px -2px 0 white) drop-shadow(-2px -2px 0 white)
	        drop-shadow(0 0 10px #FFD750);
}

#inventori #mapa-icona:hover{
	transform: scale(1.1) rotate(4deg);
	filter: drop-shadow(2px 2px 0 white) drop-shadow(-2px 2px 0 white)
	        drop-shadow(2px -2px 0 white) drop-shadow(-2px -2px 0 white)
	        drop-shadow(0 0 10px #FFD750);
}


/* Minijoc del disc de xifrat */
.disc-joc{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
}
.disc-paret, .disc-resultat{
	font-size: 22px;
}
.disc-paret b, .disc-resultat b{
	font-family: 'Cinzel', Georgia, serif; font-weight: 900;
	letter-spacing: 6px;
	color: #F1C40F;
	text-shadow: none;
	background: rgba(0,0,0,0.45);
	padding: 2px 10px;
	border-radius: 6px;
}
#disc-svg{
	max-width: 80vw;
	cursor: grab;
}
.disc-fora{ fill: url(#textura-fusta-fosca); stroke: #2a1a0c; stroke-width: 5; }
.disc-dins{ fill: url(#textura-fusta-clara); stroke: #3b2a17; stroke-width: 4; }
.disc-centre{ fill: url(#textura-bronze); stroke: #3b2a17; stroke-width: 3; }
.disc-marca{ stroke: #b03a2e; stroke-width: 4; stroke-linecap: round; }
.lletra-clara{ fill: #ffe7a8; font-family: 'Cinzel', Georgia, serif; font-weight: 900; text-shadow: none; paint-order: stroke; stroke: #2a1a0c; stroke-width: 2.2px; }
.lletra-xifrada{ fill: #4a1608; font-family: 'Cinzel', Georgia, serif; font-weight: 900; paint-order: stroke; stroke: rgba(255, 235, 190, 0.55); stroke-width: 1.2px; }
#disc-dins{
	transform-box: view-box;
	transform-origin: 160px 160px;
	transition: transform 0.25s ease;
}
#disc-num{
	fill: #ffe9a8; font-size: 40px; font-family: 'Cinzel', Georgia, serif; font-weight: 900; paint-order: stroke; stroke: #2a1a0c; stroke-width: 3px;
}
.disc-botons{
	display: flex; align-items: center; gap: 14px; font-size: 18px;
}
.disc-botons button{
	width: 58px; height: 58px; padding: 0; cursor: pointer;
	background: radial-gradient(circle at 35% 30%, #a87436, #6b4119 70%, #3b2410);
	border: 3px solid #d9a441; border-radius: 50%;
	box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,230,170,0.5);
	display: flex; align-items: center; justify-content: center;
	transition: transform 0.15s, filter 0.15s;
}
.disc-botons button svg{ width: 34px; height: 34px; }
.disc-botons button:hover{ filter: brightness(1.15); transform: scale(1.06); }
.disc-botons button:active{ transform: scale(0.95); }
.disc-botons span{ font-family: 'IM Fell English', Georgia, serif; font-style: italic; }
.disc-joc.encert .disc-resultat b{
	color: #b9f6ca;
	box-shadow: 0 0 16px 4px rgba(97, 239, 97, 0.7);
}
.disc-joc.encert #disc-svg{
	filter: drop-shadow(0 0 14px #FFD750);
}

/* Paret gravada del castell */
.paret-gravada{
	display: block;
	margin: 12px auto;
	max-width: 90%;
	height: auto;
	border: 3px solid #1a1c20;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}

/* Missatge damunt del mapa (localitzacions bloquejades) */
#missatge-mapa{
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 420px;
	max-width: 80%;
	padding: 18px 26px;
	background: url(../img/maps/oldPaperBackground.jpg) center / cover;
	border: 3px solid #3b2a17;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.7);
	color: white;
	font-family: 'IM Fell English', serif;
	font-size: 20px;
	text-shadow: 1px 1px 2px black;
	z-index: 10;
	cursor: pointer;
	animation: missatge-mapa 0.3s ease;
}

#missatge-mapa .titol{
	font-size: 26px;
	color: #F1C40F;
	margin-bottom: 8px;
}

#missatge-mapa .tancar{
	position: absolute;
	top: 6px;
	right: 12px;
	font-size: 18px;
	opacity: 0.8;
}

@keyframes missatge-mapa{
	from { opacity: 0; transform: translate(-50%, -40%); }
	to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Personatges dibuixats damunt de l'escena */
.figura-escena{
	position: absolute;
	pointer-events: none;   /* els clics van a la zona clicable de davall */
	z-index: 1;
	filter: drop-shadow(0 10px 8px rgba(0,0,0,0.45));
}

#imatge-aventura img.figura-escena{
	max-width: none;
	max-height: none;
	border: none;
	border-radius: 0;
	background: none;
}

/* L'herba de davant d'un personatge no porta ombra */
#imatge-aventura img.figura-escena.sense-ombra{
	filter: none;
}

/* Zona que brilla per indicar on cal clicar */
#zona-ressaltada{
	position: absolute; width: 0; height: 0;
	pointer-events: none; z-index: 3;
}
/* el punt que brilla i dues ones que se n'allunyen */
#zona-ressaltada span{
	position: absolute; left: 0; top: 0;
	width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
}
#zona-ressaltada span:first-child{
	background: radial-gradient(circle, rgba(255, 215, 60, 0.75) 0%, rgba(255, 200, 40, 0.4) 35%, rgba(255, 190, 0, 0) 70%);
	filter: blur(3px);
	animation: punt-brilla 0.8s ease-in-out infinite alternate;
}
#zona-ressaltada span:not(:first-child){
	border: 3px solid #FFD750;
	animation: punt-ona 1.6s ease-out infinite;
}
#zona-ressaltada span:last-child{ animation-delay: 0.8s; }
@keyframes punt-brilla{
	from { transform: scale(0.8); opacity: 0.75; }
	to   { transform: scale(1.15); opacity: 1; }
}
@keyframes punt-ona{
	from { transform: scale(0.6); opacity: 0.9; }
	to   { transform: scale(3.2); opacity: 0; }
}

/* ===== Minijocs de Bufanúvols (minijocs_vent.js) ===== */
.minijoc{
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	margin-top: 10px; user-select: none;
}
.minijoc-intro{ font-size: 18px; display: flex; align-items: center; gap: 14px; text-align: left; }
.minijoc-personatge{ height: 110px; flex: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.mj-estat{ font-size: 19px; min-height: 2.6em; text-align: center; }
.mj-boto{ margin-top: 4px; }
.minijoc.mj-guanyat canvas, .minijoc.mj-guanyat svg{
	filter: drop-shadow(0 0 14px #FFD750);
}
.mj-progres{ display: flex; gap: 8px; }
.mj-progres span{
	width: 16px; height: 16px; border-radius: 50%;
	background: rgba(0,0,0,0.35); border: 2px solid #3b2a17;
}
.mj-progres span.ara{ background: #F1C40F; }
.mj-progres span.fet{ background: #61ef61; }

/* Prova 1: rosa dels vents */
.rosa-rafegues{ max-width: 80vw; height: auto; }
.sector-vent{ cursor: pointer; }
.sector-vent path{
	fill: #e3c38c; stroke: #3b2a17; stroke-width: 3;
	transition: fill 0.15s;
}
.sector-vent:hover path{ fill: #f0d7a8; }
.sector-vent text{
	fill: #3b2a17; font-family: 'IM Fell English', serif; font-size: 15px; font-weight: bold;
	pointer-events: none; text-shadow: none;
}
.sector-vent.encesa path{ fill: var(--color-vent, #8fd3ff); filter: drop-shadow(0 0 10px var(--color-vent, #ffffff)) brightness(1.1); }
.sector-vent.encesa text{ fill: #1e1209; }
.centre-rosa{ fill: #7a4e25; stroke: #3b2a17; stroke-width: 3; }
#raf-nom{
	fill: #fff3d6; font-family: 'Chela One', serif; font-size: 17px; text-shadow: none;
}

/* Prova 2: parelles de vents */
.parelles-tauler{
	display: grid; grid-template-columns: repeat(4, 96px); gap: 10px;
}
.carta-vent{ width: 96px; height: 96px; perspective: 600px; cursor: pointer; }
.carta-dins{
	position: relative; width: 100%; height: 100%;
	transition: transform 0.45s; transform-style: preserve-3d;
}
.carta-vent.girada .carta-dins, .carta-vent.feta .carta-dins{ transform: rotateY(180deg); }
.carta-esquena, .carta-cara{
	position: absolute; inset: 0; backface-visibility: hidden;
	display: flex; align-items: center; justify-content: center;
	border: 3px solid #3b2a17; border-radius: 10px; box-sizing: border-box;
}
.carta-esquena{
	background: repeating-linear-gradient(45deg, #7a4e25 0 8px, #8a5a2b 8px 16px);
	color: #fff3d6; font-family: 'Chela One', serif; font-size: 40px;
}
.carta-vent:hover .carta-esquena{ filter: brightness(1.15); }
.carta-cara{ background: #e3c38c; transform: rotateY(180deg); }
.carta-vent.feta .carta-cara{ box-shadow: 0 0 12px 3px rgba(97, 239, 97, 0.8); cursor: default; }
.nom-vent{
	font-family: 'IM Fell English', serif; font-size: 17px; font-weight: bold;
	color: #3b2a17; text-shadow: none;
}

/* Prova 3: bufa el núvol */
.nuvol-info{
	display: flex; justify-content: space-between; width: 540px; max-width: 80vw; font-size: 18px;
}
.nuvol-tauler{
	display: grid; gap: 6px; align-items: center; justify-items: center;
	grid-template-areas: ". dalt ." "esq tauler dre" ". baix .";
}
#nuvol-canvas{
	grid-area: tauler; width: 540px; max-width: 62vw;
	border: 4px solid #3b2a17; border-radius: 8px;
}
.boto-vent{
	font-family: 'IM Fell English', serif; font-size: 15px; line-height: 1.1;
	padding: 4px 8px; cursor: pointer;
	background: #7a4e25; color: #fff3d6; border: 2px solid #3b2a17; border-radius: 8px;
}
.boto-vent:hover{ background: #94612f; }
.boto-vent.bufant{ background: #8fd3ff; color: #3b2a17; }
.boto-vent.dalt{ grid-area: dalt; }
.boto-vent.baix{ grid-area: baix; }
.boto-vent.esq{ grid-area: esq; }
.boto-vent.dre{ grid-area: dre; }


/* ===== Riu de lava (lava.js) ===== */
.lava-intro{ font-size: 18px; margin-bottom: 4px; }
.lava-tauler{
	position: relative; overflow: hidden;
	display: flex; flex-direction: column-reverse; gap: 4px;
	margin: 10px auto 6px; padding: 10px 16px; max-width: 640px;
	border: 4px solid #3b2a17; border-radius: 12px;
	/* la lava corre: la textura (sense costures) es desplaça contínuament */
	background: url('../img/general/lava.jpg?v=3') repeat;
	background-size: 320px 320px;
	animation: lava-corre 40s linear infinite;
	box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
}
/* una segona capa de la mateixa lava, més lenta i en una altra direcció, fa l'efecte de bullir */
.lava-tauler::before{
	content: ''; position: absolute; inset: 0; pointer-events: none;
	background: url('../img/general/lava.jpg?v=3') repeat;
	background-size: 384px 384px;
	mix-blend-mode: screen; opacity: 0.3;
	animation: lava-bull 60s linear infinite;
}
.lava-tauler > *{ position: relative; z-index: 1; }
@keyframes lava-corre{
	from { background-position: 0 0; }
	to   { background-position: 320px 960px; }
}
@keyframes lava-bull{
	from { background-position: 0 0; }
	to   { background-position: -768px 384px; }
}
.lava-riba{
	text-align: center; font-size: 15px; font-style: italic; color: #fff3d6;
	background: rgba(40,25,15,0.8); border-radius: 6px; padding: 2px;
}
.lava-fila{
	display: flex; align-items: center; justify-content: center; gap: 6px;
	transition: opacity 0.3s, filter 0.3s;
}
.lava-fila.lluny{ opacity: 0.8; }
.lava-fila.feta{ opacity: 0.8; }
.lava-num{
	width: 22px; font-weight: bold; color: #fff3d6; text-shadow: 0 0 4px #000, 0 0 8px #000;
}
/* cada pedra és la imatge pedra_lava.png amb la runa gravada damunt */
.pedra-lava{
	width: 84px; height: 56px; padding: 0 0 10px;
	background: url('../img/general/pedra_lava.png') center / contain no-repeat;
	border: none; outline: none;
	filter: drop-shadow(0 6px 4px rgba(0,0,0,0.6));
	color: #ffb347; font-size: 26px; line-height: 1;
	font-family: 'Segoe UI Historic', 'Noto Sans Runic', serif;
	text-shadow: 0 0 6px #ff6a00, 0 0 2px #000;
	cursor: default; transition: transform 0.15s, filter 0.15s;
}
.lava-fila.actual .pedra-lava{ cursor: pointer; }
.lava-fila.actual .pedra-lava:hover{ transform: translateY(-3px) scale(1.08); filter: drop-shadow(0 8px 5px rgba(0,0,0,0.6)) brightness(1.3); }
.lava-fila.actual .lava-num{ color: #fff3a0; }
.pedra-lava.trepitjada{
	color: #b9f6ca; text-shadow: 0 0 8px #61ef61, 0 0 2px #000;
	filter: drop-shadow(0 0 8px rgba(97, 239, 97, 0.9));
}
.lava-cami{
	min-width: 90px; text-align: left; font-size: 24px; letter-spacing: 3px;
	font-family: 'Segoe UI Historic', 'Noto Sans Runic', Consolas, serif;
	color: #fff3d6; text-shadow: 0 0 4px #000, 0 0 8px #000;
}
.pedra-lava.bot{ transform: translateY(-6px) scale(1.12); }
.pedra-lava.enfonsada{
	animation: pedra-enfonsa 1.4s ease forwards;
}
@keyframes pedra-enfonsa{
	0%   { transform: translateY(0); opacity: 1; }
	60%  { transform: translateY(14px) scale(0.8); opacity: 0.15; filter: sepia(1) saturate(5) hue-rotate(-20deg); }
	100% { transform: translateY(0); opacity: 1; }
}

#titol-aventura{ cursor: pointer; }

/* ===== La batalla amb el drac (drac.js) ===== */
#botiga-drac{
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0;
}
.columna-tresor{ display: flex; flex-direction: column; gap: 5px; }
.titol-columna{ font-size: 17px; color: #F1C40F; margin-bottom: 2px; }
.peca-tresor{
	display: flex; flex-direction: column; align-items: flex-start;
	padding: 4px 8px; cursor: pointer; text-align: left;
	background: rgba(40, 25, 15, 0.75); color: #fff3d6;
	border: 2px solid #7a4e25; border-radius: 8px;
	font-family: 'IM Fell English', serif; transition: transform 0.1s, border-color 0.15s;
}
.peca-tresor:hover{ transform: translateY(-2px); border-color: #c9a25a; }
.peca-tresor.triada{ border-color: #F1C40F; background: rgba(120, 80, 10, 0.85); box-shadow: 0 0 10px rgba(241, 196, 15, 0.7); }
.peca-nom{ font-size: 16px; font-weight: bold; }
.peca-dades{ font-size: 14px; opacity: 0.9; }
#resum-equip{ font-size: 18px; margin: 6px 0; }
#arena-drac{
	display: flex; align-items: center; justify-content: center; gap: 30px;
	margin: 14px 0; padding: 14px; border-radius: 12px;
	background: radial-gradient(ellipse at center, rgba(120, 30, 5, 0.6), rgba(20, 5, 2, 0.85));
}
.lluitador{ display: flex; flex-direction: column; align-items: center; gap: 4px; width: 220px; }
.retrat-heroi{
	width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
	font-size: 70px; color: #fff3d6; border-radius: 50%;
	background: radial-gradient(circle, #6b4a2a, #2c1a0c); border: 3px solid #c9a25a;
}
.retrat-drac{ width: 180px; height: 128px; object-fit: cover; border-radius: 12px; border: 3px solid #c0392b; }
.nom-lluitador{ font-size: 20px; color: #F1C40F; }
.barra-vida{ width: 100%; height: 14px; background: rgba(0,0,0,0.6); border: 2px solid #3b2a17; border-radius: 8px; overflow: hidden; }
.vida-plena{ height: 100%; width: 100%; background: linear-gradient(90deg, #c0392b, #61ef61); transition: width 0.15s; }
.xifra-vida{ font-size: 15px; color: #fff3d6; }
.contra{ font-size: 22px; color: #fff3d6; font-style: italic; }
.lluitador.colpejat{ animation: colp 0.25s ease; }
@keyframes colp{
	0%, 100% { transform: translateX(0); filter: none; }
	30% { transform: translateX(-8px); filter: brightness(1.8) sepia(1) hue-rotate(-30deg); }
	60% { transform: translateX(6px); }
}
.lluitador.rendit .retrat-drac{ filter: grayscale(0.6) brightness(0.7); transform: rotate(-8deg); transition: all 0.8s; }
#canvas-espurnes{ width: 100%; max-width: 760px; border-radius: 12px; border: 3px solid #3b2a17; background: #140402; }

.dades-drac{ font-size: 17px; margin: 6px 0; color: #fff3d6; }
.passa-pressupost{ color: #ff6b5b; }

/* ===== Pantalla final (final.js) ===== */
#pantalla-final{
	position: fixed; inset: 0; z-index: 3000; overflow-y: auto;
	background: radial-gradient(ellipse at center, rgba(60, 20, 5, 0.88), rgba(10, 3, 1, 0.97)),
	            url('../img/maps/loc_12.jpg') center / cover;
	animation: final-entra 1.2s ease;
}
@keyframes final-entra{ from { opacity: 0; } to { opacity: 1; } }
#monedes-final{ position: fixed; inset: 0; pointer-events: none; }
.contingut-final{
	position: relative; max-width: 900px; margin: 4vh auto; padding: 20px 30px;
	text-align: center; color: #fff3d6; font-family: 'IM Fell English', serif;
}
.contingut-final h1{
	font-family: 'Chela One', serif; font-size: 7vmin; color: #FFD750; margin: 0 0 10px;
	text-shadow: 0 0 18px #ff8c00, 3px 3px 0 #3b2a17;
	animation: titol-final 1.6s ease both;
}
@keyframes titol-final{ from { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.08); } to { transform: scale(1); opacity: 1; } }
.epileg{ font-size: 21px; line-height: 1.45; animation: apareix 1s ease 1s both; }
.comiats{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 22px 0; }
.comiat{
	display: flex; align-items: center; gap: 12px; text-align: left; font-size: 17px;
	background: rgba(40, 25, 15, 0.7); border: 2px solid #7a4e25; border-radius: 12px; padding: 8px 12px;
	animation: apareix 0.8s ease both;
}
.comiat img{ height: 90px; width: 90px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6)); }
.comiat b{ color: #F1C40F; font-size: 19px; }
.dades-final{ font-size: 20px; margin: 10px 0; animation: apareix 0.8s ease both; }
.botons-final{ display: flex; gap: 14px; justify-content: center; animation: apareix 0.8s ease both; }
@keyframes apareix{ from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.botons-final .boto-popup{
	font-family: 'IM Fell English', serif; font-size: 20px; padding: 10px 22px; cursor: pointer;
	background: #7a4e25; color: #fff3d6; border: 2px solid #c9a25a; border-radius: 10px;
}
.botons-final .boto-popup:hover{ background: #94612f; }

/* Aventura acabada: la icona del mapa desapareix */
body.acabat #inventori #mapa-icona{ display: none !important; }

/* ===== Assoliments (assoliments.js) ===== */
#boto-assoliments{
	margin-top: 4px; padding: 2px 8px; cursor: pointer;
	font-family: 'Carter One', cursive; font-size: 2.4vmin; color: #fff3d6;
	background: rgba(60, 35, 15, 0.85); border: 2px solid #c9a25a; border-radius: 10px;
}
#boto-assoliments:hover{ background: rgba(110, 70, 25, 0.95); }
#avisos-assoliments{
	position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4000;
	display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.avis-assoliment{
	display: flex; align-items: center; gap: 12px; min-width: 300px;
	padding: 10px 16px; border-radius: 12px; color: #fff3d6;
	background: linear-gradient(135deg, rgba(60, 35, 10, 0.95), rgba(120, 80, 15, 0.95));
	border: 2px solid #FFD750; box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 18px rgba(255, 215, 80, 0.5);
	font-family: 'IM Fell English', serif; font-size: 17px;
	animation: avis-entra 0.5s ease;
	transition: opacity 0.6s, transform 0.6s;
}
.avis-assoliment.se-nva{ opacity: 0; transform: translateY(-20px); }
.avis-assoliment .copa{ font-size: 36px; }
.avis-titol{ font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #FFD750; }
@keyframes avis-entra{ from { opacity: 0; transform: translateY(-30px) scale(0.9); } to { opacity: 1; transform: none; } }
.llista-assoliments{ display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; text-align: left; }
.assoliment{
	display: flex; align-items: center; gap: 10px; padding: 6px 10px;
	border-radius: 10px; border: 2px solid #5a4632; background: rgba(30, 20, 10, 0.6);
	filter: grayscale(1); opacity: 0.6; font-size: 16px;
}
.assoliment.fet{ filter: none; opacity: 1; border-color: #FFD750; background: rgba(90, 60, 15, 0.75); }
.assoliment .copa{ font-size: 26px; }
.assoliments-final{ margin: 16px 0; animation: apareix 0.8s ease both; }

/* ===== Versos de la Quarantamaula (quarantamaula.js) ===== */
.versos{ display: flex; flex-direction: column; gap: 6px; margin: 10px auto; max-width: 30em; }
.vers{
	font-family: 'IM Fell English', serif; font-size: 19px; font-style: italic;
	padding: 5px 10px; border: none; border-bottom: 2px dashed #c9a25a;
	background: rgba(255, 243, 214, 0.12); color: #fff3d6; border-radius: 4px;
}
.vers:focus{ outline: none; background: rgba(255, 243, 214, 0.22); }
#canvas-quarantamaula{ display: block; margin: 10px auto; width: 300px; height: 300px; border-radius: 12px; border: 3px solid #5b3f8c; box-shadow: 0 0 20px rgba(140, 90, 220, 0.6); }

/* =========================================================
   Distribució més gran: la imatge del lloc ocupa quasi tota la pantalla
   i la motxilla i el mapa queden a la columna de la dreta, un damunt de l'altre
   ========================================================= */
:root{
	--marge-lateral: 9vw;           /* columnes dels costats (música / vides, motxilla, mapa) */
	--mida-icona: 6.5vw;            /* motxilla i mapa */
}
#container{
	height: 100vh;
	grid-template-rows: 11vh 87vh 2vh;
}
#titol-aventura{
	line-height: 11vh;
	font-size: 6.5vmin;
	min-width: 30vh;
	padding: 0 8vh;
	border-image-width: 2.6vh 8vh 2.6vh 8vh;
}
#imatge-aventura img{
	max-height: 85vh;
	max-width: calc(100vw - 2 * var(--marge-lateral));
}
#illa{ max-width: calc(100vw - 2 * var(--marge-lateral)); }
#illa-mapa{ max-height: 85vh; }

/* motxilla a baix a la dreta; el mapa just damunt */
#inventori #motxilla,
body.te-mapa #inventori #motxilla{
	width: var(--mida-icona);
	right: calc((var(--marge-lateral) - var(--mida-icona)) / 2);
	bottom: 2vh;
	left: auto;
}
#inventori #mapa-icona{
	width: var(--mida-icona);
	right: calc((var(--marge-lateral) - var(--mida-icona)) / 2);
	left: auto;
	bottom: calc(2vh + var(--mida-icona) * 1.15 + 1.5vh);
}
/* els objectes s'obrin cap a l'esquerra de la motxilla */
#motxilla-content,
body.te-mapa #motxilla-content{
	right: calc(var(--marge-lateral) + 0.5vw);
	bottom: 2vh;
	max-width: calc(100vw - 2 * var(--marge-lateral) - 2vw);
}
/* la columna de les vides comença a dalt de tot (no se'n surt de la pantalla) */
.user-info{
	align-self: start;
	margin-top: 0.5vh;
	gap: 0.4vh;
}
.vides{
	width: 8vmin; height: 7.2vmin; line-height: 8.4vmin; font-size: 3.4vmin;
}
button.bTancar{ width: 12vmin; font-size: 2.5vmin; }
#boto-assoliments{ margin-top: 0; font-size: 2.1vmin; }

/* ===== Visor de fitxers (merges.js) ===== */
a.fitxer-repte{ display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; }
.nom-fitxer{ font-size: 13px; color: #fff3d6; font-family: Consolas, monospace; }
#visor-fitxer{
	position: fixed; inset: 0; z-index: 5000;
	background: rgba(0, 0, 0, 0.6);
	display: flex; align-items: center; justify-content: center;
}
.panell-visor{
	width: min(92vw, 1000px); max-height: 88vh; display: flex; flex-direction: column;
	background: url(../img/maps/oldPaperBackground.jpg) center / cover;
	border: 3px solid #3b2a17; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.8);
	padding: 12px 16px; color: #fff3d6; font-family: 'IM Fell English', serif;
}
.capcalera-visor{ display: flex; align-items: baseline; gap: 8px; font-size: 20px; margin-bottom: 8px; }
.capcalera-visor b{ font-family: Consolas, monospace; color: #F1C40F; }
.tanca-visor{ margin-left: auto; background: none; border: none; color: #fff3d6; font-size: 22px; cursor: pointer; }
.contingut-visor{
	flex: 1; overflow: auto; margin: 0; padding: 10px 12px;
	background: rgba(10, 8, 5, 0.85); color: #e8f5e0; border-radius: 8px;
	font-family: Consolas, 'Courier New', monospace; font-size: 14px; line-height: 1.35;
	white-space: pre; text-align: left; user-select: text;
}
.botons-visor{ display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.boto-visor{
	font-family: 'IM Fell English', serif; font-size: 17px; padding: 6px 14px; cursor: pointer;
	background: #7a4e25; color: #fff3d6; border: 2px solid #c9a25a; border-radius: 8px; text-decoration: none;
}
.boto-visor:hover{ background: #94612f; }
#visor-avis{ color: #61ef61; font-size: 17px; }

/* ===== Ajuda: on es pot clicar ===== */
#zones-ajuda{ position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.punt-zona{
	position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 215, 60, 0.75) 0%, rgba(255, 200, 40, 0.4) 35%, rgba(255, 190, 0, 0) 70%);
	filter: blur(3px);
	animation: punt-brilla 0.6s ease-in-out infinite alternate;
}

/* ===== Pantalla d'entrada (nuvol.js) ===== */
#pantalla-entrada{
	position: fixed; inset: 0; z-index: 6000;
	display: flex; align-items: center; justify-content: center;
	background: radial-gradient(ellipse at center, rgba(20, 10, 5, 0.55), rgba(5, 2, 1, 0.9)),
	            url('../img/maps/mapa.png?v=3') center / cover;
}
.caixa-entrada{
	max-width: 560px; padding: 28px 36px; text-align: center; color: #fff3d6;
	background: url('../img/maps/oldPaperBackground.jpg') center / cover;
	border: 3px solid #3b2a17; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.8);
	font-family: 'IM Fell English', serif; font-size: 19px;
}
.caixa-entrada h1{
	font-family: 'Chela One', serif; font-size: 48px; margin: 0 0 10px; color: #FFD750;
	text-shadow: 0 0 14px #ff8c00, 3px 3px 0 #3b2a17;
}
#boto-google{
	display: inline-flex; align-items: center; gap: 12px; margin-top: 14px;
	padding: 10px 22px; cursor: pointer; font-size: 19px; font-family: 'IM Fell English', serif;
	background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 24px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
#boto-google:hover{ background: #f4f6f9; }
#boto-google img{ width: 22px; height: 22px; }
#error-entrada{ margin-top: 10px; color: #ff8a7a; min-height: 1.2em; }

/* =========================================================
   Cinturó d'inventari: una barra de fusta sota la imatge amb
   el mapa a l'esquerra, els objectes en caselles i els assoliments a la dreta
   ========================================================= */
#container{
	grid-template-rows: 11vh 1fr 13vh;
}
#imatge-aventura img{ max-height: calc(100vh - 11vh - 13vh - 2vh); }
#illa-mapa{ max-height: calc(100vh - 11vh - 13vh - 2vh); }

#inventori{
	align-self: center; justify-self: center;
	display: flex; align-items: center; gap: 1.2vh;
	width: min(calc(100vw - 2 * var(--marge-lateral)), 150vh);
	height: 11vh; box-sizing: border-box; padding: 0 1.5vh;
	background:
		repeating-linear-gradient(90deg, rgba(0,0,0,0.08) 0 2px, transparent 2px 23px),
		linear-gradient(180deg, #8a5a2b 0%, #6b4220 45%, #4e2f15 100%);
	border: 3px solid #2e1b0c; border-radius: 14px;
	box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.35), inset 0 -3px 6px rgba(0,0,0,0.5), 0 6px 16px rgba(0,0,0,0.6);
}
/* la motxilla ja no fa falta: els objectes sempre es veuen */
#inventori #motxilla{ display: none !important; }

/* el mapa, a l'esquerra del cinturó */
#inventori #mapa-icona,
body.te-mapa #inventori #mapa-icona{
	position: static; order: 0; flex: none;
	width: auto; height: 9vh; cursor: pointer;
}
#inventori #mapa-icona{ visibility: hidden; display: block !important; }
body.te-mapa #inventori #mapa-icona{ visibility: visible; }
body.acabat #inventori #mapa-icona{ visibility: hidden; display: block !important; }

/* les caselles dels objectes */
#motxilla-content,
body.te-mapa #motxilla-content,
#motxilla-content.visible{
	position: static; order: 1; flex: 1;
	visibility: visible; display: flex; gap: 0.8vh; align-items: center;
	height: auto; max-width: none; margin: 0; padding: 0;
	background: none; border: none; box-shadow: none;
	overflow-x: auto; overflow-y: hidden;
}
#motxilla-content li{
	flex: none; width: 8.4vh; height: 8.4vh; border-radius: 8px;
	display: flex; align-items: center; justify-content: center;
	background: radial-gradient(circle at 50% 40%, rgba(60, 35, 15, 0.55), rgba(25, 12, 4, 0.8));
	border: 2px solid #c9a25a;
	box-shadow: inset 0 2px 6px rgba(0,0,0,0.7);
}
#motxilla-content li.buida{ border-color: rgba(201, 162, 90, 0.35); }
#motxilla-content li img{ height: auto; width: auto; max-height: 7vh; max-width: 7.4vh; }
#motxilla-content li.nou{ animation: casella-nova 0.7s ease 4; }
@keyframes casella-nova{
	0%, 100% { box-shadow: inset 0 2px 6px rgba(0,0,0,0.7); }
	50%      { box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 0 16px 6px rgba(255, 215, 80, 0.9); border-color: #FFD750; }
}

/* els assoliments, a la dreta del cinturó */
#inventori #boto-assoliments{
	order: 2; flex: none; margin: 0;
	font-size: 2.6vh; padding: 0.6vh 1.4vh;
}
#motxilla-content li{ width: 7.8vh; height: 7.8vh; }
#motxilla-content::-webkit-scrollbar{ height: 6px; }
#motxilla-content::-webkit-scrollbar-thumb{ background: #c9a25a; border-radius: 3px; }
#motxilla-content::-webkit-scrollbar-track{ background: transparent; }

/* ===== Diari d'aventura (diari.js) ===== */
#diari{
	position: fixed; z-index: 4; box-sizing: border-box; overflow-y: auto;
	padding: 1.4vh 1.2vh; color: #3b2a17;
	background: linear-gradient(rgba(255, 243, 214, 0.25), rgba(255, 243, 214, 0.1)), url('../img/maps/oldPaperBackground.jpg') center / cover;
	border: 3px solid #3b2a17; border-radius: 12px;
	box-shadow: inset 0 0 20px rgba(60, 30, 5, 0.5), 0 6px 16px rgba(0,0,0,0.6);
	font-family: 'IM Fell English', serif; font-size: clamp(12px, 1.9vh, 18px); line-height: 1.3;
	transition: box-shadow 0.3s;
}
#diari h2{ font-family: 'Chela One', serif; font-size: 1.4em; margin: 0 0 0.4em; text-align: center; color: #5a2d0c; }
#diari h3{ font-size: 1em; margin: 0.8em 0 0.3em; color: #922B21; border-bottom: 1px solid rgba(59, 42, 23, 0.4); }
#diari .objectiu{ margin: 0.2em 0; font-weight: bold; color: #fff3d6; text-shadow: 1px 1px 2px #000; }
#diari ul{ margin: 0.3em 0; padding-left: 0; list-style: none; }
#diari .tasques li{ margin: 0.25em 0; color: #fff3d6; text-shadow: 1px 1px 2px #000; }
#diari .tasques li.feta{ text-decoration: line-through; opacity: 0.7; }
#diari .notes li{
	margin: 0.4em 0; padding: 0.35em 0.5em; border-radius: 6px;
	background: rgba(255, 243, 214, 0.18); color: #fff3d6; text-shadow: 1px 1px 2px #000; font-size: 0.92em;
}
#diari .sense-notes{ font-style: italic; color: #fff3d6; opacity: 0.75; }
#diari.nota-nova{ box-shadow: inset 0 0 20px rgba(60, 30, 5, 0.5), 0 0 20px 6px rgba(255, 215, 80, 0.85); }

/* L'escena es desplaça a la dreta per deixar més lloc al diari de l'esquerra */
/* reserva una columna fixa per al diari a l'esquerra; la imatge es centra en la resta */
#imatge-aventura{ text-align: center; padding-left: 22vw; padding-right: 1.5vw; box-sizing: border-box; }
#imatge-aventura img{ max-width: calc(100vw - 23.5vw); }
#illa{ max-width: calc(100vw - 23.5vw); }

/* ===== Escates del drac (escates.js) ===== */
.escata-brill{
	position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 2;
	background: radial-gradient(circle, rgba(255, 215, 60, 0.6) 0%, rgba(255, 200, 40, 0.25) 40%, rgba(255, 190, 0, 0) 70%);
	filter: blur(2px);
	border-radius: 50%; opacity: 0;
	animation: escata-llu 3.2s ease-in-out infinite;
}
@keyframes escata-llu{
	0%, 70%, 100% { opacity: 0; transform: scale(0.5); }
	80%           { opacity: 0.8; transform: scale(1.2); }
	90%           { opacity: 0.3; transform: scale(0.9); }
}
#motxilla-content li{ position: relative; }
.comptador-objecte{
	position: absolute; right: 2px; bottom: 1px; font-family: 'Carter One', cursive; font-size: 1.6vh;
	color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none;
}
#diari .consell{
	margin-top: 1em; padding: 0.5em 0.6em; border-radius: 8px;
	font-size: 0.95em; font-weight: bold; line-height: 1.3;
	color: #3b2a17; background: rgba(255, 215, 80, 0.85);
	border: 2px solid #5a2d0c; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Contorn dels objectes de la motxilla: més suau i transparent */
#motxilla-content li img{
	filter: drop-shadow(1px 1px 0 rgba(255, 243, 214, 0.35))
	        drop-shadow(-1px 1px 0 rgba(255, 243, 214, 0.35))
	        drop-shadow(1px -1px 0 rgba(255, 243, 214, 0.35))
	        drop-shadow(-1px -1px 0 rgba(255, 243, 214, 0.35));
}

/* ===== Mapa en miniatura a sota del diari (diari.js) ===== */
#inventori #mapa-icona,
body.te-mapa #inventori #mapa-icona,
body.acabat #inventori #mapa-icona{ display: none !important; }
#minimapa{
	position: fixed; z-index: 4; box-sizing: border-box; cursor: pointer; display: none;
	border: 3px solid #3b2a17; border-radius: 12px; overflow: hidden;
	background: #e8d3a3; box-shadow: 0 6px 16px rgba(0,0,0,0.6);
	transition: transform 0.2s, box-shadow 0.2s;
}
#minimapa:hover{ transform: scale(1.03); box-shadow: 0 0 14px 4px rgba(255, 215, 80, 0.8), 0 6px 16px rgba(0,0,0,0.6); }
#minimapa img{ width: 100%; height: 100%; display: block; }
#minimapa .mm-punts{ position: absolute; inset: 0; pointer-events: none; }
.mm-punt{
	position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
	background: #f4d27a; border: 1px solid #3b2a17;
}
.mm-punt.actual{
	width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: #c0392b; border: 2px solid #fff;
	animation: mm-batec 1.2s ease-in-out infinite;
}
@keyframes mm-batec{ 50%{ transform: scale(1.35); box-shadow: 0 0 8px 3px rgba(192, 57, 43, 0.7); } }
#minimapa.nou{ animation: casella-nova 0.7s ease 4; }
#diari::-webkit-scrollbar{ width: 6px; }
#diari::-webkit-scrollbar-thumb{ background: #8a5a2b; border-radius: 3px; }
#diari::-webkit-scrollbar-track{ background: transparent; }

/* ===== Pantalla estreta: diari i mapa com a icones a l'esquerra del cinturó ===== */
#icones-columna{ order: -1; flex: none; display: flex; gap: 0.8vh; align-items: center; }
#icones-columna button{
	width: 7.8vh; height: 7.8vh; padding: 0; cursor: pointer; overflow: hidden;
	border: 2px solid #c9a25a; border-radius: 8px; font-size: 4.6vh; line-height: 1;
	background: radial-gradient(circle at 50% 40%, rgba(110, 70, 25, 0.9), rgba(45, 25, 8, 0.95));
	box-shadow: inset 0 2px 6px rgba(0,0,0,0.6); transition: transform 0.15s, box-shadow 0.15s;
}
#icones-columna button:hover{ transform: scale(1.08); box-shadow: 0 0 12px 3px rgba(255, 215, 80, 0.8); }
#icones-columna #ic-mapa img{ width: 100%; height: 100%; object-fit: cover; display: block; }
#ic-diari.nota-nova{ box-shadow: 0 0 16px 6px rgba(255, 215, 80, 0.9); }
#diari-popup{ text-align: left; color: #3b2a17; font-family: 'IM Fell English', serif; font-size: 17px; }
#diari-popup h2{ font-family: 'Chela One', serif; text-align: center; color: #5a2d0c; margin: 0 0 0.4em; }
#diari-popup h3{ color: #922B21; border-bottom: 1px solid rgba(59, 42, 23, 0.4); margin: 0.8em 0 0.3em; font-size: 1.05em; }
#diari-popup ul{ list-style: none; padding: 0; margin: 0.3em 0; }
#diari-popup .objectiu{ font-weight: bold; }
#diari-popup .tasques li.feta{ text-decoration: line-through; opacity: 0.7; }
#diari-popup .notes li{ margin: 0.4em 0; padding: 0.35em 0.5em; border-radius: 6px; background: rgba(90, 45, 12, 0.12); }
#diari-popup .consell{
	margin-top: 1em; padding: 0.5em 0.6em; border-radius: 8px; font-weight: bold;
	background: rgba(255, 215, 80, 0.85); border: 2px solid #5a2d0c;
}
body.sense-columna #imatge-aventura{ padding-left: 1.5vw; }
body.sense-columna #imatge-aventura img,
body.sense-columna #illa{ max-width: calc(100vw - 3vw); }
#diari-popup{ color: #fff3d6; text-shadow: 1px 1px 2px #000; }
#diari-popup h2{ color: #FFD750; }
#diari-popup h3{ color: #ffb38a; border-bottom-color: rgba(255, 243, 214, 0.4); }
#diari-popup .notes li{ background: rgba(255, 243, 214, 0.15); }
#diari-popup .consell{ color: #3b2a17; text-shadow: none; }
#icones-columna #ic-diari img{ width: 88%; height: 88%; object-fit: contain; display: block; margin: auto; }
.icona-diari{ height: 1.5em; vertical-align: middle; margin-right: 0.3em; }

/* ===== El mapa gran s'adapta a la pantalla (map.js, escalaMapa) ===== */
.popup-mapa{ padding: 0 !important; overflow: visible; }
.popup-mapa .swal2-html-container{ margin: 0 !important; padding: 0 !important; overflow: visible !important; }
#map-caixa{ position: relative; margin: 0 auto; }
#map-caixa #map{ position: absolute; left: 0; top: 0; width: 1120px; height: 632px; transform-origin: 0 0; }

/* Botons dels minijocs i reptes (Comença, Lluita!, Torna a començar...): el mateix estil que els botons dels popups */
.boto-popup.mj-boto{
	font-family: 'IM Fell English', serif; font-weight: bold; font-size: 16px;
	margin: 6px 4px 0; padding: 10px 17.6px; cursor: pointer;
	background: #7066e0; color: #fff; border: 0; border-radius: 4px;
	box-shadow: none; transition: box-shadow 0.1s, background-image 0.1s;
}
.boto-popup.mj-boto:hover:not(:disabled){ background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)); }
.boto-popup.mj-boto:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(112, 102, 224, 0.5); }
.boto-popup.mj-boto:disabled{ opacity: 0.4; cursor: default; }

/* ===== La cançó de la Quarantamaula (quarantamaula.js) ===== */
.versos-titol{ margin: 12px 0 6px; font-weight: bold; color: #FFD750; text-shadow: 1px 1px 2px #000; }
.versos-titol small{ font-weight: normal; opacity: 0.85; }
.versos-diari{ display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 2em; }
.vers-diari{
	font-family: 'IM Fell English', serif; font-size: 16px; padding: 6px 12px; cursor: pointer;
	background: #f3e2bd; color: #3b2a17; border: 2px solid #8a5a2b; border-radius: 16px;
	transition: transform 0.1s, background 0.15s;
}
.vers-diari:hover:not(:disabled){ background: #ffd77a; transform: translateY(-2px); }
.vers-diari:disabled{ cursor: default; opacity: 0.5; }
.vers-diari.usat{ text-decoration: line-through; opacity: 0.35; }
.versos-poema{ max-width: 32em; margin: 0 auto; padding-left: 2em; text-align: left; }
.versos-poema li{
	display: flex; align-items: center; gap: 6px; margin: 4px 0; padding: 5px 8px;
	background: rgba(255, 243, 214, 0.9); color: #3b2a17; border-radius: 6px; font-style: italic;
}
.versos-poema li::marker{ color: #FFD750; font-weight: bold; }
.versos-poema li.buit{ background: rgba(255, 243, 214, 0.25); color: #fff3d6; }
.versos-poema .text-vers{ flex: 1; }
.mou-vers{
	width: 28px; height: 28px; padding: 0; cursor: pointer; font-size: 13px;
	background: #7a4e25; color: #fff3d6; border: 1px solid #3b2a17; border-radius: 5px;
}
.mou-vers:hover:not(:disabled){ background: #94612f; }
.mou-vers:disabled{ opacity: 0.3; cursor: default; }
.versos-poema li.es-pot-moure, .vers-diari.es-pot-moure{ cursor: grab; touch-action: none; user-select: none; }
.vers-fantasma{
	position: fixed; z-index: 10000; pointer-events: none; transform: translate(-50%, -50%) rotate(-2deg);
	font-family: 'IM Fell English', serif; font-size: 16px; font-style: italic; padding: 6px 12px;
	background: #ffd77a; color: #3b2a17; border: 2px solid #8a5a2b; border-radius: 10px;
	box-shadow: 0 6px 14px rgba(0,0,0,0.5); white-space: nowrap;
}
.versos-poema li.sobre{ outline: 3px dashed #FFD750; outline-offset: 2px; }
.versos-diari.sobre{ outline: 3px dashed #ff8a6b; outline-offset: 4px; border-radius: 10px; }
.arrossegant-vers{ opacity: 0.4; }

/* Previsió del combat amb el drac */
.previsio-combat{
	margin: 8px auto 0; max-width: 46em; padding: 8px 12px; text-align: left; font-size: 15px; line-height: 1.5;
	background: rgba(0, 0, 0, 0.35); border: 1px solid #c9a25a; border-radius: 8px;
}
.previsio-bona{ margin-top: 4px; color: #8ff08f; }
.previsio-dolenta{ margin-top: 4px; color: #ffb38a; }

/* La paret gravada del castell: imatge + paraula xifrada de l'alumne dins del cercle */
.paret-gravada{
	position: relative; width: 100%; max-width: 560px; margin: 10px auto; aspect-ratio: 800 / 452;
	background: url('../img/general/paret_gravada.jpg') center / cover; border-radius: 8px;
	box-shadow: 0 4px 14px rgba(0,0,0,0.6); container-type: inline-size;
}
.paraula-gravada{
	position: absolute; left: 48.4%; top: 45.3%; transform: translate(-50%, -50%);
	font-family: 'IM Fell English', serif; font-weight: bold; font-size: 7cqw; letter-spacing: 0.12em;
	color: #b9c4bd; text-shadow: -1px -1px 0 rgba(0,0,0,0.9), 1px 1px 0 rgba(255,255,255,0.25), 0 0 6px rgba(120, 255, 140, 0.25);
	white-space: nowrap; pointer-events: none;
}

/* Objectes de la motxilla: sense contorn; en passar-hi el ratolí, resplendor blanca (sense engrandir-se) */
#motxilla-content li img{ filter: none; transition: filter 0.15s; }
#motxilla-content li img:hover{
	transform: none;
	filter: drop-shadow(0 0 3px rgba(255, 250, 235, 0.95)) drop-shadow(0 0 8px rgba(255, 243, 214, 0.7));
}

/* Cartes il·lustrades del joc de parelles */
.parelles-tauler{ grid-template-columns: repeat(4, 110px); }
.carta-vent{ width: 110px; height: 110px; }
.img-carta-vent{ width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.carta-cara:has(.img-carta-vent){ padding: 0; overflow: hidden; }

/* Cim dels Núvols: llegenda de les fletxes del teclat */
.llegenda-vents{ display: grid; grid-template-columns: repeat(2, auto); gap: 4px 18px; justify-content: center; margin-top: 6px; font-size: 15px; }
.tecla-vent{ cursor: pointer; white-space: nowrap; color: #fff3d6; text-shadow: 1px 1px 2px #000; }
.tecla-vent small{ opacity: 0.75; }
.tecla-vent kbd{
	display: inline-block; min-width: 1.6em; padding: 1px 6px; margin-right: 4px; text-align: center;
	font-family: sans-serif; font-size: 15px; font-weight: bold; color: #3b2a17; text-shadow: none;
	background: #f3e2bd; border: 2px solid #8a5a2b; border-bottom-width: 4px; border-radius: 6px;
}
.tecla-vent.bufant kbd{ background: #8fd3ff; border-bottom-width: 2px; transform: translateY(2px); }

/* Les zones clicables no han de mostrar el contorn de focus del navegador (en tancar un popup, el focus hi torna) */
map area, map area:focus, map area:focus-visible{ outline: none !important; }

/* Pantalla d'entrada: saga i presentació */
.subtitol-entrada{
	font-family: 'Carter One', cursive; font-size: 20px; letter-spacing: 0.25em; text-transform: uppercase;
	color: #c9a25a; margin-bottom: -6px;
}
.presentacio-entrada{ font-size: 1.1em; font-style: italic; color: #fff3d6; }

/* De moment no hi ha música: s'amaga el botó de pausa (el codi es manté per quan n'hi haja) */
#musica{ display: none !important; }

/* Les endevinalles del drac */
.endevinalla{ margin-top: 10px; }
#end-text{ font-size: 22px; line-height: 1.35; margin: 10px auto; max-width: 30em; color: #FFD750; text-shadow: 1px 1px 3px #000; }
#end-pista{ min-height: 1.4em; font-size: 16px; color: #fff3d6; opacity: 0.9; }
.end-resposta{ display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 8px; }
#end-input{ font: 18px 'IM Fell English', serif; padding: 8px 10px; width: 16em; border-radius: 6px; border: 2px solid #8a5a2b; }
.end-resposta .mj-boto{ margin-top: 0; }
#end-progres{ justify-content: center; align-items: center; }

/* Tancament del conte, a la frase final de la llar */
.conte-contat{
	margin-top: 14px; font-family: 'Chela One', serif; font-size: 28px; color: #FFD750;
	text-shadow: 0 0 10px rgba(255, 200, 60, 0.6), 2px 2px 3px #000;
}

#conte-escena{
	position: absolute; z-index: 3; pointer-events: auto; cursor: default; box-sizing: border-box;
	display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; padding-top: 6%;
	font-family: 'Chela One', serif; font-size: clamp(28px, 4.5vw, 64px); color: #FFD750; text-align: center;
	text-shadow: 0 0 18px rgba(255, 190, 60, 0.75), 3px 3px 4px #000, 0 0 2px #000;
	animation: conte-apareix 2.5s ease-out;
}
@keyframes conte-apareix{ from{ opacity: 0; transform: translateY(-12px); } to{ opacity: 1; transform: none; } }
#conte-escena #conte-nova{ pointer-events: auto; font-size: 18px; text-shadow: none; }

/* Aventura acabada: l'escena i els objectes de la motxilla ja no es poden fer servir */
body.acabat #motxilla-content{ pointer-events: none; opacity: 0.6; }
body.acabat #icones-columna{ display: none !important; }

/* Avís de partida desada */
#avis-desat{
	position: fixed; right: 16px; bottom: 16px; z-index: 5000; pointer-events: none;
	padding: 6px 12px; border-radius: 8px; font-size: 14px; color: #fff3d6;
	background: rgba(40, 25, 10, 0.85); border: 1px solid #c9a25a;
	transition: opacity 0.8s; opacity: 1;
}
#avis-desat.se-nva{ opacity: 0; }

/* ===== El rat penat, el guia (ratpenat.js) ===== */
#rat-penat{
	position: fixed; z-index: 6; width: 48px; height: 94px; padding: 0;
	background: none; border: none; cursor: pointer;
	transform-origin: 50% 0;
	animation: rat-gronxa 3s ease-in-out infinite;
	filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.7));
}
#rat-penat img, #ic-rat img{ width: 100%; height: 100%; object-fit: contain; display: block; }
#rat-penat .rat-emoji{ display: block; font-size: 40px; line-height: 56px; transform: rotate(180deg); }
#rat-penat:hover{ filter: drop-shadow(0 0 8px rgba(255, 215, 80, 0.95)); }
#rat-penat.aleteja, #ic-rat.aleteja{ animation: rat-aleteja 0.7s ease-in-out 2; }
@keyframes rat-gronxa{ 0%, 100%{ transform: rotate(-6deg); } 50%{ transform: rotate(6deg); } }
@keyframes rat-aleteja{
	0%, 100%{ transform: rotate(0) scale(1); }
	25%{ transform: rotate(-14deg) scale(1.15, 0.9); }
	75%{ transform: rotate(14deg) scale(1.15, 0.9); }
}
#ic-rat .rat-emoji{ font-size: 4.5vh; line-height: 1; }
#bafarada-rat{
	position: fixed; z-index: 1500; max-width: 300px; padding: 12px 14px;
	background: #fff8e6; color: #3b2a17; border: 3px solid #3b2a17; border-radius: 14px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.6);
	font-family: 'IM Fell English', serif; font-size: 16px; line-height: 1.35;
	cursor: pointer; animation: bafarada-entra 0.25s ease-out;
}
#bafarada-rat.dreta::before{
	content: ''; position: absolute; left: -14px; top: 14px;
	border: 7px solid transparent; border-right-color: #3b2a17;
}
#bafarada-rat .tancar{ position: absolute; right: 9px; top: 5px; font-size: 14px; opacity: 0.6; }
@keyframes bafarada-entra{ from{ opacity: 0; transform: scale(0.85); } to{ opacity: 1; transform: scale(1); } }
/* les zones que ja has mirat brillen més fluixet */
.punt-zona.ja-mirat{ opacity: 0.35; transform: scale(0.65); animation: none; }
body.acabat #rat-penat, body.acabat #bafarada-rat{ display: none !important; }
/* deixa lloc al rat penat, que penja de la cantonada de dalt del diari */
#diari h2, #diari h3:first-of-type, #diari .objectiu{ padding-right: 40px; }

/* Botó d'Eixir amb el mateix estil que el dels assoliments (fusta i or) */
button.bTancar{
	background: rgba(60, 35, 15, 0.85); border: 2px solid #c9a25a; border-radius: 10px;
	color: #fff3d6; padding: 0.4vmin 1.2vmin; width: auto; min-width: 9vmin;
	box-shadow: 0 3px 8px rgba(0,0,0,0.6);
}
button.bTancar:hover{ background: rgba(110, 70, 25, 0.95); -webkit-text-stroke-width: 0; box-shadow: 0 0 10px 2px rgba(255, 215, 80, 0.7); }

/* Cor de les vides: gemma roja en marc d'or; el número, centrat damunt de la gemma */
.vides{
	background: url('../img/general/vides.png?v=2') center / contain no-repeat;
	width: 8.6vmin; height: 8vmin; line-height: 7.6vmin;
	font-size: 3.3vmin; color: #fff3d6;
	-webkit-text-stroke-width: 1.5px; -webkit-text-stroke-color: #4a0b0b;
	text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}
/* Contalles del rat penat, al diari */
#diari .contalles-diari, #diari-popup .contalles-diari{ margin: 0.8em 0 0.4em; }
.contalles-diari summary{ cursor: pointer; font-weight: bold; color: #922B21; border-bottom: 1px solid rgba(59, 42, 23, 0.4); }
.contalles-diari ul{ margin: 0.4em 0; padding-left: 0; list-style: none; }
.contalles-diari li{ margin: 0.35em 0; font-size: 0.92em; color: #3b2a17; }
/* El rat penat té una contalla nova: es remena, brilla i mostra un «!» */
#rat-penat.te-contalla{ animation: rat-impacient 1.6s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(255, 215, 80, 0.9)); }
#rat-penat.te-contalla::after, #ic-rat.te-contalla::after{
	content: '!'; position: absolute; top: 18px; left: -10px;
	width: 20px; height: 20px; border-radius: 50%;
	background: #FFD750; color: #3b2a17; border: 2px solid #3b2a17;
	font: bold 14px/16px Georgia, serif; text-align: center;
	animation: rat-exclama 0.8s ease-in-out infinite alternate;
}
#ic-rat{ position: relative; }
#ic-rat.te-contalla{ box-shadow: 0 0 14px 4px rgba(255, 215, 80, 0.85); }
#ic-rat.te-contalla::after{ top: -6px; left: auto; right: -6px; }
#rat-penat.te-contalla.aleteja{ animation: rat-aleteja 0.7s ease-in-out 2; }
@keyframes rat-impacient{
	0%, 100%{ transform: rotate(0); }
	10%{ transform: rotate(-14deg); } 20%{ transform: rotate(12deg); } 30%{ transform: rotate(-9deg); } 40%{ transform: rotate(5deg); } 50%{ transform: rotate(0); }
}
@keyframes rat-exclama{ from{ transform: scale(0.9); } to{ transform: scale(1.15); } }

/* Popups llargs amb imatge de personatge: la imatge a l'esquerra i el text a la dreta (eixamplaPopUp) */
.swal2-popup.imatge-costat{ grid-template-columns: auto minmax(0, 1fr); column-gap: 1.2em; }
.swal2-popup.imatge-costat > *{ grid-column: 2; }
.swal2-popup.imatge-costat > .swal2-image{
	grid-column: 1; grid-row: 1 / span 3; align-self: center;
	max-width: 260px; max-height: 60vh; width: auto !important; height: auto !important; margin: 1em 0 1em 1em;
}
.swal2-popup.imatge-costat > .swal2-close{ grid-column: 2; }

/* El donyet és menut: als popups, més xicotet que la resta de personatges */
.swal2-image[src*="donyet"]{ max-height: 18vh !important; }
.swal2-popup.imatge-costat > .swal2-image[src*="donyet"]{ max-height: 22vh !important; max-width: 130px; }
/* Parelles: cada parella feta brilla del color del seu vent (el mateix que al Simon) */
.carta-vent.feta .carta-cara{ box-shadow: 0 0 14px 5px var(--color-vent, rgba(97, 239, 97, 0.8)); outline: 3px solid var(--color-vent, transparent); outline-offset: -3px; }
/* Contalles del rat penat: el mateix fons mig transparent que les notes */
#diari .contalles-diari li, #diari-popup .contalles-diari li{
	margin: 0.4em 0; padding: 0.35em 0.5em; border-radius: 6px;
	background: rgba(255, 243, 214, 0.18); color: #fff3d6; text-shadow: 1px 1px 2px #000; font-size: 0.92em;
}
/* Figures integrades a l'escena: més fosques ("llum") i amb ombra al terra ("ombra") */
#imatge-aventura img.figura-escena.amb-llum{
	filter: brightness(var(--llum-figura, 1)) saturate(0.9) drop-shadow(0 10px 8px rgba(0,0,0,0.45));
}
.figura-escena.ombra-terra{
	border-radius: 50%;
	/* el·lipse centrada als peus: negra al centre (on toca el terra) i s'esvaeix cap a fora */
	background: radial-gradient(ellipse closest-side at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.25) 75%, rgba(0,0,0,0) 100%);
	filter: none;
}
/* Ombra allargada cap avall a l'esquerra (llum que ve de dalt a la dreta): el centre fosc continua als peus */
.figura-escena.ombra-terra.cap-esquerra{
	background: radial-gradient(ellipse farthest-side at 65% 35%, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 25%, rgba(0,0,0,0.3) 55%, rgba(0,0,0,0) 100%);
	transform: rotate(-9deg);
	transform-origin: 65% 35%;
}
/* Si la figura ja té ombra al terra, sense l'ombra difusa desplaçada (feia una franja clara davall dels peus) */
#imatge-aventura img.figura-escena.amb-ombra-terra{
	filter: none;
}
#imatge-aventura img.figura-escena.amb-ombra-terra.amb-llum{
	filter: brightness(var(--llum-figura, 1)) saturate(0.9);
}

/* Escales entre plantes: el ratolí és una fletxa cap amunt o cap avall */
area[data-direccio="amunt"]{ cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20transform%3D%22rotate%280%2020%2020%29%22%3E%3Cpath%20d%3D%22M20%203%20L35%2020%20H26%20V37%20H14%20V20%20H5%20Z%22%20fill%3D%22%23FFD750%22%20stroke%3D%22%233b2a17%22%20stroke-width%3D%222.5%22%20stroke-linejoin%3D%22round%22/%3E%3C/g%3E%3C/svg%3E") 20 3, n-resize; }
area[data-direccio="avall"]{ cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20transform%3D%22rotate%28180%2020%2020%29%22%3E%3Cpath%20d%3D%22M20%203%20L35%2020%20H26%20V37%20H14%20V20%20H5%20Z%22%20fill%3D%22%23FFD750%22%20stroke%3D%22%233b2a17%22%20stroke-width%3D%222.5%22%20stroke-linejoin%3D%22round%22/%3E%3C/g%3E%3C/svg%3E") 20 37, s-resize; }

/* Refranys (refranys.js) */
.refrany-dit{ margin-top: 0.9em; padding: 0.5em 0.8em; border-left: 3px solid #FFD750; background: rgba(255, 215, 80, 0.12); border-radius: 6px; text-align: left; }
.duel-opcions{ display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0.8em 0; }
.opcio-refrany{ font-size: 15px !important; padding: 6px 12px !important; }
.opcio-refrany.no-se{ opacity: 0.75; font-style: italic; }
.inici-refrany{ font-size: 1.3em; color: #FFD750; }

/* Rosa dels vents amb noms en passar el ratolí (merges.js → htmlRosaVents) */
.rosa-vents{ position: relative; }
.rosa-vents img{ width: 100%; display: block; }
.punt-rosa{
	position: absolute; width: 11%; height: 11%; transform: translate(-50%, -50%); border-radius: 50%;
	cursor: help; display: flex; align-items: center; justify-content: center;
	font: bold 22px/1 Georgia, serif; color: #fff;
}
.punt-rosa:hover{ box-shadow: 0 0 10px 4px rgba(255, 215, 80, 0.9); }
.punt-rosa.amb-signe{ border: 2px solid #fff; }
.punt-rosa.suma{ background: #2e7d32; }
.punt-rosa.resta{ background: #b71c1c; }
.punt-rosa::after{
	content: attr(data-nom); position: absolute; left: 50%; bottom: 115%; transform: translateX(-50%);
	padding: 3px 10px; border-radius: 8px; white-space: nowrap;
	background: #3b2a17; color: #FFD750; border: 2px solid #c9a25a;
	font: bold 15px 'IM Fell English', Georgia, serif; text-shadow: none;
	opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 5;
}
.punt-rosa:hover::after{ opacity: 1; }
/* La rosa dels vents, a l'esquerra del text (com els personatges) */
.img-repte.rosa-vents{ float: left; margin: -10px 20px 6px 0; }
/* als punts de dalt, el nom surt per davall (si no, el popup el talla) */
.punt-rosa.nom-avall::after{ bottom: auto; top: 115%; }

/* Exemples dels reptes, centrats dins del popup */
.content-popup pre, .swal2-html-container pre{ width: fit-content; max-width: 100%; margin: 0.7em auto !important; text-align: left; }
.content-popup .exemple{ width: fit-content; margin: 0.6em auto; text-align: left; line-height: 1.8; }

/* Sobrenom sota el nom al títol dels popups ("Penyagolosa" / "Cim del Sol") */
.sobrenom-titol{
	display: block;
	font-size: 0.55em;
	font-weight: normal;
	opacity: 0.85;
	margin-top: 0.15em;
	letter-spacing: 0.03em;
	text-transform: none;   /* el títol posa majúscula a cada paraula: «Cim del Sol», no «Cim Del Sol» */
}

/* Quilòmetres caminats, damunt de la llista d'assoliments */
.km-caminats{
	text-align: right;
	margin-top: 0.8em;
	font-size: 0.9em;
	font-style: italic;
	opacity: 0.9;
}

/* Targeta del fitxer d'un repte: sempre davall del text, centrada, amb aspecte de botó */
a.fitxer-repte{
	display: flex; flex-direction: row; align-items: center; gap: 12px;
	width: fit-content; max-width: 90%;
	margin: 14px auto 6px; padding: 8px 18px 8px 10px;
	border: 2px dashed rgba(255, 215, 120, 0.7); border-radius: 10px;
	background: rgba(255, 230, 170, 0.12);
	text-decoration: none; cursor: pointer;
	transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
	animation: crida-fitxer 2.4s ease-in-out 3;
}
a.fitxer-repte:hover{
	transform: translateY(-2px);
	background: rgba(255, 230, 170, 0.22);
	box-shadow: 0 0 14px rgba(255, 210, 110, 0.55);
}
a.fitxer-repte img{ width: 46px; margin: 0; }
a.fitxer-repte img:hover{ transform: none; }
.dades-fitxer{ display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.25; }
.nom-fitxer{ font-size: 16px; color: #fff3d6; font-family: Consolas, monospace; font-weight: bold; }
.clica-fitxer{ font-size: 14px; color: #ffd778; font-style: italic; }
@keyframes crida-fitxer{
	0%, 100%{ box-shadow: 0 0 0 rgba(255, 210, 110, 0); }
	50%{ box-shadow: 0 0 16px rgba(255, 210, 110, 0.6); }
}

/* Avís del trencaclosques del núvol: tornar a començar costa una vida */
.nuv-avis-vida{ font-size: 13px; font-style: italic; opacity: 0.8; margin-top: 4px; }

/* Popup que dona dues coses alhora (la fornera: coca i sucre) */
.dues-imatges{ display: flex; justify-content: center; align-items: flex-end; gap: 28px; margin: 4px 0 14px; }
.dues-imatges img{ max-height: 130px; max-width: 40%; filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.5)); }

/* Nom de la zona clicable en passar-hi el ratolí (mateix estil que les agulles del mapa) */
#etiqueta-zona{
	position: fixed; z-index: 3000; pointer-events: none;
	padding: 0.125em 0.4em;
	background-color: rgba(255,255,255,0.35);
	color: #922B21;
	text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff,
	             1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
	font-family: 'IM Fell English', serif; font-weight: bold; font-style: italic;
	font-size: clamp(15px, 1.5vw, 24px);
	border-radius: 0.25em; white-space: nowrap; text-align: center;
	opacity: 0; transition: opacity 0.12s;
}
#etiqueta-zona.visible{ opacity: 1; }
#etiqueta-zona small{ display: block; font-size: 0.65em; }

/* Vers del gat negre dins d'un popup (merges.js → marcaVersos) */
.vers-gat{
	display: inline-block; margin: 0.2em 0.15em; padding: 0.1em 0.6em;
	background: rgba(120, 80, 180, 0.35); border: 1px solid rgba(190, 160, 240, 0.7);
	border-radius: 8px; color: #f3e9ff; font-weight: bold; font-style: italic;
	box-shadow: 0 0 8px rgba(150, 110, 220, 0.45);
}

/* Aventura acabada: del cinturó només queden els assoliments, centrats sota l'escena */
body.acabat #inventori{
	width: auto !important; height: auto; padding: 0;
	background: none; border: none; box-shadow: none;
	justify-content: center;
}
body.acabat #motxilla-content{ display: none !important; }
body.acabat #inventori #boto-assoliments{ font-size: 3vh; padding: 0.8vh 2.2vh; }

/* Diari: el títol es queda fix a dalt i només fa scroll el contingut */
#diari{ display: flex; flex-direction: column; overflow: hidden !important; }
#diari h2{ flex: none; }
#diari .diari-cos{ flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
#diari .diari-cos::-webkit-scrollbar{ width: 6px; }
#diari .diari-cos::-webkit-scrollbar-thumb{ background: rgba(90, 45, 12, 0.5); border-radius: 3px; }

/* Pàgines del diari (diari.js): punts de llibre que pugen des de la línia de davall
   (el botó porta la brillantor; la cinta de dins, la forma retallada) */
.pestanyes-diari{
	flex: none; display: flex; justify-content: flex-start; align-items: flex-end; gap: 6px;
	margin: 0 0 0.6em; padding: 0 38px 0 6px; height: 2.9em;
	border-bottom: 2px solid #5a2d0c;              /* la vora de les pàgines, d'on ixen els punts de llibre */
}
.pestanya-diari{
	position: relative; cursor: pointer; border: none; background: none; padding: 0; width: 2.15em;
	filter: drop-shadow(1px -1px 1px rgba(0,0,0,0.35));
	transition: filter 0.15s;
}
.pestanya-diari .cinta{
	display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
	height: 2.2em; padding: 0 0 0.3em; box-sizing: border-box;
	font-size: 1.05em; line-height: 1;
	background: var(--cinta, #922B21);
	clip-path: polygon(0 0, 50% 22%, 100% 0, 100% 100%, 0 100%);   /* cinta amb la punta en V, a dalt */
	transition: height 0.15s, background 0.15s;
}
.pestanya-diari[data-pagina=ara]{ --cinta: #922B21; }
.pestanya-diari[data-pagina=versos]{ --cinta: #5b3a8c; }
.pestanya-diari[data-pagina=contalles]{ --cinta: #2f5d50; }
.pestanya-diari[data-pagina=refranys]{ --cinta: #b07a1c; }
.pestanya-diari:hover .cinta{ height: 2.45em; }
/* la pàgina oberta: el punt de llibre puja més i brilla */
.pestanya-diari.activa .cinta{ height: 2.8em; background: linear-gradient(180deg, rgba(255,240,190,0.35), rgba(255,240,190,0) 60%), var(--cinta); }
.pestanya-diari.activa{ filter: drop-shadow(0 0 3px #ffe08a) drop-shadow(0 0 7px rgba(255, 200, 60, 0.85)); }
.compte-pestanya{ font-size: 0.55em; font-weight: bold; color: #fff3d6; margin-top: 2px; }
.pestanya-diari.nou{ animation: pestanya-nova 1.2s ease-in-out infinite; }
.pestanya-diari.nou::after{ content: ''; position: absolute; top: 6px; right: 1px; width: 7px; height: 7px; border-radius: 50%; background: #ffd750; }
@keyframes pestanya-nova{ 0%, 100%{ filter: drop-shadow(1px -1px 1px rgba(0,0,0,0.35)); } 50%{ filter: drop-shadow(0 0 6px rgba(255, 215, 80, 1)); } }
.llista-diari{ margin: 0.3em 0; padding-left: 0; list-style: none; }
.llista-diari li{ margin: 0.45em 0; font-size: 0.92em; color: #3b2a17; }
