/* ============================================================
   TRIVIAL MUNICIPIOS - estilos
   Para cambiar los colores, edita las variables de :root
   ============================================================ */

* { box-sizing: border-box; }

:root {
	color-scheme: light;
	--navy: #123047;
	--teal: #167d78;
	--teal-dark: #106661;
	--ink: #203747;
	--muted: #5a6c79;          /* más oscuro que antes: mejor contraste */
	--line: #dbe5e9;
	--paper: #ffffff;
	--bg: #f3f7f7;

	--ok: #2a9a7a;
	--ok-bg: #eefaf5;
	--mal: #d4584a;
	--mal-bg: #fff4f2;
	--ambar: #8a5a00;
	--ambar-linea: #efd08a;
	--ambar-bg: #fff8e6;
}

[hidden] { display: none !important; }

html { min-height: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	
    background-image:
        linear-gradient(
            rgba(245, 249, 248, 0.65),
            rgba(245, 249, 248, 0.65)
        ),
        url("../img/fondo_peninsula.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
	font-family: 'DM Sans', system-ui, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

#contenedor {
	width: min(920px, calc(100% - 36px));
	margin: 0 auto;
	padding: 26px 0 20px;
}

button, select { font-family: inherit; }

:focus-visible {
	outline: 3px solid #5bb5ae;
	outline-offset: 2px;
}

/* ---------- Cabecera ---------- */

.cabecera {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2px 2px 22px;
}

.marca {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--navy);
	font-family: Manrope, sans-serif;
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 1.6px;
}

.marca-icono {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 11px;
	background: var(--navy);
	color: #fff;
	font-size: 26px;
	line-height: 1;
}

.marca-punto { color: var(--teal); }

.etiqueta-superior {
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.6px;
}

/* ---------- Intro ---------- */

.intro { text-align: center; padding: 22px 15px 30px; }

.sobre-titulo {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 9px;
	color: var(--teal);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.8px;
}

.sobre-titulo span { width: 22px; height: 2px; background: #65aaa5; border-radius: 2px; }

h1 {
	margin: 12px 0 10px;
	color: var(--navy);
	font-family: Manrope, sans-serif;
	font-size: clamp(38px, 6.4vw, 58px);
	line-height: 1.1;
	letter-spacing: -2px;
	font-weight: 800;
}

h1 span { color: var(--teal); }

.descripcion {
	margin: 0 auto;
	max-width: 520px;
	color: var(--muted);
	font-size: 17px;
	line-height: 1.65;
}

.indicadores { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 26px; }
.indicador { display: flex; align-items: center; gap: 10px; text-align: left; }

.indicador-icono {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 4px 14px #17364b0c;
	font-size: 18px;
}

.indicador strong, .indicador small { display: block; }
.indicador strong { color: var(--navy); font-size: 17px; line-height: 1.2; }
.indicador small { color: var(--muted); font-size: 13px; }
.separador { height: 30px; width: 1px; background: #d9e3e6; }

/* ---------- Tarjeta del juego ---------- */

.juego {
	padding: clamp(22px, 4vw, 40px);
	border: 1px solid #e7edef;
	border-radius: 22px;
	background: var(--paper);
	box-shadow: 0 18px 55px #16374b0d, 0 3px 10px #16374b05;
}

.juego-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 15px; }

.paso { color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: 1.8px; }

h2 {
	margin: 6px 0 0;
	color: var(--navy);
	font-family: Manrope, sans-serif;
	font-size: clamp(23px, 3.4vw, 30px);
	letter-spacing: -.6px;
}

.contador {
	flex-shrink: 0;
	padding: 9px 13px;
	border-radius: 10px;
	background: #eff7f6;
	color: var(--teal);
	font-size: 15px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.contador span { color: #8fb3b0; }

.progreso { height: 6px; margin: 16px 0 4px; border-radius: 6px; background: #e8f0f1; overflow: hidden; }
.progreso span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--teal); transition: width .35s ease; }

.ayuda { margin: 12px 0 22px; color: var(--muted); font-size: 16px; line-height: 1.6; }

.mensaje {
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid #f0b8b0;
	border-radius: 12px;
	background: var(--mal-bg);
	color: #9c3a2e;
	font-size: 15px;
}

#formulario-trivial { margin: 0; }

/* ---------- Filas de preguntas ---------- */

.pregunta {
	display: grid;
	grid-template-columns: 42px minmax(0, 1.05fr) 22px minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	margin: 0 0 12px;
	padding: 13px 15px;
	border: 1.5px solid var(--line);
	border-radius: 15px;
	background: #fff;
	transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.pregunta:focus-within { border-color: #83c2bd; box-shadow: 0 0 0 3px #167d7814; }

.numero {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: #f0f5f6;
	color: #5d7681;
	font-size: 14px;
	font-weight: 700;
	transition: background-color .2s, color .2s;
}

/* El municipio: texto grande, puede ocupar varias líneas */
.municipio {
	margin: 0;
	display: flex;
	align-items: center;
	min-height: 56px;
	padding: 10px 14px;
	border-radius: 11px;
	background: #f4f8f9;
	color: var(--navy);
	font-size: clamp(18px, 2.4vw, 21px);
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.flecha { text-align: center; color: #8fa2ab; font-size: 20px; }

select {
	min-width: 0;
	width: 100%;
	height: 56px;
	padding: 0 36px 0 14px;
	border: 1.5px solid #d6e0e4;
	border-radius: 11px;
	background-color: #fff;
	color: var(--ink);
	font-size: clamp(17px, 2.2vw, 19px);
	font-weight: 500;
	cursor: pointer;
	outline: none;
}

select:hover:not(:disabled) { border-color: #9cc9c5; }
select:focus { border-color: var(--teal); }
select:disabled { cursor: not-allowed; opacity: .85; background-color: #f4f8f9; }

/* Estados de cada fila */
.pregunta.acierto { border-color: var(--ok); background: var(--ok-bg); }
.pregunta.acierto .numero { background: var(--ok); color: #fff; }

.pregunta.fallo { border-color: var(--mal); background: var(--mal-bg); }
.pregunta.fallo .numero { background: var(--mal); color: #fff; }

.pregunta.con-pista { border-color: var(--ambar-linea); background: var(--ambar-bg); }
.pregunta.con-pista .numero { background: #f6dd9a; color: var(--ambar); }

.pregunta.revelada select { font-weight: 700; color: var(--ambar); border-color: var(--ambar-linea); }

/* ---------- Panel de pista ---------- */

.pista-panel {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	margin: 4px 0 16px;
	padding: 16px 18px;
	border: 1.5px solid var(--ambar-linea);
	border-radius: 15px;
	background: var(--ambar-bg);
	color: #5e3f00;
	animation: aparecer .3s ease;
}

.pista-icono { font-size: 26px; line-height: 1.2; }
.pista-contenido { flex: 1; min-width: 0; }
.pista-contenido p { margin: 0; font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.pista-contenido strong { color: #4a3000; }

@keyframes aparecer {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

.boton-mini {
	margin-top: 10px;
	padding: 9px 16px;
	border: 1.5px solid #d9aa45;
	border-radius: 999px;
	background: #fff;
	color: var(--ambar);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .2s;
}

.boton-mini:hover { background: #fff1cc; }

/* ---------- Acciones ---------- */

.acciones { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.acciones-izq { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.boton-pista {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 54px;
	padding: 10px 20px;
	border: 1.5px solid var(--ambar-linea);
	border-radius: 12px;
	background: var(--ambar-bg);
	color: var(--ambar);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .2s, transform .2s;
}

.boton-pista:hover:not(:disabled) { background: #fff0c8; transform: translateY(-1px); }
.boton-pista:disabled { cursor: not-allowed; opacity: .55; }
.pista-bombilla { font-size: 20px; }

.boton-texto {
	min-height: 44px;
	padding: 8px 12px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: var(--muted);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.boton-texto:hover { color: var(--teal); background: #eff7f6; }

#enviar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 56px;
	padding: 12px 20px;
	border: 0;
	border-radius: 12px;
	background: var(--teal);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 7px 16px #167d7828;
	transition: background-color .2s, transform .2s, box-shadow .2s;
}

#enviar:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 10px 20px #167d7835; }
#enviar:active { transform: translateY(0); }
#enviar:disabled { opacity: .6; cursor: not-allowed; }

.boton-flecha { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #ffffff25; font-size: 18px; }

.estado-pistas { display: flex; align-items: center; gap: 9px; margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.punto-verde { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #47a88e; box-shadow: 0 0 0 4px #47a88e1c; }

/* ---------- Pie ---------- */

footer { display: flex; justify-content: space-between; gap: 15px; padding: 24px 4px 4px; color: #6d7f89; font-size: 12px; letter-spacing: .7px; }
footer span:first-child { font-weight: 700; }
footer b { color: var(--teal); }

/* ---------- Audio y ventana de resultado ---------- */

#sonido { display: none; }

#fiesta {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: #102a3bee;
	backdrop-filter: blur(7px);
}

#fiesta:not([hidden]) { display: flex; }

.celebracion {
	width: min(560px, 100%);
	max-height: 100%;
	overflow-y: auto;
	padding: 36px 26px 28px;
	border: 1px solid #ffffff28;
	border-radius: 24px;
	background: #fff;
	text-align: center;
	box-shadow: 0 25px 80px #0003;
	animation: aparecer .3s ease;
}

.celebracion-icono { font-size: 48px; }

#texto {
	margin: 14px 0 8px;
	color: var(--navy);
	font-family: Manrope, sans-serif;
	font-size: clamp(25px, 5vw, 36px);
	font-weight: 800;
	line-height: 1.2;
}

.celebracion-subtitulo { margin: 0; color: var(--muted); font-size: 17px; }

#fuegos { display: none; width: min(280px, 100%); height: auto; margin: 18px auto 0; border-radius: 12px; }
#fuegos.visible { display: block; }

.celebracion-botones { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.boton-principal, .boton-secundario {
	min-height: 52px;
	padding: 12px 22px;
	border-radius: 12px;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
}

.boton-principal { border: 0; background: var(--teal); color: #fff; }
.boton-principal:hover { background: var(--teal-dark); }
.boton-secundario { border: 1.5px solid var(--line); background: #fff; color: var(--muted); }
.boton-secundario:hover { border-color: #9cc9c5; color: var(--teal); }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Pantallas anchas ---------- */

@media (min-width: 650px) {
	.acciones { flex-direction: row; align-items: center; justify-content: space-between; }
	#enviar { width: auto; min-width: 270px; }
	.celebracion-botones { flex-direction: row-reverse; justify-content: center; }
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
	#contenedor { width: calc(100% - 24px); padding-top: 16px; }
	.cabecera { padding-bottom: 12px; }
	.etiqueta-superior { font-size: 10px; letter-spacing: 1px; }
	.intro { padding: 20px 5px 24px; }
	.indicadores { gap: 12px; }
	.indicador { gap: 7px; }
	.indicador-icono { width: 34px; height: 34px; font-size: 15px; }
	.indicador small { font-size: 12px; }
	.juego { padding: 20px 14px; border-radius: 18px; }

	.pregunta {
		grid-template-columns: 38px minmax(0, 1fr);
		gap: 10px 12px;
		padding: 12px;
		align-items: start;
	}
	.numero { width: 36px; height: 36px; grid-row: 1 / span 2; }
	.municipio { grid-column: 2; }
	.flecha { display: none; }
	select { grid-column: 2; }

	.boton-pista { flex: 1; }
	footer { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}
