/* Definición de la fuente personalizada */
@font-face {
    font-family: 'BrokenChalk';
    src: url('../BrokenChalk.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Darling-Coffee';
    src: url('../Darling-Coffee.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/*colores barra scroll*/
     *::-webkit-scrollbar {
		    width: 15px; /* ← SIN ESTO, CHROME IGNORA TRACK/THUMB */
		}
     *::-webkit-scrollbar-track{
		background: transparent;
		border-radius: 1rem;
	 }
	 *::-webkit-scrollbar-thumb{
		background: linear-gradient(45deg, #ff6b6bba, #feca57c9, #48dbfbcf, #1dd1a1bd);
		border-radius: 1rem;
		border:2px solid #8d53af;
	 }
	 *::-webkit-scrollbar-thumb:hover{
		background: deeppink !important;
		border-radius: 1rem;
	 }
	 
html{
	background: linear-gradient(45deg, #ff6b6bba, #feca57c9, #48dbfbcf, #1dd1a1bd);
	background-size: 110% 100%;
	display: flex;
  	justify-content: center;
	height: 100%;
	width: 100%; 
	overflow-x: hidden;
	font-size: 26px;
}

body{
	height: 100%;
	width: 95%; 
	text-align: center;
	font-family: 'Darling-Coffee', Comic Sans MS;
	color: #0166a9;
}

#logoIni {
	width: 45vh;
	max-width: 250px;
	min-width: 150px;
}

.tarjeta{
	width: 95%;
	display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1%;
    margin: 1%;
    background-color: #ffffffc7;
    border-radius: 1rem;
}

header>nav{
	display: flex;
    justify-content: space-around;
    align-items: center;
    text-transform: uppercase;
    font-family: 'BrokenChalk';
}


/* ================== MASCOTA MODERNA ================== */
.mascot {
	border-radius: 8rem;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    z-index: 10;
    pointer-events: auto;
    overflow: visible;
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    cursor: pointer;
}
#speech-bubble {
    position: fixed;
    bottom: 140px;
    right: 20px;
    z-index: 99;
    border-radius: 1rem;
    padding: 1%;
    background: radial-gradient(circle at center,
	    #fff6a5 0%,
	    #fde24a 45%,
	    #e0c400 100%
	);
    border: #0166a9 solid 2px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Cuerpo con degradado y sombra */
#mascot-body circle {
    fill: url(#bodyGradient);
    stroke: #0166a9;
    stroke-width: 3;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Ojos modernos */
.eye {
    fill: url(#eyeGradient);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
    transition: transform 0.2s ease;
}

.eye-light {
    fill: #ffffff;
    opacity: 0.8;
}

/* Boca minimalista */
.mouth {
    stroke: #0166a9;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Boca idle inicialmente */
#mouth-idle { opacity: 1; }
/* ===== ESTADOS BOCA ===== */
.mascot.success #mouth-idle { opacity: 0; }
.mascot.success #mouth-happy { opacity: 1; }

.mascot.error #mouth-idle { opacity: 0; }
.mascot.error #mouth-sad { opacity: 1; }

.mascot.deflate #mouth-idle,
.mascot.deflate #mouth-happy,
.mascot.deflate #mouth-sad { opacity: 0; }
.mascot.deflate #mouth-o { opacity: 1; }

/* Animaciones flotantes y efectos funcionales */
@keyframes idleFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}
.mascot #mascot-body { animation: idleFloat 8s ease-in-out infinite; }

@keyframes successDance {
    0% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-10px) rotate(-5deg); }
    60% { transform: translateY(0) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}
.mascot.success #mascot-body { animation: successDance 1.2s ease-in-out; }

@keyframes errorShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}
.mascot.error #mascot-body { animation: errorShake 0.6s ease-in-out; }

/* Desinflado */
@keyframes deflateShake {
    0%   { transform: translateX(0) scale(1); }
    20%  { transform: translateX(-4px) scale(1); }
    40%  { transform: translateX(4px) scale(1); }
    60%  { transform: translateX(-4px) scale(1); }
    80%  { transform: translateX(4px) scale(1); }
    100% { transform: translateX(0) scale(1); }
}
.mascot.deflate #mascot-body { animation: deflateShake 0.8s ease-in-out; }

/* Ojos cerrados */
#eyes, #eyes-closed { transition: opacity 0.2s ease; }
#eyes-closed { opacity: 0; }
.mascot.deflate #eyes { opacity: 0; }
.mascot.deflate #eyes-closed { opacity: 1; }

/* Pequeño movimiento de ojos y boca para dar vida */
.eye {
    animation: mouthMove 10s ease-in-out infinite;
}

#mouth-idle {
    transform-origin: 60px 74px; /* centro aproximado de la boca */
    animation: mouthMove 6s ease-in-out infinite;
}

@keyframes mouthMove {
    0%, 100% { transform: translateY(0) scaleY(0.9); }
    25% { transform: translateY(-1px) scaleY(1); }
    50% { transform: translateY(1px) scaleY(1); }
    75% { transform: translateY(-1px) scaleY(1.05); }
}

h1, h2, h3, h4, h5, h6{
	color: #0189e3;
}

input{
	font-family: 'Darling-Coffee', Comic Sans MS;
	color: #0166a9;
	font-size: 26px;
}

.mensaje-resultado {
	background-color: transparent;
    padding: 3% 1%;
    border-radius: 1rem;
    width: 95%;
    color: #8d53af;
    font-family: 'Darling-Coffee';
    font-size: clamp(24px, 3vw, 34px);

    /* transición solo de la posición / escala del contenedor */
    transition:
        top 0.6s ease,
        left 0.6s ease,
        transform 0.6s ease,
        opacity 0.3s ease;
}

.mensaje-centrado {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 9999;
}

/* Animación aplicada solo al contenido */
.mensaje-animado {
    display: inline-block;
    animation: shake-pop 0.4s ease;
}

@keyframes shake-pop {
    0%   { transform: scale(1) translateX(0); }
    15%  { transform: scale(1.05) translateX(-5px); }
    30%  { transform: scale(1.05) translateX(5px); }
    45%  { transform: scale(1.05) translateX(-4px); }
    60%  { transform: scale(1.05) translateX(4px); }
    75%  { transform: scale(1.05) translateX(-2px); }
    100% { transform: scale(1) translateX(0); }
}

#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}
.confetti {
    position: absolute;
    bottom: -10px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    animation: confetti-fall 1.2s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-60vh) rotate(360deg);
        opacity: 0;
    }
}

button {
    font-family: 'Darling-Coffee', Comic Sans MS; /* fuente divertida */
    font-size: 20px;
    font-weight: bold;
	color: #551b6b;
    background: linear-gradient(45deg, #ff6b6bba, #feca57c9, #48dbfbcf, #1dd1a1bd);
    border: 3px solid #fe6e9c;
    border-radius: 15px;
    padding: 12px 25px;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-align: center;
    margin: 3% 3%;
}

/* Efecto hover divertido */
button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}
/* Efecto click */
button:active {
    transform: scale(0.95);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
a {
    display: inline-block;           /* esencial */
    text-decoration: none;
    color: #0189e3 !important;      /* fuerza el color inicial */
    font-weight: bold;
    border: none;
    outline: none;
    background: none;
    will-change: transform;          /* ayuda a que no aparezca recuadro */
    transform: translateZ(0);       /* activa render GPU */
}

a:hover, a:active {
    transform: scale(1.1) translateZ(0);
    color: #ff6b6b !important;      /* fuerza el color al hover */
    background: none;
    outline: none;
    box-shadow: none;                /* quita sombra si la hubiera */
}

#contenedor-juego{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: 90%;
    margin-top: 40px;
}

#juego{
    display: flex;
    flex-direction: column;
    align-items: center;
	min-width: 90%;
	max-width: 90%;
}


#infoIcon{
    text-transform: none;
    font-family: 'Darling-Coffee';
}
.info-icon-circle {
    display: inline-block;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;       /* círculo */
    background-color: #3498db; /* azul */
    color: white;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    vertical-align: text-bottom;
    line-height: 1.8;
    transition: background-color 0.2s;
}

.info-icon-circle:hover {
    background-color: #2980b9;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

.modal-content {
    background: #ffffff;
    width: 80%;
    max-width: 500px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 6px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 18px;
}

.vocabulario-definiciones{
	width: 100%;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
}


/* juego común vocabulario */
#palabras-disponibles {
    position: sticky;       /* sticky funciona ahora */
    top: 0;
    background-color: #ff9d8f24;
    z-index: 10;
	width: 95%;
    border-radius: 1rem;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
}

#palabras-disponibles>p{
	padding: 1%;
	margin:1%;
	border: 2px dotted #0189e3;
	border-radius: 5%;
    cursor: pointer;
    user-select: none;
    width: max-content;
    background: #f9f9f9;
}

[data-tipo="Vocabulario"] div.conjunto-soluciones-txt{
	display:grid;
    gap: 10px;
    justify-items: center;
    border: 2px dotted #0189e3;
    border-radius: 5%;
    padding: 2%;
}


.copiada{
	font-style: italic;
	background-color: rgb(255, 255, 128) !important;
}
.usada,
.usada.copiada {
	font-style: italic;
	background-color: rgb(178 231 241) !important;
}
#palabras-espanol{
    min-width: 90%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
}

[data-tipo="definiciones"] #palabras-espanol,
[data-tipo="ReglasOrtograficas"] #palabras-espanol {
	flex-direction:column;
}


.conjunto-soluciones>*{
	width:200px;
}

.correcto{
	background-color: rgb(119 238 212);
}
.incorrecto{
	background-color: pink;
}
.img-vocabulario {
    height: 100px;
    border-radius: 1rem;
}

.barra-juego a:nth-child(1) {
    justify-self: start;
}

.barra-juego a:nth-child(2) {
    justify-self: center;
}

.barra-juego a:nth-child(3) {
    justify-self: end;
}



/* Atribución para recursos embebidos de Wordwall */
.wordwall-attribution {
    margin-top: 8px;
    margin-bottom: 16px;
    text-align: right;
    font-size: 0.75rem;
    color: #666;
    opacity: 0.8;
}

.wordwall-attribution a {
    color: #0066cc;
    text-decoration: none;
}

.wordwall-attribution a:hover {
    text-decoration: underline;
}

/* Asegurar que los iframes sean responsive */
.juegosColegio iframe {
    max-width: 100%;
    border-radius: 4px;
}

@media only screen and (max-width: 850px){
	html{
		font-size: 20px;
	}
    .mascot {
        width: 70px;
    }

	#palabras-disponibles{
		height: 95px; 
	    overflow-y: auto;       /* scroll solo en este div */
		overflow-x: hidden;
	}

	.vocabulario-definiciones{
	    flex-direction: column;
	}
	
    .juegosColegio iframe {
        width: 100%;
        height: 300px;
    }
}

@media print {
	html{
		font-size: 18px;
		background: transparent;
	}
	input{
		font-size: 18px;
	}
	
	input::placeholder,
  	textarea::placeholder,
  	button,
    #mascot,
    header,
    audio,
    #confetti-container,
    footer, #footer,
    script,
    .btn-juegos,
    #menu-juegos,
    #print-placeholder,
    .acciones,
    #mensaje,
    #infoModal,
    #infoIcon,
    #script-fragment,
    h1, h4 {
		color: transparent;
        display: none !important;
        height: 0 !important;
    }
    
    /*VOCABULARIO*/
    #palabras-disponibles {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        z-index: auto !important;
    }

	.conjunto-soluciones>*{
		width:120px;
	}
	.conjunto-soluciones>img{
		height: auto;
	}
	.respuesta{
	    border: none;
	    border-bottom: 2px solid;
	}	
	    /* El contenedor grande puede cortarse */
    #palabras-espanol {
        page-break-inside: auto; /* default, se puede cortar */
    }
    
	html {
		height: auto;
	}
	
	/*LECTURAS - ARTICULOS DETERMINADOS*/
	#juego>#frontArticulosDeterminados>.conjunto-soluciones{
		flex-direction: row !important;
		width: 15%;
	    align-items: center !important;
	    justify-content: flex-start !important;
	    gap: 10px;
	}
	
	/*LECTURAS - GENERO/NÚMERO*/
	#tGeneroNumero .inputFinal {
		border: none;
	    background: transparent;
	} 
	#tGeneroNumero thead{
		font-size: 14px;
	}
	

	
	@page{
		margin:0.5cm;
	}
}

/* head menú hamburguesa pc y mvl */
/* Paleta de colores sugerida: Azul suave, Naranja divertido, Blanco */
:root {
    --color-primario: #0189e3;
    --color-secundario: #FF9F43;
    --color-fondo-menu: #FFF9F2; /* Crema suave */
}

/* Menú en Escritorio (PC) */
#hamburguesa.tarjeta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    flex-direction: row;
    justify-content: center;
}

#hamburguesa a {
    flex: 0 1 250px;
    width: 250px;
    max-height: 35px;
    text-decoration: none;
    background-color: var(--color-primario);
    padding: 10px 20px;
    border-radius: 50px; /* Bordes muy redondeados */
    border-bottom: 4px solid #005fa3; /* Efecto 3D */
    transition: transform 0.2s, background-color 0.2s;
}

#hamburguesa a:hover {
    transform: scale(1.05);
    background-color: var(--color-secundario);
    border-bottom: 4px solid #e67e22;
}

#hamburguesa h4 {
    margin-top: 1%;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: white;
}


/* Botón Hamburguesa */
#btn-hamburguesa {
    display: none;
}

#btn-hamburguesa span {
    width: 100%;
    height: 5px;
    background: white;
    border-radius: 10px;
    transition: 0.3s;
}

/* Responsivo (Móvil) */
@media only screen and (max-width: 850px) {
    #btn-hamburguesa {
        display: flex;
        flex-direction: column;
	    justify-content: space-around;
	    width: 45px;
	    height: 45px;
	    background: var(--color-secundario);
	    padding: 8px;
	    border-radius: 12px;
	    border: none;
	    box-shadow: 0 4px 0 #e67e22;
    }

    #hamburguesa.tarjeta {
        display: none; /* Se controla por JS */
        position: fixed;
        top: 85px; /* Ajusta según altura de tu cabecera */
        right: 20px;
        width: 250px;
        height: auto;
        max-height: 80vh;
        background-color: var(--color-fondo-menu);
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-y: auto;
        padding: 20px;
        border-radius: 25px;
        border: 4px dashed var(--color-secundario);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 1000;
        gap: 12px;
    }

    #hamburguesa a {
        width: 100%;
        box-sizing: border-box;
    }
    
    #hamburguesa h4 {
    	margin-top: -2%;
    }

    /* Animación de la X */
    #btn-hamburguesa.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
    #btn-hamburguesa.active span:nth-child(2) { opacity: 0; }
    #btn-hamburguesa.active span:nth-child(3) { transform: rotate(-45deg) translate(8px, -8px); }
}


/*** Menú2 en Escritorio (PC) ***/
.menu-juegos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-evenly
}
.menu-juegos>button{
	margin: 0;
}

/* Botón Hamburguesa */
.btn-juegos {
    display: none;
}

.btn-juegos span {
    width: 100%;
    height: 5px;
    background: white;
    border-radius: 10px;
    transition: 0.3s;
}

/* Responsivo (Móvil) */
@media only screen and (max-width: 850px) {
    .btn-juegos {
        display: flex !important;
        flex-direction: column;
	    justify-content: space-around;
	    width: 45px;
	    height: 45px;
	    background: var(--color-primario);
	    padding: 8px;
	    border-radius: 12px;
	    border: none;
	    box-shadow: 0 4px 0 #0363a2;
        margin-bottom: 20px;
    }

    .menu-juegos {
        display: none; /* Se controla por JS */
        position: fixed;
        top: 85px; /* Ajusta según altura de tu cabecera */
        right: 20px;
        width: 250px;
        height: auto;
        max-height: 80vh;
        background-color: var(--color-fondo-menu);
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-y: auto;
        padding: 20px;
        border-radius: 25px;
        border: 4px dashed var(--color-primario);
        box-shadow: 0 10px 30px #0363a2;
        z-index: 1000;
        gap: 12px;
    }

    .menu-juegos a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* Animación de la X */
    .btn-juegos.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
    .btn-juegos.active span:nth-child(2) { opacity: 0; }
    .btn-juegos.active span:nth-child(3) { transform: rotate(-45deg) translate(8px, -8px); }
}


