/* ========================= RESET B脕SICO ========================= */
 body {
	 margin: 0;
	 font-family: Arial, sans-serif;
	 color: #f0e6d2;
	 background: url("../img/bgolas.png");
	 background-repeat: repeat-y; background-size: cover;
	 background-position: top center; 
	 } 
	 
html, body {
    overflow-x: hidden;
}
	 
	 /* ========================= HEADER ========================= */
	 .header {
		 position: sticky;
		 top: 0;
		 z-index: 1000;
		 height: 100px;
		 background: url("../img/madera.jpg");
		 background-size: cover;
		 background-position: center;
		 display: flex;
		 align-items: center;
		 justify-content: space-between;
		 padding: 0 30px;
		 border-bottom: 3px solid #5a3b1a;
		 box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 -10px 20px rgba(0,0,0,0.4); 
		 } 
		 
		 
		 /* ========================= LOGO ========================= */ 
		 .logo img { height: 70px; 
		 } 
		 
		 
		 /* ========================= TIM脫N + AVATAR ========================= */ 
		 .avatar-container {
			 position: relative;
			 height: 100%;
			 aspect-ratio: 1;
			 } 
			 
			 .avatar-container img.timon {
				 height: 100%;
				 width: auto;
				 }

				 .avatar-container img.avatar { 
				 position: absolute;
				 top: 50%;
				 left: 50%;
				 width: 60%;
				 height: 60%;
				 transform: translate(-50%, -50%);
				 border-radius: 50%;
				 object-fit: cover;
				 box-shadow: 0 0 8px rgba(0,0,0,0.8);
				 transition: all 0.3s ease;
				 }

				 /* ========================= CONTENEDOR ========================= */

				 .container {
				width: fit-content;
				max-width: 95%;
				 margin: 60px auto;
				 background: rgba(30, 20, 10, 0.85);
				 backdrop-filter: blur(3px);
				 padding: 25px;
				 border-radius: 10px;
				 border: 2px solid #8b5a2b;
				 box-shadow: 0 0 20px rgba(0,0,0,0.5);
				 word-wrap: break-word;
				overflow-wrap: break-word;
				 
				 } 
				 
				 /* ========================= FORMULARIO ========================= */ 
				 
				 form {
					 display: flex;
					 flex-direction: column;
					 } 
					 
					 label {
						 margin-top: 10px;

						 }


						 input {
						 padding: 8px;
						 margin-top: 5px;
						 border-radius: 5px;
						 border: none;
						 background: #f5deb3;
						 } 
						 
						 
			/* ========================= BOTONES ========================= */

			button {
				margin-top: 20px; 
				padding: 10px;
				background: #8b5a2b; 
				color: white;
				border: none;
				border-radius: 5px;
				cursor: pointer;

				} 
				
				button:hover {
				background: #a86b34;
				} 
				
				
			/* ========================= LINKS ========================= */

			a {
				color: #f5deb3;
				text-decoration: none;
				}

				a:hover {
				text-decoration: underline;
				} 
				
				
			/* ========================= BOT脫N AYUDA ========================= */

			.help-btn {

				width: 20px;
				height: 20px;
				margin-left: 8px;
				cursor: pointer;
				vertical-align: middle;
				transition: transform 0.2s;
				} 
				
				
				.help-btn:hover { 
				transform: scale(1.2);
				} 
				
				
				
		/* ========================= BOCADILLO AYUDA (VERSI脫N PRO) ========================= */


		#help-box {
			position: fixed;
			width: 320px;
			max-height: 260px; /* 馃敟 ahora s铆 din谩mico */
			background: url("../img/mapa.jpg");
			background-size: cover;
			border: 3px solid #8b5a2b;
			border-radius: 12px;
			z-index: 4000;
			box-shadow: 0 0 20px rgba(0,0,0,0.8);
			overflow: visible;
			display: flex;
			flex-direction: column; /* animaci贸n */
			opacity: 0;
			transform: translateY(-20px) scale(0.95);
			transition: all 0.3s ease;
			pointer-events: none;
			} 
			
			#help-box.show {
				opacity: 1;
				transform: translateY(0) scale(1);
				 pointer-events: auto;
				} 
				
		/* ========================= HEADER (barra de la X) ========================= */
		#help-header {
			display: flex;
			align-items: center; /* 馃敟 centra verticalmente */
			gap: 10px; /* 馃敟 separaci贸n bot贸n-texto */ 
			padding: 4px 10px 6px 10px;
			background: rgba(0,0,0,0.15);
			border-top-left-radius: 10px;
			border-top-right-radius: 10px;

			}

			/* BOT脫N */ 
			
			#close-help {
				width: 26px;
				height: 26px;
				margin: 0;
				line-height: 1;
				border-radius: 6px;
				border: none;
				background: rgba(0,0,0,0.65);
				color: white;
				font-size: 15px;
				font-weight: bold;
				cursor: pointer;
				display: flex;
				align-items: center;
				justify-content: center;
				} 
				
				#close-help:hover {
					background: #8b0000;
					} 
					
			/* T脥TULO */ 
			
			#help-title {
				font-family: "Palatino Linotype", "Book Antiqua", serif; font-style: italic;
				color: #2b0c05;
				font-size: 20px;
				text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
				} 
				
		/* ========================= CONTENIDO ========================= */

		.help-content { 
		overflow-y: auto;
		padding: 10px 20px 20px 20px;
		flex: 1; /* 馃敟 ocupa el resto */ 
		
		} /* TEXTO */ 
		
		#help-text {
			color: #090a25;
			font-weight: 500;
			} 
			
			
	/* ========================= PICO ========================= */

	#help-box::after {
		content: ""; 
		position: absolute;
		top: -18px;
		left: var(--arrow-x, 50%);
		transform: translateX(-50%) rotate(15deg);
		border-width: 0 15px 20px 15px;
		border-style: solid;
		border-color: transparent transparent #a05a2c transparent;
		} 
		
		/* OCULTO */ 
		.hidden {
			display: none;
			}


			/* ========================= Tim贸n Preview ========================= */

			#avatar-preview-container {
				position: relative;
				width: 120px;
				margin: 10px auto;
				} 
				
				
				.timon-preview {
					width: 100%;
					}


					#avatar-preview {
						position: absolute;
						top: 50%; 
						left: 50%;
						width: 60%; 
						height: 60%;
						transform: translate(-50%, -50%);
						border-radius: 50%;
						object-fit: cover;

						} /*


		========================= AVATARES PREDEFINIDOS ========================= */

		#avatar-presets {
			display: flex;
			flex-wrap: wrap;
			gap: 10px;
			margin-top: 10px;

			} 
			
		#avatar-presets.hidden {
			display: none;
			} 
			
			#avatar-presets label {
				cursor: pointer;
				display: inline-block;
				padding: 4px; 
				border-radius: 50%; 
				
				}


				#avatar-presets input {
					display: none; 
					} 
					
					#avatar-presets img {
						width: 60px;
						height: 60px;
						border-radius: 50%; 
						object-fit: cover;
						border: 2px solid transparent;
						transition: transform 0.2s, border 0.2s;

						} 
						
						
			/* hover */ 
			
			#avatar-presets img:hover {
				transform: scale(1.1);
				} 
				
				
				/* seleccionado */

				#avatar-presets input:checked + img {
					border: 2px solid gold;
					}



			/* ========================= EDITOR AVATAR (POPUP) ========================= */


			#avatar-editor {
				position: fixed;
				inset: 0;
				background: rgba(0,0,0,0.8);
				z-index: 3000;
				display: none; /* 馃敟 IMPORTANTE */
				align-items: center;
				justify-content: center;
				}
				
				
				#avatar-editor.show {
					display: flex; 
					}
					
					#editor-box { 
					background: #1a1208;
					padding: 20px; 
					border-radius: 10px; 
					border: 2px solid #8b5a2b;

					} /* CONTENEDOR */ 
					
					#editor-canvas-container { 
					position: relative;
					width: 300px;
					height: 300px;
					overflow: hidden;
					cursor: grab;

					} /* IMAGEN MOVIBLE */


					#editor-image { 
					pointer-events: auto;
					user-drag: none;
					-webkit-user-drag: none;
					position: absolute;
					top: 0;
					left: 0;
					user-select: none;
					cursor: grab;
					} /* M脕SCARA CIRCULAR */

					#editor-mask {
						position: absolute;
						inset: 0;
						border-radius: 50%;
						box-shadow: 0 0 0 9999px rgba(0,0,0,0.6);
						pointer-events: none;
						border: 2px solid gold;
						} 
						
						
						/* BOTONES */ 
						
						
						#editor-controls {
							margin-top: 10px;
							display: flex; 
							justify-content: space-between;

							} 
							
							.space-between { 
							display: flex; 
							justify-content: space-between;
							margin-top: 10px;
							}


							.space-between a {
								color: #f5deb3;
								font-size: 14px;

								}
								
								
/* =========================
   MEN脷 USUARIO
========================= */

#avatar-menu-trigger {
    cursor: pointer;
}

#user-menu {

    position: absolute;
    top: calc(100% + 5px);
    right: 0;

    min-width: 200px;

    background: rgba(20, 10, 5, 0.95);
    border: 2px solid #8b5a2b;
    border-radius: 12px;
	 backdrop-filter: blur(6px);

    padding: 10px;

    box-shadow: 0 0 15px rgba(0,0,0,0.7);

    z-index: 1500;
	
	 /* 馃敟 ANIMACI脫N */
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;

    transition: all 0.25s ease;
}

/* visible */
#user-menu.menu-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}



/* LOGIN FORM */
#user-menu form {
    display: flex;
    flex-direction: column;
	  gap: 10px;
}

#user-menu input {
    margin-bottom: 8px;
	 padding: 12px;

    font-size: 16px; /* 馃敟 evita zoom autom谩tico en m贸viles */

}

#user-menu button {
    padding: 12px;
}

/* LINKS */
#user-menu a {
    display: block;
    padding: 12px;
	font-size: 16px;
    border-radius: 5px;
}

#user-menu a:hover {
    background: rgba(255,255,255,0.1);
}


/* =========================
  ESTILO DE MENSAJE.PHP DIV succes-message
========================= */

.success-message {
    margin: 25px 0;
    padding: 20px;
    border: 2px solid #c9a44b;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: #ffe9a8;
    font-size: 1.1em;
    line-height: 1.6;
    text-align: center;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
}



/* =========================
   TABLA RESPONSIVE
========================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* ?? evita que se rompa */
}

th, td {
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    text-align: left;
}

/* =========================
   BOTóN EDITAR TABLA RESPONSIVE
========================= */

.edit-btn {
    background: rgba(255,255,255,0.1);
   border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 16px;

    transition: transform 0.2s;
}

.edit-btn:hover {
    transform: scale(1.2);
}


/* =========================
   CELDAS EDITABLES
========================= */

.editable {
    position: relative;
    cursor: pointer;
}

.editable .edit-icon {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.6;
}

.editable:hover .edit-icon {
    opacity: 1;
}

/* INPUT INLINE */
.editable input,
.editable select {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: none;
}


/* =========================
   BOTóN GUARDAR
========================= */

.save-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 20px;
    cursor: pointer;
    box-shadow: none;
}

.save-btn:hover {
    transform: scale(1.2);
    background: transparent;
}

/* =========================
   BOTóN DELETE
========================= */

.delete-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
}

.delete-btn:hover {
    transform: scale(1.2);
}


/* =========================
   馃摫 MOBILE (<= 768px)
========================= */

@media (max-width: 768px) {

    /* HEADER */

    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;

        height: 70px;
        z-index: 3000;

        padding: 0 10px; /* 馃敟 menos padding */
    }

    body {
        padding-top: 70px;
    }



    /* LOGO */
    .logo img {
        height: 45px;
        max-width: 120px;
        object-fit: contain;
    }

    /* TIM脫N */
.avatar-container {
    height: 60px;              /* 馃敟 m谩s grande */
    margin-left: 10px;
    margin-right: 10px;        /* 馃敟 separarlo del borde */
    flex-shrink: 0;
}

.avatar-container img.timon {
    height: 100%;
}


.avatar-container img.avatar {
    width: 65%;   /* 馃敟 un poco m谩s visible */
    height: 65%;
}

    /* CONTENEDOR */
    .container {
        width: 90%;
        margin: 20px auto;
        padding: 15px;
    }

    /* INPUTS */
    input {
        font-size: 16px; /* evita zoom raro en m贸viles */
    }

    /* BOTONES */
    button {
        font-size: 16px;
        padding: 12px;
    }

    /* MEN脷 USUARIO */
#user-menu {
    position: fixed;   /* 馃敟 CLAVE */
    top: 80px;         /* debajo del header */
    left: 10px;
    right: 10px;

    width: auto;
    min-width: unset;

    z-index: 3500;
}

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }

}   /* Cierre parte moviles */


}

